Fix and make some types in PHPDoc and JSDoc tags more specific
authorThiemo Mättig <thiemo.maettig@wikimedia.de>
Fri, 21 Jul 2017 10:22:12 +0000 (12:22 +0200)
committerThiemo Mättig <thiemo.maettig@wikimedia.de>
Sat, 5 Aug 2017 16:46:44 +0000 (18:46 +0200)
Change-Id: I7c109067579f570ecccaabc75b0b4db7eac4e6c2

includes/api/ApiBase.php
includes/libs/StatusValue.php
includes/specials/SpecialSearch.php
languages/Language.php

index bc3def8..44a2280 100644 (file)
@@ -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
index e860ec4..f9dcc1b 100644 (file)
  * @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 = [];
index eeb8823..8afea0b 100644 (file)
@@ -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 );
 
index 83dff65..f319d38 100644 (file)
@@ -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?
         *