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:
Joshua Spence
2015-05-14 06:50:28 +10:00
parent f3d5e22a45
commit acb45968d8
78 changed files with 268 additions and 233 deletions

View File

@@ -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__));
}

View File

@@ -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);