Skip to content

Commit

Permalink
Fix errors found by PHPStan
Browse files Browse the repository at this point in the history
Test Plan:
Ran `phpstan analyze --autoload-file=src/__phutil_library_init__.php -c phpstan.neon -l 1 src/` with `phpstan.neon` containing:

  parameters:
      excludes_analyse:
          - */__tests__/*

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D17364
  • Loading branch information
vrana authored and vrana committed Feb 16, 2017
1 parent d37145b commit cfeafaf
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/cache/PhutilAPCKeyValueCache.php
Expand Up @@ -90,7 +90,7 @@ public function destroyCache() {
return $this;
}

private static function isAPCU() {
private static function isAPCu() {
return function_exists('apcu_fetch');
}

Expand Down
2 changes: 1 addition & 1 deletion src/cache/PhutilKeyValueCacheStack.php
Expand Up @@ -68,7 +68,7 @@ public function setCaches(array $caches) {
* @task config
*/
public function setNextTTL($ttl) {
$this->ttl = $ttl;
$this->nextTTL = $ttl;
return $this;
}

Expand Down
2 changes: 1 addition & 1 deletion src/filesystem/Filesystem.php
Expand Up @@ -384,7 +384,7 @@ public static function changePermissions($path, $umask) {
* Get the last modified time of a file
*
* @param string Path to file
* @return Time last modified
* @return int Time last modified
*
* @task file
*/
Expand Down
1 change: 1 addition & 0 deletions src/future/aws/PhutilAWSException.php
Expand Up @@ -4,6 +4,7 @@ final class PhutilAWSException extends Exception {

private $httpStatus;
private $requestID;
private $params;

public function __construct($http_status, array $params) {
$this->httpStatus = $http_status;
Expand Down
3 changes: 2 additions & 1 deletion src/future/exec/PhutilSignalRouter.php
Expand Up @@ -69,7 +69,8 @@ public function routeSignal($signo) {
throw new PhutilAggregateException(
pht(
'Signal handlers raised exceptions while handling "%s".',
phutil_get_signal_name($signo)));
phutil_get_signal_name($signo)),
$exceptions);
}

switch ($signo) {
Expand Down
2 changes: 2 additions & 0 deletions src/future/http/status/HTTPFutureParseResponseStatus.php
Expand Up @@ -4,6 +4,8 @@ final class HTTPFutureParseResponseStatus extends HTTPFutureResponseStatus {

const ERROR_MALFORMED_RESPONSE = 1;

private $rawResponse;

public function __construct($code, $raw_response) {
$this->rawResponse = $raw_response;
parent::__construct($code);
Expand Down
3 changes: 2 additions & 1 deletion src/internationalization/PhutilNumber.php
Expand Up @@ -5,8 +5,9 @@ final class PhutilNumber extends Phobject {
private $value;
private $decimals = 0;

public function __construct($value) {
public function __construct($value, $decimals = 0) {
$this->value = $value;
$this->decimals = $decimals;
}

public function getNumber() {
Expand Down
2 changes: 1 addition & 1 deletion src/markup/engine/PhutilRemarkupEngine.php
Expand Up @@ -293,7 +293,7 @@ public function postprocessText(array $dict) {
$rule->didMarkupText();
}

return $this->restoreText(idx($dict, 'output'), $this->isTextMode());
return $this->restoreText(idx($dict, 'output'));
}

public function restoreText($text) {
Expand Down

0 comments on commit cfeafaf

Please sign in to comment.