From a778151f28c16ef8feb01830be9216245f177366 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 17 Feb 2017 10:10:15 +0000 Subject: [PATCH] Fix errors found by PHPStan Test Plan: Ran `phpstan analyze -a autoload.php phabricator/src`. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, hach-que Differential Revision: https://secure.phabricator.com/D17371 --- .../PhabricatorAuthUnlinkController.php | 2 +- .../PhabricatorBadgesAwardController.php | 2 +- ...bricatorBadgesEditRecipientsController.php | 2 +- ...icatorBadgesRemoveRecipientsController.php | 2 +- .../base/PhabricatorApplication.php | 2 +- .../__tests__/CalendarTimeUtilTestCase.php | 4 +-- .../PhabricatorCalendarExternalInvitee.php | 2 +- .../PhabricatorConduitController.php | 8 ++--- .../check/PhabricatorDaemonsSetupCheck.php | 2 +- .../check/PhabricatorPHPConfigSetupCheck.php | 2 +- .../check/PhabricatorSecuritySetupCheck.php | 2 +- .../check/PhabricatorStorageSetupCheck.php | 2 +- ...icatorConfigClusterDatabasesController.php | 2 +- ...orConfigClusterNotificationsController.php | 2 +- ...torConfigClusterRepositoriesController.php | 2 +- .../PhabricatorConfigIssueListController.php | 2 +- ...ricatorSyntaxHighlightingConfigOptions.php | 2 +- .../schema/PhabricatorConfigKeySchema.php | 1 + ...onpherenceCreateThreadConduitAPIMethod.php | 3 -- .../PhabricatorDashboardManageController.php | 2 +- ...abricatorDashboardPanelRenderingEngine.php | 3 +- .../customfield/DifferentialCustomField.php | 8 ++--- ...tialRevisionRequiredActionResultBucket.php | 2 +- .../DiffusionDiffQueryConduitAPIMethod.php | 4 +-- .../controller/DiffusionBrowseController.php | 2 +- .../controller/DiffusionController.php | 2 +- .../controller/DiffusionHistoryController.php | 2 +- ...ffusionRepositoryStatusManagementPanel.php | 2 +- ...fusionCommitRequiredActionResultBucket.php | 2 +- src/applications/diviner/atom/DivinerAtom.php | 2 +- .../renderer/DivinerDefaultRenderer.php | 2 +- .../diviner/workflow/DivinerWorkflow.php | 2 +- .../herald/controller/HeraldController.php | 2 +- .../herald/query/HeraldRuleQuery.php | 5 --- .../LegalpadDocumentEditController.php | 2 +- .../LegalpadDocumentManageController.php | 2 +- .../legalpad/storage/LegalpadDocumentBody.php | 3 -- .../PhabricatorTestDataGenerator.php | 4 ++- .../controller/ManiphestController.php | 2 +- .../ManiphestTaskDetailController.php | 2 +- .../field/ManiphestConfiguredCustomField.php | 3 +- ...atorMailImplementationPHPMailerAdapter.php | 2 +- ...MailImplementationPHPMailerLiteAdapter.php | 2 +- .../storage/PhabricatorMetaMTAAttachment.php | 2 +- ...PhabricatorOwnersConfiguredCustomField.php | 4 +-- .../paste/query/PhabricatorPasteQuery.php | 2 +- .../PhabricatorPasteTitleTransaction.php | 4 +-- .../PhabricatorUserConfiguredCustomField.php | 2 +- src/applications/phame/storage/PhamePost.php | 2 +- src/applications/phid/utils.php | 2 +- .../controller/PholioMockViewController.php | 2 +- .../phragment/storage/PhragmentFragment.php | 1 + .../conduit/PhrictionInfoConduitAPIMethod.php | 4 +-- .../PhabricatorPolicyExplainController.php | 2 +- .../PonderQuestionViewController.php | 2 +- ...PhabricatorProjectMembersAddController.php | 2 +- ...bricatorProjectMembersRemoveController.php | 2 +- .../PhabricatorProjectSilenceController.php | 2 +- .../PhabricatorProjectUpdateController.php | 2 +- .../PhabricatorProjectWatchController.php | 2 +- ...habricatorProjectConfiguredCustomField.php | 4 +-- .../icon/PhabricatorProjectIconSet.php | 2 +- .../releeph/query/ReleephRequestQuery.php | 4 +-- .../query/PhabricatorRepositoryURIQuery.php | 5 --- .../storage/PhabricatorRepositoryURI.php | 2 +- .../PhabricatorApplicationSearchEngine.php | 4 +-- .../engine/PhabricatorProfileMenuEngine.php | 4 +-- .../search/storage/PhabricatorSavedQuery.php | 4 +-- .../PhabricatorSlowvoteVoteController.php | 4 +-- .../PhabricatorSpacesListController.php | 2 +- .../tokens/storage/PhabricatorTokensToken.php | 1 + ...catorApplicationTransactionCommentView.php | 1 + .../PhabricatorStreamingProtocolAdapter.php | 2 +- src/infrastructure/storage/lisk/LiskDAO.php | 4 +-- .../password/PhabricatorPasswordHasher.php | 4 +-- .../control/AphrontFormTextAreaControl.php | 2 +- src/view/layout/AphrontSideNavFilterView.php | 2 +- src/view/phui/PHUITimelineView.php | 2 +- .../phui/calendar/PHUICalendarDayView.php | 34 ------------------- .../phui/calendar/PHUICalendarListView.php | 3 +- 80 files changed, 92 insertions(+), 147 deletions(-) diff --git a/src/applications/auth/controller/PhabricatorAuthUnlinkController.php b/src/applications/auth/controller/PhabricatorAuthUnlinkController.php index 3f694207b9..2c21f63407 100644 --- a/src/applications/auth/controller/PhabricatorAuthUnlinkController.php +++ b/src/applications/auth/controller/PhabricatorAuthUnlinkController.php @@ -61,7 +61,7 @@ final class PhabricatorAuthUnlinkController return id(new AphrontRedirectResponse())->setURI($this->getDoneURI()); } - return $this->renderConfirmDialog($account); + return $this->renderConfirmDialog(); } private function getDoneURI() { diff --git a/src/applications/badges/controller/PhabricatorBadgesAwardController.php b/src/applications/badges/controller/PhabricatorBadgesAwardController.php index 0e5679caa4..f9294ec5c6 100644 --- a/src/applications/badges/controller/PhabricatorBadgesAwardController.php +++ b/src/applications/badges/controller/PhabricatorBadgesAwardController.php @@ -40,7 +40,7 @@ final class PhabricatorBadgesAwardController ->setTransactionType(PhabricatorBadgesTransaction::TYPE_AWARD) ->setNewValue($award_phids); - $editor = id(new PhabricatorBadgesEditor($badge)) + $editor = id(new PhabricatorBadgesEditor()) ->setActor($viewer) ->setContentSourceFromRequest($request) ->setContinueOnNoEffect(true) diff --git a/src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php b/src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php index 2f794e4470..546c41a1d4 100644 --- a/src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php +++ b/src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php @@ -40,7 +40,7 @@ final class PhabricatorBadgesEditRecipientsController ->setTransactionType(PhabricatorBadgesTransaction::TYPE_AWARD) ->setNewValue($award_phids); - $editor = id(new PhabricatorBadgesEditor($badge)) + $editor = id(new PhabricatorBadgesEditor()) ->setActor($viewer) ->setContentSourceFromRequest($request) ->setContinueOnNoEffect(true) diff --git a/src/applications/badges/controller/PhabricatorBadgesRemoveRecipientsController.php b/src/applications/badges/controller/PhabricatorBadgesRemoveRecipientsController.php index c77a5f33ea..0185698686 100644 --- a/src/applications/badges/controller/PhabricatorBadgesRemoveRecipientsController.php +++ b/src/applications/badges/controller/PhabricatorBadgesRemoveRecipientsController.php @@ -37,7 +37,7 @@ final class PhabricatorBadgesRemoveRecipientsController ->setTransactionType(PhabricatorBadgesTransaction::TYPE_REVOKE) ->setNewValue(array($remove_phid)); - $editor = id(new PhabricatorBadgesEditor($badge)) + $editor = id(new PhabricatorBadgesEditor()) ->setActor($viewer) ->setContentSourceFromRequest($request) ->setContinueOnNoEffect(true) diff --git a/src/applications/base/PhabricatorApplication.php b/src/applications/base/PhabricatorApplication.php index b791aaeef8..93b738d9e0 100644 --- a/src/applications/base/PhabricatorApplication.php +++ b/src/applications/base/PhabricatorApplication.php @@ -251,7 +251,7 @@ abstract class PhabricatorApplication } final protected function getInboundEmailSupportLink() { - return PhabricatorEnv::getDocLink('Configuring Inbound Email'); + return PhabricatorEnv::getDoclink('Configuring Inbound Email'); } public function getAppEmailBlurb() { diff --git a/src/applications/calendar/__tests__/CalendarTimeUtilTestCase.php b/src/applications/calendar/__tests__/CalendarTimeUtilTestCase.php index aa44acec70..646badfe9c 100644 --- a/src/applications/calendar/__tests__/CalendarTimeUtilTestCase.php +++ b/src/applications/calendar/__tests__/CalendarTimeUtilTestCase.php @@ -7,9 +7,7 @@ final class CalendarTimeUtilTestCase extends PhabricatorTestCase { $u->overrideTimezoneIdentifier('America/Los_Angeles'); $days = $this->getAllDays(); foreach ($days as $day) { - $data = CalendarTimeUtil::getCalendarWidgetTimestamps( - $u, - $day); + $data = CalendarTimeUtil::getTimestamps($u, $day, 1); $this->assertEqual( '000000', diff --git a/src/applications/calendar/storage/PhabricatorCalendarExternalInvitee.php b/src/applications/calendar/storage/PhabricatorCalendarExternalInvitee.php index 27a23d1e17..80679a9533 100644 --- a/src/applications/calendar/storage/PhabricatorCalendarExternalInvitee.php +++ b/src/applications/calendar/storage/PhabricatorCalendarExternalInvitee.php @@ -14,7 +14,7 @@ final class PhabricatorCalendarExternalInvitee PhabricatorUser $actor, $event) { return id(new PhabricatorCalendarEventInvitee()) ->setInviterPHID($actor->getPHID()) - ->setStatus(self::STATUS_INVITED) + ->setStatus(PhabricatorCalendarEventInvitee::STATUS_INVITED) ->setEventPHID($event->getPHID()); } diff --git a/src/applications/conduit/controller/PhabricatorConduitController.php b/src/applications/conduit/controller/PhabricatorConduitController.php index 6187421e16..8588bc07f9 100644 --- a/src/applications/conduit/controller/PhabricatorConduitController.php +++ b/src/applications/conduit/controller/PhabricatorConduitController.php @@ -154,7 +154,7 @@ abstract class PhabricatorConduitController extends PhabricatorController { $parts[] = "\n\n"; $parts[] = 'require_once '; - $parts[] = phutil_var_export($libphutil_path, true); + $parts[] = phutil_var_export($libphutil_path); $parts[] = ";\n\n"; $parts[] = '$api_token = "'; @@ -168,7 +168,7 @@ abstract class PhabricatorConduitController extends PhabricatorController { $parts[] = ');'; } else { $params = $this->simplifyParams($params); - $params = phutil_var_export($params, true); + $params = phutil_var_export($params); $parts[] = phutil_tag('strong', array('class' => 'real'), $params); $parts[] = ';'; } @@ -178,7 +178,7 @@ abstract class PhabricatorConduitController extends PhabricatorController { $parts[] = phutil_tag( 'strong', array('class' => 'real'), - phutil_var_export(PhabricatorEnv::getURI('/'), true)); + phutil_var_export(PhabricatorEnv::getURI('/'))); $parts[] = ");\n"; $parts[] = '$client->setConduitToken($api_token);'; @@ -188,7 +188,7 @@ abstract class PhabricatorConduitController extends PhabricatorController { $parts[] = phutil_tag( 'strong', array('class' => 'real'), - phutil_var_export($method->getAPIMethodName(), true)); + phutil_var_export($method->getAPIMethodName())); $parts[] = ', '; $parts[] = '$api_parameters'; $parts[] = ");\n"; diff --git a/src/applications/config/check/PhabricatorDaemonsSetupCheck.php b/src/applications/config/check/PhabricatorDaemonsSetupCheck.php index 1802e608e9..46ee4efe77 100644 --- a/src/applications/config/check/PhabricatorDaemonsSetupCheck.php +++ b/src/applications/config/check/PhabricatorDaemonsSetupCheck.php @@ -16,7 +16,7 @@ final class PhabricatorDaemonsSetupCheck extends PhabricatorSetupCheck { ->execute(); if (!$task_daemon) { - $doc_href = PhabricatorEnv::getDocLink('Managing Daemons with phd'); + $doc_href = PhabricatorEnv::getDoclink('Managing Daemons with phd'); $summary = pht( 'You must start the Phabricator daemons to send email, rebuild '. diff --git a/src/applications/config/check/PhabricatorPHPConfigSetupCheck.php b/src/applications/config/check/PhabricatorPHPConfigSetupCheck.php index 1dd3add94d..5382a27b7a 100644 --- a/src/applications/config/check/PhabricatorPHPConfigSetupCheck.php +++ b/src/applications/config/check/PhabricatorPHPConfigSetupCheck.php @@ -14,7 +14,7 @@ final class PhabricatorPHPConfigSetupCheck extends PhabricatorSetupCheck { protected function executeChecks() { if (empty($_SERVER['REMOTE_ADDR'])) { - $doc_href = PhabricatorEnv::getDocLink('Configuring a Preamble Script'); + $doc_href = PhabricatorEnv::getDoclink('Configuring a Preamble Script'); $summary = pht( 'You likely need to fix your preamble script so '. diff --git a/src/applications/config/check/PhabricatorSecuritySetupCheck.php b/src/applications/config/check/PhabricatorSecuritySetupCheck.php index d7ae7db53a..518f6c7d54 100644 --- a/src/applications/config/check/PhabricatorSecuritySetupCheck.php +++ b/src/applications/config/check/PhabricatorSecuritySetupCheck.php @@ -52,7 +52,7 @@ final class PhabricatorSecuritySetupCheck extends PhabricatorSetupCheck { $file_key = 'security.alternate-file-domain'; $file_domain = PhabricatorEnv::getEnvConfig($file_key); if (!$file_domain) { - $doc_href = PhabricatorEnv::getDocLink('Configuring a File Domain'); + $doc_href = PhabricatorEnv::getDoclink('Configuring a File Domain'); $this->newIssue('security.'.$file_key) ->setName(pht('Alternate File Domain Not Configured')) diff --git a/src/applications/config/check/PhabricatorStorageSetupCheck.php b/src/applications/config/check/PhabricatorStorageSetupCheck.php index 9ec753da05..09cecfe6d0 100644 --- a/src/applications/config/check/PhabricatorStorageSetupCheck.php +++ b/src/applications/config/check/PhabricatorStorageSetupCheck.php @@ -16,7 +16,7 @@ final class PhabricatorStorageSetupCheck extends PhabricatorSetupCheck { $this->checkS3(); if (!$chunk_engine_active) { - $doc_href = PhabricatorEnv::getDocLink('Configuring File Storage'); + $doc_href = PhabricatorEnv::getDoclink('Configuring File Storage'); $message = pht( 'Large file storage has not been configured, which will limit '. diff --git a/src/applications/config/controller/PhabricatorConfigClusterDatabasesController.php b/src/applications/config/controller/PhabricatorConfigClusterDatabasesController.php index 8753531c7e..03dfa3f64c 100644 --- a/src/applications/config/controller/PhabricatorConfigClusterDatabasesController.php +++ b/src/applications/config/controller/PhabricatorConfigClusterDatabasesController.php @@ -21,7 +21,7 @@ final class PhabricatorConfigClusterDatabasesController ->setText(pht('Documentation'))); $crumbs = $this - ->buildApplicationCrumbs($nav) + ->buildApplicationCrumbs() ->addTextCrumb($title) ->setBorder(true); diff --git a/src/applications/config/controller/PhabricatorConfigClusterNotificationsController.php b/src/applications/config/controller/PhabricatorConfigClusterNotificationsController.php index d0d26d0613..47ab022831 100644 --- a/src/applications/config/controller/PhabricatorConfigClusterNotificationsController.php +++ b/src/applications/config/controller/PhabricatorConfigClusterNotificationsController.php @@ -21,7 +21,7 @@ final class PhabricatorConfigClusterNotificationsController ->setText(pht('Documentation'))); $crumbs = $this - ->buildApplicationCrumbs($nav) + ->buildApplicationCrumbs() ->addTextCrumb($title) ->setBorder(true); diff --git a/src/applications/config/controller/PhabricatorConfigClusterRepositoriesController.php b/src/applications/config/controller/PhabricatorConfigClusterRepositoriesController.php index b3fd9915b1..3531c916a4 100644 --- a/src/applications/config/controller/PhabricatorConfigClusterRepositoriesController.php +++ b/src/applications/config/controller/PhabricatorConfigClusterRepositoriesController.php @@ -22,7 +22,7 @@ final class PhabricatorConfigClusterRepositoriesController ->setText(pht('Documentation'))); $crumbs = $this - ->buildApplicationCrumbs($nav) + ->buildApplicationCrumbs() ->addTextCrumb(pht('Repository Servers')) ->setBorder(true); diff --git a/src/applications/config/controller/PhabricatorConfigIssueListController.php b/src/applications/config/controller/PhabricatorConfigIssueListController.php index 7e4ee758f6..869f53c223 100644 --- a/src/applications/config/controller/PhabricatorConfigIssueListController.php +++ b/src/applications/config/controller/PhabricatorConfigIssueListController.php @@ -49,7 +49,7 @@ final class PhabricatorConfigIssueListController ->setProfileHeader(true); $crumbs = $this - ->buildApplicationCrumbs($nav) + ->buildApplicationCrumbs() ->addTextCrumb(pht('Setup Issues')) ->setBorder(true); diff --git a/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php b/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php index 41133d5ede..75d3e8ad6d 100644 --- a/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php +++ b/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php @@ -20,7 +20,7 @@ final class PhabricatorSyntaxHighlightingConfigOptions } public function getOptions() { - $caches_href = PhabricatorEnv::getDocLink('Managing Caches'); + $caches_href = PhabricatorEnv::getDoclink('Managing Caches'); return array( $this->newOption( diff --git a/src/applications/config/schema/PhabricatorConfigKeySchema.php b/src/applications/config/schema/PhabricatorConfigKeySchema.php index b30a3641e9..566df54601 100644 --- a/src/applications/config/schema/PhabricatorConfigKeySchema.php +++ b/src/applications/config/schema/PhabricatorConfigKeySchema.php @@ -9,6 +9,7 @@ final class PhabricatorConfigKeySchema private $unique; private $table; private $indexType; + private $property; public function setIndexType($index_type) { $this->indexType = $index_type; diff --git a/src/applications/conpherence/conduit/ConpherenceCreateThreadConduitAPIMethod.php b/src/applications/conpherence/conduit/ConpherenceCreateThreadConduitAPIMethod.php index 85f450a648..9cae87e10a 100644 --- a/src/applications/conpherence/conduit/ConpherenceCreateThreadConduitAPIMethod.php +++ b/src/applications/conpherence/conduit/ConpherenceCreateThreadConduitAPIMethod.php @@ -50,9 +50,6 @@ final class ConpherenceCreateThreadConduitAPIMethod if ($errors) { foreach ($errors as $error_code) { switch ($error_code) { - case ConpherenceEditor::ERROR_EMPTY_TITLE: - throw new ConduitException('ERR_EMPTY_TITLE'); - break; case ConpherenceEditor::ERROR_EMPTY_PARTICIPANTS: throw new ConduitException('ERR_EMPTY_PARTICIPANT_PHIDS'); break; diff --git a/src/applications/dashboard/controller/PhabricatorDashboardManageController.php b/src/applications/dashboard/controller/PhabricatorDashboardManageController.php index 60b47d6361..39a7e46841 100644 --- a/src/applications/dashboard/controller/PhabricatorDashboardManageController.php +++ b/src/applications/dashboard/controller/PhabricatorDashboardManageController.php @@ -36,7 +36,7 @@ final class PhabricatorDashboardManageController $crumbs->addTextCrumb(pht('Manage')); $header = $this->buildHeaderView(); - $curtain = $this->buildCurtainview($dashboard); + $curtain = $this->buildCurtainView($dashboard); $properties = $this->buildPropertyView($dashboard); $timeline = $this->buildTransactionTimeline( diff --git a/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php b/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php index 26aa24cb0c..dfe328933a 100644 --- a/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php +++ b/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php @@ -88,7 +88,6 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject { public function renderPanel() { $panel = $this->getPanel(); - $viewer = $this->getViewer(); if (!$panel) { return $this->renderErrorPanel( @@ -117,7 +116,7 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject { } } - return $this->renderNormalPanel($viewer, $panel, $this); + return $this->renderNormalPanel(); } catch (Exception $ex) { return $this->renderErrorPanel( $panel->getName(), diff --git a/src/applications/differential/customfield/DifferentialCustomField.php b/src/applications/differential/customfield/DifferentialCustomField.php index 487e412f66..0382034a0e 100644 --- a/src/applications/differential/customfield/DifferentialCustomField.php +++ b/src/applications/differential/customfield/DifferentialCustomField.php @@ -111,8 +111,8 @@ abstract class DifferentialCustomField * @task diff */ public function renderDiffPropertyViewLabel(DifferentialDiff $diff) { - if ($this->proxy) { - return $this->proxy->renderDiffPropertyViewLabel($diff); + if ($this->getProxy()) { + return $this->getProxy()->renderDiffPropertyViewLabel($diff); } return $this->getFieldName(); } @@ -122,8 +122,8 @@ abstract class DifferentialCustomField * @task diff */ public function renderDiffPropertyViewValue(DifferentialDiff $diff) { - if ($this->proxy) { - return $this->proxy->renderDiffPropertyViewValue($diff); + if ($this->getProxy()) { + return $this->getProxy()->renderDiffPropertyViewValue($diff); } throw new PhabricatorCustomFieldImplementationIncompleteException($this); } diff --git a/src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php b/src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php index b9fec508c5..64570bf2cc 100644 --- a/src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php +++ b/src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php @@ -20,7 +20,7 @@ final class DifferentialRevisionRequiredActionResultBucket $this->objects = $objects; - $phids = $query->getEvaluatedParameter('responsiblePHIDs', array()); + $phids = $query->getEvaluatedParameter('responsiblePHIDs'); if (!$phids) { throw new Exception( pht( diff --git a/src/applications/diffusion/conduit/DiffusionDiffQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionDiffQueryConduitAPIMethod.php index d8ce38b5d5..694d4bc012 100644 --- a/src/applications/diffusion/conduit/DiffusionDiffQueryConduitAPIMethod.php +++ b/src/applications/diffusion/conduit/DiffusionDiffQueryConduitAPIMethod.php @@ -201,7 +201,7 @@ final class DiffusionDiffQueryConduitAPIMethod $effective_commit = $this->getEffectiveCommit($request); if (!$effective_commit) { - return $this->getEmptyResult(1); + return $this->getEmptyResult(); } $raw_query = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest) @@ -209,7 +209,7 @@ final class DiffusionDiffQueryConduitAPIMethod $raw_diff = $raw_query->executeInline(); if (!$raw_diff) { - return $this->getEmptyResult(2); + return $this->getEmptyResult(); } $parser = $this->getDefaultParser(); diff --git a/src/applications/diffusion/controller/DiffusionBrowseController.php b/src/applications/diffusion/controller/DiffusionBrowseController.php index f9d7b6792f..aa8e370e25 100644 --- a/src/applications/diffusion/controller/DiffusionBrowseController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseController.php @@ -44,7 +44,7 @@ final class DiffusionBrowseController extends DiffusionController { $is_file = ($reason == DiffusionBrowseResultSet::REASON_IS_FILE); if ($is_file) { - return $this->browseFile($results); + return $this->browseFile(); } else { $paths = $results->getPaths(); $paths = $pager->sliceResults($paths); diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php index 61c17e0877..eb46211d99 100644 --- a/src/applications/diffusion/controller/DiffusionController.php +++ b/src/applications/diffusion/controller/DiffusionController.php @@ -357,7 +357,7 @@ abstract class DiffusionController extends PhabricatorController { $stable_commit = $drequest->getStableCommit(); $stable_commit_hash = PhabricatorHash::digestForIndex($stable_commit); - $readme_path_hash = PhabricatorHash::digestForindex($readme_path); + $readme_path_hash = PhabricatorHash::digestForIndex($readme_path); $cache = PhabricatorCaches::getMutableStructureCache(); $cache_key = "diffusion". diff --git a/src/applications/diffusion/controller/DiffusionHistoryController.php b/src/applications/diffusion/controller/DiffusionHistoryController.php index eca8fe2a2f..c9df551c43 100644 --- a/src/applications/diffusion/controller/DiffusionHistoryController.php +++ b/src/applications/diffusion/controller/DiffusionHistoryController.php @@ -59,7 +59,7 @@ final class DiffusionHistoryController extends DiffusionController { ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setTable($history_table); - $header = $this->buildHeader($drequest, $repository); + $header = $this->buildHeader($drequest); $crumbs = $this->buildCrumbs( array( diff --git a/src/applications/diffusion/management/DiffusionRepositoryStatusManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryStatusManagementPanel.php index 0fb220c385..324338443d 100644 --- a/src/applications/diffusion/management/DiffusionRepositoryStatusManagementPanel.php +++ b/src/applications/diffusion/management/DiffusionRepositoryStatusManagementPanel.php @@ -241,7 +241,7 @@ final class DiffusionRepositoryStatusManagementPanel } } - $doc_href = PhabricatorEnv::getDocLink('Managing Daemons with phd'); + $doc_href = PhabricatorEnv::getDoclink('Managing Daemons with phd'); $daemon_instructions = pht( 'Use %s to start daemons. See %s.', diff --git a/src/applications/diffusion/query/DiffusionCommitRequiredActionResultBucket.php b/src/applications/diffusion/query/DiffusionCommitRequiredActionResultBucket.php index 41840bcb72..40bc63025d 100644 --- a/src/applications/diffusion/query/DiffusionCommitRequiredActionResultBucket.php +++ b/src/applications/diffusion/query/DiffusionCommitRequiredActionResultBucket.php @@ -17,7 +17,7 @@ final class DiffusionCommitRequiredActionResultBucket $this->objects = $objects; - $phids = $query->getEvaluatedParameter('responsiblePHIDs', array()); + $phids = $query->getEvaluatedParameter('responsiblePHIDs'); if (!$phids) { throw new Exception( pht( diff --git a/src/applications/diviner/atom/DivinerAtom.php b/src/applications/diviner/atom/DivinerAtom.php index 520a51e26b..f7f8d2c4ac 100644 --- a/src/applications/diviner/atom/DivinerAtom.php +++ b/src/applications/diviner/atom/DivinerAtom.php @@ -43,7 +43,7 @@ final class DivinerAtom extends Phobject { $this->getContext(), $this->getName(), $this->getFile(), - sprintf('%08', $this->getLine()), + sprintf('%08d', $this->getLine()), )); } diff --git a/src/applications/diviner/renderer/DivinerDefaultRenderer.php b/src/applications/diviner/renderer/DivinerDefaultRenderer.php index 6ec70f2a3c..a4c551e93d 100644 --- a/src/applications/diviner/renderer/DivinerDefaultRenderer.php +++ b/src/applications/diviner/renderer/DivinerDefaultRenderer.php @@ -94,7 +94,7 @@ final class DivinerDefaultRenderer extends DivinerRenderer { $this->pushAtomStack($atom); $description = $engine->markupText($text); - $this->popAtomStack($atom); + $this->popAtomStack(); return phutil_tag( 'div', diff --git a/src/applications/diviner/workflow/DivinerWorkflow.php b/src/applications/diviner/workflow/DivinerWorkflow.php index 152910a477..69fcc67f48 100644 --- a/src/applications/diviner/workflow/DivinerWorkflow.php +++ b/src/applications/diviner/workflow/DivinerWorkflow.php @@ -61,7 +61,7 @@ abstract class DivinerWorkflow extends PhabricatorManagementWorkflow { } foreach (idx($book, 'groups', array()) as $group) { - PhutilTypeSpec::checkmap( + PhutilTypeSpec::checkMap( $group, array( 'name' => 'string', diff --git a/src/applications/herald/controller/HeraldController.php b/src/applications/herald/controller/HeraldController.php index 355d3b90f9..1a5d2084dd 100644 --- a/src/applications/herald/controller/HeraldController.php +++ b/src/applications/herald/controller/HeraldController.php @@ -3,7 +3,7 @@ abstract class HeraldController extends PhabricatorController { public function buildApplicationMenu() { - return $this->buildSideNavView(true)->getMenu(); + return $this->buildSideNavView()->getMenu(); } protected function buildApplicationCrumbs() { diff --git a/src/applications/herald/query/HeraldRuleQuery.php b/src/applications/herald/query/HeraldRuleQuery.php index e2c5f6928b..88df18db24 100644 --- a/src/applications/herald/query/HeraldRuleQuery.php +++ b/src/applications/herald/query/HeraldRuleQuery.php @@ -40,11 +40,6 @@ final class HeraldRuleQuery extends PhabricatorCursorPagedPolicyAwareQuery { return $this; } - public function withExecutableRules($executable) { - $this->executable = $executable; - return $this; - } - public function withDisabled($disabled) { $this->disabled = $disabled; return $this; diff --git a/src/applications/legalpad/controller/LegalpadDocumentEditController.php b/src/applications/legalpad/controller/LegalpadDocumentEditController.php index 3804885edb..8f84f60339 100644 --- a/src/applications/legalpad/controller/LegalpadDocumentEditController.php +++ b/src/applications/legalpad/controller/LegalpadDocumentEditController.php @@ -213,7 +213,7 @@ final class LegalpadDocumentEditController extends LegalpadController { ->setPolicies($policies) ->setName('can_edit')); - $crumbs = $this->buildApplicationCrumbs($this->buildSideNav()); + $crumbs = $this->buildApplicationCrumbs(); $submit = new AphrontFormSubmitControl(); if ($is_create) { $submit->setValue(pht('Create Document')); diff --git a/src/applications/legalpad/controller/LegalpadDocumentManageController.php b/src/applications/legalpad/controller/LegalpadDocumentManageController.php index 1a39f2c143..6d9360a731 100644 --- a/src/applications/legalpad/controller/LegalpadDocumentManageController.php +++ b/src/applications/legalpad/controller/LegalpadDocumentManageController.php @@ -54,7 +54,7 @@ final class LegalpadDocumentManageController extends LegalpadController { $add_comment = $this->buildAddCommentView($document, $comment_form_id); - $crumbs = $this->buildApplicationCrumbs($this->buildSideNav()); + $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb( $document->getMonogram(), '/'.$document->getMonogram()); diff --git a/src/applications/legalpad/storage/LegalpadDocumentBody.php b/src/applications/legalpad/storage/LegalpadDocumentBody.php index a55583428c..a3fdf20f5f 100644 --- a/src/applications/legalpad/storage/LegalpadDocumentBody.php +++ b/src/applications/legalpad/storage/LegalpadDocumentBody.php @@ -52,9 +52,6 @@ final class LegalpadDocumentBody extends LegalpadDAO case self::MARKUP_FIELD_TEXT: $text = $this->getText(); break; - case self::MARKUP_FIELD_TITLE: - $text = $this->getTitle(); - break; default: throw new Exception(pht('Unknown field: %s', $field)); break; diff --git a/src/applications/lipsum/generator/PhabricatorTestDataGenerator.php b/src/applications/lipsum/generator/PhabricatorTestDataGenerator.php index b44895ae87..2617c755df 100644 --- a/src/applications/lipsum/generator/PhabricatorTestDataGenerator.php +++ b/src/applications/lipsum/generator/PhabricatorTestDataGenerator.php @@ -98,8 +98,10 @@ abstract class PhabricatorTestDataGenerator extends Phobject { ->loadOneWhere('1 = 1 ORDER BY RAND() LIMIT 1'); } catch (PhutilMissingSymbolException $ex) { throw new PhutilMissingSymbolException( + $classname, + pht('class'), pht( - 'Unable to load symbol %s: this class does not exit.', + 'Unable to load symbol %s: this class does not exist.', $classname)); } } diff --git a/src/applications/maniphest/controller/ManiphestController.php b/src/applications/maniphest/controller/ManiphestController.php index 17ba6cb548..c80a1a462a 100644 --- a/src/applications/maniphest/controller/ManiphestController.php +++ b/src/applications/maniphest/controller/ManiphestController.php @@ -3,7 +3,7 @@ abstract class ManiphestController extends PhabricatorController { public function buildApplicationMenu() { - return $this->buildSideNavView(true)->getMenu(); + return $this->buildSideNavView()->getMenu(); } public function buildSideNavView() { diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php index ca0fe5466e..369986705c 100644 --- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php +++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php @@ -219,7 +219,7 @@ final class ManiphestTaskDetailController extends ManiphestController { $status = $task->getStatus(); $status_name = ManiphestTaskStatus::renderFullDescription( - $status, $priority_name, $priority_color); + $status, $priority_name); $view->addProperty(PHUIHeaderView::PROPERTY_STATUS, $status_name); $view->setHeaderIcon(ManiphestTaskStatus::getStatusIcon( diff --git a/src/applications/maniphest/field/ManiphestConfiguredCustomField.php b/src/applications/maniphest/field/ManiphestConfiguredCustomField.php index 9e6b4f038b..68c20c70bc 100644 --- a/src/applications/maniphest/field/ManiphestConfiguredCustomField.php +++ b/src/applications/maniphest/field/ManiphestConfiguredCustomField.php @@ -10,8 +10,7 @@ final class ManiphestConfiguredCustomField public function createFields($object) { $config = PhabricatorEnv::getEnvConfig( - 'maniphest.custom-field-definitions', - array()); + 'maniphest.custom-field-definitions'); $fields = PhabricatorStandardCustomField::buildStandardFields( $this, $config); diff --git a/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerAdapter.php b/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerAdapter.php index 8f7e809d6c..2fadd6491f 100644 --- a/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerAdapter.php +++ b/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerAdapter.php @@ -15,7 +15,7 @@ final class PhabricatorMailImplementationPHPMailerAdapter $this->mailer = new PHPMailer($use_exceptions = true); $this->mailer->CharSet = 'utf-8'; - $encoding = PhabricatorEnv::getEnvConfig('phpmailer.smtp-encoding', '8bit'); + $encoding = PhabricatorEnv::getEnvConfig('phpmailer.smtp-encoding'); $this->mailer->Encoding = $encoding; // By default, PHPMailer sends one mail per recipient. We handle diff --git a/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerLiteAdapter.php b/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerLiteAdapter.php index 2a8b12b64a..f072e769c3 100644 --- a/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerLiteAdapter.php +++ b/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerLiteAdapter.php @@ -18,7 +18,7 @@ class PhabricatorMailImplementationPHPMailerLiteAdapter $this->mailer = new PHPMailerLite($use_exceptions = true); $this->mailer->CharSet = 'utf-8'; - $encoding = PhabricatorEnv::getEnvConfig('phpmailer.smtp-encoding', '8bit'); + $encoding = PhabricatorEnv::getEnvConfig('phpmailer.smtp-encoding'); $this->mailer->Encoding = $encoding; // By default, PHPMailerLite sends one mail per recipient. We handle diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAAttachment.php b/src/applications/metamta/storage/PhabricatorMetaMTAAttachment.php index 96d2f50f0a..b26bb0b8a7 100644 --- a/src/applications/metamta/storage/PhabricatorMetaMTAAttachment.php +++ b/src/applications/metamta/storage/PhabricatorMetaMTAAttachment.php @@ -41,7 +41,7 @@ final class PhabricatorMetaMTAAttachment extends Phobject { public function toDictionary() { return array( 'filename' => $this->getFilename(), - 'mimetype' => $this->getMimetype(), + 'mimetype' => $this->getMimeType(), 'data' => $this->getData(), ); } diff --git a/src/applications/owners/customfield/PhabricatorOwnersConfiguredCustomField.php b/src/applications/owners/customfield/PhabricatorOwnersConfiguredCustomField.php index a35296311f..092ebf41cc 100644 --- a/src/applications/owners/customfield/PhabricatorOwnersConfiguredCustomField.php +++ b/src/applications/owners/customfield/PhabricatorOwnersConfiguredCustomField.php @@ -9,9 +9,7 @@ final class PhabricatorOwnersConfiguredCustomField } public function createFields($object) { - $config = PhabricatorEnv::getEnvConfig( - 'owners.custom-field-definitions', - array()); + $config = PhabricatorEnv::getEnvConfig('owners.custom-field-definitions'); $fields = PhabricatorStandardCustomField::buildStandardFields( $this, diff --git a/src/applications/paste/query/PhabricatorPasteQuery.php b/src/applications/paste/query/PhabricatorPasteQuery.php index 110083a64e..7ecd83447a 100644 --- a/src/applications/paste/query/PhabricatorPasteQuery.php +++ b/src/applications/paste/query/PhabricatorPasteQuery.php @@ -292,7 +292,7 @@ final class PhabricatorPasteQuery foreach ($pastes as $paste) { $key = $this->getSnippetCacheKey($paste); if (isset($caches[$key])) { - $snippet_data = phutil_json_decode($caches[$key], true); + $snippet_data = phutil_json_decode($caches[$key]); $snippet = new PhabricatorPasteSnippet( phutil_safe_html($snippet_data['content']), $snippet_data['type'], diff --git a/src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php b/src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php index 931a78df96..56fc913558 100644 --- a/src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php +++ b/src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php @@ -15,7 +15,7 @@ final class PhabricatorPasteTitleTransaction public function getTitle() { $old = $this->getOldValue(); - $new = $this->getNeWValue(); + $new = $this->getNewValue(); if (strlen($old) && strlen($new)) { return pht( @@ -38,7 +38,7 @@ final class PhabricatorPasteTitleTransaction public function getTitleForFeed() { $old = $this->getOldValue(); - $new = $this->getNeWValue(); + $new = $this->getNewValue(); if (strlen($old) && strlen($new)) { return pht( diff --git a/src/applications/people/customfield/PhabricatorUserConfiguredCustomField.php b/src/applications/people/customfield/PhabricatorUserConfiguredCustomField.php index 9c58b970bb..800ea320c3 100644 --- a/src/applications/people/customfield/PhabricatorUserConfiguredCustomField.php +++ b/src/applications/people/customfield/PhabricatorUserConfiguredCustomField.php @@ -11,7 +11,7 @@ final class PhabricatorUserConfiguredCustomField public function createFields($object) { return PhabricatorStandardCustomField::buildStandardFields( $this, - PhabricatorEnv::getEnvConfig('user.custom-field-definitions', array())); + PhabricatorEnv::getEnvConfig('user.custom-field-definitions')); } public function newStorageObject() { diff --git a/src/applications/phame/storage/PhamePost.php b/src/applications/phame/storage/PhamePost.php index fb959e61f7..6e9e005bfa 100644 --- a/src/applications/phame/storage/PhamePost.php +++ b/src/applications/phame/storage/PhamePost.php @@ -172,7 +172,7 @@ final class PhamePost extends PhameDAO } public function getSlug() { - return PhabricatorSlug::normalizeProjectSlug($this->getTitle(), true); + return PhabricatorSlug::normalizeProjectSlug($this->getTitle()); } public function getHeaderImageURI() { diff --git a/src/applications/phid/utils.php b/src/applications/phid/utils.php index d667473190..152a547284 100644 --- a/src/applications/phid/utils.php +++ b/src/applications/phid/utils.php @@ -5,7 +5,7 @@ * PhabricatorPHIDConstants::PHID_TYPE_UNKNOWN if it fails to look up the type * * @param phid Anything. - * @return A value from PhabricatorPHIDConstants (ideally) + * @return string A value from PhabricatorPHIDConstants (ideally) */ function phid_get_type($phid) { $matches = null; diff --git a/src/applications/pholio/controller/PholioMockViewController.php b/src/applications/pholio/controller/PholioMockViewController.php index a1fb40c86b..2ab31d0d96 100644 --- a/src/applications/pholio/controller/PholioMockViewController.php +++ b/src/applications/pholio/controller/PholioMockViewController.php @@ -67,7 +67,7 @@ final class PholioMockViewController extends PholioController { $timeline->setMock($mock); $curtain = $this->buildCurtainView($mock); - $details = $this->buildDescriptionView($mock, $engine); + $details = $this->buildDescriptionView($mock); require_celerity_resource('pholio-css'); require_celerity_resource('pholio-inline-comments-css'); diff --git a/src/applications/phragment/storage/PhragmentFragment.php b/src/applications/phragment/storage/PhragmentFragment.php index af733ab730..0f04783419 100644 --- a/src/applications/phragment/storage/PhragmentFragment.php +++ b/src/applications/phragment/storage/PhragmentFragment.php @@ -10,6 +10,7 @@ final class PhragmentFragment extends PhragmentDAO protected $editPolicy; private $latestVersion = self::ATTACHABLE; + private $file = self::ATTACHABLE; protected function getConfiguration() { return array( diff --git a/src/applications/phriction/conduit/PhrictionInfoConduitAPIMethod.php b/src/applications/phriction/conduit/PhrictionInfoConduitAPIMethod.php index 60d9ece734..360b3e7b93 100644 --- a/src/applications/phriction/conduit/PhrictionInfoConduitAPIMethod.php +++ b/src/applications/phriction/conduit/PhrictionInfoConduitAPIMethod.php @@ -38,9 +38,7 @@ final class PhrictionInfoConduitAPIMethod extends PhrictionConduitAPIMethod { throw new ConduitException('ERR-BAD-DOCUMENT'); } - return $this->buildDocumentInfoDictionary( - $document, - $document->getContent()); + return $this->buildDocumentInfoDictionary($document); } } diff --git a/src/applications/policy/controller/PhabricatorPolicyExplainController.php b/src/applications/policy/controller/PhabricatorPolicyExplainController.php index 45ac0ee5e1..da4103765b 100644 --- a/src/applications/policy/controller/PhabricatorPolicyExplainController.php +++ b/src/applications/policy/controller/PhabricatorPolicyExplainController.php @@ -85,7 +85,7 @@ final class PhabricatorPolicyExplainController return null; } - if (!PhabricatorSpacesNamespaceQuery::getSpacesExist($viewer)) { + if (!PhabricatorSpacesNamespaceQuery::getSpacesExist()) { return null; } diff --git a/src/applications/ponder/controller/PonderQuestionViewController.php b/src/applications/ponder/controller/PonderQuestionViewController.php index 529c396328..59da519834 100644 --- a/src/applications/ponder/controller/PonderQuestionViewController.php +++ b/src/applications/ponder/controller/PonderQuestionViewController.php @@ -83,7 +83,7 @@ final class PonderQuestionViewController extends PonderController { ->setContentID($content_id) ->setCount(count($xactions)); - $crumbs = $this->buildApplicationCrumbs($this->buildSideNavView()); + $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb('Q'.$id, '/Q'.$id); $crumbs->setBorder(true); diff --git a/src/applications/project/controller/PhabricatorProjectMembersAddController.php b/src/applications/project/controller/PhabricatorProjectMembersAddController.php index a3b89e46fd..79c66dc5b1 100644 --- a/src/applications/project/controller/PhabricatorProjectMembersAddController.php +++ b/src/applications/project/controller/PhabricatorProjectMembersAddController.php @@ -48,7 +48,7 @@ final class PhabricatorProjectMembersAddController '+' => array_fuse($member_phids), )); - $editor = id(new PhabricatorProjectTransactionEditor($project)) + $editor = id(new PhabricatorProjectTransactionEditor()) ->setActor($viewer) ->setContentSourceFromRequest($request) ->setContinueOnNoEffect(true) diff --git a/src/applications/project/controller/PhabricatorProjectMembersRemoveController.php b/src/applications/project/controller/PhabricatorProjectMembersRemoveController.php index ea41ea7113..029d4374b6 100644 --- a/src/applications/project/controller/PhabricatorProjectMembersRemoveController.php +++ b/src/applications/project/controller/PhabricatorProjectMembersRemoveController.php @@ -49,7 +49,7 @@ final class PhabricatorProjectMembersRemoveController '-' => array($remove_phid => $remove_phid), )); - $editor = id(new PhabricatorProjectTransactionEditor($project)) + $editor = id(new PhabricatorProjectTransactionEditor()) ->setActor($viewer) ->setContentSourceFromRequest($request) ->setContinueOnNoEffect(true) diff --git a/src/applications/project/controller/PhabricatorProjectSilenceController.php b/src/applications/project/controller/PhabricatorProjectSilenceController.php index 6edd9bab39..ead0a83da2 100644 --- a/src/applications/project/controller/PhabricatorProjectSilenceController.php +++ b/src/applications/project/controller/PhabricatorProjectSilenceController.php @@ -53,7 +53,7 @@ final class PhabricatorProjectSilenceController $edge_action => array($viewer_phid => $viewer_phid), )); - $editor = id(new PhabricatorProjectTransactionEditor($project)) + $editor = id(new PhabricatorProjectTransactionEditor()) ->setActor($viewer) ->setContentSourceFromRequest($request) ->setContinueOnNoEffect(true) diff --git a/src/applications/project/controller/PhabricatorProjectUpdateController.php b/src/applications/project/controller/PhabricatorProjectUpdateController.php index 9f8c204c55..7cbd77b4cb 100644 --- a/src/applications/project/controller/PhabricatorProjectUpdateController.php +++ b/src/applications/project/controller/PhabricatorProjectUpdateController.php @@ -67,7 +67,7 @@ final class PhabricatorProjectUpdateController ->setMetadataValue('edge:type', $type_member) ->setNewValue($member_spec); - $editor = id(new PhabricatorProjectTransactionEditor($project)) + $editor = id(new PhabricatorProjectTransactionEditor()) ->setActor($viewer) ->setContentSourceFromRequest($request) ->setContinueOnNoEffect(true) diff --git a/src/applications/project/controller/PhabricatorProjectWatchController.php b/src/applications/project/controller/PhabricatorProjectWatchController.php index 00117768e1..cc83f782c6 100644 --- a/src/applications/project/controller/PhabricatorProjectWatchController.php +++ b/src/applications/project/controller/PhabricatorProjectWatchController.php @@ -64,7 +64,7 @@ final class PhabricatorProjectWatchController ->setMetadataValue('edge:type', $type_watcher) ->setNewValue($member_spec); - $editor = id(new PhabricatorProjectTransactionEditor($project)) + $editor = id(new PhabricatorProjectTransactionEditor()) ->setActor($viewer) ->setContentSourceFromRequest($request) ->setContinueOnNoEffect(true) diff --git a/src/applications/project/customfield/PhabricatorProjectConfiguredCustomField.php b/src/applications/project/customfield/PhabricatorProjectConfiguredCustomField.php index 6ee623147d..864aa76a24 100644 --- a/src/applications/project/customfield/PhabricatorProjectConfiguredCustomField.php +++ b/src/applications/project/customfield/PhabricatorProjectConfiguredCustomField.php @@ -11,9 +11,7 @@ final class PhabricatorProjectConfiguredCustomField public function createFields($object) { return PhabricatorStandardCustomField::buildStandardFields( $this, - PhabricatorEnv::getEnvConfig( - 'projects.custom-field-definitions', - array())); + PhabricatorEnv::getEnvConfig('projects.custom-field-definitions')); } } diff --git a/src/applications/project/icon/PhabricatorProjectIconSet.php b/src/applications/project/icon/PhabricatorProjectIconSet.php index 7e48cdfd74..2283026598 100644 --- a/src/applications/project/icon/PhabricatorProjectIconSet.php +++ b/src/applications/project/icon/PhabricatorProjectIconSet.php @@ -269,7 +269,7 @@ final class PhabricatorProjectIconSet 'The project icon ("%s") with special attribute "%s" must '. 'not be disabled', $key, - self::SPECIAL_MIILESTONE)); + self::SPECIAL_MILESTONE)); } $milestone = $value; } else { diff --git a/src/applications/releeph/query/ReleephRequestQuery.php b/src/applications/releeph/query/ReleephRequestQuery.php index 363a3b05d6..7d4f19e624 100644 --- a/src/applications/releeph/query/ReleephRequestQuery.php +++ b/src/applications/releeph/query/ReleephRequestQuery.php @@ -229,11 +229,11 @@ final class ReleephRequestQuery ); case self::STATUS_NEEDS_REVERT: return array( - ReleephRequestStatus::NEEDS_REVERT, + ReleephRequestStatus::STATUS_NEEDS_REVERT, ); case self::STATUS_REVERTED: return array( - ReleephRequestStatus::REVERTED, + ReleephRequestStatus::STATUS_REVERTED, ); default: throw new Exception(pht("Unknown status '%s'!", $this->status)); diff --git a/src/applications/repository/query/PhabricatorRepositoryURIQuery.php b/src/applications/repository/query/PhabricatorRepositoryURIQuery.php index 330fe769f5..71252a6fb7 100644 --- a/src/applications/repository/query/PhabricatorRepositoryURIQuery.php +++ b/src/applications/repository/query/PhabricatorRepositoryURIQuery.php @@ -30,11 +30,6 @@ final class PhabricatorRepositoryURIQuery return $this; } - public function withObjectHashes(array $hashes) { - $this->objectHashes = $hashes; - return $this; - } - public function newResultObject() { return new PhabricatorRepositoryURI(); } diff --git a/src/applications/repository/storage/PhabricatorRepositoryURI.php b/src/applications/repository/storage/PhabricatorRepositoryURI.php index 1cb3182c16..cbd25b74eb 100644 --- a/src/applications/repository/storage/PhabricatorRepositoryURI.php +++ b/src/applications/repository/storage/PhabricatorRepositoryURI.php @@ -577,7 +577,7 @@ final class PhabricatorRepositoryURI self::IO_READWRITE => 200, self::IO_READ => 100, ); - $score += idx($io_points, $this->getEffectiveIoType(), 0); + $score += idx($io_points, $this->getEffectiveIOType(), 0); $protocol_points = array( self::BUILTIN_PROTOCOL_SSH => 30, diff --git a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php index d5ca8b7a5e..4329509b02 100644 --- a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php +++ b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php @@ -139,7 +139,7 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject { * Executes the saved query. * * @param PhabricatorSavedQuery The saved query to operate on. - * @return The result of the query. + * @return PhabricatorQuery The result of the query. */ public function buildQueryFromSavedQuery(PhabricatorSavedQuery $original) { $saved = clone $original; @@ -469,7 +469,7 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject { public function loadAllNamedQueries() { $viewer = $this->requireViewer(); - $builtin = $this->getBuiltinQueries($viewer); + $builtin = $this->getBuiltinQueries(); if ($this->namedQueries === null) { $named_queries = id(new PhabricatorNamedQueryQuery()) diff --git a/src/applications/search/engine/PhabricatorProfileMenuEngine.php b/src/applications/search/engine/PhabricatorProfileMenuEngine.php index f41424a4e7..4b24e67c6b 100644 --- a/src/applications/search/engine/PhabricatorProfileMenuEngine.php +++ b/src/applications/search/engine/PhabricatorProfileMenuEngine.php @@ -218,7 +218,7 @@ abstract class PhabricatorProfileMenuEngine extends Phobject { $edit_mode = $request->getURIData('itemEditMode'); } - $available_modes = $this->getViewerEditModes($viewer); + $available_modes = $this->getViewerEditModes(); if ($available_modes) { $available_modes = array_fuse($available_modes); if (isset($available_modes[$edit_mode])) { @@ -731,7 +731,7 @@ abstract class PhabricatorProfileMenuEngine extends Phobject { private function buildMenuEditModeContent() { $viewer = $this->getViewer(); - $modes = $this->getViewerEditModes($viewer); + $modes = $this->getViewerEditModes(); if (!$modes) { return new Aphront404Response(); } diff --git a/src/applications/search/storage/PhabricatorSavedQuery.php b/src/applications/search/storage/PhabricatorSavedQuery.php index 5bc8a95915..3f75027888 100644 --- a/src/applications/search/storage/PhabricatorSavedQuery.php +++ b/src/applications/search/storage/PhabricatorSavedQuery.php @@ -59,8 +59,8 @@ final class PhabricatorSavedQuery extends PhabricatorSearchDAO return $this; } - public function getEvaluatedParameter($key, $default = null) { - return $this->assertAttachedKey($this->parameterMap, $key, $default); + public function getEvaluatedParameter($key) { + return $this->assertAttachedKey($this->parameterMap, $key); } diff --git a/src/applications/slowvote/controller/PhabricatorSlowvoteVoteController.php b/src/applications/slowvote/controller/PhabricatorSlowvoteVoteController.php index 2d630bffc1..c69a825c3a 100644 --- a/src/applications/slowvote/controller/PhabricatorSlowvoteVoteController.php +++ b/src/applications/slowvote/controller/PhabricatorSlowvoteVoteController.php @@ -28,7 +28,7 @@ final class PhabricatorSlowvoteVoteController if ($request->isAjax()) { $vote = $request->getInt('vote'); $votes = array_keys($old_votes); - $votes = array_fuse($votes, $votes); + $votes = array_fuse($votes); if ($poll->getMethod() == PhabricatorSlowvotePoll::METHOD_PLURALITY) { if (idx($votes, $vote, false)) { @@ -68,7 +68,7 @@ final class PhabricatorSlowvoteVoteController } $votes = $request->getArr('vote'); - $votes = array_fuse($votes, $votes); + $votes = array_fuse($votes); $this->updateVotes($viewer, $poll, $old_votes, $votes); diff --git a/src/applications/spaces/controller/PhabricatorSpacesListController.php b/src/applications/spaces/controller/PhabricatorSpacesListController.php index fe439b0097..c270171574 100644 --- a/src/applications/spaces/controller/PhabricatorSpacesListController.php +++ b/src/applications/spaces/controller/PhabricatorSpacesListController.php @@ -9,7 +9,7 @@ final class PhabricatorSpacesListController public function handleRequest(AphrontRequest $request) { $request = $this->getRequest(); - $controller = id(new PhabricatorApplicationSearchController($request)) + $controller = id(new PhabricatorApplicationSearchController()) ->setQueryKey($request->getURIData('queryKey')) ->setSearchEngine(new PhabricatorSpacesNamespaceSearchEngine()) ->setNavigation($this->buildSideNavView()); diff --git a/src/applications/tokens/storage/PhabricatorTokensToken.php b/src/applications/tokens/storage/PhabricatorTokensToken.php index 8cd83cd884..50bada38b9 100644 --- a/src/applications/tokens/storage/PhabricatorTokensToken.php +++ b/src/applications/tokens/storage/PhabricatorTokensToken.php @@ -14,6 +14,7 @@ final class PhabricatorTokensToken extends PhabricatorTokenDAO protected $tokenImagePHID; protected $builtinKey; + private $tokenImageFile = self::ATTACHABLE; const STATUS_ACTIVE = 'active'; const STATUS_ARCHIVED = 'archived'; diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php index f69a2cd1bd..996b12bc51 100644 --- a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php +++ b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php @@ -12,6 +12,7 @@ class PhabricatorApplicationTransactionCommentView extends AphrontView { private $previewTimelineID; private $previewToggleID; private $formID; + private $statusID; private $commentID; private $draft; private $requestURI; diff --git a/src/infrastructure/daemon/bot/adapter/PhabricatorStreamingProtocolAdapter.php b/src/infrastructure/daemon/bot/adapter/PhabricatorStreamingProtocolAdapter.php index 52707b1a03..95955c1c2a 100644 --- a/src/infrastructure/daemon/bot/adapter/PhabricatorStreamingProtocolAdapter.php +++ b/src/infrastructure/daemon/bot/adapter/PhabricatorStreamingProtocolAdapter.php @@ -6,11 +6,11 @@ abstract class PhabricatorStreamingProtocolAdapter protected $readHandles; protected $multiHandle; protected $authtoken; + protected $inRooms = array(); private $readBuffers; private $server; private $active; - private $inRooms = array(); public function getServiceName() { $uri = new PhutilURI($this->server); diff --git a/src/infrastructure/storage/lisk/LiskDAO.php b/src/infrastructure/storage/lisk/LiskDAO.php index 0527c3cf1e..c6712ae873 100644 --- a/src/infrastructure/storage/lisk/LiskDAO.php +++ b/src/infrastructure/storage/lisk/LiskDAO.php @@ -242,7 +242,7 @@ abstract class LiskDAO extends Phobject { * Get an existing, cached connection for this object. * * @param mode Connection mode. - * @return AprontDatabaseConnection|null Connection, if it exists in cache. + * @return AphrontDatabaseConnection|null Connection, if it exists in cache. * @task conn */ protected function getEstablishedConnection($mode) { @@ -953,7 +953,7 @@ abstract class LiskDAO extends Phobject { * @param string 'r' for read, 'w' for read/write. * @param bool True to force a new connection. The connection will not * be retrieved from or saved into the connection cache. - * @return LiskDatabaseConnection Lisk connection object. + * @return AphrontDatabaseConnection Lisk connection object. * * @task info */ diff --git a/src/infrastructure/util/password/PhabricatorPasswordHasher.php b/src/infrastructure/util/password/PhabricatorPasswordHasher.php index b7a4c1453b..7972acc0a8 100644 --- a/src/infrastructure/util/password/PhabricatorPasswordHasher.php +++ b/src/infrastructure/util/password/PhabricatorPasswordHasher.php @@ -260,7 +260,7 @@ abstract class PhabricatorPasswordHasher extends Phobject { /** * Get the best (strongest) available hasher. * - * @return PhabicatorPasswordHasher Best hasher. + * @return PhabricatorPasswordHasher Best hasher. * @task hashing */ public static function getBestHasher() { @@ -282,7 +282,7 @@ abstract class PhabricatorPasswordHasher extends Phobject { /** * Get the hashser for a given stored hash. * - * @return PhabicatorPasswordHasher Corresponding hasher. + * @return PhabricatorPasswordHasher Corresponding hasher. * @task hashing */ public static function getHasherForHash(PhutilOpaqueEnvelope $hash) { diff --git a/src/view/form/control/AphrontFormTextAreaControl.php b/src/view/form/control/AphrontFormTextAreaControl.php index 88eed462f3..2665c6aaa7 100644 --- a/src/view/form/control/AphrontFormTextAreaControl.php +++ b/src/view/form/control/AphrontFormTextAreaControl.php @@ -85,7 +85,7 @@ class AphrontFormTextAreaControl extends AphrontFormControl { array( 'name' => $this->getName(), 'disabled' => $this->getDisabled() ? 'disabled' : null, - 'readonly' => $this->getReadonly() ? 'readonly' : null, + 'readonly' => $this->getReadOnly() ? 'readonly' : null, 'class' => $classes, 'style' => $this->getControlStyle(), 'id' => $this->getID(), diff --git a/src/view/layout/AphrontSideNavFilterView.php b/src/view/layout/AphrontSideNavFilterView.php index 87c0d920e8..6564fab196 100644 --- a/src/view/layout/AphrontSideNavFilterView.php +++ b/src/view/layout/AphrontSideNavFilterView.php @@ -105,7 +105,7 @@ final class AphrontSideNavFilterView extends AphrontView { $key, $name, $uri, PHUIListItemView::TYPE_BUTTON); } - private function addThing($key, $name, $uri, $type, $icon) { + private function addThing($key, $name, $uri, $type, $icon = null) { $item = id(new PHUIListItemView()) ->setName($name) ->setType($type); diff --git a/src/view/phui/PHUITimelineView.php b/src/view/phui/PHUITimelineView.php index fa3bd4a69f..20ce5e9e65 100644 --- a/src/view/phui/PHUITimelineView.php +++ b/src/view/phui/PHUITimelineView.php @@ -182,7 +182,7 @@ final class PHUITimelineView extends AphrontView { } if ($this->shouldTerminate) { - $events[] = self::renderEnder(true); + $events[] = self::renderEnder(); } return $events; diff --git a/src/view/phui/calendar/PHUICalendarDayView.php b/src/view/phui/calendar/PHUICalendarDayView.php index 5a2a8ee178..11ebc200e7 100644 --- a/src/view/phui/calendar/PHUICalendarDayView.php +++ b/src/view/phui/calendar/PHUICalendarDayView.php @@ -369,38 +369,4 @@ final class PHUICalendarDayView extends AphrontView { return $date; } - - private function findTodayClusters() { - $events = msort($this->todayEvents, 'getEpochStart'); - $clusters = array(); - - foreach ($events as $event) { - $destination_cluster_key = null; - $event_start = $event->getEpochStart() - (30 * 60); - $event_end = $event->getEpochEnd() + (30 * 60); - - foreach ($clusters as $key => $cluster) { - foreach ($cluster as $clustered_event) { - $compare_event_start = $clustered_event->getEpochStart(); - $compare_event_end = $clustered_event->getEpochEnd(); - - if ($event_start < $compare_event_end - && $event_end > $compare_event_start) { - $destination_cluster_key = $key; - break; - } - } - } - - if ($destination_cluster_key !== null) { - $clusters[$destination_cluster_key][] = $event; - } else { - $next_cluster = array(); - $next_cluster[] = $event; - $clusters[] = $next_cluster; - } - } - - return $clusters; - } } diff --git a/src/view/phui/calendar/PHUICalendarListView.php b/src/view/phui/calendar/PHUICalendarListView.php index bf4726796c..9ce03bcd84 100644 --- a/src/view/phui/calendar/PHUICalendarListView.php +++ b/src/view/phui/calendar/PHUICalendarListView.php @@ -57,7 +57,6 @@ final class PHUICalendarListView extends AphrontTagView { Javelin::initBehavior('phabricator-tooltips'); $singletons = array(); - $allday = false; foreach ($this->events as $event) { $start_epoch = $event->getEpochStart(); @@ -81,7 +80,7 @@ final class PHUICalendarListView extends AphrontTagView { array( 'class' => 'phui-calendar-list-title', ), - $this->getEventTitle($event, $allday)); + $this->getEventTitle($event)); $time = phutil_tag( 'span', array(