From: Thiemo Mättig Date: Fri, 21 Jul 2017 10:22:12 +0000 (+0200) Subject: Fix and make some types in PHPDoc and JSDoc tags more specific X-Git-Tag: 1.31.0-rc.0~2455^2 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=c785efd25e8e8f32efe14d4f416aaf0df0b3a4a5;p=lhc%2Fweb%2Fwiklou.git Fix and make some types in PHPDoc and JSDoc tags more specific Change-Id: I7c109067579f570ecccaabc75b0b4db7eac4e6c2 --- diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index bc3def841f..44a2280087 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -2857,7 +2857,7 @@ abstract class ApiBase extends ContextSource { * Return the error message related to a certain array * @deprecated since 1.29 * @param array|string|MessageSpecifier $error Element of a getUserPermissionsErrors()-style array - * @return [ 'code' => code, 'info' => info ] + * @return array [ 'code' => code, 'info' => info ] */ public function parseMsg( $error ) { // Check whether someone passed the whole array, instead of one element as diff --git a/includes/libs/StatusValue.php b/includes/libs/StatusValue.php index e860ec491f..f9dcc1b52e 100644 --- a/includes/libs/StatusValue.php +++ b/includes/libs/StatusValue.php @@ -40,17 +40,22 @@ * @since 1.25 */ class StatusValue { + /** @var bool */ protected $ok = true; - /** @var array */ + + /** @var array[] */ protected $errors = []; /** @var mixed */ public $value; - /** @var array Map of (key => bool) to indicate success of each part of batch operations */ + + /** @var bool[] Map of (key => bool) to indicate success of each part of batch operations */ public $success = []; + /** @var int Counter for batch operations */ public $successCount = 0; + /** @var int Counter for batch operations */ public $failCount = 0; @@ -138,7 +143,7 @@ class StatusValue { * * Each error is a (message:string or MessageSpecifier,params:array) map * - * @return array + * @return array[] */ public function getErrors() { return $this->errors; @@ -230,7 +235,7 @@ class StatusValue { * - params: array list of parameters * * @param string $type - * @return array + * @return array[] */ public function getErrorsByType( $type ) { $result = []; diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index eeb8823ffb..8afea0b295 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -352,7 +352,7 @@ class SpecialSearch extends SpecialPage { $out->addHTML( $dymWidget->render( $term, $textMatches ) ); } - $hasErrors = $textStatus && $textStatus->getErrors(); + $hasErrors = $textStatus && $textStatus->getErrors() !== []; $hasOtherResults = $textMatches && $textMatches->hasInterwikiResults( SearchResultSet::INLINE_RESULTS ); diff --git a/languages/Language.php b/languages/Language.php index 83dff65aba..f319d38cd0 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1092,7 +1092,7 @@ class Language { * YYYYMMDDHHMMSS * 01234567890123 * @param DateTimeZone $zone Timezone of $ts - * @param[out] int $ttl The amount of time (in seconds) the output may be cached for. + * @param int &$ttl The amount of time (in seconds) the output may be cached for. * Only makes sense if $ts is the current time. * @todo handling of "o" format character for Iranian, Hebrew, Hijri & Thai? *