@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+268 -233
+1 -1
src/aphront/AphrontRequest.php
··· 650 650 * safe. 651 651 */ 652 652 public function isProxiedClusterRequest() { 653 - return (bool)AphrontRequest::getHTTPHeader('X-Phabricator-Cluster'); 653 + return (bool)self::getHTTPHeader('X-Phabricator-Cluster'); 654 654 } 655 655 656 656
+4 -1
src/aphront/response/AphrontProxyResponse.php
··· 65 65 66 66 final public function buildResponseString() { 67 67 throw new Exception( 68 - 'AphrontProxyResponse must implement reduceProxyResponse().'); 68 + pht( 69 + '%s must implement %s.', 70 + __CLASS__, 71 + 'reduceProxyResponse()')); 69 72 } 70 73 71 74 }
+1 -1
src/aphront/response/AphrontResponse.php
··· 154 154 155 155 array_walk_recursive( 156 156 $object, 157 - array('AphrontResponse', 'processValueForJSONEncoding')); 157 + array(__CLASS__, 'processValueForJSONEncoding')); 158 158 159 159 $response = json_encode($object); 160 160
+7 -7
src/applications/audit/constants/PhabricatorAuditStatusConstants.php
··· 60 60 61 61 public static function getStatusIcon($code) { 62 62 switch ($code) { 63 - case PhabricatorAuditStatusConstants::AUDIT_NOT_REQUIRED: 64 - case PhabricatorAuditStatusConstants::RESIGNED: 63 + case self::AUDIT_NOT_REQUIRED: 64 + case self::RESIGNED: 65 65 $icon = PHUIStatusItemView::ICON_OPEN; 66 66 break; 67 - case PhabricatorAuditStatusConstants::AUDIT_REQUIRED: 68 - case PhabricatorAuditStatusConstants::AUDIT_REQUESTED: 67 + case self::AUDIT_REQUIRED: 68 + case self::AUDIT_REQUESTED: 69 69 $icon = PHUIStatusItemView::ICON_WARNING; 70 70 break; 71 - case PhabricatorAuditStatusConstants::CONCERNED: 71 + case self::CONCERNED: 72 72 $icon = PHUIStatusItemView::ICON_REJECT; 73 73 break; 74 - case PhabricatorAuditStatusConstants::ACCEPTED: 75 - case PhabricatorAuditStatusConstants::CLOSED: 74 + case self::ACCEPTED: 75 + case self::CLOSED: 76 76 $icon = PHUIStatusItemView::ICON_ACCEPT; 77 77 break; 78 78 default:
+1 -1
src/applications/audit/storage/PhabricatorAuditInlineComment.php
··· 115 115 private static function buildProxies(array $inlines) { 116 116 $results = array(); 117 117 foreach ($inlines as $key => $inline) { 118 - $results[$key] = PhabricatorAuditInlineComment::newFromModernComment( 118 + $results[$key] = self::newFromModernComment( 119 119 $inline); 120 120 } 121 121 return $results;
+1 -1
src/applications/base/PhabricatorApplication.php
··· 361 361 362 362 public static function getByClass($class_name) { 363 363 $selected = null; 364 - $applications = PhabricatorApplication::getAllApplications(); 364 + $applications = self::getAllApplications(); 365 365 366 366 foreach ($applications as $application) { 367 367 if (get_class($application) == $class_name) {
+1 -1
src/applications/cache/PhabricatorCaches.php
··· 270 270 } 271 271 272 272 private static function addNamespaceToCaches(array $caches) { 273 - $namespace = PhabricatorCaches::getNamespace(); 273 + $namespace = self::getNamespace(); 274 274 if (!$namespace) { 275 275 return $caches; 276 276 }
+1 -1
src/applications/calendar/storage/PhabricatorCalendarEvent.php
··· 200 200 201 201 public function getTerseSummary(PhabricatorUser $viewer) { 202 202 $until = phabricator_date($this->dateTo, $viewer); 203 - if ($this->status == PhabricatorCalendarEvent::STATUS_SPORADIC) { 203 + if ($this->status == self::STATUS_SPORADIC) { 204 204 return pht('Sporadic until %s', $until); 205 205 } else { 206 206 return pht('Away until %s', $until);
+1 -1
src/applications/celerity/resources/CelerityPhysicalResources.php
··· 25 25 $resources_map = array(); 26 26 27 27 $resources_list = id(new PhutilSymbolLoader()) 28 - ->setAncestorClass('CelerityPhysicalResources') 28 + ->setAncestorClass(__CLASS__) 29 29 ->loadObjects(); 30 30 31 31 foreach ($resources_list as $resources) {
+3 -3
src/applications/conduit/method/ConduitAPIMethod.php
··· 100 100 $name = $this->getAPIMethodName(); 101 101 102 102 $map = array( 103 - ConduitAPIMethod::METHOD_STATUS_STABLE => 0, 104 - ConduitAPIMethod::METHOD_STATUS_UNSTABLE => 1, 105 - ConduitAPIMethod::METHOD_STATUS_DEPRECATED => 2, 103 + self::METHOD_STATUS_STABLE => 0, 104 + self::METHOD_STATUS_UNSTABLE => 1, 105 + self::METHOD_STATUS_DEPRECATED => 2, 106 106 ); 107 107 $ord = idx($map, $this->getMethodStatus(), 0); 108 108
+1 -1
src/applications/conduit/query/PhabricatorConduitLogQuery.php
··· 22 22 $this->buildOrderClause($conn_r), 23 23 $this->buildLimitClause($conn_r)); 24 24 25 - return $table->loadAllFromArray($data);; 25 + return $table->loadAllFromArray($data); 26 26 } 27 27 28 28 protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
+1 -1
src/applications/conduit/query/PhabricatorConduitTokenQuery.php
··· 46 46 $this->buildOrderClause($conn_r), 47 47 $this->buildLimitClause($conn_r)); 48 48 49 - return $table->loadAllFromArray($data);; 49 + return $table->loadAllFromArray($data); 50 50 } 51 51 52 52 protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
+1 -1
src/applications/conduit/storage/PhabricatorConduitToken.php
··· 65 65 // to expire) so generate a new token. 66 66 67 67 $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); 68 - $token = PhabricatorConduitToken::initializeNewToken( 68 + $token = self::initializeNewToken( 69 69 $user->getPHID(), 70 70 self::TYPE_CLUSTER); 71 71 $token->save();
+1 -1
src/applications/config/check/PhabricatorSetupCheck.php
··· 113 113 114 114 final public static function runAllChecks() { 115 115 $symbols = id(new PhutilSymbolLoader()) 116 - ->setAncestorClass('PhabricatorSetupCheck') 116 + ->setAncestorClass(__CLASS__) 117 117 ->setConcreteOnly(true) 118 118 ->selectAndLoadSymbols(); 119 119
+11 -5
src/applications/config/option/PhabricatorApplicationConfigOptions.php
··· 187 187 188 188 final public static function loadAll($external_only = false) { 189 189 $symbols = id(new PhutilSymbolLoader()) 190 - ->setAncestorClass('PhabricatorApplicationConfigOptions') 190 + ->setAncestorClass(__CLASS__) 191 191 ->setConcreteOnly(true) 192 192 ->selectAndLoadSymbols(); 193 193 ··· 204 204 $nclass = $symbol['name']; 205 205 206 206 throw new Exception( 207 - "Multiple PhabricatorApplicationConfigOptions subclasses have the ". 208 - "same key ('{$key}'): {$pclass}, {$nclass}."); 207 + pht( 208 + "Multiple %s subclasses have the same key ('%s'): %s, %s.", 209 + __CLASS__, 210 + $key, 211 + $pclass, 212 + $nclass)); 209 213 } 210 214 $groups[$key] = $obj; 211 215 } ··· 222 226 $key = $option->getKey(); 223 227 if (isset($options[$key])) { 224 228 throw new Exception( 225 - "Mulitple PhabricatorApplicationConfigOptions subclasses contain ". 226 - "an option named '{$key}'!"); 229 + pht( 230 + "Mulitple % subclasses contain an option named '%s'!", 231 + __CLASS__, 232 + $key)); 227 233 } 228 234 $options[$key] = $option; 229 235 }
+1 -1
src/applications/conpherence/storage/ConpherenceThread.php
··· 407 407 PhabricatorUser $viewer, 408 408 array $conpherences) { 409 409 410 - assert_instances_of($conpherences, 'ConpherenceThread'); 410 + assert_instances_of($conpherences, __CLASS__); 411 411 412 412 $grouped = mgroup($conpherences, 'getIsRoom'); 413 413 $rooms = idx($grouped, 1, array());
+1 -1
src/applications/console/plugin/errorlog/DarkConsoleErrorLogPluginAPI.php
··· 12 12 // reenter autoloaders). 13 13 PhutilReadableSerializer::printableValue(null); 14 14 PhutilErrorHandler::setErrorListener( 15 - array('DarkConsoleErrorLogPluginAPI', 'handleErrors')); 15 + array(__CLASS__, 'handleErrors')); 16 16 } 17 17 18 18 public static function enableDiscardMode() {
+2 -2
src/applications/daemon/query/PhabricatorDaemonLogQuery.php
··· 68 68 } 69 69 70 70 protected function willFilterPage(array $daemons) { 71 - $unknown_delay = PhabricatorDaemonLogQuery::getTimeUntilUnknown(); 72 - $dead_delay = PhabricatorDaemonLogQuery::getTimeUntilDead(); 71 + $unknown_delay = self::getTimeUntilUnknown(); 72 + $dead_delay = self::getTimeUntilDead(); 73 73 74 74 $status_running = PhabricatorDaemonLog::STATUS_RUNNING; 75 75 $status_unknown = PhabricatorDaemonLog::STATUS_UNKNOWN;
+20 -20
src/applications/differential/constants/DifferentialAction.php
··· 22 22 23 23 public static function getBasicStoryText($action, $author_name) { 24 24 switch ($action) { 25 - case DifferentialAction::ACTION_COMMENT: 25 + case self::ACTION_COMMENT: 26 26 $title = pht('%s commented on this revision.', 27 27 $author_name); 28 28 break; 29 - case DifferentialAction::ACTION_ACCEPT: 29 + case self::ACTION_ACCEPT: 30 30 $title = pht('%s accepted this revision.', 31 31 $author_name); 32 32 break; 33 - case DifferentialAction::ACTION_REJECT: 33 + case self::ACTION_REJECT: 34 34 $title = pht('%s requested changes to this revision.', 35 35 $author_name); 36 36 break; 37 - case DifferentialAction::ACTION_RETHINK: 37 + case self::ACTION_RETHINK: 38 38 $title = pht('%s planned changes to this revision.', 39 39 $author_name); 40 40 break; 41 - case DifferentialAction::ACTION_ABANDON: 41 + case self::ACTION_ABANDON: 42 42 $title = pht('%s abandoned this revision.', 43 43 $author_name); 44 44 break; 45 - case DifferentialAction::ACTION_CLOSE: 45 + case self::ACTION_CLOSE: 46 46 $title = pht('%s closed this revision.', 47 47 $author_name); 48 48 break; 49 - case DifferentialAction::ACTION_REQUEST: 49 + case self::ACTION_REQUEST: 50 50 $title = pht('%s requested a review of this revision.', 51 51 $author_name); 52 52 break; 53 - case DifferentialAction::ACTION_RECLAIM: 53 + case self::ACTION_RECLAIM: 54 54 $title = pht('%s reclaimed this revision.', 55 55 $author_name); 56 56 break; 57 - case DifferentialAction::ACTION_UPDATE: 57 + case self::ACTION_UPDATE: 58 58 $title = pht('%s updated this revision.', 59 59 $author_name); 60 60 break; 61 - case DifferentialAction::ACTION_RESIGN: 61 + case self::ACTION_RESIGN: 62 62 $title = pht('%s resigned from this revision.', 63 63 $author_name); 64 64 break; 65 - case DifferentialAction::ACTION_SUMMARIZE: 65 + case self::ACTION_SUMMARIZE: 66 66 $title = pht('%s summarized this revision.', 67 67 $author_name); 68 68 break; 69 - case DifferentialAction::ACTION_TESTPLAN: 69 + case self::ACTION_TESTPLAN: 70 70 $title = pht('%s explained the test plan for this revision.', 71 71 $author_name); 72 72 break; 73 - case DifferentialAction::ACTION_CREATE: 73 + case self::ACTION_CREATE: 74 74 $title = pht('%s created this revision.', 75 75 $author_name); 76 76 break; 77 - case DifferentialAction::ACTION_ADDREVIEWERS: 77 + case self::ACTION_ADDREVIEWERS: 78 78 $title = pht('%s added reviewers to this revision.', 79 79 $author_name); 80 80 break; 81 - case DifferentialAction::ACTION_ADDCCS: 81 + case self::ACTION_ADDCCS: 82 82 $title = pht('%s added CCs to this revision.', 83 83 $author_name); 84 84 break; 85 - case DifferentialAction::ACTION_CLAIM: 85 + case self::ACTION_CLAIM: 86 86 $title = pht('%s commandeered this revision.', 87 87 $author_name); 88 88 break; 89 - case DifferentialAction::ACTION_REOPEN: 89 + case self::ACTION_REOPEN: 90 90 $title = pht('%s reopened this revision.', 91 91 $author_name); 92 92 break; ··· 127 127 } 128 128 129 129 public static function allowReviewers($action) { 130 - if ($action == DifferentialAction::ACTION_ADDREVIEWERS || 131 - $action == DifferentialAction::ACTION_REQUEST || 132 - $action == DifferentialAction::ACTION_RESIGN) { 130 + if ($action == self::ACTION_ADDREVIEWERS || 131 + $action == self::ACTION_REQUEST || 132 + $action == self::ACTION_RESIGN) { 133 133 return true; 134 134 } 135 135 return false;
+12 -12
src/applications/differential/constants/DifferentialChangeType.php
··· 52 52 53 53 public static function isOldLocationChangeType($type) { 54 54 static $types = array( 55 - DifferentialChangeType::TYPE_MOVE_AWAY => true, 56 - DifferentialChangeType::TYPE_COPY_AWAY => true, 57 - DifferentialChangeType::TYPE_MULTICOPY => true, 55 + self::TYPE_MOVE_AWAY => true, 56 + self::TYPE_COPY_AWAY => true, 57 + self::TYPE_MULTICOPY => true, 58 58 ); 59 59 return isset($types[$type]); 60 60 } 61 61 62 62 public static function isNewLocationChangeType($type) { 63 63 static $types = array( 64 - DifferentialChangeType::TYPE_MOVE_HERE => true, 65 - DifferentialChangeType::TYPE_COPY_HERE => true, 64 + self::TYPE_MOVE_HERE => true, 65 + self::TYPE_COPY_HERE => true, 66 66 ); 67 67 return isset($types[$type]); 68 68 } 69 69 70 70 public static function isDeleteChangeType($type) { 71 71 static $types = array( 72 - DifferentialChangeType::TYPE_DELETE => true, 73 - DifferentialChangeType::TYPE_MOVE_AWAY => true, 74 - DifferentialChangeType::TYPE_MULTICOPY => true, 72 + self::TYPE_DELETE => true, 73 + self::TYPE_MOVE_AWAY => true, 74 + self::TYPE_MULTICOPY => true, 75 75 ); 76 76 return isset($types[$type]); 77 77 } 78 78 79 79 public static function isCreateChangeType($type) { 80 80 static $types = array( 81 - DifferentialChangeType::TYPE_ADD => true, 82 - DifferentialChangeType::TYPE_COPY_HERE => true, 83 - DifferentialChangeType::TYPE_MOVE_HERE => true, 81 + self::TYPE_ADD => true, 82 + self::TYPE_COPY_HERE => true, 83 + self::TYPE_MOVE_HERE => true, 84 84 ); 85 85 return isset($types[$type]); 86 86 } 87 87 88 88 public static function isModifyChangeType($type) { 89 89 static $types = array( 90 - DifferentialChangeType::TYPE_CHANGE => true, 90 + self::TYPE_CHANGE => true, 91 91 ); 92 92 return isset($types[$type]); 93 93 }
+1 -1
src/applications/differential/storage/DifferentialTransaction.php
··· 568 568 'this revision.'); 569 569 } 570 570 break; 571 - case DifferentialTransaction::TYPE_ACTION: 571 + case self::TYPE_ACTION: 572 572 switch ($this->getNewValue()) { 573 573 case DifferentialAction::ACTION_CLOSE: 574 574 return pht('This revision is already closed.');
+2 -2
src/applications/diffusion/data/DiffusionPathChange.php
··· 119 119 } 120 120 121 121 final public static function convertToArcanistChanges(array $changes) { 122 - assert_instances_of($changes, 'DiffusionPathChange'); 122 + assert_instances_of($changes, __CLASS__); 123 123 $direct = array(); 124 124 $result = array(); 125 125 foreach ($changes as $path) { ··· 145 145 final public static function convertToDifferentialChangesets( 146 146 PhabricatorUser $user, 147 147 array $changes) { 148 - assert_instances_of($changes, 'DiffusionPathChange'); 148 + assert_instances_of($changes, __CLASS__); 149 149 $arcanist_changes = self::convertToArcanistChanges($changes); 150 150 $diff = DifferentialDiff::newEphemeralFromRawChanges( 151 151 $arcanist_changes);
+2 -2
src/applications/diviner/storage/DivinerLiveSymbol.php
··· 174 174 } 175 175 176 176 public function attachExtends(array $extends) { 177 - assert_instances_of($extends, 'DivinerLiveSymbol'); 177 + assert_instances_of($extends, __CLASS__); 178 178 $this->extends = $extends; 179 179 return $this; 180 180 } ··· 184 184 } 185 185 186 186 public function attachChildren(array $children) { 187 - assert_instances_of($children, 'DivinerLiveSymbol'); 187 + assert_instances_of($children, __CLASS__); 188 188 $this->children = $children; 189 189 return $this; 190 190 }
+1 -1
src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
··· 377 377 if ($list === null) { 378 378 $blueprints = id(new PhutilSymbolLoader()) 379 379 ->setType('class') 380 - ->setAncestorClass('DrydockBlueprintImplementation') 380 + ->setAncestorClass(__CLASS__) 381 381 ->setConcreteOnly(true) 382 382 ->selectAndLoadSymbols(); 383 383 $list = ipull($blueprints, 'name', 'name');
+1 -1
src/applications/drydock/storage/DrydockLease.php
··· 149 149 } 150 150 151 151 public static function waitForLeases(array $leases) { 152 - assert_instances_of($leases, 'DrydockLease'); 152 + assert_instances_of($leases, __CLASS__); 153 153 154 154 $task_ids = array_filter(mpull($leases, 'getTaskID')); 155 155
+1 -1
src/applications/feed/story/PhabricatorFeedStory.php
··· 48 48 try { 49 49 $ok = 50 50 class_exists($class) && 51 - is_subclass_of($class, 'PhabricatorFeedStory'); 51 + is_subclass_of($class, __CLASS__); 52 52 } catch (PhutilMissingSymbolException $ex) { 53 53 $ok = false; 54 54 }
+1 -1
src/applications/files/controller/PhabricatorFileComposeController.php
··· 242 242 } 243 243 244 244 $dialog_id = celerity_generate_unique_node_id(); 245 - $color_input_id = celerity_generate_unique_node_id();; 245 + $color_input_id = celerity_generate_unique_node_id(); 246 246 $icon_input_id = celerity_generate_unique_node_id(); 247 247 $preview_id = celerity_generate_unique_node_id(); 248 248
+5 -5
src/applications/files/storage/PhabricatorFile.php
··· 215 215 216 216 if (!$file) { 217 217 $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); 218 - $file = PhabricatorFile::newFromFileData($data, $params); 218 + $file = self::newFromFileData($data, $params); 219 219 unset($unguarded); 220 220 } 221 221 ··· 236 236 $copy_of_byte_size = $file->getByteSize(); 237 237 $copy_of_mime_type = $file->getMimeType(); 238 238 239 - $new_file = PhabricatorFile::initializeNewFile(); 239 + $new_file = self::initializeNewFile(); 240 240 241 241 $new_file->setByteSize($copy_of_byte_size); 242 242 ··· 262 262 $length, 263 263 array $params) { 264 264 265 - $file = PhabricatorFile::initializeNewFile(); 265 + $file = self::initializeNewFile(); 266 266 267 267 $file->setByteSize($length); 268 268 ··· 316 316 throw new Exception(pht('No valid storage engines are available!')); 317 317 } 318 318 319 - $file = PhabricatorFile::initializeNewFile(); 319 + $file = self::initializeNewFile(); 320 320 321 321 $data_handle = null; 322 322 $engine_identifier = null; ··· 1017 1017 ); 1018 1018 1019 1019 $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); 1020 - $file = PhabricatorFile::newFromFileData($data, $params); 1020 + $file = self::newFromFileData($data, $params); 1021 1021 $xform = id(new PhabricatorTransformedFile()) 1022 1022 ->setOriginalPHID(PhabricatorPHIDConstants::PHID_VOID) 1023 1023 ->setTransform('builtin:'.$name)
+18 -18
src/applications/fund/storage/FundInitiativeTransaction.php
··· 38 38 39 39 $type = $this->getTransactionType(); 40 40 switch ($type) { 41 - case FundInitiativeTransaction::TYPE_MERCHANT: 41 + case self::TYPE_MERCHANT: 42 42 if ($old) { 43 43 $phids[] = $old; 44 44 } ··· 46 46 $phids[] = $new; 47 47 } 48 48 break; 49 - case FundInitiativeTransaction::TYPE_REFUND: 49 + case self::TYPE_REFUND: 50 50 $phids[] = $this->getMetadataValue(self::PROPERTY_BACKER); 51 51 break; 52 52 } ··· 63 63 64 64 $type = $this->getTransactionType(); 65 65 switch ($type) { 66 - case FundInitiativeTransaction::TYPE_NAME: 66 + case self::TYPE_NAME: 67 67 if ($old === null) { 68 68 return pht( 69 69 '%s created this initiative.', ··· 76 76 $new); 77 77 } 78 78 break; 79 - case FundInitiativeTransaction::TYPE_RISKS: 79 + case self::TYPE_RISKS: 80 80 return pht( 81 81 '%s edited the risks for this initiative.', 82 82 $this->renderHandleLink($author_phid)); 83 - case FundInitiativeTransaction::TYPE_DESCRIPTION: 83 + case self::TYPE_DESCRIPTION: 84 84 return pht( 85 85 '%s edited the description of this initiative.', 86 86 $this->renderHandleLink($author_phid)); 87 - case FundInitiativeTransaction::TYPE_STATUS: 87 + case self::TYPE_STATUS: 88 88 switch ($new) { 89 89 case FundInitiative::STATUS_OPEN: 90 90 return pht( ··· 96 96 $this->renderHandleLink($author_phid)); 97 97 } 98 98 break; 99 - case FundInitiativeTransaction::TYPE_BACKER: 99 + case self::TYPE_BACKER: 100 100 $amount = $this->getMetadataValue(self::PROPERTY_AMOUNT); 101 101 $amount = PhortuneCurrency::newFromString($amount); 102 102 return pht( 103 103 '%s backed this initiative with %s.', 104 104 $this->renderHandleLink($author_phid), 105 105 $amount->formatForDisplay()); 106 - case FundInitiativeTransaction::TYPE_REFUND: 106 + case self::TYPE_REFUND: 107 107 $amount = $this->getMetadataValue(self::PROPERTY_AMOUNT); 108 108 $amount = PhortuneCurrency::newFromString($amount); 109 109 ··· 114 114 $this->renderHandleLink($author_phid), 115 115 $amount->formatForDisplay(), 116 116 $this->renderHandleLink($backer_phid)); 117 - case FundInitiativeTransaction::TYPE_MERCHANT: 117 + case self::TYPE_MERCHANT: 118 118 if ($old === null) { 119 119 return pht( 120 120 '%s set this initiative to pay to %s.', ··· 142 142 143 143 $type = $this->getTransactionType(); 144 144 switch ($type) { 145 - case FundInitiativeTransaction::TYPE_NAME: 145 + case self::TYPE_NAME: 146 146 if ($old === null) { 147 147 return pht( 148 148 '%s created %s.', ··· 156 156 $this->renderHandleLink($object_phid)); 157 157 } 158 158 break; 159 - case FundInitiativeTransaction::TYPE_DESCRIPTION: 159 + case self::TYPE_DESCRIPTION: 160 160 return pht( 161 161 '%s updated the description for %s.', 162 162 $this->renderHandleLink($author_phid), 163 163 $this->renderHandleLink($object_phid)); 164 - case FundInitiativeTransaction::TYPE_STATUS: 164 + case self::TYPE_STATUS: 165 165 switch ($new) { 166 166 case FundInitiative::STATUS_OPEN: 167 167 return pht( ··· 175 175 $this->renderHandleLink($object_phid)); 176 176 } 177 177 break; 178 - case FundInitiativeTransaction::TYPE_BACKER: 178 + case self::TYPE_BACKER: 179 179 $amount = $this->getMetadataValue(self::PROPERTY_AMOUNT); 180 180 $amount = PhortuneCurrency::newFromString($amount); 181 181 return pht( ··· 183 183 $this->renderHandleLink($author_phid), 184 184 $this->renderHandleLink($object_phid), 185 185 $amount->formatForDisplay()); 186 - case FundInitiativeTransaction::TYPE_REFUND: 186 + case self::TYPE_REFUND: 187 187 $amount = $this->getMetadataValue(self::PROPERTY_AMOUNT); 188 188 $amount = PhortuneCurrency::newFromString($amount); 189 189 ··· 223 223 public function shouldHide() { 224 224 $old = $this->getOldValue(); 225 225 switch ($this->getTransactionType()) { 226 - case FundInitiativeTransaction::TYPE_DESCRIPTION: 227 - case FundInitiativeTransaction::TYPE_RISKS: 226 + case self::TYPE_DESCRIPTION: 227 + case self::TYPE_RISKS: 228 228 return ($old === null); 229 229 } 230 230 return parent::shouldHide(); ··· 232 232 233 233 public function hasChangeDetails() { 234 234 switch ($this->getTransactionType()) { 235 - case FundInitiativeTransaction::TYPE_DESCRIPTION: 236 - case FundInitiativeTransaction::TYPE_RISKS: 235 + case self::TYPE_DESCRIPTION: 236 + case self::TYPE_RISKS: 237 237 return ($this->getOldValue() !== null); 238 238 } 239 239
+1 -1
src/applications/harbormaster/step/HarbormasterBuildStepImplementation.php
··· 4 4 5 5 public static function getImplementations() { 6 6 return id(new PhutilSymbolLoader()) 7 - ->setAncestorClass('HarbormasterBuildStepImplementation') 7 + ->setAncestorClass(__CLASS__) 8 8 ->loadObjects(); 9 9 } 10 10
+2 -2
src/applications/harbormaster/storage/HarbormasterBuildable.php
··· 88 88 if ($buildable) { 89 89 return $buildable; 90 90 } 91 - $buildable = HarbormasterBuildable::initializeNewBuildable($actor) 91 + $buildable = self::initializeNewBuildable($actor) 92 92 ->setBuildablePHID($buildable_object_phid) 93 93 ->setContainerPHID($container_object_phid); 94 94 $buildable->save(); ··· 116 116 return; 117 117 } 118 118 119 - $buildable = HarbormasterBuildable::createOrLoadExisting( 119 + $buildable = self::createOrLoadExisting( 120 120 PhabricatorUser::getOmnipotentUser(), 121 121 $phid, 122 122 $container_phid);
+1 -1
src/applications/help/application/PhabricatorHelpApplication.php
··· 43 43 array( 44 44 'bubbleID' => $help_id, 45 45 'dropdownID' => 'phabricator-help-menu', 46 - 'applicationClass' => 'PhabricatorHelpApplication', 46 + 'applicationClass' => __CLASS__, 47 47 'local' => true, 48 48 'desktop' => true, 49 49 'right' => true,
+1 -1
src/applications/herald/adapter/HeraldAdapter.php
··· 1083 1083 public static function getEnabledAdapterMap(PhabricatorUser $viewer) { 1084 1084 $map = array(); 1085 1085 1086 - $adapters = HeraldAdapter::getAllAdapters(); 1086 + $adapters = self::getAllAdapters(); 1087 1087 foreach ($adapters as $adapter) { 1088 1088 if (!$adapter->isAvailableToUser($viewer)) { 1089 1089 continue;
+1 -1
src/applications/macro/controller/PhabricatorMacroMemeController.php
··· 14 14 $lower_text = $request->getStr('lowertext'); 15 15 $user = $request->getUser(); 16 16 17 - $uri = PhabricatorMacroMemeController::generateMacro($user, $macro_name, 17 + $uri = self::generateMacro($user, $macro_name, 18 18 $upper_text, $lower_text); 19 19 if ($uri === false) { 20 20 return new Aphront404Response();
+1 -1
src/applications/maniphest/query/ManiphestTaskQuery.php
··· 754 754 $id = $result->getID(); 755 755 756 756 if ($this->groupBy == self::GROUP_PROJECT) { 757 - return rtrim($id.'.'.$result->getGroupByProjectPHID(), '.');; 757 + return rtrim($id.'.'.$result->getGroupByProjectPHID(), '.'); 758 758 } 759 759 760 760 return $id;
+1 -1
src/applications/metamta/command/MetaMTAEmailTransactionCommand.php
··· 91 91 } 92 92 93 93 public static function getCommandMap(array $commands) { 94 - assert_instances_of($commands, 'MetaMTAEmailTransactionCommand'); 94 + assert_instances_of($commands, __CLASS__); 95 95 96 96 $map = array(); 97 97 foreach ($commands as $command) {
+3 -3
src/applications/metamta/contentsource/PhabricatorContentSource.php
··· 46 46 47 47 public static function newConsoleSource() { 48 48 return self::newForSource( 49 - PhabricatorContentSource::SOURCE_CONSOLE, 49 + self::SOURCE_CONSOLE, 50 50 array()); 51 51 } 52 52 53 53 public static function newFromRequest(AphrontRequest $request) { 54 54 return self::newForSource( 55 - PhabricatorContentSource::SOURCE_WEB, 55 + self::SOURCE_WEB, 56 56 array( 57 57 'ip' => $request->getRemoteAddr(), 58 58 )); ··· 60 60 61 61 public static function newFromConduitRequest(ConduitAPIRequest $request) { 62 62 return self::newForSource( 63 - PhabricatorContentSource::SOURCE_CONDUIT, 63 + self::SOURCE_CONDUIT, 64 64 array()); 65 65 } 66 66
+1 -1
src/applications/nuance/storage/NuanceItem.php
··· 20 20 public static function initializeNewItem(PhabricatorUser $user) { 21 21 return id(new NuanceItem()) 22 22 ->setDateNuanced(time()) 23 - ->setStatus(NuanceItem::STATUS_OPEN); 23 + ->setStatus(self::STATUS_OPEN); 24 24 } 25 25 26 26 protected function getConfiguration() {
+6 -6
src/applications/paste/storage/PhabricatorPasteTransaction.php
··· 67 67 68 68 $type = $this->getTransactionType(); 69 69 switch ($type) { 70 - case PhabricatorPasteTransaction::TYPE_CONTENT: 70 + case self::TYPE_CONTENT: 71 71 if ($old === null) { 72 72 return pht( 73 73 '%s created this paste.', ··· 78 78 $this->renderHandleLink($author_phid)); 79 79 } 80 80 break; 81 - case PhabricatorPasteTransaction::TYPE_TITLE: 81 + case self::TYPE_TITLE: 82 82 return pht( 83 83 '%s updated the paste\'s title to "%s".', 84 84 $this->renderHandleLink($author_phid), 85 85 $new); 86 86 break; 87 - case PhabricatorPasteTransaction::TYPE_LANGUAGE: 87 + case self::TYPE_LANGUAGE: 88 88 return pht( 89 89 "%s updated the paste's language.", 90 90 $this->renderHandleLink($author_phid)); ··· 103 103 104 104 $type = $this->getTransactionType(); 105 105 switch ($type) { 106 - case PhabricatorPasteTransaction::TYPE_CONTENT: 106 + case self::TYPE_CONTENT: 107 107 if ($old === null) { 108 108 return pht( 109 109 '%s created %s.', ··· 116 116 $this->renderHandleLink($object_phid)); 117 117 } 118 118 break; 119 - case PhabricatorPasteTransaction::TYPE_TITLE: 119 + case self::TYPE_TITLE: 120 120 return pht( 121 121 '%s updated the title for %s.', 122 122 $this->renderHandleLink($author_phid), 123 123 $this->renderHandleLink($object_phid)); 124 124 break; 125 - case PhabricatorPasteTransaction::TYPE_LANGUAGE: 125 + case self::TYPE_LANGUAGE: 126 126 return pht( 127 127 '%s updated the language for %s.', 128 128 $this->renderHandleLink($author_phid),
+2 -2
src/applications/people/editor/__tests__/PhabricatorUserEditorTestCase.php
··· 14 14 15 15 $this->registerUser( 16 16 'PhabricatorUserEditorTestCaseOK', 17 - 'PhabricatorUserEditorTestCase@example.com'); 17 + 'PhabricatorUserEditorTest@example.com'); 18 18 19 19 $this->assertTrue(true); 20 20 } ··· 45 45 try { 46 46 $this->registerUser( 47 47 'PhabricatorUserEditorTestCaseDomain', 48 - 'PhabricatorUserEditorTestCase@whitehouse.gov'); 48 + 'PhabricatorUserEditorTest@whitehouse.gov'); 49 49 } catch (Exception $ex) { 50 50 $caught = $ex; 51 51 }
+3 -2
src/applications/phid/handle/pool/PhabricatorHandleList.php
··· 158 158 private function raiseImmutableException() { 159 159 throw new Exception( 160 160 pht( 161 - 'Trying to mutate a PhabricatorHandleList, but this is not permitted; '. 162 - 'handle lists are immutable.')); 161 + 'Trying to mutate a %s, but this is not permitted; '. 162 + 'handle lists are immutable.', 163 + __CLASS__)); 163 164 } 164 165 165 166
+7 -3
src/applications/phid/type/PhabricatorPHIDType.php
··· 169 169 $that_class = $original[$type]; 170 170 $this_class = get_class($object); 171 171 throw new Exception( 172 - "Two PhabricatorPHIDType classes ({$that_class}, {$this_class}) ". 173 - "both handle PHID type '{$type}'. A type may be handled by only ". 174 - "one class."); 172 + pht( 173 + "Two %s classes (%s, %s) both handle PHID type '%s'. ". 174 + "A type may be handled by only one class.", 175 + __CLASS__, 176 + $that_class, 177 + $this_class, 178 + $type)); 175 179 } 176 180 177 181 $original[$type] = get_class($object);
+6 -6
src/applications/phortune/currency/PhortuneCurrency.php
··· 68 68 } 69 69 70 70 public static function newFromList(array $list) { 71 - assert_instances_of($list, 'PhortuneCurrency'); 71 + assert_instances_of($list, __CLASS__); 72 72 73 73 if (!$list) { 74 - return PhortuneCurrency::newEmptyCurrency(); 74 + return self::newEmptyCurrency(); 75 75 } 76 76 77 77 $total = null; ··· 201 201 */ 202 202 public function assertInRange($minimum, $maximum) { 203 203 if ($minimum !== null && $maximum !== null) { 204 - $min = PhortuneCurrency::newFromString($minimum); 205 - $max = PhortuneCurrency::newFromString($maximum); 204 + $min = self::newFromString($minimum); 205 + $max = self::newFromString($maximum); 206 206 if ($min->value > $max->value) { 207 207 throw new Exception( 208 208 pht( ··· 213 213 } 214 214 215 215 if ($minimum !== null) { 216 - $min = PhortuneCurrency::newFromString($minimum); 216 + $min = self::newFromString($minimum); 217 217 if ($min->value > $this->value) { 218 218 throw new Exception( 219 219 pht( ··· 223 223 } 224 224 225 225 if ($maximum !== null) { 226 - $max = PhortuneCurrency::newFromString($maximum); 226 + $max = self::newFromString($maximum); 227 227 if ($max->value < $this->value) { 228 228 throw new Exception( 229 229 pht(
+1 -1
src/applications/phortune/provider/PhortunePaymentProvider.php
··· 118 118 119 119 public static function getAllProviders() { 120 120 return id(new PhutilSymbolLoader()) 121 - ->setAncestorClass('PhortunePaymentProvider') 121 + ->setAncestorClass(__CLASS__) 122 122 ->loadObjects(); 123 123 } 124 124
+1 -1
src/applications/phortune/storage/PhortuneAccount.php
··· 27 27 PhabricatorUser $actor, 28 28 PhabricatorContentSource $content_source) { 29 29 30 - $account = PhortuneAccount::initializeNewAccount($actor); 30 + $account = self::initializeNewAccount($actor); 31 31 32 32 $xactions = array(); 33 33 $xactions[] = id(new PhortuneAccountTransaction())
+1 -1
src/applications/phortune/storage/PhortuneCart.php
··· 136 136 } 137 137 138 138 $charge->save(); 139 - $this->setStatus(PhortuneCart::STATUS_PURCHASING)->save(); 139 + $this->setStatus(self::STATUS_PURCHASING)->save(); 140 140 141 141 $this->endReadLocking(); 142 142 $this->saveTransaction();
+1 -1
src/applications/phragment/storage/PhragmentFragment.php
··· 256 256 $mappings[$path], 257 257 array('name' => basename($path))); 258 258 } 259 - PhragmentFragment::createFromFile( 259 + self::createFromFile( 260 260 $viewer, 261 261 $file, 262 262 $base_path.'/'.$path,
+2 -2
src/applications/policy/constants/PhabricatorPolicies.php
··· 15 15 */ 16 16 public static function getMostOpenPolicy() { 17 17 if (PhabricatorEnv::getEnvConfig('policy.allow-public')) { 18 - return PhabricatorPolicies::POLICY_PUBLIC; 18 + return self::POLICY_PUBLIC; 19 19 } else { 20 - return PhabricatorPolicies::POLICY_USER; 20 + return self::POLICY_USER; 21 21 } 22 22 } 23 23
+1 -1
src/applications/project/icon/PhabricatorProjectIcon.php
··· 44 44 } 45 45 46 46 public static function renderIconForChooser($icon) { 47 - $project_icons = PhabricatorProjectIcon::getIconMap(); 47 + $project_icons = self::getIconMap(); 48 48 49 49 return phutil_tag( 50 50 'span',
+1 -1
src/applications/project/storage/PhabricatorProjectColumn.php
··· 111 111 ->setMetadata( 112 112 array( 113 113 'tip' => $text, 114 - ));; 114 + )); 115 115 } 116 116 117 117 return null;
+3 -3
src/applications/project/storage/PhabricatorProjectColumnTransaction.php
··· 21 21 $author_handle = $this->renderHandleLink($this->getAuthorPHID()); 22 22 23 23 switch ($this->getTransactionType()) { 24 - case PhabricatorProjectColumnTransaction::TYPE_NAME: 24 + case self::TYPE_NAME: 25 25 if ($old === null) { 26 26 return pht( 27 27 '%s created this column.', ··· 44 44 $author_handle); 45 45 } 46 46 } 47 - case PhabricatorProjectColumnTransaction::TYPE_LIMIT: 47 + case self::TYPE_LIMIT: 48 48 if (!$old) { 49 49 return pht( 50 50 '%s set the point limit for this column to %s.', ··· 62 62 $new); 63 63 } 64 64 65 - case PhabricatorProjectColumnTransaction::TYPE_STATUS: 65 + case self::TYPE_STATUS: 66 66 switch ($new) { 67 67 case PhabricatorProjectColumn::STATUS_ACTIVE: 68 68 return pht(
+17 -17
src/applications/project/storage/PhabricatorProjectTransaction.php
··· 28 28 29 29 $req_phids = array(); 30 30 switch ($this->getTransactionType()) { 31 - case PhabricatorProjectTransaction::TYPE_MEMBERS: 31 + case self::TYPE_MEMBERS: 32 32 $add = array_diff($new, $old); 33 33 $rem = array_diff($old, $new); 34 34 $req_phids = array_merge($add, $rem); 35 35 break; 36 - case PhabricatorProjectTransaction::TYPE_IMAGE: 36 + case self::TYPE_IMAGE: 37 37 $req_phids[] = $old; 38 38 $req_phids[] = $new; 39 39 break; ··· 48 48 $new = $this->getNewValue(); 49 49 50 50 switch ($this->getTransactionType()) { 51 - case PhabricatorProjectTransaction::TYPE_STATUS: 51 + case self::TYPE_STATUS: 52 52 if ($old == 0) { 53 53 return 'red'; 54 54 } else { ··· 64 64 $new = $this->getNewValue(); 65 65 66 66 switch ($this->getTransactionType()) { 67 - case PhabricatorProjectTransaction::TYPE_STATUS: 67 + case self::TYPE_STATUS: 68 68 if ($old == 0) { 69 69 return 'fa-ban'; 70 70 } else { 71 71 return 'fa-check'; 72 72 } 73 - case PhabricatorProjectTransaction::TYPE_LOCKED: 73 + case self::TYPE_LOCKED: 74 74 if ($new) { 75 75 return 'fa-lock'; 76 76 } else { 77 77 return 'fa-unlock'; 78 78 } 79 - case PhabricatorProjectTransaction::TYPE_ICON: 79 + case self::TYPE_ICON: 80 80 return $new; 81 - case PhabricatorProjectTransaction::TYPE_IMAGE: 81 + case self::TYPE_IMAGE: 82 82 return 'fa-photo'; 83 - case PhabricatorProjectTransaction::TYPE_MEMBERS: 83 + case self::TYPE_MEMBERS: 84 84 return 'fa-user'; 85 - case PhabricatorProjectTransaction::TYPE_SLUGS: 85 + case self::TYPE_SLUGS: 86 86 return 'fa-tag'; 87 87 } 88 88 return parent::getIcon(); ··· 94 94 $author_handle = $this->renderHandleLink($this->getAuthorPHID()); 95 95 96 96 switch ($this->getTransactionType()) { 97 - case PhabricatorProjectTransaction::TYPE_NAME: 97 + case self::TYPE_NAME: 98 98 if ($old === null) { 99 99 return pht( 100 100 '%s created this project.', ··· 106 106 $old, 107 107 $new); 108 108 } 109 - case PhabricatorProjectTransaction::TYPE_STATUS: 109 + case self::TYPE_STATUS: 110 110 if ($old == 0) { 111 111 return pht( 112 112 '%s archived this project.', ··· 116 116 '%s activated this project.', 117 117 $author_handle); 118 118 } 119 - case PhabricatorProjectTransaction::TYPE_IMAGE: 119 + case self::TYPE_IMAGE: 120 120 // TODO: Some day, it would be nice to show the images. 121 121 if (!$old) { 122 122 return pht( ··· 135 135 $this->renderHandleLink($new)); 136 136 } 137 137 138 - case PhabricatorProjectTransaction::TYPE_ICON: 138 + case self::TYPE_ICON: 139 139 return pht( 140 140 '%s set this project\'s icon to %s.', 141 141 $author_handle, 142 142 PhabricatorProjectIcon::getLabel($new)); 143 143 144 - case PhabricatorProjectTransaction::TYPE_COLOR: 144 + case self::TYPE_COLOR: 145 145 return pht( 146 146 '%s set this project\'s color to %s.', 147 147 $author_handle, 148 148 PHUITagView::getShadeName($new)); 149 149 150 - case PhabricatorProjectTransaction::TYPE_LOCKED: 150 + case self::TYPE_LOCKED: 151 151 if ($new) { 152 152 return pht( 153 153 '%s locked this project\'s membership.', ··· 158 158 $author_handle); 159 159 } 160 160 161 - case PhabricatorProjectTransaction::TYPE_SLUGS: 161 + case self::TYPE_SLUGS: 162 162 $add = array_diff($new, $old); 163 163 $rem = array_diff($old, $new); 164 164 ··· 184 184 $this->renderSlugList($rem)); 185 185 } 186 186 187 - case PhabricatorProjectTransaction::TYPE_MEMBERS: 187 + case self::TYPE_MEMBERS: 188 188 $add = array_diff($new, $old); 189 189 $rem = array_diff($old, $new); 190 190
+2 -2
src/applications/releeph/storage/ReleephRequest.php
··· 127 127 if ($this->getInBranch()) { 128 128 return ReleephRequestStatus::STATUS_NEEDS_REVERT; 129 129 } else { 130 - $intent_pass = ReleephRequest::INTENT_PASS; 131 - $intent_want = ReleephRequest::INTENT_WANT; 130 + $intent_pass = self::INTENT_PASS; 131 + $intent_want = self::INTENT_WANT; 132 132 133 133 $has_been_in_branch = $this->getCommitIdentifier(); 134 134 // Regardless of why we reverted something, always say reverted if it
+14 -14
src/applications/releeph/storage/ReleephRequestTransaction.php
··· 38 38 $new = $this->getNewValue(); 39 39 40 40 switch ($this->getTransactionType()) { 41 - case ReleephRequestTransaction::TYPE_REQUEST: 42 - case ReleephRequestTransaction::TYPE_DISCOVERY: 41 + case self::TYPE_REQUEST: 42 + case self::TYPE_DISCOVERY: 43 43 $phids[] = $new; 44 44 break; 45 45 46 - case ReleephRequestTransaction::TYPE_EDIT_FIELD: 46 + case self::TYPE_EDIT_FIELD: 47 47 self::searchForPHIDs($this->getOldValue(), $phids); 48 48 self::searchForPHIDs($this->getNewValue(), $phids); 49 49 break; ··· 60 60 $new = $this->getNewValue(); 61 61 62 62 switch ($this->getTransactionType()) { 63 - case ReleephRequestTransaction::TYPE_REQUEST: 63 + case self::TYPE_REQUEST: 64 64 return pht( 65 65 '%s requested %s', 66 66 $this->renderHandleLink($author_phid), 67 67 $this->renderHandleLink($new)); 68 68 break; 69 69 70 - case ReleephRequestTransaction::TYPE_USER_INTENT: 70 + case self::TYPE_USER_INTENT: 71 71 return $this->getIntentTitle(); 72 72 break; 73 73 74 - case ReleephRequestTransaction::TYPE_EDIT_FIELD: 74 + case self::TYPE_EDIT_FIELD: 75 75 $field = newv($this->getMetadataValue('fieldClass'), array()); 76 76 $name = $field->getName(); 77 77 ··· 89 89 $field->normalizeForTransactionView($this, $new)); 90 90 break; 91 91 92 - case ReleephRequestTransaction::TYPE_PICK_STATUS: 92 + case self::TYPE_PICK_STATUS: 93 93 switch ($new) { 94 94 case ReleephRequest::PICK_OK: 95 95 return pht('%s found this request picks without error', ··· 109 109 } 110 110 break; 111 111 112 - case ReleephRequestTransaction::TYPE_COMMIT: 112 + case self::TYPE_COMMIT: 113 113 $action_type = $this->getMetadataValue('action'); 114 114 switch ($action_type) { 115 115 case 'pick': ··· 126 126 } 127 127 break; 128 128 129 - case ReleephRequestTransaction::TYPE_MANUAL_IN_BRANCH: 129 + case self::TYPE_MANUAL_IN_BRANCH: 130 130 $action = $new ? pht('picked') : pht('reverted'); 131 131 return pht( 132 132 '%s marked this request as manually %s', ··· 134 134 $action); 135 135 break; 136 136 137 - case ReleephRequestTransaction::TYPE_DISCOVERY: 137 + case self::TYPE_DISCOVERY: 138 138 return pht('%s discovered this commit as %s', 139 139 $this->renderHandleLink($author_phid), 140 140 $this->renderHandleLink($new)); ··· 173 173 $new = $this->getNewValue(); 174 174 175 175 switch ($this->getTransactionType()) { 176 - case ReleephRequestTransaction::TYPE_USER_INTENT: 176 + case self::TYPE_USER_INTENT: 177 177 switch ($new) { 178 178 case ReleephRequest::INTENT_WANT: 179 179 return PhabricatorTransactions::COLOR_GREEN; ··· 243 243 public function shouldHide() { 244 244 $type = $this->getTransactionType(); 245 245 246 - if ($type === ReleephRequestTransaction::TYPE_USER_INTENT && 246 + if ($type === self::TYPE_USER_INTENT && 247 247 $this->getMetadataValue('isRQCreate')) { 248 248 249 249 return true; ··· 255 255 256 256 // ReleephSummaryFieldSpecification is usually blank when an RQ is created, 257 257 // creating a transaction change from null to "". Hide these! 258 - if ($type === ReleephRequestTransaction::TYPE_EDIT_FIELD) { 258 + if ($type === self::TYPE_EDIT_FIELD) { 259 259 if ($this->getOldValue() === null && $this->getNewValue() === '') { 260 260 return true; 261 261 } ··· 265 265 266 266 public function isBoringPickStatus() { 267 267 $type = $this->getTransactionType(); 268 - if ($type === ReleephRequestTransaction::TYPE_PICK_STATUS) { 268 + if ($type === self::TYPE_PICK_STATUS) { 269 269 $new = $this->getNewValue(); 270 270 if ($new === ReleephRequest::PICK_OK || 271 271 $new === ReleephRequest::REVERT_OK) {
+1 -1
src/applications/repository/query/PhabricatorRepositorySearchEngine.php
··· 201 201 array $handles) { 202 202 assert_instances_of($repositories, 'PhabricatorRepository'); 203 203 204 - $viewer = $this->requireViewer();; 204 + $viewer = $this->requireViewer(); 205 205 206 206 $list = new PHUIObjectItemListView(); 207 207 foreach ($repositories as $repository) {
+4 -4
src/applications/repository/storage/PhabricatorRepositoryPushLog.php
··· 54 54 55 55 public static function getHeraldChangeFlagConditionOptions() { 56 56 return array( 57 - PhabricatorRepositoryPushLog::CHANGEFLAG_ADD => 57 + self::CHANGEFLAG_ADD => 58 58 pht('change creates ref'), 59 - PhabricatorRepositoryPushLog::CHANGEFLAG_DELETE => 59 + self::CHANGEFLAG_DELETE => 60 60 pht('change deletes ref'), 61 - PhabricatorRepositoryPushLog::CHANGEFLAG_REWRITE => 61 + self::CHANGEFLAG_REWRITE => 62 62 pht('change rewrites ref'), 63 - PhabricatorRepositoryPushLog::CHANGEFLAG_DANGEROUS => 63 + self::CHANGEFLAG_DANGEROUS => 64 64 pht('dangerous change'), 65 65 ); 66 66 }
+2 -2
src/applications/settings/storage/PhabricatorUserPreferences.php
··· 74 74 } 75 75 76 76 public function getPinnedApplications(array $apps, PhabricatorUser $viewer) { 77 - $pref_pinned = PhabricatorUserPreferences::PREFERENCE_APP_PINNED; 77 + $pref_pinned = self::PREFERENCE_APP_PINNED; 78 78 $pinned = $this->getPreference($pref_pinned); 79 79 80 80 if ($pinned) { 81 81 return $pinned; 82 82 } 83 83 84 - $pref_tiles = PhabricatorUserPreferences::PREFERENCE_APP_TILES; 84 + $pref_tiles = self::PREFERENCE_APP_TILES; 85 85 $tiles = $this->getPreference($pref_tiles, array()); 86 86 $full_tile = 'full'; 87 87
+20 -20
src/applications/slowvote/storage/PhabricatorSlowvoteTransaction.php
··· 26 26 $new = $this->getNewValue(); 27 27 28 28 switch ($this->getTransactionType()) { 29 - case PhabricatorSlowvoteTransaction::TYPE_DESCRIPTION: 30 - case PhabricatorSlowvoteTransaction::TYPE_RESPONSES: 31 - case PhabricatorSlowvoteTransaction::TYPE_SHUFFLE: 32 - case PhabricatorSlowvoteTransaction::TYPE_CLOSE: 29 + case self::TYPE_DESCRIPTION: 30 + case self::TYPE_RESPONSES: 31 + case self::TYPE_SHUFFLE: 32 + case self::TYPE_CLOSE: 33 33 return ($old === null); 34 34 } 35 35 ··· 43 43 $new = $this->getNewValue(); 44 44 45 45 switch ($this->getTransactionType()) { 46 - case PhabricatorSlowvoteTransaction::TYPE_QUESTION: 46 + case self::TYPE_QUESTION: 47 47 if ($old === null) { 48 48 return pht( 49 49 '%s created this poll.', ··· 56 56 $new); 57 57 } 58 58 break; 59 - case PhabricatorSlowvoteTransaction::TYPE_DESCRIPTION: 59 + case self::TYPE_DESCRIPTION: 60 60 return pht( 61 61 '%s updated the description for this poll.', 62 62 $this->renderHandleLink($author_phid)); 63 - case PhabricatorSlowvoteTransaction::TYPE_RESPONSES: 63 + case self::TYPE_RESPONSES: 64 64 // TODO: This could be more detailed 65 65 return pht( 66 66 '%s changed who can see the responses.', 67 67 $this->renderHandleLink($author_phid)); 68 - case PhabricatorSlowvoteTransaction::TYPE_SHUFFLE: 68 + case self::TYPE_SHUFFLE: 69 69 if ($new) { 70 70 return pht( 71 71 '%s made poll responses appear in a random order.', ··· 76 76 $this->renderHandleLink($author_phid)); 77 77 } 78 78 break; 79 - case PhabricatorSlowvoteTransaction::TYPE_CLOSE: 79 + case self::TYPE_CLOSE: 80 80 if ($new) { 81 81 return pht( 82 82 '%s closed this poll.', ··· 98 98 $new = $this->getNewValue(); 99 99 100 100 switch ($this->getTransactionType()) { 101 - case PhabricatorSlowvoteTransaction::TYPE_QUESTION: 101 + case self::TYPE_QUESTION: 102 102 if ($old === null) { 103 103 return 'fa-plus'; 104 104 } else { 105 105 return 'fa-pencil'; 106 106 } 107 - case PhabricatorSlowvoteTransaction::TYPE_DESCRIPTION: 108 - case PhabricatorSlowvoteTransaction::TYPE_RESPONSES: 107 + case self::TYPE_DESCRIPTION: 108 + case self::TYPE_RESPONSES: 109 109 return 'fa-pencil'; 110 - case PhabricatorSlowvoteTransaction::TYPE_SHUFFLE: 110 + case self::TYPE_SHUFFLE: 111 111 return 'fa-refresh'; 112 - case PhabricatorSlowvoteTransaction::TYPE_CLOSE: 112 + case self::TYPE_CLOSE: 113 113 if ($new) { 114 114 return 'fa-ban'; 115 115 } else { ··· 126 126 $new = $this->getNewValue(); 127 127 128 128 switch ($this->getTransactionType()) { 129 - case PhabricatorSlowvoteTransaction::TYPE_QUESTION: 130 - case PhabricatorSlowvoteTransaction::TYPE_DESCRIPTION: 131 - case PhabricatorSlowvoteTransaction::TYPE_RESPONSES: 132 - case PhabricatorSlowvoteTransaction::TYPE_SHUFFLE: 133 - case PhabricatorSlowvoteTransaction::TYPE_CLOSE: 129 + case self::TYPE_QUESTION: 130 + case self::TYPE_DESCRIPTION: 131 + case self::TYPE_RESPONSES: 132 + case self::TYPE_SHUFFLE: 133 + case self::TYPE_CLOSE: 134 134 return PhabricatorTransactions::COLOR_BLUE; 135 135 } 136 136 ··· 139 139 140 140 public function hasChangeDetails() { 141 141 switch ($this->getTransactionType()) { 142 - case PhabricatorSlowvoteTransaction::TYPE_DESCRIPTION: 142 + case self::TYPE_DESCRIPTION: 143 143 return true; 144 144 } 145 145 return parent::hasChangeDetails();
+2 -2
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
··· 1073 1073 } 1074 1074 1075 1075 public function attachTransactionGroup(array $group) { 1076 - assert_instances_of($group, 'PhabricatorApplicationTransaction'); 1076 + assert_instances_of($group, __CLASS__); 1077 1077 $this->transactionGroup = $group; 1078 1078 return $this; 1079 1079 } ··· 1165 1165 } 1166 1166 1167 1167 $old_target = $xaction->getRenderingTarget(); 1168 - $new_target = PhabricatorApplicationTransaction::TARGET_TEXT; 1168 + $new_target = self::TARGET_TEXT; 1169 1169 $xaction->setRenderingTarget($new_target); 1170 1170 1171 1171 if ($publisher->getRenderWithImpliedContext()) {
+1 -1
src/infrastructure/customfield/field/PhabricatorCustomField.php
··· 65 65 "object of class '{$obj_class}'."); 66 66 } 67 67 68 - $fields = PhabricatorCustomField::buildFieldList( 68 + $fields = self::buildFieldList( 69 69 $base_class, 70 70 $spec, 71 71 $object);
+6 -2
src/infrastructure/daemon/bot/PhabricatorBot.php
··· 19 19 protected function run() { 20 20 $argv = $this->getArgv(); 21 21 if (count($argv) !== 1) { 22 - throw new Exception('usage: PhabricatorBot <json_config_file>'); 22 + throw new Exception( 23 + pht( 24 + 'Usage: %s %s', 25 + __CLASS__, 26 + '<json_config_file>')); 23 27 } 24 28 25 29 $json_raw = Filesystem::readFile($argv[0]); ··· 72 76 $response = $conduit->callMethodSynchronous( 73 77 'conduit.connect', 74 78 array( 75 - 'client' => 'PhabricatorBot', 79 + 'client' => __CLASS__, 76 80 'clientVersion' => '1.0', 77 81 'clientDescription' => php_uname('n').':'.$nick, 78 82 'host' => $conduit_host,
+1 -1
src/infrastructure/daemon/workers/query/PhabricatorWorkerTriggerQuery.php
··· 150 150 151 151 if (($this->nextEpochMin !== null) || 152 152 ($this->nextEpochMax !== null) || 153 - ($this->order == PhabricatorWorkerTriggerQuery::ORDER_EXECUTION)) { 153 + ($this->order == self::ORDER_EXECUTION)) { 154 154 $joins[] = qsprintf( 155 155 $conn_r, 156 156 'JOIN %T e ON e.triggerID = t.id',
+6 -6
src/infrastructure/env/PhabricatorEnv.php
··· 88 88 89 89 // Force a valid timezone. If both PHP and Phabricator configuration are 90 90 // invalid, use UTC. 91 - $tz = PhabricatorEnv::getEnvConfig('phabricator.timezone'); 91 + $tz = self::getEnvConfig('phabricator.timezone'); 92 92 if ($tz) { 93 93 @date_default_timezone_set($tz); 94 94 } ··· 102 102 $phabricator_path = dirname(phutil_get_library_root('phabricator')); 103 103 $support_path = $phabricator_path.'/support/bin'; 104 104 $env_path = $support_path.PATH_SEPARATOR.$env_path; 105 - $append_dirs = PhabricatorEnv::getEnvConfig('environment.append-paths'); 105 + $append_dirs = self::getEnvConfig('environment.append-paths'); 106 106 if (!empty($append_dirs)) { 107 107 $append_path = implode(PATH_SEPARATOR, $append_dirs); 108 108 $env_path = $env_path.PATH_SEPARATOR.$append_path; ··· 116 116 117 117 // If an instance identifier is defined, write it into the environment so 118 118 // it's available to subprocesses. 119 - $instance = PhabricatorEnv::getEnvConfig('cluster.instance'); 119 + $instance = self::getEnvConfig('cluster.instance'); 120 120 if (strlen($instance)) { 121 121 putenv('PHABRICATOR_INSTANCE='.$instance); 122 122 $_ENV['PHABRICATOR_INSTANCE'] = $instance; ··· 139 139 $translations = PhutilTranslation::getTranslationMapForLocale( 140 140 $locale_code); 141 141 142 - $override = PhabricatorEnv::getEnvConfig('translation.override'); 142 + $override = self::getEnvConfig('translation.override'); 143 143 if (!is_array($override)) { 144 144 $override = array(); 145 145 } ··· 178 178 // If the install overrides the database adapter, we might need to load 179 179 // the database adapter class before we can push on the database config. 180 180 // This config is locked and can't be edited from the web UI anyway. 181 - foreach (PhabricatorEnv::getEnvConfig('load-libraries') as $library) { 181 + foreach (self::getEnvConfig('load-libraries') as $library) { 182 182 phutil_load_library($library); 183 183 } 184 184 ··· 809 809 } 810 810 811 811 public static function isClusterAddress($address) { 812 - $cluster_addresses = PhabricatorEnv::getEnvConfig('cluster.addresses'); 812 + $cluster_addresses = self::getEnvConfig('cluster.addresses'); 813 813 if (!$cluster_addresses) { 814 814 throw new Exception( 815 815 pht(
+5 -2
src/infrastructure/events/PhabricatorExampleEventListener.php
··· 21 21 22 22 $console = PhutilConsole::getConsole(); 23 23 $console->writeOut( 24 - "PhabricatorExampleEventListener got test event at %d\n", 25 - $event->getValue('time')); 24 + "%s\n", 25 + pht( 26 + '% got test event at %d', 27 + __CLASS__, 28 + $event->getValue('time'))); 26 29 } 27 30 28 31 }
+3 -3
src/infrastructure/sms/storage/PhabricatorSMS.php
··· 38 38 // and ProviderSMSID are totally garbage data before a send it attempted. 39 39 return id(new PhabricatorSMS()) 40 40 ->setBody($body) 41 - ->setSendStatus(PhabricatorSMS::STATUS_UNSENT) 42 - ->setProviderShortName(PhabricatorSMS::SHORTNAME_PLACEHOLDER) 41 + ->setSendStatus(self::STATUS_UNSENT) 42 + ->setProviderShortName(self::SHORTNAME_PLACEHOLDER) 43 43 ->setProviderSMSID(Filesystem::readRandomCharacters(40)); 44 44 } 45 45 ··· 70 70 71 71 public function hasBeenSentAtLeastOnce() { 72 72 return ($this->getProviderShortName() != 73 - PhabricatorSMS::SHORTNAME_PLACEHOLDER); 73 + self::SHORTNAME_PLACEHOLDER); 74 74 } 75 75 }
+1 -1
src/infrastructure/storage/patch/PhabricatorSQLPatchList.php
··· 38 38 39 39 final public static function buildAllPatches() { 40 40 $patch_lists = id(new PhutilSymbolLoader()) 41 - ->setAncestorClass('PhabricatorSQLPatchList') 41 + ->setAncestorClass(__CLASS__) 42 42 ->setConcreteOnly(true) 43 43 ->selectAndLoadSymbols(); 44 44
+5 -2
src/infrastructure/time/PhabricatorTime.php
··· 25 25 26 26 public static function popTime($key) { 27 27 if ($key !== last_key(self::$stack)) { 28 - throw new Exception('PhabricatorTime::popTime with bad key.'); 28 + throw new Exception( 29 + pht( 30 + '%s with bad key.', 31 + __METHOD__)); 29 32 } 30 33 array_pop(self::$stack); 31 34 ··· 49 52 $old_zone = date_default_timezone_get(); 50 53 51 54 date_default_timezone_set($user->getTimezoneIdentifier()); 52 - $timestamp = (int)strtotime($time, PhabricatorTime::getNow()); 55 + $timestamp = (int)strtotime($time, self::getNow()); 53 56 if ($timestamp <= 0) { 54 57 $timestamp = null; 55 58 }
+2 -2
src/infrastructure/util/PhabricatorHash.php
··· 35 35 } 36 36 37 37 for ($ii = 0; $ii < 1000; $ii++) { 38 - $result = PhabricatorHash::digest($result, $salt); 38 + $result = self::digest($result, $salt); 39 39 } 40 40 41 41 return $result; ··· 113 113 // who can control the inputs from intentionally using the hashed form 114 114 // of a string to cause a collision. 115 115 116 - $hash = PhabricatorHash::digestForIndex($string); 116 + $hash = self::digestForIndex($string); 117 117 118 118 $prefix = substr($string, 0, ($length - ($min_length - 1))); 119 119
+3 -3
src/infrastructure/util/password/PhabricatorPasswordHasher.php
··· 213 213 */ 214 214 public static function getAllHashers() { 215 215 $objects = id(new PhutilSymbolLoader()) 216 - ->setAncestorClass('PhabricatorPasswordHasher') 216 + ->setAncestorClass(__CLASS__) 217 217 ->loadObjects(); 218 218 219 219 $map = array(); ··· 404 404 } 405 405 406 406 try { 407 - $current_hasher = PhabricatorPasswordHasher::getHasherForHash($hash); 407 + $current_hasher = self::getHasherForHash($hash); 408 408 return $current_hasher->getHumanReadableName(); 409 409 } catch (Exception $ex) { 410 410 $info = self::parseHashFromStorage($hash); ··· 421 421 */ 422 422 public static function getBestAlgorithmName() { 423 423 try { 424 - $best_hasher = PhabricatorPasswordHasher::getBestHasher(); 424 + $best_hasher = self::getBestHasher(); 425 425 return $best_hasher->getHumanReadableName(); 426 426 } catch (Exception $ex) { 427 427 return pht('Unknown');
+4 -1
src/view/AphrontDialogView.php
··· 215 215 216 216 if (!$this->user) { 217 217 throw new Exception( 218 - pht('You must call setUser() when rendering an AphrontDialogView.')); 218 + pht( 219 + 'You must call %s when rendering an %s.', 220 + 'setUser()', 221 + __CLASS__)); 219 222 } 220 223 221 224 $more = $this->class;
+4 -1
src/view/form/AphrontFormView.php
··· 126 126 $layout = $this->buildLayoutView(); 127 127 128 128 if (!$this->user) { 129 - throw new Exception(pht('You must pass the user to AphrontFormView.')); 129 + throw new Exception( 130 + pht( 131 + 'You must pass the user to %s.', 132 + __CLASS__)); 130 133 } 131 134 132 135 $sigils = $this->sigils;
+4 -1
src/view/form/PHUIFormLayoutView.php
··· 33 33 public function appendRemarkupInstructions($remarkup) { 34 34 if ($this->getUser() === null) { 35 35 throw new Exception( 36 - 'Call `setUser` before appending Remarkup to PHUIFormLayoutView.'); 36 + pht( 37 + 'Call %s before appending Remarkup to %s.', 38 + 'setUser()', 39 + __CLASS__)); 37 40 } 38 41 39 42 return $this->appendInstructions(
-1
src/view/form/PHUIInfoView.php
··· 41 41 } 42 42 43 43 final public function render() { 44 - 45 44 require_celerity_resource('phui-info-view-css'); 46 45 47 46 $errors = $this->errors;
+1 -1
src/view/form/PHUIPagedFormView.php
··· 152 152 153 153 $is_attempt_complete = false; 154 154 if ($this->prevPage) { 155 - $prev_index = $this->getPageIndex($selected->getKey()) - 1;; 155 + $prev_index = $this->getPageIndex($selected->getKey()) - 1; 156 156 $index = max(0, $prev_index); 157 157 $selected = $this->getPageByIndex($index); 158 158 } else if ($this->nextPage) {
+4 -1
src/view/form/control/PhabricatorRemarkupControl.php
··· 25 25 $viewer = $this->getUser(); 26 26 if (!$viewer) { 27 27 throw new Exception( 28 - pht('Call setUser() before rendering a PhabricatorRemarkupControl!')); 28 + pht( 29 + 'Call %s before rendering a %s!', 30 + 'setUser()', 31 + __CLASS__)); 29 32 } 30 33 31 34 // We need to have this if previews render images, since Ajax can not
+2 -2
src/view/page/PhabricatorStandardPageView.php
··· 3 3 /** 4 4 * This is a standard Phabricator page with menus, Javelin, DarkConsole, and 5 5 * basic styles. 6 - * 7 6 */ 8 7 final class PhabricatorStandardPageView extends PhabricatorBarePageView { 9 8 ··· 160 159 if (!$this->getRequest()) { 161 160 throw new Exception( 162 161 pht( 163 - 'You must set the Request to render a PhabricatorStandardPageView.')); 162 + 'You must set the Request to render a %s.', 163 + __CLASS__)); 164 164 } 165 165 166 166 $console = $this->getConsole();
+1 -1
src/view/phui/PHUIDocumentView.php
··· 74 74 75 75 if ($this->offset) { 76 76 $classes[] = 'phui-document-offset'; 77 - }; 77 + } 78 78 79 79 if ($this->fluid) { 80 80 $classes[] = 'phui-document-fluid';
+2 -2
support/PhabricatorStartup.php
··· 255 255 static $initialized; 256 256 if (!$initialized) { 257 257 declare(ticks=1); 258 - register_tick_function(array('PhabricatorStartup', 'onDebugTick')); 258 + register_tick_function(array(__CLASS__, 'onDebugTick')); 259 259 } 260 260 } 261 261 ··· 647 647 // populated into $_POST, but it wasn't. 648 648 649 649 $config = ini_get('post_max_size'); 650 - PhabricatorStartup::didFatal( 650 + self::didFatal( 651 651 "As received by the server, this request had a nonzero content length ". 652 652 "but no POST data.\n\n". 653 653 "Normally, this indicates that it exceeds the 'post_max_size' setting ".