diff --git a/src/aphront/AphrontRequest.php b/src/aphront/AphrontRequest.php --- a/src/aphront/AphrontRequest.php +++ b/src/aphront/AphrontRequest.php @@ -28,44 +28,44 @@ private $applicationConfiguration; private $uriData; - final public function __construct($host, $path) { + public function __construct($host, $path) { $this->host = $host; $this->path = $path; } - final public function setURIMap(array $uri_data) { + public function setURIMap(array $uri_data) { $this->uriData = $uri_data; return $this; } - final public function getURIMap() { + public function getURIMap() { return $this->uriData; } - final public function getURIData($key, $default = null) { + public function getURIData($key, $default = null) { return idx($this->uriData, $key, $default); } - final public function setApplicationConfiguration( + public function setApplicationConfiguration( $application_configuration) { $this->applicationConfiguration = $application_configuration; return $this; } - final public function getApplicationConfiguration() { + public function getApplicationConfiguration() { return $this->applicationConfiguration; } - final public function setPath($path) { + public function setPath($path) { $this->path = $path; return $this; } - final public function getPath() { + public function getPath() { return $this->path; } - final public function getHost() { + public function getHost() { // The "Host" header may include a port number, or may be a malicious // header in the form "realdomain.com:ignored@evil.com". Invoke the full // parser to extract the real domain correctly. See here for coverage of @@ -83,7 +83,7 @@ /** * @task data */ - final public function setRequestData(array $request_data) { + public function setRequestData(array $request_data) { $this->requestData = $request_data; return $this; } @@ -92,7 +92,7 @@ /** * @task data */ - final public function getRequestData() { + public function getRequestData() { return $this->requestData; } @@ -100,7 +100,7 @@ /** * @task data */ - final public function getInt($name, $default = null) { + public function getInt($name, $default = null) { if (isset($this->requestData[$name])) { return (int)$this->requestData[$name]; } else { @@ -112,7 +112,7 @@ /** * @task data */ - final public function getBool($name, $default = null) { + public function getBool($name, $default = null) { if (isset($this->requestData[$name])) { if ($this->requestData[$name] === 'true') { return true; @@ -130,7 +130,7 @@ /** * @task data */ - final public function getStr($name, $default = null) { + public function getStr($name, $default = null) { if (isset($this->requestData[$name])) { $str = (string)$this->requestData[$name]; // Normalize newline craziness. @@ -148,7 +148,7 @@ /** * @task data */ - final public function getArr($name, $default = array()) { + public function getArr($name, $default = array()) { if (isset($this->requestData[$name]) && is_array($this->requestData[$name])) { return $this->requestData[$name]; @@ -161,7 +161,7 @@ /** * @task data */ - final public function getStrList($name, $default = array()) { + public function getStrList($name, $default = array()) { if (!isset($this->requestData[$name])) { return $default; } @@ -174,36 +174,36 @@ /** * @task data */ - final public function getExists($name) { + public function getExists($name) { return array_key_exists($name, $this->requestData); } - final public function getFileExists($name) { + public function getFileExists($name) { return isset($_FILES[$name]) && (idx($_FILES[$name], 'error') !== UPLOAD_ERR_NO_FILE); } - final public function isHTTPGet() { + public function isHTTPGet() { return ($_SERVER['REQUEST_METHOD'] == 'GET'); } - final public function isHTTPPost() { + public function isHTTPPost() { return ($_SERVER['REQUEST_METHOD'] == 'POST'); } - final public function isAjax() { + public function isAjax() { return $this->getExists(self::TYPE_AJAX) && !$this->isQuicksand(); } - final public function isWorkflow() { + public function isWorkflow() { return $this->getExists(self::TYPE_WORKFLOW) && !$this->isQuicksand(); } - final public function isQuicksand() { + public function isQuicksand() { return $this->getExists(self::TYPE_QUICKSAND); } - final public function isConduit() { + public function isConduit() { return $this->getExists(self::TYPE_CONDUIT); } @@ -215,7 +215,7 @@ return 'X-Phabricator-Csrf'; } - final public function validateCSRF() { + public function validateCSRF() { $token_name = self::getCSRFTokenName(); $token = $this->getStr($token_name); @@ -281,7 +281,7 @@ return true; } - final public function isFormPost() { + public function isFormPost() { $post = $this->getExists(self::TYPE_FORM) && !$this->getExists(self::TYPE_HISEC) && $this->isHTTPPost(); @@ -293,7 +293,7 @@ return $this->validateCSRF(); } - final public function isFormOrHisecPost() { + public function isFormOrHisecPost() { $post = $this->getExists(self::TYPE_FORM) && $this->isHTTPPost(); @@ -305,12 +305,12 @@ } - final public function setCookiePrefix($prefix) { + public function setCookiePrefix($prefix) { $this->cookiePrefix = $prefix; return $this; } - final private function getPrefixedCookieName($name) { + private function getPrefixedCookieName($name) { if (strlen($this->cookiePrefix)) { return $this->cookiePrefix.'_'.$name; } else { @@ -318,7 +318,7 @@ } } - final public function getCookie($name, $default = null) { + public function getCookie($name, $default = null) { $name = $this->getPrefixedCookieName($name); $value = idx($_COOKIE, $name, $default); @@ -337,7 +337,7 @@ return $value; } - final public function clearCookie($name) { + public function clearCookie($name) { $this->setCookieWithExpiration($name, '', time() - (60 * 60 * 24 * 30)); unset($_COOKIE[$name]); } @@ -390,7 +390,7 @@ * * @task cookie */ - final public function canSetCookies() { + public function canSetCookies() { return (bool)$this->getCookieDomainURI(); } @@ -405,7 +405,7 @@ * @return this * @task cookie */ - final public function setCookie($name, $value) { + public function setCookie($name, $value) { $far_future = time() + (60 * 60 * 24 * 365 * 5); return $this->setCookieWithExpiration($name, $value, $far_future); } @@ -421,7 +421,7 @@ * @return this * @task cookie */ - final public function setTemporaryCookie($name, $value) { + public function setTemporaryCookie($name, $value) { return $this->setCookieWithExpiration($name, $value, 0); } @@ -435,7 +435,7 @@ * @return this * @task cookie */ - final private function setCookieWithExpiration( + private function setCookieWithExpiration( $name, $value, $expire) { @@ -485,31 +485,31 @@ return $this; } - final public function setUser($user) { + public function setUser($user) { $this->user = $user; return $this; } - final public function getUser() { + public function getUser() { return $this->user; } - final public function getViewer() { + public function getViewer() { return $this->user; } - final public function getRequestURI() { + public function getRequestURI() { $get = $_GET; unset($get['__path__']); $path = phutil_escape_uri($this->getPath()); return id(new PhutilURI($path))->setQueryParams($get); } - final public function isDialogFormPost() { + public function isDialogFormPost() { return $this->isFormPost() && $this->getStr('__dialog__'); } - final public function getRemoteAddr() { + public function getRemoteAddr() { return $_SERVER['REMOTE_ADDR']; } @@ -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/AphrontURIMapper.php b/src/aphront/AphrontURIMapper.php --- a/src/aphront/AphrontURIMapper.php +++ b/src/aphront/AphrontURIMapper.php @@ -4,11 +4,11 @@ private $map; - final public function __construct(array $map) { + public function __construct(array $map) { $this->map = $map; } - final public function mapPath($path) { + public function mapPath($path) { $map = $this->map; foreach ($map as $rule => $value) { list($controller, $data) = $this->tryRule($rule, $value, $path); @@ -25,7 +25,7 @@ return array(null, null); } - final private function tryRule($rule, $value, $path) { + private function tryRule($rule, $value, $path) { $match = null; $pattern = '#^'.$rule.(is_array($value) ? '' : '$').'#'; if (!preg_match($pattern, $path, $match)) { 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 @@ -205,7 +205,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/CelerityResourceGraph.php b/src/applications/celerity/CelerityResourceGraph.php --- a/src/applications/celerity/CelerityResourceGraph.php +++ b/src/applications/celerity/CelerityResourceGraph.php @@ -20,7 +20,7 @@ return $edges; } - final public function setResourceGraph(array $graph) { + public function setResourceGraph(array $graph) { $this->resourceGraph = $graph; $this->graphSet = true; return $this; 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/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 @@ -13,12 +13,12 @@ private $targetCommitIdentifier; private $awayPaths = array(); - final public function setPath($path) { + public function setPath($path) { $this->path = $path; return $this; } - final public function getPath() { + public function getPath() { return $this->path; } @@ -58,58 +58,58 @@ return $this->awayPaths; } - final public function setCommitIdentifier($commit) { + public function setCommitIdentifier($commit) { $this->commitIdentifier = $commit; return $this; } - final public function getCommitIdentifier() { + public function getCommitIdentifier() { return $this->commitIdentifier; } - final public function setTargetCommitIdentifier($target_commit_identifier) { + public function setTargetCommitIdentifier($target_commit_identifier) { $this->targetCommitIdentifier = $target_commit_identifier; return $this; } - final public function getTargetCommitIdentifier() { + public function getTargetCommitIdentifier() { return $this->targetCommitIdentifier; } - final public function setCommit($commit) { + public function setCommit($commit) { $this->commit = $commit; return $this; } - final public function getCommit() { + public function getCommit() { return $this->commit; } - final public function setCommitData($commit_data) { + public function setCommitData($commit_data) { $this->commitData = $commit_data; return $this; } - final public function getCommitData() { + public function getCommitData() { return $this->commitData; } - final public function getEpoch() { + public function getEpoch() { if ($this->getCommit()) { return $this->getCommit()->getEpoch(); } return null; } - final public function getAuthorName() { + public function getAuthorName() { if ($this->getCommitData()) { return $this->getCommitData()->getAuthorName(); } return null; } - final public function getSummary() { + public function getSummary() { if (!$this->getCommitData()) { return null; } @@ -118,7 +118,7 @@ return substr($first, 0, 80); } - final public static function convertToArcanistChanges(array $changes) { + public static function convertToArcanistChanges(array $changes) { assert_instances_of($changes, 'DiffusionPathChange'); $direct = array(); $result = array(); @@ -142,7 +142,7 @@ return array_select_keys($result, $direct); } - final public static function convertToDifferentialChangesets( + public static function convertToDifferentialChangesets( PhabricatorUser $user, array $changes) { assert_instances_of($changes, 'DiffusionPathChange'); diff --git a/src/applications/diffusion/query/DiffusionRenameHistoryQuery.php b/src/applications/diffusion/query/DiffusionRenameHistoryQuery.php --- a/src/applications/diffusion/query/DiffusionRenameHistoryQuery.php +++ b/src/applications/diffusion/query/DiffusionRenameHistoryQuery.php @@ -30,7 +30,7 @@ return $this->oldCommit; } - final public function loadOldFilename() { + public function loadOldFilename() { $drequest = $this->request; $repository_id = $drequest->getRepository()->getID(); $conn_r = id(new PhabricatorRepository())->establishConnection('r'); diff --git a/src/applications/diffusion/query/pathchange/DiffusionPathChangeQuery.php b/src/applications/diffusion/query/pathchange/DiffusionPathChangeQuery.php --- a/src/applications/diffusion/query/pathchange/DiffusionPathChangeQuery.php +++ b/src/applications/diffusion/query/pathchange/DiffusionPathChangeQuery.php @@ -14,11 +14,11 @@ return $this->limit; } - final private function __construct() { + private function __construct() { // } - final public static function newFromDiffusionRequest( + public static function newFromDiffusionRequest( DiffusionRequest $request) { $query = new DiffusionPathChangeQuery(); $query->request = $request; @@ -26,11 +26,11 @@ return $query; } - final protected function getRequest() { + protected function getRequest() { return $this->request; } - final public function loadChanges() { + public function loadChanges() { return $this->executeQuery(); } 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 @@ -241,7 +241,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 @@ -214,7 +214,7 @@ if (!$file) { $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); - $file = PhabricatorFile::newFromFileData($data, $params); + $file = self::newFromFileData($data, $params); unset($unguarded); } @@ -235,7 +235,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); @@ -261,7 +261,7 @@ $length, array $params) { - $file = PhabricatorFile::initializeNewFile(); + $file = self::initializeNewFile(); $file->setByteSize($length); @@ -315,7 +315,7 @@ throw new Exception(pht('No valid storage engines are available!')); } - $file = PhabricatorFile::initializeNewFile(); + $file = self::initializeNewFile(); $data_handle = null; $engine_identifier = null; @@ -1040,7 +1040,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/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/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/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/metamta/storage/PhabricatorMetaMTAReceivedMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php --- a/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php +++ b/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php @@ -90,7 +90,7 @@ return $this->loadPHIDsFromAddresses($addresses); } - final public function loadCCPHIDs() { + public function loadCCPHIDs() { return $this->loadPHIDsFromAddresses($this->getCCAddresses()); } 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/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 @@ -71,7 +71,7 @@ assert_instances_of($list, 'PhortuneCurrency'); 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/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/tokens/query/PhabricatorTokenCountQuery.php b/src/applications/tokens/query/PhabricatorTokenCountQuery.php --- a/src/applications/tokens/query/PhabricatorTokenCountQuery.php +++ b/src/applications/tokens/query/PhabricatorTokenCountQuery.php @@ -10,7 +10,7 @@ return $this; } - final public function execute() { + public function execute() { $table = new PhabricatorTokenCount(); $conn_r = $table->establishConnection('r'); 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 @@ -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/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/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/configuration/DefaultDatabaseConfigurationProvider.php b/src/infrastructure/storage/configuration/DefaultDatabaseConfigurationProvider.php --- a/src/infrastructure/storage/configuration/DefaultDatabaseConfigurationProvider.php +++ b/src/infrastructure/storage/configuration/DefaultDatabaseConfigurationProvider.php @@ -40,7 +40,7 @@ return $this->namespace.'_'.$this->getDao()->getApplicationName(); } - final protected function getDao() { + protected function getDao() { return $this->dao; } diff --git a/src/infrastructure/storage/lisk/LiskDAOSet.php b/src/infrastructure/storage/lisk/LiskDAOSet.php --- a/src/infrastructure/storage/lisk/LiskDAOSet.php +++ b/src/infrastructure/storage/lisk/LiskDAOSet.php @@ -38,7 +38,7 @@ * The main purpose of this method is to break cyclic dependency. * It removes all objects from this set and all subsets created by it. */ - final public function clearSet() { + public function clearSet() { $this->daos = array(); $this->relatives = array(); foreach ($this->subsets as $set) { 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 @@ -49,7 +49,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 @@ -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 @@ -174,7 +174,7 @@ return $this; } - final public function render() { + public function render() { require_celerity_resource('aphront-dialog-view-css'); $buttons = array(); diff --git a/src/view/AphrontJavelinView.php b/src/view/AphrontJavelinView.php --- a/src/view/AphrontJavelinView.php +++ b/src/view/AphrontJavelinView.php @@ -46,7 +46,7 @@ return $this->name; } - final public function setName($template_name) { + public function setName($template_name) { $this->name = $template_name; return $this; } @@ -55,7 +55,7 @@ return $this->parameters; } - final public function setParameters($template_parameters) { + public function setParameters($template_parameters) { $this->parameters = $template_parameters; return $this; } @@ -64,7 +64,7 @@ return $this->celerityResource; } - final public function setCelerityResource($celerity_resource) { + public function setCelerityResource($celerity_resource) { $this->celerityResource = $celerity_resource; return $this; } diff --git a/src/view/control/AphrontCursorPagerView.php b/src/view/control/AphrontCursorPagerView.php --- a/src/view/control/AphrontCursorPagerView.php +++ b/src/view/control/AphrontCursorPagerView.php @@ -13,64 +13,64 @@ private $uri; - final public function setPageSize($page_size) { + public function setPageSize($page_size) { $this->pageSize = max(1, $page_size); return $this; } - final public function getPageSize() { + public function getPageSize() { return $this->pageSize; } - final public function setURI(PhutilURI $uri) { + public function setURI(PhutilURI $uri) { $this->uri = $uri; return $this; } - final public function readFromRequest(AphrontRequest $request) { + public function readFromRequest(AphrontRequest $request) { $this->uri = $request->getRequestURI(); $this->afterID = $request->getStr('after'); $this->beforeID = $request->getStr('before'); return $this; } - final public function setAfterID($after_id) { + public function setAfterID($after_id) { $this->afterID = $after_id; return $this; } - final public function getAfterID() { + public function getAfterID() { return $this->afterID; } - final public function setBeforeID($before_id) { + public function setBeforeID($before_id) { $this->beforeID = $before_id; return $this; } - final public function getBeforeID() { + public function getBeforeID() { return $this->beforeID; } - final public function setNextPageID($next_page_id) { + public function setNextPageID($next_page_id) { $this->nextPageID = $next_page_id; return $this; } - final public function getNextPageID() { + public function getNextPageID() { return $this->nextPageID; } - final public function setPrevPageID($prev_page_id) { + public function setPrevPageID($prev_page_id) { $this->prevPageID = $prev_page_id; return $this; } - final public function getPrevPageID() { + public function getPrevPageID() { return $this->prevPageID; } - final public function sliceResults(array $results) { + public function sliceResults(array $results) { if (count($results) > $this->getPageSize()) { $offset = ($this->beforeID ? count($results) - $this->getPageSize() : 0); $results = array_slice($results, $offset, $this->getPageSize(), true); @@ -79,7 +79,7 @@ return $results; } - final public function getHasMoreResults() { + public function getHasMoreResults() { return $this->moreResults; } diff --git a/src/view/control/AphrontPagerView.php b/src/view/control/AphrontPagerView.php --- a/src/view/control/AphrontPagerView.php +++ b/src/view/control/AphrontPagerView.php @@ -13,52 +13,52 @@ private $surroundingPages = 2; private $enableKeyboardShortcuts; - final public function setPageSize($page_size) { + public function setPageSize($page_size) { $this->pageSize = max(1, $page_size); return $this; } - final public function setOffset($offset) { + public function setOffset($offset) { $this->offset = max(0, $offset); return $this; } - final public function getOffset() { + public function getOffset() { return $this->offset; } - final public function getPageSize() { + public function getPageSize() { return $this->pageSize; } - final public function setCount($count) { + public function setCount($count) { $this->count = $count; return $this; } - final public function setHasMorePages($has_more) { + public function setHasMorePages($has_more) { $this->hasMorePages = $has_more; return $this; } - final public function setURI(PhutilURI $uri, $paging_parameter) { + public function setURI(PhutilURI $uri, $paging_parameter) { $this->uri = $uri; $this->pagingParameter = $paging_parameter; return $this; } - final public function readFromRequest(AphrontRequest $request) { + public function readFromRequest(AphrontRequest $request) { $this->uri = $request->getRequestURI(); $this->pagingParameter = 'offset'; $this->offset = $request->getInt($this->pagingParameter); return $this; } - final public function willShowPagingControls() { + public function willShowPagingControls() { return $this->hasMorePages; } - final public function setSurroundingPages($pages) { + public function setSurroundingPages($pages) { $this->surroundingPages = max(0, $pages); return $this; } 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 @@ -40,7 +40,7 @@ return $this; } - final public function render() { + public function render() { require_celerity_resource('phui-info-view-css'); 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/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 @@ -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 ".