Use __CLASS__ instead of hard-coding class names
Summary: Use `__CLASS__` instead of hard-coding class names. Depends on D12605. Test Plan: Eyeball it. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: hach-que, Korvin, epriestley Differential Revision: https://secure.phabricator.com/D12806
This commit is contained in:
@@ -158,8 +158,9 @@ final class PhabricatorHandleList
|
||||
private function raiseImmutableException() {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Trying to mutate a PhabricatorHandleList, but this is not permitted; '.
|
||||
'handle lists are immutable.'));
|
||||
'Trying to mutate a %s, but this is not permitted; '.
|
||||
'handle lists are immutable.',
|
||||
__CLASS__));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -169,9 +169,13 @@ abstract class PhabricatorPHIDType {
|
||||
$that_class = $original[$type];
|
||||
$this_class = get_class($object);
|
||||
throw new Exception(
|
||||
"Two PhabricatorPHIDType classes ({$that_class}, {$this_class}) ".
|
||||
"both handle PHID type '{$type}'. A type may be handled by only ".
|
||||
"one class.");
|
||||
pht(
|
||||
"Two %s classes (%s, %s) both handle PHID type '%s'. ".
|
||||
"A type may be handled by only one class.",
|
||||
__CLASS__,
|
||||
$that_class,
|
||||
$this_class,
|
||||
$type));
|
||||
}
|
||||
|
||||
$original[$type] = get_class($object);
|
||||
|
||||
Reference in New Issue
Block a user