From c896aeb62ed94dfd5d778d0faa294d04275b0de1 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Wed, 20 May 2015 07:06:07 +1000 Subject: [PATCH] Various linter fixes Summary: Apply various linter fixes. Test Plan: Unit tests + eyeballing. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: hach-que, Korvin, epriestley Differential Revision: https://secure.phabricator.com/D12390 --- src/aphront/AphrontRequest.php | 82 +++++++++---------- src/aphront/AphrontURIMapper.php | 6 +- src/aphront/response/AphrontJSONResponse.php | 2 +- .../celerity/CelerityResourceGraph.php | 2 +- .../ConpherenceUpdateController.php | 2 +- ...abricatorDashboardPanelRenderingEngine.php | 4 +- .../diffusion/data/DiffusionPathChange.php | 30 +++---- .../query/DiffusionRenameHistoryQuery.php | 2 +- .../pathchange/DiffusionPathChangeQuery.php | 8 +- .../files/storage/PhabricatorFile.php | 2 +- .../herald/adapter/HeraldAdapter.php | 6 +- .../LegalpadDocumentSignController.php | 2 +- .../PhabricatorMetaMTAReceivedMail.php | 2 +- ...PhabricatorNotificationPanelController.php | 2 +- .../oauthserver/PhabricatorOAuthServer.php | 2 +- .../PhabricatorOwnersDetailController.php | 2 +- .../PhabricatorOwnersListController.php | 2 +- .../PhabricatorPeopleController.php | 4 - .../pholio/editor/PholioMockEditor.php | 6 +- .../pholio/view/PholioMockImagesView.php | 4 +- .../PhabricatorProjectTransactionEditor.php | 2 +- ...ReleephWorkNextRequestConduitAPIMethod.php | 2 +- ...entialReleephRequestFieldSpecification.php | 2 +- .../ReleephRequestTransactionalEditor.php | 2 +- .../releeph/storage/ReleephRequest.php | 7 -- .../storage/ReleephRequestTransaction.php | 4 - .../query/PhabricatorTokenCountQuery.php | 2 +- ...catorApplicationTransactionCommentView.php | 2 +- .../events/PhabricatorEvent.php | 4 - .../DefaultDatabaseConfigurationProvider.php | 2 +- .../storage/lisk/LiskDAOSet.php | 2 +- src/view/AphrontDialogView.php | 2 +- src/view/AphrontJavelinView.php | 6 +- src/view/control/AphrontCursorPagerView.php | 28 +++---- src/view/control/AphrontPagerView.php | 20 ++--- src/view/form/PHUIInfoView.php | 2 +- src/view/layout/PhabricatorSourceCodeView.php | 2 +- src/view/phui/PHUITimelineView.php | 2 +- 38 files changed, 123 insertions(+), 142 deletions(-) diff --git a/src/aphront/AphrontRequest.php b/src/aphront/AphrontRequest.php index ab6e0d9820..4aa52c1fcb 100644 --- a/src/aphront/AphrontRequest.php +++ b/src/aphront/AphrontRequest.php @@ -28,44 +28,44 @@ final class AphrontRequest { 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 @@ final class AphrontRequest { /** * @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 @@ final class AphrontRequest { /** * @task data */ - final public function getRequestData() { + public function getRequestData() { return $this->requestData; } @@ -100,7 +100,7 @@ final class AphrontRequest { /** * @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 @@ final class AphrontRequest { /** * @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 @@ final class AphrontRequest { /** * @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 @@ final class AphrontRequest { /** * @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 @@ final class AphrontRequest { /** * @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 @@ final class AphrontRequest { /** * @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 @@ final class AphrontRequest { return 'X-Phabricator-Csrf'; } - final public function validateCSRF() { + public function validateCSRF() { $token_name = self::getCSRFTokenName(); $token = $this->getStr($token_name); @@ -281,7 +281,7 @@ final class AphrontRequest { 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 @@ final class AphrontRequest { return $this->validateCSRF(); } - final public function isFormOrHisecPost() { + public function isFormOrHisecPost() { $post = $this->getExists(self::TYPE_FORM) && $this->isHTTPPost(); @@ -305,12 +305,12 @@ final class AphrontRequest { } - 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 class AphrontRequest { } } - 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 @@ final class AphrontRequest { 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 @@ final class AphrontRequest { * * @task cookie */ - final public function canSetCookies() { + public function canSetCookies() { return (bool)$this->getCookieDomainURI(); } @@ -405,7 +405,7 @@ final class AphrontRequest { * @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 @@ final class AphrontRequest { * @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 @@ final class AphrontRequest { * @return this * @task cookie */ - final private function setCookieWithExpiration( + private function setCookieWithExpiration( $name, $value, $expire) { @@ -485,31 +485,31 @@ final class AphrontRequest { 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']; } diff --git a/src/aphront/AphrontURIMapper.php b/src/aphront/AphrontURIMapper.php index 9c68f2485f..32f464911a 100644 --- a/src/aphront/AphrontURIMapper.php +++ b/src/aphront/AphrontURIMapper.php @@ -4,11 +4,11 @@ final class AphrontURIMapper { 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 @@ final class AphrontURIMapper { 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/aphront/response/AphrontJSONResponse.php b/src/aphront/response/AphrontJSONResponse.php index a9493a6282..3d1c429d41 100644 --- a/src/aphront/response/AphrontJSONResponse.php +++ b/src/aphront/response/AphrontJSONResponse.php @@ -19,7 +19,7 @@ final class AphrontJSONResponse extends AphrontResponse { if ($this->addJSONShield === null) { return true; } - return (bool) $this->addJSONShield; + return (bool)$this->addJSONShield; } public function buildResponseString() { diff --git a/src/applications/celerity/CelerityResourceGraph.php b/src/applications/celerity/CelerityResourceGraph.php index 715a64c35c..3aa5c12497 100644 --- a/src/applications/celerity/CelerityResourceGraph.php +++ b/src/applications/celerity/CelerityResourceGraph.php @@ -18,7 +18,7 @@ final class CelerityResourceGraph extends AbstractDirectedGraph { 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/conpherence/controller/ConpherenceUpdateController.php b/src/applications/conpherence/controller/ConpherenceUpdateController.php index d37fefdf14..8d7db7691c 100644 --- a/src/applications/conpherence/controller/ConpherenceUpdateController.php +++ b/src/applications/conpherence/controller/ConpherenceUpdateController.php @@ -550,7 +550,7 @@ final class ConpherenceUpdateController $content = array( 'non_update' => $non_update, 'transactions' => hsprintf('%s', $rendered_transactions), - 'conpherence_title' => (string) $data['title'], + 'conpherence_title' => (string)$data['title'], 'latest_transaction_id' => $new_latest_transaction_id, 'nav_item' => $nav_item, 'conpherence_phid' => $conpherence->getPHID(), diff --git a/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php b/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php index e8f796fa59..dfba37eaa5 100644 --- a/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php +++ b/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php @@ -246,7 +246,7 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject { $action_edit = id(new PHUIIconView()) ->setIconFont('fa-pencil') ->setWorkflow(true) - ->setHref((string) $edit_uri); + ->setHref((string)$edit_uri); $header->addAction($action_edit); if ($dashboard_id) { @@ -255,7 +255,7 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject { ->setQueryParam('panelPHID', $panel->getPHID()); $action_remove = id(new PHUIIconView()) ->setIconFont('fa-trash-o') - ->setHref((string) $uri) + ->setHref((string)$uri) ->setWorkflow(true); $header->addAction($action_remove); } diff --git a/src/applications/diffusion/data/DiffusionPathChange.php b/src/applications/diffusion/data/DiffusionPathChange.php index 6f96057014..939fea9449 100644 --- a/src/applications/diffusion/data/DiffusionPathChange.php +++ b/src/applications/diffusion/data/DiffusionPathChange.php @@ -13,12 +13,12 @@ final class DiffusionPathChange { 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 @@ final class DiffusionPathChange { 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 @@ final class DiffusionPathChange { return substr($first, 0, 80); } - final public static function convertToArcanistChanges(array $changes) { + public static function convertToArcanistChanges(array $changes) { assert_instances_of($changes, __CLASS__); $direct = array(); $result = array(); @@ -142,7 +142,7 @@ final class DiffusionPathChange { return array_select_keys($result, $direct); } - final public static function convertToDifferentialChangesets( + public static function convertToDifferentialChangesets( PhabricatorUser $user, array $changes) { assert_instances_of($changes, __CLASS__); diff --git a/src/applications/diffusion/query/DiffusionRenameHistoryQuery.php b/src/applications/diffusion/query/DiffusionRenameHistoryQuery.php index 537364b0ce..a8f5615192 100644 --- a/src/applications/diffusion/query/DiffusionRenameHistoryQuery.php +++ b/src/applications/diffusion/query/DiffusionRenameHistoryQuery.php @@ -30,7 +30,7 @@ final class DiffusionRenameHistoryQuery { 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 index c661e55226..d2f4a2b690 100644 --- a/src/applications/diffusion/query/pathchange/DiffusionPathChangeQuery.php +++ b/src/applications/diffusion/query/pathchange/DiffusionPathChangeQuery.php @@ -14,11 +14,11 @@ final class DiffusionPathChangeQuery { 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 @@ final class DiffusionPathChangeQuery { 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/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php index f8e99bc965..c236a2368e 100644 --- a/src/applications/files/storage/PhabricatorFile.php +++ b/src/applications/files/storage/PhabricatorFile.php @@ -758,7 +758,7 @@ final class PhabricatorFile extends PhabricatorFileDAO public function getDownloadURI() { $uri = id(new PhutilURI($this->getViewURI())) ->setQueryParam('download', true); - return (string) $uri; + return (string)$uri; } public function getURIForTransform(PhabricatorFileTransform $transform) { diff --git a/src/applications/herald/adapter/HeraldAdapter.php b/src/applications/herald/adapter/HeraldAdapter.php index f56572a398..ca52b8da15 100644 --- a/src/applications/herald/adapter/HeraldAdapter.php +++ b/src/applications/herald/adapter/HeraldAdapter.php @@ -166,7 +166,7 @@ abstract class HeraldAdapter { throw new Exception(pht('You must setIsNewObject to a boolean first!')); } public function setIsNewObject($new) { - $this->isNewObject = (bool) $new; + $this->isNewObject = (bool)$new; return $this; } @@ -681,9 +681,9 @@ abstract class HeraldAdapter { } return $result; case self::CONDITION_HAS_BIT: - return (($condition_value & $field_value) === (int) $condition_value); + return (($condition_value & $field_value) === (int)$condition_value); case self::CONDITION_NOT_BIT: - return (($condition_value & $field_value) !== (int) $condition_value); + return (($condition_value & $field_value) !== (int)$condition_value); default: throw new HeraldInvalidConditionException( "Unknown condition '{$condition_type}'."); diff --git a/src/applications/legalpad/controller/LegalpadDocumentSignController.php b/src/applications/legalpad/controller/LegalpadDocumentSignController.php index b1c23f5d9a..4cd2f59b4c 100644 --- a/src/applications/legalpad/controller/LegalpadDocumentSignController.php +++ b/src/applications/legalpad/controller/LegalpadDocumentSignController.php @@ -199,7 +199,7 @@ final class LegalpadDocumentSignController extends LegalpadController { $next_uri = '/'.$document->getMonogram(); if ($document->getRequireSignature()) { $request_uri = $request->getRequestURI(); - $next_uri = (string) $request_uri; + $next_uri = (string)$request_uri; } } else { $this->sendVerifySignatureEmail( diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php index fa5ad7f752..91634fe577 100644 --- a/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php +++ b/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php @@ -90,7 +90,7 @@ final class PhabricatorMetaMTAReceivedMail extends PhabricatorMetaMTADAO { return $this->loadPHIDsFromAddresses($addresses); } - final public function loadCCPHIDs() { + public function loadCCPHIDs() { return $this->loadPHIDsFromAddresses($this->getCCAddresses()); } diff --git a/src/applications/notification/controller/PhabricatorNotificationPanelController.php b/src/applications/notification/controller/PhabricatorNotificationPanelController.php index 850bfe7392..3e8f16b07a 100644 --- a/src/applications/notification/controller/PhabricatorNotificationPanelController.php +++ b/src/applications/notification/controller/PhabricatorNotificationPanelController.php @@ -34,7 +34,7 @@ final class PhabricatorNotificationPanelController 'a', array( 'sigil' => 'workflow', - 'href' => (string) $clear_uri, + 'href' => (string)$clear_uri, 'class' => $clear_ui_class, ), pht('Mark All Read')); diff --git a/src/applications/oauthserver/PhabricatorOAuthServer.php b/src/applications/oauthserver/PhabricatorOAuthServer.php index 228ea8e61e..b7dc0d6301 100644 --- a/src/applications/oauthserver/PhabricatorOAuthServer.php +++ b/src/applications/oauthserver/PhabricatorOAuthServer.php @@ -112,7 +112,7 @@ final class PhabricatorOAuthServer { $authorization_code->setClientPHID($client->getPHID()); $authorization_code->setClientSecret($client->getSecret()); $authorization_code->setUserPHID($this->getUser()->getPHID()); - $authorization_code->setRedirectURI((string) $redirect_uri); + $authorization_code->setRedirectURI((string)$redirect_uri); $authorization_code->save(); return $authorization_code; diff --git a/src/applications/owners/controller/PhabricatorOwnersDetailController.php b/src/applications/owners/controller/PhabricatorOwnersDetailController.php index 1db98f14aa..0b50db02d5 100644 --- a/src/applications/owners/controller/PhabricatorOwnersDetailController.php +++ b/src/applications/owners/controller/PhabricatorOwnersDetailController.php @@ -92,7 +92,7 @@ final class PhabricatorOwnersDetailController $path_link = phutil_tag( 'a', array( - 'href' => (string) $href, + 'href' => (string)$href, ), $path->getPath()); $path_links[] = hsprintf( diff --git a/src/applications/owners/controller/PhabricatorOwnersListController.php b/src/applications/owners/controller/PhabricatorOwnersListController.php index ef7b01ebfb..2a206616e6 100644 --- a/src/applications/owners/controller/PhabricatorOwnersListController.php +++ b/src/applications/owners/controller/PhabricatorOwnersListController.php @@ -285,7 +285,7 @@ final class PhabricatorOwnersListController phutil_tag( 'a', array( - 'href' => (string) $href, + 'href' => (string)$href, ), $path->getPath())); } else { diff --git a/src/applications/people/controller/PhabricatorPeopleController.php b/src/applications/people/controller/PhabricatorPeopleController.php index 5b06364bbd..4366c39758 100644 --- a/src/applications/people/controller/PhabricatorPeopleController.php +++ b/src/applications/people/controller/PhabricatorPeopleController.php @@ -45,10 +45,6 @@ abstract class PhabricatorPeopleController extends PhabricatorController { return $this->buildSideNavView(true)->getMenu(); } - protected function buildApplicationCrumbs() { - return parent::buildApplicationCrumbs(); - } - public function buildIconNavView(PhabricatorUser $user) { $viewer = $this->getViewer(); $picture = $user->getProfileImageURI(); diff --git a/src/applications/pholio/editor/PholioMockEditor.php b/src/applications/pholio/editor/PholioMockEditor.php index cd36b563b3..87d8d51167 100644 --- a/src/applications/pholio/editor/PholioMockEditor.php +++ b/src/applications/pholio/editor/PholioMockEditor.php @@ -260,19 +260,19 @@ final class PholioMockEditor extends PhabricatorApplicationTransactionEditor { break; case PholioTransactionType::TYPE_IMAGE_NAME: $image = $this->getImageForXaction($object, $xaction); - $value = (string) head($xaction->getNewValue()); + $value = (string)head($xaction->getNewValue()); $image->setName($value); $image->save(); break; case PholioTransactionType::TYPE_IMAGE_DESCRIPTION: $image = $this->getImageForXaction($object, $xaction); - $value = (string) head($xaction->getNewValue()); + $value = (string)head($xaction->getNewValue()); $image->setDescription($value); $image->save(); break; case PholioTransactionType::TYPE_IMAGE_SEQUENCE: $image = $this->getImageForXaction($object, $xaction); - $value = (int) head($xaction->getNewValue()); + $value = (int)head($xaction->getNewValue()); $image->setSequence($value); $image->save(); break; diff --git a/src/applications/pholio/view/PholioMockImagesView.php b/src/applications/pholio/view/PholioMockImagesView.php index d59e701579..c1bcb46230 100644 --- a/src/applications/pholio/view/PholioMockImagesView.php +++ b/src/applications/pholio/view/PholioMockImagesView.php @@ -137,7 +137,7 @@ final class PholioMockImagesView extends AphrontView { ); $login_uri = id(new PhutilURI('/login/')) - ->setQueryParam('next', (string) $this->getRequestURI()); + ->setQueryParam('next', (string)$this->getRequestURI()); $config = array( 'mockID' => $mock->getID(), @@ -147,7 +147,7 @@ final class PholioMockImagesView extends AphrontView { 'images' => $images, 'selectedID' => $selected_id, 'loggedIn' => $this->getUser()->isLoggedIn(), - 'logInLink' => (string) $login_uri, + 'logInLink' => (string)$login_uri, 'navsequence' => $navsequence, 'fullIcon' => hsprintf('%s', $full_icon), 'downloadIcon' => hsprintf('%s', $download_icon), diff --git a/src/applications/project/editor/PhabricatorProjectTransactionEditor.php b/src/applications/project/editor/PhabricatorProjectTransactionEditor.php index 307e186dbd..b85c127241 100644 --- a/src/applications/project/editor/PhabricatorProjectTransactionEditor.php +++ b/src/applications/project/editor/PhabricatorProjectTransactionEditor.php @@ -51,7 +51,7 @@ final class PhabricatorProjectTransactionEditor case PhabricatorProjectTransaction::TYPE_COLOR: return $object->getColor(); case PhabricatorProjectTransaction::TYPE_LOCKED: - return (int) $object->getIsMembershipLocked(); + return (int)$object->getIsMembershipLocked(); } return parent::getCustomTransactionOldValue($object, $xaction); diff --git a/src/applications/releeph/conduit/work/ReleephWorkNextRequestConduitAPIMethod.php b/src/applications/releeph/conduit/work/ReleephWorkNextRequestConduitAPIMethod.php index 5e3d004ce6..e161faf082 100644 --- a/src/applications/releeph/conduit/work/ReleephWorkNextRequestConduitAPIMethod.php +++ b/src/applications/releeph/conduit/work/ReleephWorkNextRequestConduitAPIMethod.php @@ -177,7 +177,7 @@ final class ReleephWorkNextRequestConduitAPIMethod foreach ($releeph_requests as $rq) { // TODO: it's likely that relying on the `id` column to provide // trunk-commit-order is thoroughly broken. - $ordinal = (int) $rq->loadPhabricatorRepositoryCommit()->getID(); + $ordinal = (int)$rq->loadPhabricatorRepositoryCommit()->getID(); $surrogate[$ordinal] = $rq; } ksort($surrogate); diff --git a/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php b/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php index 1c2a10eace..6e635ee4b3 100644 --- a/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php +++ b/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php @@ -180,7 +180,7 @@ final class DifferentialReleephRequestFieldSpecification { "Releeph request token '{$token}'!"); } - $id = (int) $match[1]; + $id = (int)$match[1]; $releeph_request = id(new ReleephRequest())->load($id); if (!$releeph_request) { diff --git a/src/applications/releeph/editor/ReleephRequestTransactionalEditor.php b/src/applications/releeph/editor/ReleephRequestTransactionalEditor.php index 9e4c0083d2..993079c506 100644 --- a/src/applications/releeph/editor/ReleephRequestTransactionalEditor.php +++ b/src/applications/releeph/editor/ReleephRequestTransactionalEditor.php @@ -114,7 +114,7 @@ final class ReleephRequestTransactionalEditor break; case ReleephRequestTransaction::TYPE_MANUAL_IN_BRANCH: - $object->setInBranch((int) $new); + $object->setInBranch((int)$new); break; } } diff --git a/src/applications/releeph/storage/ReleephRequest.php b/src/applications/releeph/storage/ReleephRequest.php index 7f2487107a..f2b51b6d89 100644 --- a/src/applications/releeph/storage/ReleephRequest.php +++ b/src/applications/releeph/storage/ReleephRequest.php @@ -293,13 +293,6 @@ final class ReleephRequest extends ReleephDAO throw new Exception('`status` is now deprecated!'); } -/* -( Make magic Lisk methods private )------------------------------------ */ - - private function setUserIntents(array $ar) { - return parent::setUserIntents($ar); - } - - /* -( PhabricatorApplicationTransactionInterface )------------------------- */ diff --git a/src/applications/releeph/storage/ReleephRequestTransaction.php b/src/applications/releeph/storage/ReleephRequestTransaction.php index f4a4720c78..b12ed6ad8c 100644 --- a/src/applications/releeph/storage/ReleephRequestTransaction.php +++ b/src/applications/releeph/storage/ReleephRequestTransaction.php @@ -146,10 +146,6 @@ final class ReleephRequestTransaction } } - public function getActionStrength() { - return parent::getActionStrength(); - } - public function getActionName() { switch ($this->getTransactionType()) { case self::TYPE_REQUEST: diff --git a/src/applications/tokens/query/PhabricatorTokenCountQuery.php b/src/applications/tokens/query/PhabricatorTokenCountQuery.php index d942f22ce4..64333715fd 100644 --- a/src/applications/tokens/query/PhabricatorTokenCountQuery.php +++ b/src/applications/tokens/query/PhabricatorTokenCountQuery.php @@ -10,7 +10,7 @@ final class PhabricatorTokenCountQuery return $this; } - final public function execute() { + public function execute() { $table = new PhabricatorTokenCount(); $conn_r = $table->establishConnection('r'); diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php index 311c7e8b9f..cbc3739cfb 100644 --- a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php +++ b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php @@ -83,7 +83,7 @@ class PhabricatorApplicationTransactionCommentView extends AphrontView { $user = $this->getUser(); if (!$user->isLoggedIn()) { $uri = id(new PhutilURI('/login/')) - ->setQueryParam('next', (string) $this->getRequestURI()); + ->setQueryParam('next', (string)$this->getRequestURI()); return id(new PHUIObjectBoxView()) ->setFlush(true) ->setHeaderText(pht('Add Comment')) diff --git a/src/infrastructure/events/PhabricatorEvent.php b/src/infrastructure/events/PhabricatorEvent.php index bfb08b203b..b0e8b28ebd 100644 --- a/src/infrastructure/events/PhabricatorEvent.php +++ b/src/infrastructure/events/PhabricatorEvent.php @@ -6,10 +6,6 @@ final class PhabricatorEvent extends PhutilEvent { private $aphrontRequest; private $conduitRequest; - public function __construct($type, array $data = array()) { - parent::__construct($type, $data); - } - public function setUser(PhabricatorUser $user) { $this->user = $user; return $this; diff --git a/src/infrastructure/storage/configuration/DefaultDatabaseConfigurationProvider.php b/src/infrastructure/storage/configuration/DefaultDatabaseConfigurationProvider.php index 839fa2816b..ea83209b43 100644 --- a/src/infrastructure/storage/configuration/DefaultDatabaseConfigurationProvider.php +++ b/src/infrastructure/storage/configuration/DefaultDatabaseConfigurationProvider.php @@ -40,7 +40,7 @@ final class DefaultDatabaseConfigurationProvider 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 index a554a19b62..399aef3687 100644 --- a/src/infrastructure/storage/lisk/LiskDAOSet.php +++ b/src/infrastructure/storage/lisk/LiskDAOSet.php @@ -38,7 +38,7 @@ final class LiskDAOSet { * 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/view/AphrontDialogView.php b/src/view/AphrontDialogView.php index 925d76a565..b551c14f35 100644 --- a/src/view/AphrontDialogView.php +++ b/src/view/AphrontDialogView.php @@ -174,7 +174,7 @@ final class AphrontDialogView extends AphrontView { 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 index 6471f1f951..7a2954eee3 100644 --- a/src/view/AphrontJavelinView.php +++ b/src/view/AphrontJavelinView.php @@ -46,7 +46,7 @@ final class AphrontJavelinView extends AphrontView { return $this->name; } - final public function setName($template_name) { + public function setName($template_name) { $this->name = $template_name; return $this; } @@ -55,7 +55,7 @@ final class AphrontJavelinView extends AphrontView { return $this->parameters; } - final public function setParameters($template_parameters) { + public function setParameters($template_parameters) { $this->parameters = $template_parameters; return $this; } @@ -64,7 +64,7 @@ final class AphrontJavelinView extends AphrontView { 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 index 81ab33df81..bc1e872103 100644 --- a/src/view/control/AphrontCursorPagerView.php +++ b/src/view/control/AphrontCursorPagerView.php @@ -13,64 +13,64 @@ final class AphrontCursorPagerView extends AphrontView { 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 @@ final class AphrontCursorPagerView extends AphrontView { 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 index 8b08b15c5a..82314454f3 100644 --- a/src/view/control/AphrontPagerView.php +++ b/src/view/control/AphrontPagerView.php @@ -13,52 +13,52 @@ final class AphrontPagerView extends AphrontView { 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 index 497fcf3f78..f6e6f9b054 100644 --- a/src/view/form/PHUIInfoView.php +++ b/src/view/form/PHUIInfoView.php @@ -40,7 +40,7 @@ final class PHUIInfoView extends AphrontView { return $this; } - final public function render() { + public function render() { require_celerity_resource('phui-info-view-css'); $errors = $this->errors; diff --git a/src/view/layout/PhabricatorSourceCodeView.php b/src/view/layout/PhabricatorSourceCodeView.php index 9a9454cbfa..7fb3f2ca66 100644 --- a/src/view/layout/PhabricatorSourceCodeView.php +++ b/src/view/layout/PhabricatorSourceCodeView.php @@ -72,7 +72,7 @@ final class PhabricatorSourceCodeView extends AphrontView { if ($this->canClickHighlight) { $line_uri = $this->uri.'$'.$line_number; - $line_href = (string) new PhutilURI($line_uri); + $line_href = (string)new PhutilURI($line_uri); $tag_number = javelin_tag( 'a', diff --git a/src/view/phui/PHUITimelineView.php b/src/view/phui/PHUITimelineView.php index fe8cdc5971..b17e075711 100644 --- a/src/view/phui/PHUITimelineView.php +++ b/src/view/phui/PHUITimelineView.php @@ -132,7 +132,7 @@ final class PHUITimelineView extends AphrontView { javelin_tag( 'a', array( - 'href' => (string) $uri, + 'href' => (string)$uri, 'mustcapture' => true, 'sigil' => 'show-older-link', ),