Skip to content

Commit 9f3cde4

Browse files
vranavrana
authored andcommitted
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/D17377
1 parent a439ea7 commit 9f3cde4

20 files changed

+33
-29
lines changed

src/applications/calendar/util/CalendarTimeUtil.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private static function getStartDateTimeObjects(
6969

7070
$today_epoch = PhabricatorTime::parseLocalTime('today', $user);
7171
$today = new DateTime('@'.$today_epoch);
72-
$today->setTimeZone($timezone);
72+
$today->setTimezone($timezone);
7373

7474
if (strtolower($start_day_str) == 'today' ||
7575
$today->format('l') == $start_day_str) {
@@ -79,7 +79,7 @@ private static function getStartDateTimeObjects(
7979
'last '.$start_day_str,
8080
$user);
8181
$start_day = new DateTime('@'.$start_epoch);
82-
$start_day->setTimeZone($timezone);
82+
$start_day->setTimezone($timezone);
8383
}
8484
return array(
8585
'today' => $today,

src/applications/daemon/management/PhabricatorDaemonManagementRestartWorkflow.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function execute(PhutilArgumentParser $args) {
4747

4848
return $this->executeStartCommand(
4949
array(
50-
'reserve' => (float)$args->getArg('autoscale-reserve', 0.0),
50+
'reserve' => (float)$args->getArg('autoscale-reserve'),
5151
));
5252
}
5353

src/applications/daemon/management/PhabricatorDaemonManagementStartWorkflow.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function execute(PhutilArgumentParser $args) {
3434
array(
3535
'keep-leases' => $args->getArg('keep-leases'),
3636
'force' => $args->getArg('force'),
37-
'reserve' => (float)$args->getArg('autoscale-reserve', 0.0),
37+
'reserve' => (float)$args->getArg('autoscale-reserve'),
3838
));
3939
}
4040

src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected function getGitResult(ConduitAPIRequest $request) {
5252
$commit,
5353
$path);
5454
} catch (CommandException $e) {
55-
$stderr = $e->getStdErr();
55+
$stderr = $e->getStderr();
5656
if (preg_match('/^fatal: Not a valid object name/', $stderr)) {
5757
// Grab two logs, since the first one is when the object was deleted.
5858
list($stdout) = $repository->execxLocalCommand(

src/applications/diffusion/controller/DiffusionRepositoryController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ private function buildBranchListTable(DiffusionRequest $drequest) {
446446
$header->setHeader(pht('Branches'));
447447

448448
if ($more_branches) {
449-
$header->setSubHeader(pht('Showing %d branches.', $limit));
449+
$header->setSubheader(pht('Showing %d branches.', $limit));
450450
}
451451

452452
$button = new PHUIButtonView();
@@ -505,7 +505,7 @@ private function buildTagListTable(DiffusionRequest $drequest) {
505505
$header->setHeader(pht('Tags'));
506506

507507
if ($more_tags) {
508-
$header->setSubHeader(
508+
$header->setSubheader(
509509
pht('Showing the %d most recent tags.', $tag_limit));
510510
}
511511

src/applications/diffusion/editor/DiffusionCommitEditEngine.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ protected function buildCustomEditFields($object) {
111111
->setValue($object->getAuditorPHIDsForEdit());
112112

113113
$reason = $data->getCommitDetail('autocloseReason', false);
114-
$reason = PhabricatorRepository::BECAUSE_AUTOCLOSE_FORCED;
115114
if ($reason !== false) {
116115
switch ($reason) {
117116
case PhabricatorRepository::BECAUSE_REPOSITORY_IMPORTING:

src/applications/diffusion/herald/HeraldPreCommitContentAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function getDiffContent($type) {
4646

4747
if ($this->changesets instanceof Exception) {
4848
$ex_class = get_class($this->changesets);
49-
$ex_message = $this->changesets->getmessage();
49+
$ex_message = $this->changesets->getMessage();
5050
if ($type === 'name') {
5151
return array("<{$ex_class}: {$ex_message}>");
5252
} else {

src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,13 @@ private function resolveMercurialRefs() {
271271
try {
272272
list($stdout) = $future->resolvex();
273273
} catch (CommandException $ex) {
274-
if (preg_match('/ambiguous identifier/', $ex->getStdErr())) {
274+
if (preg_match('/ambiguous identifier/', $ex->getStderr())) {
275275
// This indicates that the ref ambiguously matched several things.
276276
// Eventually, it would be nice to return all of them, but it is
277277
// unclear how to best do that. For now, treat it as a miss instead.
278278
continue;
279279
}
280-
if (preg_match('/unknown revision/', $ex->getStdErr())) {
280+
if (preg_match('/unknown revision/', $ex->getStderr())) {
281281
// No matches for this ref.
282282
continue;
283283
}

src/applications/diviner/atomizer/DivinerPHPAtomizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ protected function executeAtomize($file_name, $file_data) {
128128

129129
private function parseParams(DivinerAtom $atom, AASTNode $func) {
130130
$params = $func
131-
->getChildByIndex(3, 'n_DECLARATAION_PARAMETER_LIST')
131+
->getChildOfType(3, 'n_DECLARATAION_PARAMETER_LIST')
132132
->selectDescendantsOfType('n_DECLARATION_PARAMETER');
133133

134134
$param_spec = array();

src/applications/metamta/storage/PhabricatorMetaMTAMail.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,9 @@ public function saveAndSend() {
340340
return $this->save();
341341
}
342342

343+
/**
344+
* @return this
345+
*/
343346
public function save() {
344347
if ($this->getID()) {
345348
return parent::save();

0 commit comments

Comments
 (0)