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
This commit is contained in:
Jakub Vrana
2017-02-17 10:10:15 +00:00
committed by vrana
parent b2739710ba
commit a778151f28
80 changed files with 92 additions and 147 deletions

View File

@@ -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();

View File

@@ -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);

View File

@@ -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".

View File

@@ -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(

View File

@@ -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.',

View File

@@ -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(