Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15664474
D12806.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
73 KB
Referenced Files
None
Subscribers
None
D12806.diff
View Options
diff --git a/src/aphront/AphrontRequest.php b/src/aphront/AphrontRequest.php
--- a/src/aphront/AphrontRequest.php
+++ b/src/aphront/AphrontRequest.php
@@ -650,7 +650,7 @@
* safe.
*/
public function isProxiedClusterRequest() {
- return (bool)AphrontRequest::getHTTPHeader('X-Phabricator-Cluster');
+ return (bool)self::getHTTPHeader('X-Phabricator-Cluster');
}
diff --git a/src/aphront/response/AphrontProxyResponse.php b/src/aphront/response/AphrontProxyResponse.php
--- a/src/aphront/response/AphrontProxyResponse.php
+++ b/src/aphront/response/AphrontProxyResponse.php
@@ -65,7 +65,10 @@
final public function buildResponseString() {
throw new Exception(
- 'AphrontProxyResponse must implement reduceProxyResponse().');
+ pht(
+ '%s must implement %s.',
+ __CLASS__,
+ 'reduceProxyResponse()'));
}
}
diff --git a/src/aphront/response/AphrontResponse.php b/src/aphront/response/AphrontResponse.php
--- a/src/aphront/response/AphrontResponse.php
+++ b/src/aphront/response/AphrontResponse.php
@@ -154,7 +154,7 @@
array_walk_recursive(
$object,
- array('AphrontResponse', 'processValueForJSONEncoding'));
+ array(__CLASS__, 'processValueForJSONEncoding'));
$response = json_encode($object);
diff --git a/src/applications/audit/constants/PhabricatorAuditStatusConstants.php b/src/applications/audit/constants/PhabricatorAuditStatusConstants.php
--- a/src/applications/audit/constants/PhabricatorAuditStatusConstants.php
+++ b/src/applications/audit/constants/PhabricatorAuditStatusConstants.php
@@ -60,19 +60,19 @@
public static function getStatusIcon($code) {
switch ($code) {
- case PhabricatorAuditStatusConstants::AUDIT_NOT_REQUIRED:
- case PhabricatorAuditStatusConstants::RESIGNED:
+ case self::AUDIT_NOT_REQUIRED:
+ case self::RESIGNED:
$icon = PHUIStatusItemView::ICON_OPEN;
break;
- case PhabricatorAuditStatusConstants::AUDIT_REQUIRED:
- case PhabricatorAuditStatusConstants::AUDIT_REQUESTED:
+ case self::AUDIT_REQUIRED:
+ case self::AUDIT_REQUESTED:
$icon = PHUIStatusItemView::ICON_WARNING;
break;
- case PhabricatorAuditStatusConstants::CONCERNED:
+ case self::CONCERNED:
$icon = PHUIStatusItemView::ICON_REJECT;
break;
- case PhabricatorAuditStatusConstants::ACCEPTED:
- case PhabricatorAuditStatusConstants::CLOSED:
+ case self::ACCEPTED:
+ case self::CLOSED:
$icon = PHUIStatusItemView::ICON_ACCEPT;
break;
default:
diff --git a/src/applications/audit/storage/PhabricatorAuditInlineComment.php b/src/applications/audit/storage/PhabricatorAuditInlineComment.php
--- a/src/applications/audit/storage/PhabricatorAuditInlineComment.php
+++ b/src/applications/audit/storage/PhabricatorAuditInlineComment.php
@@ -115,7 +115,7 @@
private static function buildProxies(array $inlines) {
$results = array();
foreach ($inlines as $key => $inline) {
- $results[$key] = PhabricatorAuditInlineComment::newFromModernComment(
+ $results[$key] = self::newFromModernComment(
$inline);
}
return $results;
diff --git a/src/applications/base/PhabricatorApplication.php b/src/applications/base/PhabricatorApplication.php
--- a/src/applications/base/PhabricatorApplication.php
+++ b/src/applications/base/PhabricatorApplication.php
@@ -361,7 +361,7 @@
public static function getByClass($class_name) {
$selected = null;
- $applications = PhabricatorApplication::getAllApplications();
+ $applications = self::getAllApplications();
foreach ($applications as $application) {
if (get_class($application) == $class_name) {
diff --git a/src/applications/cache/PhabricatorCaches.php b/src/applications/cache/PhabricatorCaches.php
--- a/src/applications/cache/PhabricatorCaches.php
+++ b/src/applications/cache/PhabricatorCaches.php
@@ -270,7 +270,7 @@
}
private static function addNamespaceToCaches(array $caches) {
- $namespace = PhabricatorCaches::getNamespace();
+ $namespace = self::getNamespace();
if (!$namespace) {
return $caches;
}
diff --git a/src/applications/calendar/storage/PhabricatorCalendarEvent.php b/src/applications/calendar/storage/PhabricatorCalendarEvent.php
--- a/src/applications/calendar/storage/PhabricatorCalendarEvent.php
+++ b/src/applications/calendar/storage/PhabricatorCalendarEvent.php
@@ -200,7 +200,7 @@
public function getTerseSummary(PhabricatorUser $viewer) {
$until = phabricator_date($this->dateTo, $viewer);
- if ($this->status == PhabricatorCalendarEvent::STATUS_SPORADIC) {
+ if ($this->status == self::STATUS_SPORADIC) {
return pht('Sporadic until %s', $until);
} else {
return pht('Away until %s', $until);
diff --git a/src/applications/celerity/resources/CelerityPhysicalResources.php b/src/applications/celerity/resources/CelerityPhysicalResources.php
--- a/src/applications/celerity/resources/CelerityPhysicalResources.php
+++ b/src/applications/celerity/resources/CelerityPhysicalResources.php
@@ -25,7 +25,7 @@
$resources_map = array();
$resources_list = id(new PhutilSymbolLoader())
- ->setAncestorClass('CelerityPhysicalResources')
+ ->setAncestorClass(__CLASS__)
->loadObjects();
foreach ($resources_list as $resources) {
diff --git a/src/applications/conduit/method/ConduitAPIMethod.php b/src/applications/conduit/method/ConduitAPIMethod.php
--- a/src/applications/conduit/method/ConduitAPIMethod.php
+++ b/src/applications/conduit/method/ConduitAPIMethod.php
@@ -100,9 +100,9 @@
$name = $this->getAPIMethodName();
$map = array(
- ConduitAPIMethod::METHOD_STATUS_STABLE => 0,
- ConduitAPIMethod::METHOD_STATUS_UNSTABLE => 1,
- ConduitAPIMethod::METHOD_STATUS_DEPRECATED => 2,
+ self::METHOD_STATUS_STABLE => 0,
+ self::METHOD_STATUS_UNSTABLE => 1,
+ self::METHOD_STATUS_DEPRECATED => 2,
);
$ord = idx($map, $this->getMethodStatus(), 0);
diff --git a/src/applications/conduit/query/PhabricatorConduitLogQuery.php b/src/applications/conduit/query/PhabricatorConduitLogQuery.php
--- a/src/applications/conduit/query/PhabricatorConduitLogQuery.php
+++ b/src/applications/conduit/query/PhabricatorConduitLogQuery.php
@@ -22,7 +22,7 @@
$this->buildOrderClause($conn_r),
$this->buildLimitClause($conn_r));
- return $table->loadAllFromArray($data);;
+ return $table->loadAllFromArray($data);
}
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
diff --git a/src/applications/conduit/query/PhabricatorConduitTokenQuery.php b/src/applications/conduit/query/PhabricatorConduitTokenQuery.php
--- a/src/applications/conduit/query/PhabricatorConduitTokenQuery.php
+++ b/src/applications/conduit/query/PhabricatorConduitTokenQuery.php
@@ -46,7 +46,7 @@
$this->buildOrderClause($conn_r),
$this->buildLimitClause($conn_r));
- return $table->loadAllFromArray($data);;
+ return $table->loadAllFromArray($data);
}
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
diff --git a/src/applications/conduit/storage/PhabricatorConduitToken.php b/src/applications/conduit/storage/PhabricatorConduitToken.php
--- a/src/applications/conduit/storage/PhabricatorConduitToken.php
+++ b/src/applications/conduit/storage/PhabricatorConduitToken.php
@@ -65,7 +65,7 @@
// to expire) so generate a new token.
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
- $token = PhabricatorConduitToken::initializeNewToken(
+ $token = self::initializeNewToken(
$user->getPHID(),
self::TYPE_CLUSTER);
$token->save();
diff --git a/src/applications/config/check/PhabricatorSetupCheck.php b/src/applications/config/check/PhabricatorSetupCheck.php
--- a/src/applications/config/check/PhabricatorSetupCheck.php
+++ b/src/applications/config/check/PhabricatorSetupCheck.php
@@ -113,7 +113,7 @@
final public static function runAllChecks() {
$symbols = id(new PhutilSymbolLoader())
- ->setAncestorClass('PhabricatorSetupCheck')
+ ->setAncestorClass(__CLASS__)
->setConcreteOnly(true)
->selectAndLoadSymbols();
diff --git a/src/applications/config/option/PhabricatorApplicationConfigOptions.php b/src/applications/config/option/PhabricatorApplicationConfigOptions.php
--- a/src/applications/config/option/PhabricatorApplicationConfigOptions.php
+++ b/src/applications/config/option/PhabricatorApplicationConfigOptions.php
@@ -187,7 +187,7 @@
final public static function loadAll($external_only = false) {
$symbols = id(new PhutilSymbolLoader())
- ->setAncestorClass('PhabricatorApplicationConfigOptions')
+ ->setAncestorClass(__CLASS__)
->setConcreteOnly(true)
->selectAndLoadSymbols();
@@ -204,8 +204,12 @@
$nclass = $symbol['name'];
throw new Exception(
- "Multiple PhabricatorApplicationConfigOptions subclasses have the ".
- "same key ('{$key}'): {$pclass}, {$nclass}.");
+ pht(
+ "Multiple %s subclasses have the same key ('%s'): %s, %s.",
+ __CLASS__,
+ $key,
+ $pclass,
+ $nclass));
}
$groups[$key] = $obj;
}
@@ -222,8 +226,10 @@
$key = $option->getKey();
if (isset($options[$key])) {
throw new Exception(
- "Mulitple PhabricatorApplicationConfigOptions subclasses contain ".
- "an option named '{$key}'!");
+ pht(
+ "Mulitple % subclasses contain an option named '%s'!",
+ __CLASS__,
+ $key));
}
$options[$key] = $option;
}
diff --git a/src/applications/conpherence/storage/ConpherenceThread.php b/src/applications/conpherence/storage/ConpherenceThread.php
--- a/src/applications/conpherence/storage/ConpherenceThread.php
+++ b/src/applications/conpherence/storage/ConpherenceThread.php
@@ -407,7 +407,7 @@
PhabricatorUser $viewer,
array $conpherences) {
- assert_instances_of($conpherences, 'ConpherenceThread');
+ assert_instances_of($conpherences, __CLASS__);
$grouped = mgroup($conpherences, 'getIsRoom');
$rooms = idx($grouped, 1, array());
diff --git a/src/applications/console/plugin/errorlog/DarkConsoleErrorLogPluginAPI.php b/src/applications/console/plugin/errorlog/DarkConsoleErrorLogPluginAPI.php
--- a/src/applications/console/plugin/errorlog/DarkConsoleErrorLogPluginAPI.php
+++ b/src/applications/console/plugin/errorlog/DarkConsoleErrorLogPluginAPI.php
@@ -12,7 +12,7 @@
// reenter autoloaders).
PhutilReadableSerializer::printableValue(null);
PhutilErrorHandler::setErrorListener(
- array('DarkConsoleErrorLogPluginAPI', 'handleErrors'));
+ array(__CLASS__, 'handleErrors'));
}
public static function enableDiscardMode() {
diff --git a/src/applications/daemon/query/PhabricatorDaemonLogQuery.php b/src/applications/daemon/query/PhabricatorDaemonLogQuery.php
--- a/src/applications/daemon/query/PhabricatorDaemonLogQuery.php
+++ b/src/applications/daemon/query/PhabricatorDaemonLogQuery.php
@@ -68,8 +68,8 @@
}
protected function willFilterPage(array $daemons) {
- $unknown_delay = PhabricatorDaemonLogQuery::getTimeUntilUnknown();
- $dead_delay = PhabricatorDaemonLogQuery::getTimeUntilDead();
+ $unknown_delay = self::getTimeUntilUnknown();
+ $dead_delay = self::getTimeUntilDead();
$status_running = PhabricatorDaemonLog::STATUS_RUNNING;
$status_unknown = PhabricatorDaemonLog::STATUS_UNKNOWN;
diff --git a/src/applications/differential/constants/DifferentialAction.php b/src/applications/differential/constants/DifferentialAction.php
--- a/src/applications/differential/constants/DifferentialAction.php
+++ b/src/applications/differential/constants/DifferentialAction.php
@@ -22,71 +22,71 @@
public static function getBasicStoryText($action, $author_name) {
switch ($action) {
- case DifferentialAction::ACTION_COMMENT:
+ case self::ACTION_COMMENT:
$title = pht('%s commented on this revision.',
$author_name);
break;
- case DifferentialAction::ACTION_ACCEPT:
+ case self::ACTION_ACCEPT:
$title = pht('%s accepted this revision.',
$author_name);
break;
- case DifferentialAction::ACTION_REJECT:
+ case self::ACTION_REJECT:
$title = pht('%s requested changes to this revision.',
$author_name);
break;
- case DifferentialAction::ACTION_RETHINK:
+ case self::ACTION_RETHINK:
$title = pht('%s planned changes to this revision.',
$author_name);
break;
- case DifferentialAction::ACTION_ABANDON:
+ case self::ACTION_ABANDON:
$title = pht('%s abandoned this revision.',
$author_name);
break;
- case DifferentialAction::ACTION_CLOSE:
+ case self::ACTION_CLOSE:
$title = pht('%s closed this revision.',
$author_name);
break;
- case DifferentialAction::ACTION_REQUEST:
+ case self::ACTION_REQUEST:
$title = pht('%s requested a review of this revision.',
$author_name);
break;
- case DifferentialAction::ACTION_RECLAIM:
+ case self::ACTION_RECLAIM:
$title = pht('%s reclaimed this revision.',
$author_name);
break;
- case DifferentialAction::ACTION_UPDATE:
+ case self::ACTION_UPDATE:
$title = pht('%s updated this revision.',
$author_name);
break;
- case DifferentialAction::ACTION_RESIGN:
+ case self::ACTION_RESIGN:
$title = pht('%s resigned from this revision.',
$author_name);
break;
- case DifferentialAction::ACTION_SUMMARIZE:
+ case self::ACTION_SUMMARIZE:
$title = pht('%s summarized this revision.',
$author_name);
break;
- case DifferentialAction::ACTION_TESTPLAN:
+ case self::ACTION_TESTPLAN:
$title = pht('%s explained the test plan for this revision.',
$author_name);
break;
- case DifferentialAction::ACTION_CREATE:
+ case self::ACTION_CREATE:
$title = pht('%s created this revision.',
$author_name);
break;
- case DifferentialAction::ACTION_ADDREVIEWERS:
+ case self::ACTION_ADDREVIEWERS:
$title = pht('%s added reviewers to this revision.',
$author_name);
break;
- case DifferentialAction::ACTION_ADDCCS:
+ case self::ACTION_ADDCCS:
$title = pht('%s added CCs to this revision.',
$author_name);
break;
- case DifferentialAction::ACTION_CLAIM:
+ case self::ACTION_CLAIM:
$title = pht('%s commandeered this revision.',
$author_name);
break;
- case DifferentialAction::ACTION_REOPEN:
+ case self::ACTION_REOPEN:
$title = pht('%s reopened this revision.',
$author_name);
break;
@@ -127,9 +127,9 @@
}
public static function allowReviewers($action) {
- if ($action == DifferentialAction::ACTION_ADDREVIEWERS ||
- $action == DifferentialAction::ACTION_REQUEST ||
- $action == DifferentialAction::ACTION_RESIGN) {
+ if ($action == self::ACTION_ADDREVIEWERS ||
+ $action == self::ACTION_REQUEST ||
+ $action == self::ACTION_RESIGN) {
return true;
}
return false;
diff --git a/src/applications/differential/constants/DifferentialChangeType.php b/src/applications/differential/constants/DifferentialChangeType.php
--- a/src/applications/differential/constants/DifferentialChangeType.php
+++ b/src/applications/differential/constants/DifferentialChangeType.php
@@ -52,42 +52,42 @@
public static function isOldLocationChangeType($type) {
static $types = array(
- DifferentialChangeType::TYPE_MOVE_AWAY => true,
- DifferentialChangeType::TYPE_COPY_AWAY => true,
- DifferentialChangeType::TYPE_MULTICOPY => true,
+ self::TYPE_MOVE_AWAY => true,
+ self::TYPE_COPY_AWAY => true,
+ self::TYPE_MULTICOPY => true,
);
return isset($types[$type]);
}
public static function isNewLocationChangeType($type) {
static $types = array(
- DifferentialChangeType::TYPE_MOVE_HERE => true,
- DifferentialChangeType::TYPE_COPY_HERE => true,
+ self::TYPE_MOVE_HERE => true,
+ self::TYPE_COPY_HERE => true,
);
return isset($types[$type]);
}
public static function isDeleteChangeType($type) {
static $types = array(
- DifferentialChangeType::TYPE_DELETE => true,
- DifferentialChangeType::TYPE_MOVE_AWAY => true,
- DifferentialChangeType::TYPE_MULTICOPY => true,
+ self::TYPE_DELETE => true,
+ self::TYPE_MOVE_AWAY => true,
+ self::TYPE_MULTICOPY => true,
);
return isset($types[$type]);
}
public static function isCreateChangeType($type) {
static $types = array(
- DifferentialChangeType::TYPE_ADD => true,
- DifferentialChangeType::TYPE_COPY_HERE => true,
- DifferentialChangeType::TYPE_MOVE_HERE => true,
+ self::TYPE_ADD => true,
+ self::TYPE_COPY_HERE => true,
+ self::TYPE_MOVE_HERE => true,
);
return isset($types[$type]);
}
public static function isModifyChangeType($type) {
static $types = array(
- DifferentialChangeType::TYPE_CHANGE => true,
+ self::TYPE_CHANGE => true,
);
return isset($types[$type]);
}
diff --git a/src/applications/differential/storage/DifferentialTransaction.php b/src/applications/differential/storage/DifferentialTransaction.php
--- a/src/applications/differential/storage/DifferentialTransaction.php
+++ b/src/applications/differential/storage/DifferentialTransaction.php
@@ -568,7 +568,7 @@
'this revision.');
}
break;
- case DifferentialTransaction::TYPE_ACTION:
+ case self::TYPE_ACTION:
switch ($this->getNewValue()) {
case DifferentialAction::ACTION_CLOSE:
return pht('This revision is already closed.');
diff --git a/src/applications/diffusion/data/DiffusionPathChange.php b/src/applications/diffusion/data/DiffusionPathChange.php
--- a/src/applications/diffusion/data/DiffusionPathChange.php
+++ b/src/applications/diffusion/data/DiffusionPathChange.php
@@ -119,7 +119,7 @@
}
final public static function convertToArcanistChanges(array $changes) {
- assert_instances_of($changes, 'DiffusionPathChange');
+ assert_instances_of($changes, __CLASS__);
$direct = array();
$result = array();
foreach ($changes as $path) {
@@ -145,7 +145,7 @@
final public static function convertToDifferentialChangesets(
PhabricatorUser $user,
array $changes) {
- assert_instances_of($changes, 'DiffusionPathChange');
+ assert_instances_of($changes, __CLASS__);
$arcanist_changes = self::convertToArcanistChanges($changes);
$diff = DifferentialDiff::newEphemeralFromRawChanges(
$arcanist_changes);
diff --git a/src/applications/diviner/storage/DivinerLiveSymbol.php b/src/applications/diviner/storage/DivinerLiveSymbol.php
--- a/src/applications/diviner/storage/DivinerLiveSymbol.php
+++ b/src/applications/diviner/storage/DivinerLiveSymbol.php
@@ -174,7 +174,7 @@
}
public function attachExtends(array $extends) {
- assert_instances_of($extends, 'DivinerLiveSymbol');
+ assert_instances_of($extends, __CLASS__);
$this->extends = $extends;
return $this;
}
@@ -184,7 +184,7 @@
}
public function attachChildren(array $children) {
- assert_instances_of($children, 'DivinerLiveSymbol');
+ assert_instances_of($children, __CLASS__);
$this->children = $children;
return $this;
}
diff --git a/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
--- a/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
+++ b/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
@@ -377,7 +377,7 @@
if ($list === null) {
$blueprints = id(new PhutilSymbolLoader())
->setType('class')
- ->setAncestorClass('DrydockBlueprintImplementation')
+ ->setAncestorClass(__CLASS__)
->setConcreteOnly(true)
->selectAndLoadSymbols();
$list = ipull($blueprints, 'name', 'name');
diff --git a/src/applications/drydock/storage/DrydockLease.php b/src/applications/drydock/storage/DrydockLease.php
--- a/src/applications/drydock/storage/DrydockLease.php
+++ b/src/applications/drydock/storage/DrydockLease.php
@@ -149,7 +149,7 @@
}
public static function waitForLeases(array $leases) {
- assert_instances_of($leases, 'DrydockLease');
+ assert_instances_of($leases, __CLASS__);
$task_ids = array_filter(mpull($leases, 'getTaskID'));
diff --git a/src/applications/feed/story/PhabricatorFeedStory.php b/src/applications/feed/story/PhabricatorFeedStory.php
--- a/src/applications/feed/story/PhabricatorFeedStory.php
+++ b/src/applications/feed/story/PhabricatorFeedStory.php
@@ -48,7 +48,7 @@
try {
$ok =
class_exists($class) &&
- is_subclass_of($class, 'PhabricatorFeedStory');
+ is_subclass_of($class, __CLASS__);
} catch (PhutilMissingSymbolException $ex) {
$ok = false;
}
diff --git a/src/applications/files/controller/PhabricatorFileComposeController.php b/src/applications/files/controller/PhabricatorFileComposeController.php
--- a/src/applications/files/controller/PhabricatorFileComposeController.php
+++ b/src/applications/files/controller/PhabricatorFileComposeController.php
@@ -242,7 +242,7 @@
}
$dialog_id = celerity_generate_unique_node_id();
- $color_input_id = celerity_generate_unique_node_id();;
+ $color_input_id = celerity_generate_unique_node_id();
$icon_input_id = celerity_generate_unique_node_id();
$preview_id = celerity_generate_unique_node_id();
diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php
--- a/src/applications/files/storage/PhabricatorFile.php
+++ b/src/applications/files/storage/PhabricatorFile.php
@@ -215,7 +215,7 @@
if (!$file) {
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
- $file = PhabricatorFile::newFromFileData($data, $params);
+ $file = self::newFromFileData($data, $params);
unset($unguarded);
}
@@ -236,7 +236,7 @@
$copy_of_byte_size = $file->getByteSize();
$copy_of_mime_type = $file->getMimeType();
- $new_file = PhabricatorFile::initializeNewFile();
+ $new_file = self::initializeNewFile();
$new_file->setByteSize($copy_of_byte_size);
@@ -262,7 +262,7 @@
$length,
array $params) {
- $file = PhabricatorFile::initializeNewFile();
+ $file = self::initializeNewFile();
$file->setByteSize($length);
@@ -316,7 +316,7 @@
throw new Exception(pht('No valid storage engines are available!'));
}
- $file = PhabricatorFile::initializeNewFile();
+ $file = self::initializeNewFile();
$data_handle = null;
$engine_identifier = null;
@@ -1017,7 +1017,7 @@
);
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
- $file = PhabricatorFile::newFromFileData($data, $params);
+ $file = self::newFromFileData($data, $params);
$xform = id(new PhabricatorTransformedFile())
->setOriginalPHID(PhabricatorPHIDConstants::PHID_VOID)
->setTransform('builtin:'.$name)
diff --git a/src/applications/fund/storage/FundInitiativeTransaction.php b/src/applications/fund/storage/FundInitiativeTransaction.php
--- a/src/applications/fund/storage/FundInitiativeTransaction.php
+++ b/src/applications/fund/storage/FundInitiativeTransaction.php
@@ -38,7 +38,7 @@
$type = $this->getTransactionType();
switch ($type) {
- case FundInitiativeTransaction::TYPE_MERCHANT:
+ case self::TYPE_MERCHANT:
if ($old) {
$phids[] = $old;
}
@@ -46,7 +46,7 @@
$phids[] = $new;
}
break;
- case FundInitiativeTransaction::TYPE_REFUND:
+ case self::TYPE_REFUND:
$phids[] = $this->getMetadataValue(self::PROPERTY_BACKER);
break;
}
@@ -63,7 +63,7 @@
$type = $this->getTransactionType();
switch ($type) {
- case FundInitiativeTransaction::TYPE_NAME:
+ case self::TYPE_NAME:
if ($old === null) {
return pht(
'%s created this initiative.',
@@ -76,15 +76,15 @@
$new);
}
break;
- case FundInitiativeTransaction::TYPE_RISKS:
+ case self::TYPE_RISKS:
return pht(
'%s edited the risks for this initiative.',
$this->renderHandleLink($author_phid));
- case FundInitiativeTransaction::TYPE_DESCRIPTION:
+ case self::TYPE_DESCRIPTION:
return pht(
'%s edited the description of this initiative.',
$this->renderHandleLink($author_phid));
- case FundInitiativeTransaction::TYPE_STATUS:
+ case self::TYPE_STATUS:
switch ($new) {
case FundInitiative::STATUS_OPEN:
return pht(
@@ -96,14 +96,14 @@
$this->renderHandleLink($author_phid));
}
break;
- case FundInitiativeTransaction::TYPE_BACKER:
+ case self::TYPE_BACKER:
$amount = $this->getMetadataValue(self::PROPERTY_AMOUNT);
$amount = PhortuneCurrency::newFromString($amount);
return pht(
'%s backed this initiative with %s.',
$this->renderHandleLink($author_phid),
$amount->formatForDisplay());
- case FundInitiativeTransaction::TYPE_REFUND:
+ case self::TYPE_REFUND:
$amount = $this->getMetadataValue(self::PROPERTY_AMOUNT);
$amount = PhortuneCurrency::newFromString($amount);
@@ -114,7 +114,7 @@
$this->renderHandleLink($author_phid),
$amount->formatForDisplay(),
$this->renderHandleLink($backer_phid));
- case FundInitiativeTransaction::TYPE_MERCHANT:
+ case self::TYPE_MERCHANT:
if ($old === null) {
return pht(
'%s set this initiative to pay to %s.',
@@ -142,7 +142,7 @@
$type = $this->getTransactionType();
switch ($type) {
- case FundInitiativeTransaction::TYPE_NAME:
+ case self::TYPE_NAME:
if ($old === null) {
return pht(
'%s created %s.',
@@ -156,12 +156,12 @@
$this->renderHandleLink($object_phid));
}
break;
- case FundInitiativeTransaction::TYPE_DESCRIPTION:
+ case self::TYPE_DESCRIPTION:
return pht(
'%s updated the description for %s.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid));
- case FundInitiativeTransaction::TYPE_STATUS:
+ case self::TYPE_STATUS:
switch ($new) {
case FundInitiative::STATUS_OPEN:
return pht(
@@ -175,7 +175,7 @@
$this->renderHandleLink($object_phid));
}
break;
- case FundInitiativeTransaction::TYPE_BACKER:
+ case self::TYPE_BACKER:
$amount = $this->getMetadataValue(self::PROPERTY_AMOUNT);
$amount = PhortuneCurrency::newFromString($amount);
return pht(
@@ -183,7 +183,7 @@
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid),
$amount->formatForDisplay());
- case FundInitiativeTransaction::TYPE_REFUND:
+ case self::TYPE_REFUND:
$amount = $this->getMetadataValue(self::PROPERTY_AMOUNT);
$amount = PhortuneCurrency::newFromString($amount);
@@ -223,8 +223,8 @@
public function shouldHide() {
$old = $this->getOldValue();
switch ($this->getTransactionType()) {
- case FundInitiativeTransaction::TYPE_DESCRIPTION:
- case FundInitiativeTransaction::TYPE_RISKS:
+ case self::TYPE_DESCRIPTION:
+ case self::TYPE_RISKS:
return ($old === null);
}
return parent::shouldHide();
@@ -232,8 +232,8 @@
public function hasChangeDetails() {
switch ($this->getTransactionType()) {
- case FundInitiativeTransaction::TYPE_DESCRIPTION:
- case FundInitiativeTransaction::TYPE_RISKS:
+ case self::TYPE_DESCRIPTION:
+ case self::TYPE_RISKS:
return ($this->getOldValue() !== null);
}
diff --git a/src/applications/harbormaster/step/HarbormasterBuildStepImplementation.php b/src/applications/harbormaster/step/HarbormasterBuildStepImplementation.php
--- a/src/applications/harbormaster/step/HarbormasterBuildStepImplementation.php
+++ b/src/applications/harbormaster/step/HarbormasterBuildStepImplementation.php
@@ -4,7 +4,7 @@
public static function getImplementations() {
return id(new PhutilSymbolLoader())
- ->setAncestorClass('HarbormasterBuildStepImplementation')
+ ->setAncestorClass(__CLASS__)
->loadObjects();
}
diff --git a/src/applications/harbormaster/storage/HarbormasterBuildable.php b/src/applications/harbormaster/storage/HarbormasterBuildable.php
--- a/src/applications/harbormaster/storage/HarbormasterBuildable.php
+++ b/src/applications/harbormaster/storage/HarbormasterBuildable.php
@@ -88,7 +88,7 @@
if ($buildable) {
return $buildable;
}
- $buildable = HarbormasterBuildable::initializeNewBuildable($actor)
+ $buildable = self::initializeNewBuildable($actor)
->setBuildablePHID($buildable_object_phid)
->setContainerPHID($container_object_phid);
$buildable->save();
@@ -116,7 +116,7 @@
return;
}
- $buildable = HarbormasterBuildable::createOrLoadExisting(
+ $buildable = self::createOrLoadExisting(
PhabricatorUser::getOmnipotentUser(),
$phid,
$container_phid);
diff --git a/src/applications/help/application/PhabricatorHelpApplication.php b/src/applications/help/application/PhabricatorHelpApplication.php
--- a/src/applications/help/application/PhabricatorHelpApplication.php
+++ b/src/applications/help/application/PhabricatorHelpApplication.php
@@ -43,7 +43,7 @@
array(
'bubbleID' => $help_id,
'dropdownID' => 'phabricator-help-menu',
- 'applicationClass' => 'PhabricatorHelpApplication',
+ 'applicationClass' => __CLASS__,
'local' => true,
'desktop' => true,
'right' => true,
diff --git a/src/applications/herald/adapter/HeraldAdapter.php b/src/applications/herald/adapter/HeraldAdapter.php
--- a/src/applications/herald/adapter/HeraldAdapter.php
+++ b/src/applications/herald/adapter/HeraldAdapter.php
@@ -1083,7 +1083,7 @@
public static function getEnabledAdapterMap(PhabricatorUser $viewer) {
$map = array();
- $adapters = HeraldAdapter::getAllAdapters();
+ $adapters = self::getAllAdapters();
foreach ($adapters as $adapter) {
if (!$adapter->isAvailableToUser($viewer)) {
continue;
diff --git a/src/applications/macro/controller/PhabricatorMacroMemeController.php b/src/applications/macro/controller/PhabricatorMacroMemeController.php
--- a/src/applications/macro/controller/PhabricatorMacroMemeController.php
+++ b/src/applications/macro/controller/PhabricatorMacroMemeController.php
@@ -14,7 +14,7 @@
$lower_text = $request->getStr('lowertext');
$user = $request->getUser();
- $uri = PhabricatorMacroMemeController::generateMacro($user, $macro_name,
+ $uri = self::generateMacro($user, $macro_name,
$upper_text, $lower_text);
if ($uri === false) {
return new Aphront404Response();
diff --git a/src/applications/maniphest/query/ManiphestTaskQuery.php b/src/applications/maniphest/query/ManiphestTaskQuery.php
--- a/src/applications/maniphest/query/ManiphestTaskQuery.php
+++ b/src/applications/maniphest/query/ManiphestTaskQuery.php
@@ -754,7 +754,7 @@
$id = $result->getID();
if ($this->groupBy == self::GROUP_PROJECT) {
- return rtrim($id.'.'.$result->getGroupByProjectPHID(), '.');;
+ return rtrim($id.'.'.$result->getGroupByProjectPHID(), '.');
}
return $id;
diff --git a/src/applications/metamta/command/MetaMTAEmailTransactionCommand.php b/src/applications/metamta/command/MetaMTAEmailTransactionCommand.php
--- a/src/applications/metamta/command/MetaMTAEmailTransactionCommand.php
+++ b/src/applications/metamta/command/MetaMTAEmailTransactionCommand.php
@@ -91,7 +91,7 @@
}
public static function getCommandMap(array $commands) {
- assert_instances_of($commands, 'MetaMTAEmailTransactionCommand');
+ assert_instances_of($commands, __CLASS__);
$map = array();
foreach ($commands as $command) {
diff --git a/src/applications/metamta/contentsource/PhabricatorContentSource.php b/src/applications/metamta/contentsource/PhabricatorContentSource.php
--- a/src/applications/metamta/contentsource/PhabricatorContentSource.php
+++ b/src/applications/metamta/contentsource/PhabricatorContentSource.php
@@ -46,13 +46,13 @@
public static function newConsoleSource() {
return self::newForSource(
- PhabricatorContentSource::SOURCE_CONSOLE,
+ self::SOURCE_CONSOLE,
array());
}
public static function newFromRequest(AphrontRequest $request) {
return self::newForSource(
- PhabricatorContentSource::SOURCE_WEB,
+ self::SOURCE_WEB,
array(
'ip' => $request->getRemoteAddr(),
));
@@ -60,7 +60,7 @@
public static function newFromConduitRequest(ConduitAPIRequest $request) {
return self::newForSource(
- PhabricatorContentSource::SOURCE_CONDUIT,
+ self::SOURCE_CONDUIT,
array());
}
diff --git a/src/applications/nuance/storage/NuanceItem.php b/src/applications/nuance/storage/NuanceItem.php
--- a/src/applications/nuance/storage/NuanceItem.php
+++ b/src/applications/nuance/storage/NuanceItem.php
@@ -20,7 +20,7 @@
public static function initializeNewItem(PhabricatorUser $user) {
return id(new NuanceItem())
->setDateNuanced(time())
- ->setStatus(NuanceItem::STATUS_OPEN);
+ ->setStatus(self::STATUS_OPEN);
}
protected function getConfiguration() {
diff --git a/src/applications/paste/storage/PhabricatorPasteTransaction.php b/src/applications/paste/storage/PhabricatorPasteTransaction.php
--- a/src/applications/paste/storage/PhabricatorPasteTransaction.php
+++ b/src/applications/paste/storage/PhabricatorPasteTransaction.php
@@ -67,7 +67,7 @@
$type = $this->getTransactionType();
switch ($type) {
- case PhabricatorPasteTransaction::TYPE_CONTENT:
+ case self::TYPE_CONTENT:
if ($old === null) {
return pht(
'%s created this paste.',
@@ -78,13 +78,13 @@
$this->renderHandleLink($author_phid));
}
break;
- case PhabricatorPasteTransaction::TYPE_TITLE:
+ case self::TYPE_TITLE:
return pht(
'%s updated the paste\'s title to "%s".',
$this->renderHandleLink($author_phid),
$new);
break;
- case PhabricatorPasteTransaction::TYPE_LANGUAGE:
+ case self::TYPE_LANGUAGE:
return pht(
"%s updated the paste's language.",
$this->renderHandleLink($author_phid));
@@ -103,7 +103,7 @@
$type = $this->getTransactionType();
switch ($type) {
- case PhabricatorPasteTransaction::TYPE_CONTENT:
+ case self::TYPE_CONTENT:
if ($old === null) {
return pht(
'%s created %s.',
@@ -116,13 +116,13 @@
$this->renderHandleLink($object_phid));
}
break;
- case PhabricatorPasteTransaction::TYPE_TITLE:
+ case self::TYPE_TITLE:
return pht(
'%s updated the title for %s.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid));
break;
- case PhabricatorPasteTransaction::TYPE_LANGUAGE:
+ case self::TYPE_LANGUAGE:
return pht(
'%s updated the language for %s.',
$this->renderHandleLink($author_phid),
diff --git a/src/applications/people/editor/__tests__/PhabricatorUserEditorTestCase.php b/src/applications/people/editor/__tests__/PhabricatorUserEditorTestCase.php
--- a/src/applications/people/editor/__tests__/PhabricatorUserEditorTestCase.php
+++ b/src/applications/people/editor/__tests__/PhabricatorUserEditorTestCase.php
@@ -14,7 +14,7 @@
$this->registerUser(
'PhabricatorUserEditorTestCaseOK',
- 'PhabricatorUserEditorTestCase@example.com');
+ 'PhabricatorUserEditorTest@example.com');
$this->assertTrue(true);
}
@@ -45,7 +45,7 @@
try {
$this->registerUser(
'PhabricatorUserEditorTestCaseDomain',
- 'PhabricatorUserEditorTestCase@whitehouse.gov');
+ 'PhabricatorUserEditorTest@whitehouse.gov');
} catch (Exception $ex) {
$caught = $ex;
}
diff --git a/src/applications/phid/handle/pool/PhabricatorHandleList.php b/src/applications/phid/handle/pool/PhabricatorHandleList.php
--- a/src/applications/phid/handle/pool/PhabricatorHandleList.php
+++ b/src/applications/phid/handle/pool/PhabricatorHandleList.php
@@ -158,8 +158,9 @@
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__));
}
diff --git a/src/applications/phid/type/PhabricatorPHIDType.php b/src/applications/phid/type/PhabricatorPHIDType.php
--- a/src/applications/phid/type/PhabricatorPHIDType.php
+++ b/src/applications/phid/type/PhabricatorPHIDType.php
@@ -169,9 +169,13 @@
$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);
diff --git a/src/applications/phortune/currency/PhortuneCurrency.php b/src/applications/phortune/currency/PhortuneCurrency.php
--- a/src/applications/phortune/currency/PhortuneCurrency.php
+++ b/src/applications/phortune/currency/PhortuneCurrency.php
@@ -68,10 +68,10 @@
}
public static function newFromList(array $list) {
- assert_instances_of($list, 'PhortuneCurrency');
+ assert_instances_of($list, __CLASS__);
if (!$list) {
- return PhortuneCurrency::newEmptyCurrency();
+ return self::newEmptyCurrency();
}
$total = null;
@@ -201,8 +201,8 @@
*/
public function assertInRange($minimum, $maximum) {
if ($minimum !== null && $maximum !== null) {
- $min = PhortuneCurrency::newFromString($minimum);
- $max = PhortuneCurrency::newFromString($maximum);
+ $min = self::newFromString($minimum);
+ $max = self::newFromString($maximum);
if ($min->value > $max->value) {
throw new Exception(
pht(
@@ -213,7 +213,7 @@
}
if ($minimum !== null) {
- $min = PhortuneCurrency::newFromString($minimum);
+ $min = self::newFromString($minimum);
if ($min->value > $this->value) {
throw new Exception(
pht(
@@ -223,7 +223,7 @@
}
if ($maximum !== null) {
- $max = PhortuneCurrency::newFromString($maximum);
+ $max = self::newFromString($maximum);
if ($max->value < $this->value) {
throw new Exception(
pht(
diff --git a/src/applications/phortune/provider/PhortunePaymentProvider.php b/src/applications/phortune/provider/PhortunePaymentProvider.php
--- a/src/applications/phortune/provider/PhortunePaymentProvider.php
+++ b/src/applications/phortune/provider/PhortunePaymentProvider.php
@@ -118,7 +118,7 @@
public static function getAllProviders() {
return id(new PhutilSymbolLoader())
- ->setAncestorClass('PhortunePaymentProvider')
+ ->setAncestorClass(__CLASS__)
->loadObjects();
}
diff --git a/src/applications/phortune/storage/PhortuneAccount.php b/src/applications/phortune/storage/PhortuneAccount.php
--- a/src/applications/phortune/storage/PhortuneAccount.php
+++ b/src/applications/phortune/storage/PhortuneAccount.php
@@ -27,7 +27,7 @@
PhabricatorUser $actor,
PhabricatorContentSource $content_source) {
- $account = PhortuneAccount::initializeNewAccount($actor);
+ $account = self::initializeNewAccount($actor);
$xactions = array();
$xactions[] = id(new PhortuneAccountTransaction())
diff --git a/src/applications/phortune/storage/PhortuneCart.php b/src/applications/phortune/storage/PhortuneCart.php
--- a/src/applications/phortune/storage/PhortuneCart.php
+++ b/src/applications/phortune/storage/PhortuneCart.php
@@ -136,7 +136,7 @@
}
$charge->save();
- $this->setStatus(PhortuneCart::STATUS_PURCHASING)->save();
+ $this->setStatus(self::STATUS_PURCHASING)->save();
$this->endReadLocking();
$this->saveTransaction();
diff --git a/src/applications/phragment/storage/PhragmentFragment.php b/src/applications/phragment/storage/PhragmentFragment.php
--- a/src/applications/phragment/storage/PhragmentFragment.php
+++ b/src/applications/phragment/storage/PhragmentFragment.php
@@ -256,7 +256,7 @@
$mappings[$path],
array('name' => basename($path)));
}
- PhragmentFragment::createFromFile(
+ self::createFromFile(
$viewer,
$file,
$base_path.'/'.$path,
diff --git a/src/applications/policy/constants/PhabricatorPolicies.php b/src/applications/policy/constants/PhabricatorPolicies.php
--- a/src/applications/policy/constants/PhabricatorPolicies.php
+++ b/src/applications/policy/constants/PhabricatorPolicies.php
@@ -15,9 +15,9 @@
*/
public static function getMostOpenPolicy() {
if (PhabricatorEnv::getEnvConfig('policy.allow-public')) {
- return PhabricatorPolicies::POLICY_PUBLIC;
+ return self::POLICY_PUBLIC;
} else {
- return PhabricatorPolicies::POLICY_USER;
+ return self::POLICY_USER;
}
}
diff --git a/src/applications/project/icon/PhabricatorProjectIcon.php b/src/applications/project/icon/PhabricatorProjectIcon.php
--- a/src/applications/project/icon/PhabricatorProjectIcon.php
+++ b/src/applications/project/icon/PhabricatorProjectIcon.php
@@ -44,7 +44,7 @@
}
public static function renderIconForChooser($icon) {
- $project_icons = PhabricatorProjectIcon::getIconMap();
+ $project_icons = self::getIconMap();
return phutil_tag(
'span',
diff --git a/src/applications/project/storage/PhabricatorProjectColumn.php b/src/applications/project/storage/PhabricatorProjectColumn.php
--- a/src/applications/project/storage/PhabricatorProjectColumn.php
+++ b/src/applications/project/storage/PhabricatorProjectColumn.php
@@ -111,7 +111,7 @@
->setMetadata(
array(
'tip' => $text,
- ));;
+ ));
}
return null;
diff --git a/src/applications/project/storage/PhabricatorProjectColumnTransaction.php b/src/applications/project/storage/PhabricatorProjectColumnTransaction.php
--- a/src/applications/project/storage/PhabricatorProjectColumnTransaction.php
+++ b/src/applications/project/storage/PhabricatorProjectColumnTransaction.php
@@ -21,7 +21,7 @@
$author_handle = $this->renderHandleLink($this->getAuthorPHID());
switch ($this->getTransactionType()) {
- case PhabricatorProjectColumnTransaction::TYPE_NAME:
+ case self::TYPE_NAME:
if ($old === null) {
return pht(
'%s created this column.',
@@ -44,7 +44,7 @@
$author_handle);
}
}
- case PhabricatorProjectColumnTransaction::TYPE_LIMIT:
+ case self::TYPE_LIMIT:
if (!$old) {
return pht(
'%s set the point limit for this column to %s.',
@@ -62,7 +62,7 @@
$new);
}
- case PhabricatorProjectColumnTransaction::TYPE_STATUS:
+ case self::TYPE_STATUS:
switch ($new) {
case PhabricatorProjectColumn::STATUS_ACTIVE:
return pht(
diff --git a/src/applications/project/storage/PhabricatorProjectTransaction.php b/src/applications/project/storage/PhabricatorProjectTransaction.php
--- a/src/applications/project/storage/PhabricatorProjectTransaction.php
+++ b/src/applications/project/storage/PhabricatorProjectTransaction.php
@@ -28,12 +28,12 @@
$req_phids = array();
switch ($this->getTransactionType()) {
- case PhabricatorProjectTransaction::TYPE_MEMBERS:
+ case self::TYPE_MEMBERS:
$add = array_diff($new, $old);
$rem = array_diff($old, $new);
$req_phids = array_merge($add, $rem);
break;
- case PhabricatorProjectTransaction::TYPE_IMAGE:
+ case self::TYPE_IMAGE:
$req_phids[] = $old;
$req_phids[] = $new;
break;
@@ -48,7 +48,7 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case PhabricatorProjectTransaction::TYPE_STATUS:
+ case self::TYPE_STATUS:
if ($old == 0) {
return 'red';
} else {
@@ -64,25 +64,25 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case PhabricatorProjectTransaction::TYPE_STATUS:
+ case self::TYPE_STATUS:
if ($old == 0) {
return 'fa-ban';
} else {
return 'fa-check';
}
- case PhabricatorProjectTransaction::TYPE_LOCKED:
+ case self::TYPE_LOCKED:
if ($new) {
return 'fa-lock';
} else {
return 'fa-unlock';
}
- case PhabricatorProjectTransaction::TYPE_ICON:
+ case self::TYPE_ICON:
return $new;
- case PhabricatorProjectTransaction::TYPE_IMAGE:
+ case self::TYPE_IMAGE:
return 'fa-photo';
- case PhabricatorProjectTransaction::TYPE_MEMBERS:
+ case self::TYPE_MEMBERS:
return 'fa-user';
- case PhabricatorProjectTransaction::TYPE_SLUGS:
+ case self::TYPE_SLUGS:
return 'fa-tag';
}
return parent::getIcon();
@@ -94,7 +94,7 @@
$author_handle = $this->renderHandleLink($this->getAuthorPHID());
switch ($this->getTransactionType()) {
- case PhabricatorProjectTransaction::TYPE_NAME:
+ case self::TYPE_NAME:
if ($old === null) {
return pht(
'%s created this project.',
@@ -106,7 +106,7 @@
$old,
$new);
}
- case PhabricatorProjectTransaction::TYPE_STATUS:
+ case self::TYPE_STATUS:
if ($old == 0) {
return pht(
'%s archived this project.',
@@ -116,7 +116,7 @@
'%s activated this project.',
$author_handle);
}
- case PhabricatorProjectTransaction::TYPE_IMAGE:
+ case self::TYPE_IMAGE:
// TODO: Some day, it would be nice to show the images.
if (!$old) {
return pht(
@@ -135,19 +135,19 @@
$this->renderHandleLink($new));
}
- case PhabricatorProjectTransaction::TYPE_ICON:
+ case self::TYPE_ICON:
return pht(
'%s set this project\'s icon to %s.',
$author_handle,
PhabricatorProjectIcon::getLabel($new));
- case PhabricatorProjectTransaction::TYPE_COLOR:
+ case self::TYPE_COLOR:
return pht(
'%s set this project\'s color to %s.',
$author_handle,
PHUITagView::getShadeName($new));
- case PhabricatorProjectTransaction::TYPE_LOCKED:
+ case self::TYPE_LOCKED:
if ($new) {
return pht(
'%s locked this project\'s membership.',
@@ -158,7 +158,7 @@
$author_handle);
}
- case PhabricatorProjectTransaction::TYPE_SLUGS:
+ case self::TYPE_SLUGS:
$add = array_diff($new, $old);
$rem = array_diff($old, $new);
@@ -184,7 +184,7 @@
$this->renderSlugList($rem));
}
- case PhabricatorProjectTransaction::TYPE_MEMBERS:
+ case self::TYPE_MEMBERS:
$add = array_diff($new, $old);
$rem = array_diff($old, $new);
diff --git a/src/applications/releeph/storage/ReleephRequest.php b/src/applications/releeph/storage/ReleephRequest.php
--- a/src/applications/releeph/storage/ReleephRequest.php
+++ b/src/applications/releeph/storage/ReleephRequest.php
@@ -127,8 +127,8 @@
if ($this->getInBranch()) {
return ReleephRequestStatus::STATUS_NEEDS_REVERT;
} else {
- $intent_pass = ReleephRequest::INTENT_PASS;
- $intent_want = ReleephRequest::INTENT_WANT;
+ $intent_pass = self::INTENT_PASS;
+ $intent_want = self::INTENT_WANT;
$has_been_in_branch = $this->getCommitIdentifier();
// Regardless of why we reverted something, always say reverted if it
diff --git a/src/applications/releeph/storage/ReleephRequestTransaction.php b/src/applications/releeph/storage/ReleephRequestTransaction.php
--- a/src/applications/releeph/storage/ReleephRequestTransaction.php
+++ b/src/applications/releeph/storage/ReleephRequestTransaction.php
@@ -38,12 +38,12 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case ReleephRequestTransaction::TYPE_REQUEST:
- case ReleephRequestTransaction::TYPE_DISCOVERY:
+ case self::TYPE_REQUEST:
+ case self::TYPE_DISCOVERY:
$phids[] = $new;
break;
- case ReleephRequestTransaction::TYPE_EDIT_FIELD:
+ case self::TYPE_EDIT_FIELD:
self::searchForPHIDs($this->getOldValue(), $phids);
self::searchForPHIDs($this->getNewValue(), $phids);
break;
@@ -60,18 +60,18 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case ReleephRequestTransaction::TYPE_REQUEST:
+ case self::TYPE_REQUEST:
return pht(
'%s requested %s',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($new));
break;
- case ReleephRequestTransaction::TYPE_USER_INTENT:
+ case self::TYPE_USER_INTENT:
return $this->getIntentTitle();
break;
- case ReleephRequestTransaction::TYPE_EDIT_FIELD:
+ case self::TYPE_EDIT_FIELD:
$field = newv($this->getMetadataValue('fieldClass'), array());
$name = $field->getName();
@@ -89,7 +89,7 @@
$field->normalizeForTransactionView($this, $new));
break;
- case ReleephRequestTransaction::TYPE_PICK_STATUS:
+ case self::TYPE_PICK_STATUS:
switch ($new) {
case ReleephRequest::PICK_OK:
return pht('%s found this request picks without error',
@@ -109,7 +109,7 @@
}
break;
- case ReleephRequestTransaction::TYPE_COMMIT:
+ case self::TYPE_COMMIT:
$action_type = $this->getMetadataValue('action');
switch ($action_type) {
case 'pick':
@@ -126,7 +126,7 @@
}
break;
- case ReleephRequestTransaction::TYPE_MANUAL_IN_BRANCH:
+ case self::TYPE_MANUAL_IN_BRANCH:
$action = $new ? pht('picked') : pht('reverted');
return pht(
'%s marked this request as manually %s',
@@ -134,7 +134,7 @@
$action);
break;
- case ReleephRequestTransaction::TYPE_DISCOVERY:
+ case self::TYPE_DISCOVERY:
return pht('%s discovered this commit as %s',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($new));
@@ -173,7 +173,7 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case ReleephRequestTransaction::TYPE_USER_INTENT:
+ case self::TYPE_USER_INTENT:
switch ($new) {
case ReleephRequest::INTENT_WANT:
return PhabricatorTransactions::COLOR_GREEN;
@@ -243,7 +243,7 @@
public function shouldHide() {
$type = $this->getTransactionType();
- if ($type === ReleephRequestTransaction::TYPE_USER_INTENT &&
+ if ($type === self::TYPE_USER_INTENT &&
$this->getMetadataValue('isRQCreate')) {
return true;
@@ -255,7 +255,7 @@
// ReleephSummaryFieldSpecification is usually blank when an RQ is created,
// creating a transaction change from null to "". Hide these!
- if ($type === ReleephRequestTransaction::TYPE_EDIT_FIELD) {
+ if ($type === self::TYPE_EDIT_FIELD) {
if ($this->getOldValue() === null && $this->getNewValue() === '') {
return true;
}
@@ -265,7 +265,7 @@
public function isBoringPickStatus() {
$type = $this->getTransactionType();
- if ($type === ReleephRequestTransaction::TYPE_PICK_STATUS) {
+ if ($type === self::TYPE_PICK_STATUS) {
$new = $this->getNewValue();
if ($new === ReleephRequest::PICK_OK ||
$new === ReleephRequest::REVERT_OK) {
diff --git a/src/applications/repository/query/PhabricatorRepositorySearchEngine.php b/src/applications/repository/query/PhabricatorRepositorySearchEngine.php
--- a/src/applications/repository/query/PhabricatorRepositorySearchEngine.php
+++ b/src/applications/repository/query/PhabricatorRepositorySearchEngine.php
@@ -201,7 +201,7 @@
array $handles) {
assert_instances_of($repositories, 'PhabricatorRepository');
- $viewer = $this->requireViewer();;
+ $viewer = $this->requireViewer();
$list = new PHUIObjectItemListView();
foreach ($repositories as $repository) {
diff --git a/src/applications/repository/storage/PhabricatorRepositoryPushLog.php b/src/applications/repository/storage/PhabricatorRepositoryPushLog.php
--- a/src/applications/repository/storage/PhabricatorRepositoryPushLog.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryPushLog.php
@@ -54,13 +54,13 @@
public static function getHeraldChangeFlagConditionOptions() {
return array(
- PhabricatorRepositoryPushLog::CHANGEFLAG_ADD =>
+ self::CHANGEFLAG_ADD =>
pht('change creates ref'),
- PhabricatorRepositoryPushLog::CHANGEFLAG_DELETE =>
+ self::CHANGEFLAG_DELETE =>
pht('change deletes ref'),
- PhabricatorRepositoryPushLog::CHANGEFLAG_REWRITE =>
+ self::CHANGEFLAG_REWRITE =>
pht('change rewrites ref'),
- PhabricatorRepositoryPushLog::CHANGEFLAG_DANGEROUS =>
+ self::CHANGEFLAG_DANGEROUS =>
pht('dangerous change'),
);
}
diff --git a/src/applications/settings/storage/PhabricatorUserPreferences.php b/src/applications/settings/storage/PhabricatorUserPreferences.php
--- a/src/applications/settings/storage/PhabricatorUserPreferences.php
+++ b/src/applications/settings/storage/PhabricatorUserPreferences.php
@@ -74,14 +74,14 @@
}
public function getPinnedApplications(array $apps, PhabricatorUser $viewer) {
- $pref_pinned = PhabricatorUserPreferences::PREFERENCE_APP_PINNED;
+ $pref_pinned = self::PREFERENCE_APP_PINNED;
$pinned = $this->getPreference($pref_pinned);
if ($pinned) {
return $pinned;
}
- $pref_tiles = PhabricatorUserPreferences::PREFERENCE_APP_TILES;
+ $pref_tiles = self::PREFERENCE_APP_TILES;
$tiles = $this->getPreference($pref_tiles, array());
$full_tile = 'full';
diff --git a/src/applications/slowvote/storage/PhabricatorSlowvoteTransaction.php b/src/applications/slowvote/storage/PhabricatorSlowvoteTransaction.php
--- a/src/applications/slowvote/storage/PhabricatorSlowvoteTransaction.php
+++ b/src/applications/slowvote/storage/PhabricatorSlowvoteTransaction.php
@@ -26,10 +26,10 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case PhabricatorSlowvoteTransaction::TYPE_DESCRIPTION:
- case PhabricatorSlowvoteTransaction::TYPE_RESPONSES:
- case PhabricatorSlowvoteTransaction::TYPE_SHUFFLE:
- case PhabricatorSlowvoteTransaction::TYPE_CLOSE:
+ case self::TYPE_DESCRIPTION:
+ case self::TYPE_RESPONSES:
+ case self::TYPE_SHUFFLE:
+ case self::TYPE_CLOSE:
return ($old === null);
}
@@ -43,7 +43,7 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case PhabricatorSlowvoteTransaction::TYPE_QUESTION:
+ case self::TYPE_QUESTION:
if ($old === null) {
return pht(
'%s created this poll.',
@@ -56,16 +56,16 @@
$new);
}
break;
- case PhabricatorSlowvoteTransaction::TYPE_DESCRIPTION:
+ case self::TYPE_DESCRIPTION:
return pht(
'%s updated the description for this poll.',
$this->renderHandleLink($author_phid));
- case PhabricatorSlowvoteTransaction::TYPE_RESPONSES:
+ case self::TYPE_RESPONSES:
// TODO: This could be more detailed
return pht(
'%s changed who can see the responses.',
$this->renderHandleLink($author_phid));
- case PhabricatorSlowvoteTransaction::TYPE_SHUFFLE:
+ case self::TYPE_SHUFFLE:
if ($new) {
return pht(
'%s made poll responses appear in a random order.',
@@ -76,7 +76,7 @@
$this->renderHandleLink($author_phid));
}
break;
- case PhabricatorSlowvoteTransaction::TYPE_CLOSE:
+ case self::TYPE_CLOSE:
if ($new) {
return pht(
'%s closed this poll.',
@@ -98,18 +98,18 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case PhabricatorSlowvoteTransaction::TYPE_QUESTION:
+ case self::TYPE_QUESTION:
if ($old === null) {
return 'fa-plus';
} else {
return 'fa-pencil';
}
- case PhabricatorSlowvoteTransaction::TYPE_DESCRIPTION:
- case PhabricatorSlowvoteTransaction::TYPE_RESPONSES:
+ case self::TYPE_DESCRIPTION:
+ case self::TYPE_RESPONSES:
return 'fa-pencil';
- case PhabricatorSlowvoteTransaction::TYPE_SHUFFLE:
+ case self::TYPE_SHUFFLE:
return 'fa-refresh';
- case PhabricatorSlowvoteTransaction::TYPE_CLOSE:
+ case self::TYPE_CLOSE:
if ($new) {
return 'fa-ban';
} else {
@@ -126,11 +126,11 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case PhabricatorSlowvoteTransaction::TYPE_QUESTION:
- case PhabricatorSlowvoteTransaction::TYPE_DESCRIPTION:
- case PhabricatorSlowvoteTransaction::TYPE_RESPONSES:
- case PhabricatorSlowvoteTransaction::TYPE_SHUFFLE:
- case PhabricatorSlowvoteTransaction::TYPE_CLOSE:
+ case self::TYPE_QUESTION:
+ case self::TYPE_DESCRIPTION:
+ case self::TYPE_RESPONSES:
+ case self::TYPE_SHUFFLE:
+ case self::TYPE_CLOSE:
return PhabricatorTransactions::COLOR_BLUE;
}
@@ -139,7 +139,7 @@
public function hasChangeDetails() {
switch ($this->getTransactionType()) {
- case PhabricatorSlowvoteTransaction::TYPE_DESCRIPTION:
+ case self::TYPE_DESCRIPTION:
return true;
}
return parent::hasChangeDetails();
diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
--- a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
+++ b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
@@ -1073,7 +1073,7 @@
}
public function attachTransactionGroup(array $group) {
- assert_instances_of($group, 'PhabricatorApplicationTransaction');
+ assert_instances_of($group, __CLASS__);
$this->transactionGroup = $group;
return $this;
}
@@ -1165,7 +1165,7 @@
}
$old_target = $xaction->getRenderingTarget();
- $new_target = PhabricatorApplicationTransaction::TARGET_TEXT;
+ $new_target = self::TARGET_TEXT;
$xaction->setRenderingTarget($new_target);
if ($publisher->getRenderWithImpliedContext()) {
diff --git a/src/infrastructure/customfield/field/PhabricatorCustomField.php b/src/infrastructure/customfield/field/PhabricatorCustomField.php
--- a/src/infrastructure/customfield/field/PhabricatorCustomField.php
+++ b/src/infrastructure/customfield/field/PhabricatorCustomField.php
@@ -65,7 +65,7 @@
"object of class '{$obj_class}'.");
}
- $fields = PhabricatorCustomField::buildFieldList(
+ $fields = self::buildFieldList(
$base_class,
$spec,
$object);
diff --git a/src/infrastructure/daemon/bot/PhabricatorBot.php b/src/infrastructure/daemon/bot/PhabricatorBot.php
--- a/src/infrastructure/daemon/bot/PhabricatorBot.php
+++ b/src/infrastructure/daemon/bot/PhabricatorBot.php
@@ -19,7 +19,11 @@
protected function run() {
$argv = $this->getArgv();
if (count($argv) !== 1) {
- throw new Exception('usage: PhabricatorBot <json_config_file>');
+ throw new Exception(
+ pht(
+ 'Usage: %s %s',
+ __CLASS__,
+ '<json_config_file>'));
}
$json_raw = Filesystem::readFile($argv[0]);
@@ -72,7 +76,7 @@
$response = $conduit->callMethodSynchronous(
'conduit.connect',
array(
- 'client' => 'PhabricatorBot',
+ 'client' => __CLASS__,
'clientVersion' => '1.0',
'clientDescription' => php_uname('n').':'.$nick,
'host' => $conduit_host,
diff --git a/src/infrastructure/daemon/workers/query/PhabricatorWorkerTriggerQuery.php b/src/infrastructure/daemon/workers/query/PhabricatorWorkerTriggerQuery.php
--- a/src/infrastructure/daemon/workers/query/PhabricatorWorkerTriggerQuery.php
+++ b/src/infrastructure/daemon/workers/query/PhabricatorWorkerTriggerQuery.php
@@ -150,7 +150,7 @@
if (($this->nextEpochMin !== null) ||
($this->nextEpochMax !== null) ||
- ($this->order == PhabricatorWorkerTriggerQuery::ORDER_EXECUTION)) {
+ ($this->order == self::ORDER_EXECUTION)) {
$joins[] = qsprintf(
$conn_r,
'JOIN %T e ON e.triggerID = t.id',
diff --git a/src/infrastructure/env/PhabricatorEnv.php b/src/infrastructure/env/PhabricatorEnv.php
--- a/src/infrastructure/env/PhabricatorEnv.php
+++ b/src/infrastructure/env/PhabricatorEnv.php
@@ -88,7 +88,7 @@
// Force a valid timezone. If both PHP and Phabricator configuration are
// invalid, use UTC.
- $tz = PhabricatorEnv::getEnvConfig('phabricator.timezone');
+ $tz = self::getEnvConfig('phabricator.timezone');
if ($tz) {
@date_default_timezone_set($tz);
}
@@ -102,7 +102,7 @@
$phabricator_path = dirname(phutil_get_library_root('phabricator'));
$support_path = $phabricator_path.'/support/bin';
$env_path = $support_path.PATH_SEPARATOR.$env_path;
- $append_dirs = PhabricatorEnv::getEnvConfig('environment.append-paths');
+ $append_dirs = self::getEnvConfig('environment.append-paths');
if (!empty($append_dirs)) {
$append_path = implode(PATH_SEPARATOR, $append_dirs);
$env_path = $env_path.PATH_SEPARATOR.$append_path;
@@ -116,7 +116,7 @@
// If an instance identifier is defined, write it into the environment so
// it's available to subprocesses.
- $instance = PhabricatorEnv::getEnvConfig('cluster.instance');
+ $instance = self::getEnvConfig('cluster.instance');
if (strlen($instance)) {
putenv('PHABRICATOR_INSTANCE='.$instance);
$_ENV['PHABRICATOR_INSTANCE'] = $instance;
@@ -139,7 +139,7 @@
$translations = PhutilTranslation::getTranslationMapForLocale(
$locale_code);
- $override = PhabricatorEnv::getEnvConfig('translation.override');
+ $override = self::getEnvConfig('translation.override');
if (!is_array($override)) {
$override = array();
}
@@ -178,7 +178,7 @@
// If the install overrides the database adapter, we might need to load
// the database adapter class before we can push on the database config.
// This config is locked and can't be edited from the web UI anyway.
- foreach (PhabricatorEnv::getEnvConfig('load-libraries') as $library) {
+ foreach (self::getEnvConfig('load-libraries') as $library) {
phutil_load_library($library);
}
@@ -809,7 +809,7 @@
}
public static function isClusterAddress($address) {
- $cluster_addresses = PhabricatorEnv::getEnvConfig('cluster.addresses');
+ $cluster_addresses = self::getEnvConfig('cluster.addresses');
if (!$cluster_addresses) {
throw new Exception(
pht(
diff --git a/src/infrastructure/events/PhabricatorExampleEventListener.php b/src/infrastructure/events/PhabricatorExampleEventListener.php
--- a/src/infrastructure/events/PhabricatorExampleEventListener.php
+++ b/src/infrastructure/events/PhabricatorExampleEventListener.php
@@ -21,8 +21,11 @@
$console = PhutilConsole::getConsole();
$console->writeOut(
- "PhabricatorExampleEventListener got test event at %d\n",
- $event->getValue('time'));
+ "%s\n",
+ pht(
+ '% got test event at %d',
+ __CLASS__,
+ $event->getValue('time')));
}
}
diff --git a/src/infrastructure/sms/storage/PhabricatorSMS.php b/src/infrastructure/sms/storage/PhabricatorSMS.php
--- a/src/infrastructure/sms/storage/PhabricatorSMS.php
+++ b/src/infrastructure/sms/storage/PhabricatorSMS.php
@@ -38,8 +38,8 @@
// and ProviderSMSID are totally garbage data before a send it attempted.
return id(new PhabricatorSMS())
->setBody($body)
- ->setSendStatus(PhabricatorSMS::STATUS_UNSENT)
- ->setProviderShortName(PhabricatorSMS::SHORTNAME_PLACEHOLDER)
+ ->setSendStatus(self::STATUS_UNSENT)
+ ->setProviderShortName(self::SHORTNAME_PLACEHOLDER)
->setProviderSMSID(Filesystem::readRandomCharacters(40));
}
@@ -70,6 +70,6 @@
public function hasBeenSentAtLeastOnce() {
return ($this->getProviderShortName() !=
- PhabricatorSMS::SHORTNAME_PLACEHOLDER);
+ self::SHORTNAME_PLACEHOLDER);
}
}
diff --git a/src/infrastructure/storage/patch/PhabricatorSQLPatchList.php b/src/infrastructure/storage/patch/PhabricatorSQLPatchList.php
--- a/src/infrastructure/storage/patch/PhabricatorSQLPatchList.php
+++ b/src/infrastructure/storage/patch/PhabricatorSQLPatchList.php
@@ -38,7 +38,7 @@
final public static function buildAllPatches() {
$patch_lists = id(new PhutilSymbolLoader())
- ->setAncestorClass('PhabricatorSQLPatchList')
+ ->setAncestorClass(__CLASS__)
->setConcreteOnly(true)
->selectAndLoadSymbols();
diff --git a/src/infrastructure/time/PhabricatorTime.php b/src/infrastructure/time/PhabricatorTime.php
--- a/src/infrastructure/time/PhabricatorTime.php
+++ b/src/infrastructure/time/PhabricatorTime.php
@@ -25,7 +25,10 @@
public static function popTime($key) {
if ($key !== last_key(self::$stack)) {
- throw new Exception('PhabricatorTime::popTime with bad key.');
+ throw new Exception(
+ pht(
+ '%s with bad key.',
+ __METHOD__));
}
array_pop(self::$stack);
@@ -49,7 +52,7 @@
$old_zone = date_default_timezone_get();
date_default_timezone_set($user->getTimezoneIdentifier());
- $timestamp = (int)strtotime($time, PhabricatorTime::getNow());
+ $timestamp = (int)strtotime($time, self::getNow());
if ($timestamp <= 0) {
$timestamp = null;
}
diff --git a/src/infrastructure/util/PhabricatorHash.php b/src/infrastructure/util/PhabricatorHash.php
--- a/src/infrastructure/util/PhabricatorHash.php
+++ b/src/infrastructure/util/PhabricatorHash.php
@@ -35,7 +35,7 @@
}
for ($ii = 0; $ii < 1000; $ii++) {
- $result = PhabricatorHash::digest($result, $salt);
+ $result = self::digest($result, $salt);
}
return $result;
@@ -113,7 +113,7 @@
// who can control the inputs from intentionally using the hashed form
// of a string to cause a collision.
- $hash = PhabricatorHash::digestForIndex($string);
+ $hash = self::digestForIndex($string);
$prefix = substr($string, 0, ($length - ($min_length - 1)));
diff --git a/src/infrastructure/util/password/PhabricatorPasswordHasher.php b/src/infrastructure/util/password/PhabricatorPasswordHasher.php
--- a/src/infrastructure/util/password/PhabricatorPasswordHasher.php
+++ b/src/infrastructure/util/password/PhabricatorPasswordHasher.php
@@ -213,7 +213,7 @@
*/
public static function getAllHashers() {
$objects = id(new PhutilSymbolLoader())
- ->setAncestorClass('PhabricatorPasswordHasher')
+ ->setAncestorClass(__CLASS__)
->loadObjects();
$map = array();
@@ -404,7 +404,7 @@
}
try {
- $current_hasher = PhabricatorPasswordHasher::getHasherForHash($hash);
+ $current_hasher = self::getHasherForHash($hash);
return $current_hasher->getHumanReadableName();
} catch (Exception $ex) {
$info = self::parseHashFromStorage($hash);
@@ -421,7 +421,7 @@
*/
public static function getBestAlgorithmName() {
try {
- $best_hasher = PhabricatorPasswordHasher::getBestHasher();
+ $best_hasher = self::getBestHasher();
return $best_hasher->getHumanReadableName();
} catch (Exception $ex) {
return pht('Unknown');
diff --git a/src/view/AphrontDialogView.php b/src/view/AphrontDialogView.php
--- a/src/view/AphrontDialogView.php
+++ b/src/view/AphrontDialogView.php
@@ -215,7 +215,10 @@
if (!$this->user) {
throw new Exception(
- pht('You must call setUser() when rendering an AphrontDialogView.'));
+ pht(
+ 'You must call %s when rendering an %s.',
+ 'setUser()',
+ __CLASS__));
}
$more = $this->class;
diff --git a/src/view/form/AphrontFormView.php b/src/view/form/AphrontFormView.php
--- a/src/view/form/AphrontFormView.php
+++ b/src/view/form/AphrontFormView.php
@@ -126,7 +126,10 @@
$layout = $this->buildLayoutView();
if (!$this->user) {
- throw new Exception(pht('You must pass the user to AphrontFormView.'));
+ throw new Exception(
+ pht(
+ 'You must pass the user to %s.',
+ __CLASS__));
}
$sigils = $this->sigils;
diff --git a/src/view/form/PHUIFormLayoutView.php b/src/view/form/PHUIFormLayoutView.php
--- a/src/view/form/PHUIFormLayoutView.php
+++ b/src/view/form/PHUIFormLayoutView.php
@@ -33,7 +33,10 @@
public function appendRemarkupInstructions($remarkup) {
if ($this->getUser() === null) {
throw new Exception(
- 'Call `setUser` before appending Remarkup to PHUIFormLayoutView.');
+ pht(
+ 'Call %s before appending Remarkup to %s.',
+ 'setUser()',
+ __CLASS__));
}
return $this->appendInstructions(
diff --git a/src/view/form/PHUIInfoView.php b/src/view/form/PHUIInfoView.php
--- a/src/view/form/PHUIInfoView.php
+++ b/src/view/form/PHUIInfoView.php
@@ -41,7 +41,6 @@
}
final public function render() {
-
require_celerity_resource('phui-info-view-css');
$errors = $this->errors;
diff --git a/src/view/form/PHUIPagedFormView.php b/src/view/form/PHUIPagedFormView.php
--- a/src/view/form/PHUIPagedFormView.php
+++ b/src/view/form/PHUIPagedFormView.php
@@ -152,7 +152,7 @@
$is_attempt_complete = false;
if ($this->prevPage) {
- $prev_index = $this->getPageIndex($selected->getKey()) - 1;;
+ $prev_index = $this->getPageIndex($selected->getKey()) - 1;
$index = max(0, $prev_index);
$selected = $this->getPageByIndex($index);
} else if ($this->nextPage) {
diff --git a/src/view/form/control/PhabricatorRemarkupControl.php b/src/view/form/control/PhabricatorRemarkupControl.php
--- a/src/view/form/control/PhabricatorRemarkupControl.php
+++ b/src/view/form/control/PhabricatorRemarkupControl.php
@@ -25,7 +25,10 @@
$viewer = $this->getUser();
if (!$viewer) {
throw new Exception(
- pht('Call setUser() before rendering a PhabricatorRemarkupControl!'));
+ pht(
+ 'Call %s before rendering a %s!',
+ 'setUser()',
+ __CLASS__));
}
// We need to have this if previews render images, since Ajax can not
diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php
--- a/src/view/page/PhabricatorStandardPageView.php
+++ b/src/view/page/PhabricatorStandardPageView.php
@@ -3,7 +3,6 @@
/**
* This is a standard Phabricator page with menus, Javelin, DarkConsole, and
* basic styles.
- *
*/
final class PhabricatorStandardPageView extends PhabricatorBarePageView {
@@ -160,7 +159,8 @@
if (!$this->getRequest()) {
throw new Exception(
pht(
- 'You must set the Request to render a PhabricatorStandardPageView.'));
+ 'You must set the Request to render a %s.',
+ __CLASS__));
}
$console = $this->getConsole();
diff --git a/src/view/phui/PHUIDocumentView.php b/src/view/phui/PHUIDocumentView.php
--- a/src/view/phui/PHUIDocumentView.php
+++ b/src/view/phui/PHUIDocumentView.php
@@ -74,7 +74,7 @@
if ($this->offset) {
$classes[] = 'phui-document-offset';
- };
+ }
if ($this->fluid) {
$classes[] = 'phui-document-fluid';
diff --git a/support/PhabricatorStartup.php b/support/PhabricatorStartup.php
--- a/support/PhabricatorStartup.php
+++ b/support/PhabricatorStartup.php
@@ -255,7 +255,7 @@
static $initialized;
if (!$initialized) {
declare(ticks=1);
- register_tick_function(array('PhabricatorStartup', 'onDebugTick'));
+ register_tick_function(array(__CLASS__, 'onDebugTick'));
}
}
@@ -647,7 +647,7 @@
// populated into $_POST, but it wasn't.
$config = ini_get('post_max_size');
- PhabricatorStartup::didFatal(
+ self::didFatal(
"As received by the server, this request had a nonzero content length ".
"but no POST data.\n\n".
"Normally, this indicates that it exceeds the 'post_max_size' setting ".
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, May 26, 1:04 AM (19 h, 6 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8025294
Default Alt Text
D12806.diff (73 KB)
Attached To
Mode
D12806: Use `__CLASS__` instead of hard-coding class names
Attached
Detach File
Event Timeline
Log In to Comment