From 3b6b523c2b236e3724a1e115f126cb6fd05fa128 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sat, 18 Feb 2017 09:24:19 +0000 Subject: [PATCH] Fix errors found by PHPStan Test Plan: None. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D17376 --- src/lint/ArcanistLintMessage.php | 3 ++- .../xhpast/rules/ArcanistPHPCompatibilityXHPASTLinterRule.php | 2 +- src/repository/api/ArcanistGitAPI.php | 2 +- src/repository/api/ArcanistMercurialAPI.php | 2 +- src/repository/api/ArcanistRepositoryAPI.php | 2 +- src/unit/engine/XUnitTestEngine.php | 4 ++-- src/workflow/ArcanistLandWorkflow.php | 2 +- src/workflow/ArcanistPatchWorkflow.php | 4 ++-- src/workflow/ArcanistWorkflow.php | 2 +- 9 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/lint/ArcanistLintMessage.php b/src/lint/ArcanistLintMessage.php index 29f9ab92..dafc28ba 100644 --- a/src/lint/ArcanistLintMessage.php +++ b/src/lint/ArcanistLintMessage.php @@ -40,7 +40,8 @@ final class ArcanistLintMessage extends Phobject { $message->setGranularity(idx($dict, 'granularity')); $message->setOtherLocations(idx($dict, 'locations', array())); if (isset($dict['bypassChangedLineFiltering'])) { - $message->bypassChangedLineFiltering($dict['bypassChangedLineFiltering']); + $message->setBypassChangedLineFiltering( + $dict['bypassChangedLineFiltering']); } return $message; } diff --git a/src/lint/linter/xhpast/rules/ArcanistPHPCompatibilityXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistPHPCompatibilityXHPASTLinterRule.php index c7790eb2..d73d1fae 100644 --- a/src/lint/linter/xhpast/rules/ArcanistPHPCompatibilityXHPASTLinterRule.php +++ b/src/lint/linter/xhpast/rules/ArcanistPHPCompatibilityXHPASTLinterRule.php @@ -369,7 +369,7 @@ final class ArcanistPHPCompatibilityXHPASTLinterRule } } - $literals = $root->selectDescendantsOftype('n_ARRAY_LITERAL'); + $literals = $root->selectDescendantsOfType('n_ARRAY_LITERAL'); foreach ($literals as $literal) { $open_token = head($literal->getTokens())->getValue(); if ($open_token == '[') { diff --git a/src/repository/api/ArcanistGitAPI.php b/src/repository/api/ArcanistGitAPI.php index 8efe1bce..a316093e 100644 --- a/src/repository/api/ArcanistGitAPI.php +++ b/src/repository/api/ArcanistGitAPI.php @@ -1405,7 +1405,7 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI { * or cycle locally. * * @param string Ref to start from. - * @return list Path to an upstream. + * @return ArcanistGitUpstreamPath Path to an upstream. */ public function getPathToUpstream($start) { $cursor = $start; diff --git a/src/repository/api/ArcanistMercurialAPI.php b/src/repository/api/ArcanistMercurialAPI.php index 6fa6c48a..5fe14327 100644 --- a/src/repository/api/ArcanistMercurialAPI.php +++ b/src/repository/api/ArcanistMercurialAPI.php @@ -791,7 +791,7 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI { 'commit --amend -l %s', $tmp_file); } catch (CommandException $ex) { - if (preg_match('/nothing changed/', $ex->getStdOut())) { + if (preg_match('/nothing changed/', $ex->getStdout())) { // NOTE: Mercurial considers it an error to make a no-op amend. Although // we generally defer to the underlying VCS to dictate behavior, this // one seems a little goofy, and we use amend as part of various diff --git a/src/repository/api/ArcanistRepositoryAPI.php b/src/repository/api/ArcanistRepositoryAPI.php index a77a8c90..f95742c1 100644 --- a/src/repository/api/ArcanistRepositoryAPI.php +++ b/src/repository/api/ArcanistRepositoryAPI.php @@ -282,7 +282,7 @@ abstract class ArcanistRepositoryAPI extends Phobject { * Hook for implementations to dirty working copy caches after the working * copy has been updated. * - * @return this + * @return void * @task status */ protected function didReloadWorkingCopy() { diff --git a/src/unit/engine/XUnitTestEngine.php b/src/unit/engine/XUnitTestEngine.php index 803880af..d6a20464 100644 --- a/src/unit/engine/XUnitTestEngine.php +++ b/src/unit/engine/XUnitTestEngine.php @@ -255,7 +255,7 @@ class XUnitTestEngine extends ArcanistUnitTestEngine { throw $exc; } $result->setResult(ArcanistUnitTestResult::RESULT_FAIL); - $result->setUserdata($exc->getStdout()); + $result->setUserData($exc->getStdout()); } $result->setDuration(microtime(true) - $regenerate_start); @@ -301,7 +301,7 @@ class XUnitTestEngine extends ArcanistUnitTestEngine { throw $exc; } $result->setResult(ArcanistUnitTestResult::RESULT_FAIL); - $result->setUserdata($exc->getStdout()); + $result->setUserData($exc->getStdout()); $build_failed = true; } diff --git a/src/workflow/ArcanistLandWorkflow.php b/src/workflow/ArcanistLandWorkflow.php index 8323ce24..ee59a8d2 100644 --- a/src/workflow/ArcanistLandWorkflow.php +++ b/src/workflow/ArcanistLandWorkflow.php @@ -886,7 +886,7 @@ EOTEXT } } catch (CommandException $ex) { $err = $ex->getError(); - $stdout = $ex->getStdOut(); + $stdout = $ex->getStdout(); // Copied from: PhabricatorRepositoryPullLocalDaemon.php // NOTE: Between versions 2.1 and 2.1.1, Mercurial changed the diff --git a/src/workflow/ArcanistPatchWorkflow.php b/src/workflow/ArcanistPatchWorkflow.php index e7c6760d..c1a8f878 100644 --- a/src/workflow/ArcanistPatchWorkflow.php +++ b/src/workflow/ArcanistPatchWorkflow.php @@ -710,7 +710,7 @@ EOTEXT } // in case there were any submodule changes involved - $repository_api->execpassthru('submodule update --init --recursive'); + $repository_api->execPassthru('submodule update --init --recursive'); if ($this->shouldCommit()) { if ($bundle->getFullAuthor()) { @@ -763,7 +763,7 @@ EOTEXT echo phutil_console_format( "\n** %s **\n", pht('Patch Failed!')); - $stderr = $ex->getStdErr(); + $stderr = $ex->getStderr(); if (preg_match('/case-folding collision/', $stderr)) { echo phutil_console_wrap( phutil_console_format( diff --git a/src/workflow/ArcanistWorkflow.php b/src/workflow/ArcanistWorkflow.php index 192cf243..ad78b243 100644 --- a/src/workflow/ArcanistWorkflow.php +++ b/src/workflow/ArcanistWorkflow.php @@ -336,7 +336,7 @@ abstract class ArcanistWorkflow extends Phobject { $this->conduitAuthenticated = true; - return; + return $this; } catch (Exception $ex) { $conduit->setConduitToken(null); throw $ex;