Use [...] instead of array(...) in PHP comments and documentation
authorFomafix <fomafix@googlemail.com>
Mon, 16 Jan 2017 15:42:53 +0000 (16:42 +0100)
committerFomafix <fomafix@googlemail.com>
Mon, 17 Jun 2019 19:15:09 +0000 (21:15 +0200)
Change-Id: I0c83783051bf35fe785bc01644eeb2946902b6b2

39 files changed:
docs/linkcache.txt
docs/magicword.txt
docs/memcached.txt
docs/php-memcached/Documentation
includes/Autopromote.php
includes/DefaultSettings.php
includes/Html.php
includes/OutputPage.php
includes/PathRouter.php
includes/Title.php
includes/TrackingCategories.php
includes/WebRequest.php
includes/api/ApiQueryBase.php
includes/changetags/ChangeTags.php
includes/deferred/LinksUpdate.php
includes/htmlform/HTMLFormField.php
includes/jobqueue/JobSpecification.php
includes/page/PageArchive.php
includes/page/WikiPage.php
includes/parser/Sanitizer.php
includes/rcfeed/RedisPubSubFeedEngine.php
includes/resourceloader/ResourceLoaderFileModule.php
includes/specialpage/SpecialPage.php
includes/specialpage/SpecialPageFactory.php
includes/specials/SpecialUnblock.php
includes/specials/SpecialUserrights.php
includes/specials/SpecialVersion.php
includes/user/User.php
languages/Language.php
tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php
tests/phpunit/includes/HtmlTest.php
tests/phpunit/includes/StatusTest.php
tests/phpunit/includes/TestLogger.php
tests/phpunit/includes/TitleTest.php
tests/phpunit/includes/api/query/ApiQueryTestBase.php
tests/phpunit/includes/libs/IPTest.php
tests/phpunit/includes/specials/SpecialSearchTest.php
tests/phpunit/includes/utils/BatchRowUpdateTest.php
tests/phpunit/includes/utils/UIDGeneratorTest.php

index 13b6961..cf28762 100644 (file)
@@ -13,8 +13,8 @@ purposes of updating the link tables. This application is now deprecated.
 
 To create a batch, you can use the following code:
 
 
 To create a batch, you can use the following code:
 
-$pages = array( 'Main Page', 'Project:Help', /* ... */ );
-$titles = array();
+$pages = [ 'Main Page', 'Project:Help', /* ... */ ];
+$titles = [];
 
 foreach( $pages as $page ){
        $titles[] = Title::newFromText( $page );
 
 foreach( $pages as $page ){
        $titles[] = Title::newFromText( $page );
index 6b4d37e..42f701c 100644 (file)
@@ -28,16 +28,16 @@ Create a file called ExtensionName.i18n.magic.php with the following contents:
 ----
 <?php
 
 ----
 <?php
 
-$magicWords = array();
+$magicWords = [];
 
 
-$magicWords['en'] = array(
+$magicWords['en'] = [
        // Case sensitive.
        // Case sensitive.
-       'mag_custom' => array( 1, 'CUSTOM' ),
-);
+       'mag_custom' => [ 1, 'CUSTOM' ],
+];
 
 
-$magicWords['es'] = array(
-       'mag_custom' => array( 1, 'ADUANERO' ),
-);
+$magicWords['es'] = [
+       'mag_custom' => [ 1, 'ADUANERO' ],
+];
 ----
 
 $wgExtensionMessagesFiles['ExtensionNameMagic'] = __DIR__ . '/ExtensionName.i18n.magic.php';
 ----
 
 $wgExtensionMessagesFiles['ExtensionNameMagic'] = __DIR__ . '/ExtensionName.i18n.magic.php';
@@ -62,16 +62,16 @@ Create a file called ExtensionName.i18n.magic.php with the following contents:
 ----
 <?php
 
 ----
 <?php
 
-$magicWords = array();
+$magicWords = [];
 
 
-$magicWords['en'] = array(
+$magicWords['en'] = [
        // Case insensitive.
        // Case insensitive.
-       'mag_custom' => array( 0, 'custom' ),
-);
+       'mag_custom' => [ 0, 'custom' ],
+];
 
 
-$magicWords['es'] = array(
-       'mag_custom' => array( 0, 'aduanero' ),
-);
+$magicWords['es'] = [
+       'mag_custom' => [ 0, 'aduanero' ],
+];
 ----
 
 $wgExtensionMessagesFiles['ExtensionNameMagic'] = __DIR__ . '/ExtensionName.i18n.magic.php';
 ----
 
 $wgExtensionMessagesFiles['ExtensionNameMagic'] = __DIR__ . '/ExtensionName.i18n.magic.php';
index 1e68fb7..ba325fe 100644 (file)
@@ -61,7 +61,7 @@ on port 11211, using up to 64MB of memory)
 In your LocalSettings.php file, set:
 
        $wgMainCacheType = CACHE_MEMCACHED;
 In your LocalSettings.php file, set:
 
        $wgMainCacheType = CACHE_MEMCACHED;
-       $wgMemCachedServers = array( "127.0.0.1:11211" );
+       $wgMemCachedServers = [ "127.0.0.1:11211" ];
 
 The wiki should then use memcached to cache various data. To use
 multiple servers (physically separate boxes or multiple caches
 
 The wiki should then use memcached to cache various data. To use
 multiple servers (physically separate boxes or multiple caches
@@ -70,10 +70,10 @@ to the array. To increase the weight of a server (say, because
 it has twice the memory of the others and you want to spread
 usage evenly), make its entry a subarray:
 
 it has twice the memory of the others and you want to spread
 usage evenly), make its entry a subarray:
 
-  $wgMemCachedServers = array(
+  $wgMemCachedServers = [
     "127.0.0.1:11211", # one gig on this box
     "127.0.0.1:11211", # one gig on this box
-    array("192.168.0.1:11211", 2 ) # two gigs on the other box
-  );
+    [ "192.168.0.1:11211", 2 ] # two gigs on the other box
+  ];
 
 == PHP client for memcached ==
 
 
 == PHP client for memcached ==
 
index 6a0dce6..ef9724b 100644 (file)
@@ -166,7 +166,7 @@ EXAMPLE:
 require 'MemCachedClient.inc.php';
 
 // set the servers, with the last one having an integer weight value of 3
 require 'MemCachedClient.inc.php';
 
 // set the servers, with the last one having an integer weight value of 3
-$options["servers"] = array("10.0.0.15:11000","10.0.0.16:11001",array("10.0.0.17:11002", 3));
+$options["servers"] = ["10.0.0.15:11000","10.0.0.16:11001",["10.0.0.17:11002", 3]];
 $options["debug"] = false;
 
 $memc = new MemCachedClient($options);
 $options["debug"] = false;
 
 $memc = new MemCachedClient($options);
@@ -175,7 +175,7 @@ $memc = new MemCachedClient($options);
 /***********************
  * STORE AN ARRAY
  ***********************/
 /***********************
  * STORE AN ARRAY
  ***********************/
-$myarr = array("one","two", 3);
+$myarr = ["one","two", 3];
 $memc->set("key_one", $myarr);
 $val = $memc->get("key_one");
 print $val[0]."\n";    // prints 'one'
 $memc->set("key_one", $myarr);
 $val = $memc->get("key_one");
 print $val[0]."\n";    // prints 'one'
index 02c9d01..a413037 100644 (file)
@@ -89,12 +89,12 @@ class Autopromote {
 
        /**
         * Recursively check a condition.  Conditions are in the form
 
        /**
         * Recursively check a condition.  Conditions are in the form
-        *   array( '&' or '|' or '^' or '!', cond1, cond2, ... )
+        *   [ '&' or '|' or '^' or '!', cond1, cond2, ... ]
         * where cond1, cond2, ... are themselves conditions; *OR*
         *   APCOND_EMAILCONFIRMED, *OR*
         * where cond1, cond2, ... are themselves conditions; *OR*
         *   APCOND_EMAILCONFIRMED, *OR*
-        *   array( APCOND_EMAILCONFIRMED ), *OR*
-        *   array( APCOND_EDITCOUNT, number of edits ), *OR*
-        *   array( APCOND_AGE, seconds since registration ), *OR*
+        *   [ APCOND_EMAILCONFIRMED ], *OR*
+        *   [ APCOND_EDITCOUNT, number of edits ], *OR*
+        *   [ APCOND_AGE, seconds since registration ], *OR*
         *   similar constructs defined by extensions.
         * This function evaluates the former type recursively, and passes off to
         * self::checkCondition for evaluation of the latter type.
         *   similar constructs defined by extensions.
         * This function evaluates the former type recursively, and passes off to
         * self::checkCondition for evaluation of the latter type.
index 7d6318d..2f793b5 100644 (file)
@@ -5427,20 +5427,20 @@ $wgAutoConfirmCount = 0;
  *
  * The basic syntax for `$wgAutopromote` is:
  *
  *
  * The basic syntax for `$wgAutopromote` is:
  *
- *     $wgAutopromote = array(
+ *     $wgAutopromote = [
  *         'groupname' => cond,
  *         'group2' => cond2,
  *         'groupname' => cond,
  *         'group2' => cond2,
- *     );
+ *     ];
  *
  * A `cond` may be:
  *  - a single condition without arguments:
  *      Note that Autopromote wraps a single non-array value into an array
  *      e.g. `APCOND_EMAILCONFIRMED` OR
  *
  * A `cond` may be:
  *  - a single condition without arguments:
  *      Note that Autopromote wraps a single non-array value into an array
  *      e.g. `APCOND_EMAILCONFIRMED` OR
- *           array( `APCOND_EMAILCONFIRMED` )
+ *           [ `APCOND_EMAILCONFIRMED` ]
  *  - a single condition with arguments:
  *  - a single condition with arguments:
- *      e.g. `array( APCOND_EDITCOUNT, 100 )`
+ *      e.g. `[ APCOND_EDITCOUNT, 100 ]`
  *  - a set of conditions:
  *  - a set of conditions:
- *      e.g. `array( 'operand', cond1, cond2, ... )`
+ *      e.g. `[ 'operand', cond1, cond2, ... ]`
  *
  * When constructing a set of conditions, the following conditions are available:
  *  - `&` (**AND**):
  *
  * When constructing a set of conditions, the following conditions are available:
  *  - `&` (**AND**):
@@ -5451,25 +5451,25 @@ $wgAutoConfirmCount = 0;
  *      promote if user matches **ONLY ONE OF THE CONDITIONS**
  *  - `!` (**NOT**):
  *      promote if user matces **NO** condition
  *      promote if user matches **ONLY ONE OF THE CONDITIONS**
  *  - `!` (**NOT**):
  *      promote if user matces **NO** condition
- *  - array( APCOND_EMAILCONFIRMED ):
+ *  - [ APCOND_EMAILCONFIRMED ]:
  *      true if user has a confirmed e-mail
  *      true if user has a confirmed e-mail
- *  - array( APCOND_EDITCOUNT, number of edits ):
+ *  - [ APCOND_EDITCOUNT, number of edits ]:
  *      true if user has the at least the number of edits as the passed parameter
  *      true if user has the at least the number of edits as the passed parameter
- *  - array( APCOND_AGE, seconds since registration ):
+ *  - [ APCOND_AGE, seconds since registration ]:
  *      true if the length of time since the user created his/her account
  *      is at least the same length of time as the passed parameter
  *      true if the length of time since the user created his/her account
  *      is at least the same length of time as the passed parameter
- *  - array( APCOND_AGE_FROM_EDIT, seconds since first edit ):
+ *  - [ APCOND_AGE_FROM_EDIT, seconds since first edit ]:
  *      true if the length of time since the user made his/her first edit
  *      is at least the same length of time as the passed parameter
  *      true if the length of time since the user made his/her first edit
  *      is at least the same length of time as the passed parameter
- *  - array( APCOND_INGROUPS, group1, group2, ... ):
+ *  - [ APCOND_INGROUPS, group1, group2, ... ]:
  *      true if the user is a member of each of the passed groups
  *      true if the user is a member of each of the passed groups
- *  - array( APCOND_ISIP, ip ):
+ *  - [ APCOND_ISIP, ip ]:
  *      true if the user has the passed IP address
  *      true if the user has the passed IP address
- *  - array( APCOND_IPINRANGE, range ):
+ *  - [ APCOND_IPINRANGE, range ]:
  *      true if the user has an IP address in the range of the passed parameter
  *      true if the user has an IP address in the range of the passed parameter
- *  - array( APCOND_BLOCKED ):
+ *  - [ APCOND_BLOCKED ]:
  *      true if the user is blocked
  *      true if the user is blocked
- *  - array( APCOND_ISBOT ):
+ *  - [ APCOND_ISBOT ]:
  *      true if the user is a bot
  *  - similar constructs can be defined by extensions
  *
  *      true if the user is a bot
  *  - similar constructs can be defined by extensions
  *
@@ -6423,7 +6423,7 @@ $wgDeprecationReleaseLimit = false;
  *
  * @code
  *   $wgProfiler['class'] = 'ProfilerXhprof';
  *
  * @code
  *   $wgProfiler['class'] = 'ProfilerXhprof';
- *   $wgProfiler['output'] = array( 'ProfilerOutputDb' );
+ *   $wgProfiler['output'] = [ 'ProfilerOutputDb' ];
  *   $wgProfiler['sampling'] = 50; // one every 50 requests
  * @endcode
  *
  *   $wgProfiler['sampling'] = 50; // one every 50 requests
  * @endcode
  *
index aa51243..fdc348b 100644 (file)
@@ -518,7 +518,7 @@ class Html {
                                        $newValue = [];
                                        foreach ( $value as $k => $v ) {
                                                if ( is_string( $v ) ) {
                                        $newValue = [];
                                        foreach ( $value as $k => $v ) {
                                                if ( is_string( $v ) ) {
-                                                       // String values should be normal `array( 'foo' )`
+                                                       // String values should be normal `[ 'foo' ]`
                                                        // Just append them
                                                        if ( !isset( $value[$v] ) ) {
                                                                // As a special case don't set 'foo' if a
                                                        // Just append them
                                                        if ( !isset( $value[$v] ) ) {
                                                                // As a special case don't set 'foo' if a
index 5833677..57cd74a 100644 (file)
@@ -1723,7 +1723,7 @@ class OutputPage extends ContextSource {
        /**
         * Get the files used on this page
         *
        /**
         * Get the files used on this page
         *
-        * @return array (dbKey => array('time' => MW timestamp or null, 'sha1' => sha1 or ''))
+        * @return array [ dbKey => [ 'time' => MW timestamp or null, 'sha1' => sha1 or '' ] ]
         * @since 1.18
         */
        public function getFileSearchOptions() {
         * @since 1.18
         */
        public function getFileSearchOptions() {
index eb52d7c..2882e66 100644 (file)
@@ -53,8 +53,8 @@
  *   - In a pattern $1, $2, etc... will be replaced with the relevant contents
  *   - If you used a keyed array as a path pattern, $key will be replaced with
  *     the relevant contents
  *   - In a pattern $1, $2, etc... will be replaced with the relevant contents
  *   - If you used a keyed array as a path pattern, $key will be replaced with
  *     the relevant contents
- *   - The default behavior is equivalent to `array( 'title' => '$1' )`,
- *     if you don't want the title parameter you can explicitly use `array( 'title' => false )`
+ *   - The default behavior is equivalent to `[ 'title' => '$1' ]`,
+ *     if you don't want the title parameter you can explicitly use `[ 'title' => false ]`
  *   - You can specify a value that won't have replacements in it
  *     using `'foo' => [ 'value' => 'bar' ];`
  *
  *   - You can specify a value that won't have replacements in it
  *     using `'foo' => [ 'value' => 'bar' ];`
  *
@@ -80,7 +80,7 @@ class PathRouter {
        /**
         * Protected helper to do the actual bulk work of adding a single pattern.
         * This is in a separate method so that add() can handle the difference between
        /**
         * Protected helper to do the actual bulk work of adding a single pattern.
         * This is in a separate method so that add() can handle the difference between
-        * a single string $path and an array() $path that contains multiple path
+        * a single string $path and an array $path that contains multiple path
         * patterns each with an associated $key to pass on.
         * @param string $path
         * @param array $params
         * patterns each with an associated $key to pass on.
         * @param string $path
         * @param array $params
@@ -247,9 +247,9 @@ class PathRouter {
                }
 
                // We know the difference between null (no matches) and
                }
 
                // We know the difference between null (no matches) and
-               // array() (a match with no data) but our WebRequest caller
-               // expects array() even when we have no matches so return
-               // a array() when we have null
+               // [] (a match with no data) but our WebRequest caller
+               // expects [] even when we have no matches so return
+               // a [] when we have null
                return $matches ?? [];
        }
 
                return $matches ?? [];
        }
 
index b7b28af..cf81b98 100644 (file)
@@ -1979,7 +1979,7 @@ class Title implements LinkTarget, IDBAccessObject {
         *
         * @param string|string[] $query An optional query string,
         *   not used for interwiki links. Can be specified as an associative array as well,
         *
         * @param string|string[] $query An optional query string,
         *   not used for interwiki links. Can be specified as an associative array as well,
-        *   e.g., array( 'action' => 'edit' ) (keys and values will be URL-escaped).
+        *   e.g., [ 'action' => 'edit' ] (keys and values will be URL-escaped).
         *   Some query patterns will trigger various shorturl path replacements.
         * @param string|string[]|bool $query2 An optional secondary query array. This one MUST
         *   be an array. If a string is passed it will be interpreted as a deprecated
         *   Some query patterns will trigger various shorturl path replacements.
         * @param string|string[]|bool $query2 An optional secondary query array. This one MUST
         *   be an array. If a string is passed it will be interpreted as a deprecated
index ebdbc42..d9e185e 100644 (file)
@@ -60,7 +60,7 @@ class TrackingCategories {
 
        /**
         * Read the global and extract title objects from the corresponding messages
 
        /**
         * Read the global and extract title objects from the corresponding messages
-        * @return array Array( 'msg' => Title, 'cats' => Title[] )
+        * @return array [ 'msg' => Title, 'cats' => Title[] ]
         */
        public function getTrackingCategories() {
                $categories = array_merge(
         */
        public function getTrackingCategories() {
                $categories = array_merge(
index 76d94b2..6593e49 100644 (file)
@@ -1140,7 +1140,7 @@ HTML;
        /**
         * Parse the Accept-Language header sent by the client into an array
         *
        /**
         * Parse the Accept-Language header sent by the client into an array
         *
-        * @return array Array( languageCode => q-value ) sorted by q-value in
+        * @return array [ languageCode => q-value ] sorted by q-value in
         *   descending order then appearing time in the header in ascending order.
         * May contain the "language" '*', which applies to languages other than those explicitly listed.
         * This is aligned with rfc2616 section 14.4
         *   descending order then appearing time in the header in ascending order.
         * May contain the "language" '*', which applies to languages other than those explicitly listed.
         * This is aligned with rfc2616 section 14.4
index 47ff0fb..59ec4f6 100644 (file)
@@ -252,7 +252,7 @@ abstract class ApiQueryBase extends ApiBase {
        }
 
        /**
        }
 
        /**
-        * Equivalent to addWhere(array($field => $value))
+        * Equivalent to addWhere( [ $field => $value ] )
         * @param string $field Field name
         * @param string|string[] $value Value; ignored if null or empty array
         */
         * @param string $field Field name
         * @param string|string[] $value Value; ignored if null or empty array
         */
index 7466f82..cf6ed17 100644 (file)
@@ -603,8 +603,8 @@ class ChangeTags {
         * ChangeTags::updateTags() instead, unless directly handling a user request
         * to add or remove tags from an existing revision or log entry.
         *
         * ChangeTags::updateTags() instead, unless directly handling a user request
         * to add or remove tags from an existing revision or log entry.
         *
-        * @param array|null $tagsToAdd If none, pass array() or null
-        * @param array|null $tagsToRemove If none, pass array() or null
+        * @param array|null $tagsToAdd If none, pass [] or null
+        * @param array|null $tagsToRemove If none, pass [] or null
         * @param int|null $rc_id The rc_id of the change to add the tags to
         * @param int|null $rev_id The rev_id of the change to add the tags to
         * @param int|null $log_id The log_id of the change to add the tags to
         * @param int|null $rc_id The rc_id of the change to add the tags to
         * @param int|null $rev_id The rev_id of the change to add the tags to
         * @param int|null $log_id The log_id of the change to add the tags to
index 9adb2b0..266d768 100644 (file)
@@ -965,7 +965,7 @@ class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate {
 
        /**
         * Get an array of existing inline interwiki links, as a 2-D array
 
        /**
         * Get an array of existing inline interwiki links, as a 2-D array
-        * @return array (prefix => array(dbkey => 1))
+        * @return array [ prefix => [ dbkey => 1 ] ]
         */
        private function getExistingInterwikis() {
                $res = $this->getDB()->select( 'iwlinks', [ 'iwl_prefix', 'iwl_title' ],
         */
        private function getExistingInterwikis() {
                $res = $this->getDB()->select( 'iwlinks', [ 'iwl_prefix', 'iwl_title' ],
index 16dc465..ff805d8 100644 (file)
@@ -866,7 +866,7 @@ abstract class HTMLFormField {
         * that return value has no taint.
         *
         * @param string $value The value of the input
         * that return value has no taint.
         *
         * @param string $value The value of the input
-        * @return array array( $errors, $errorClass )
+        * @return array [ $errors, $errorClass ]
         * @return-taint none
         */
        public function getErrorsAndErrorClass( $value ) {
         * @return-taint none
         */
        public function getErrorsAndErrorClass( $value ) {
index 80a46d0..19ff967 100644 (file)
@@ -27,8 +27,8 @@
  * @code
  * $job = new JobSpecification(
  *             'null',
  * @code
  * $job = new JobSpecification(
  *             'null',
- *             array( 'lives' => 1, 'usleep' => 100, 'pi' => 3.141569 ),
- *             array( 'removeDuplicates' => 1 )
+ *             [ 'lives' => 1, 'usleep' => 100, 'pi' => 3.141569 ],
+ *             [ 'removeDuplicates' => 1 ]
  * );
  * JobQueueGroup::singleton()->push( $job )
  * @endcode
  * );
  * JobQueueGroup::singleton()->push( $job )
  * @endcode
index cdaf062..d69a433 100644 (file)
@@ -406,8 +406,8 @@ class PageArchive {
         * @param User|null $user User performing the action, or null to use $wgUser
         * @param string|string[]|null $tags Change tags to add to log entry
         *   ($user should be able to add the specified tags before this is called)
         * @param User|null $user User performing the action, or null to use $wgUser
         * @param string|string[]|null $tags Change tags to add to log entry
         *   ($user should be able to add the specified tags before this is called)
-        * @return array|bool array(number of file revisions restored, number of image revisions
-        *   restored, log message) on success, false on failure.
+        * @return array|bool number of file revisions restored, number of image revisions
+        *   restored, log message ] on success, false on failure.
         */
        public function undelete( $timestamps, $comment = '', $fileVersions = [],
                $unsuppress = false, User $user = null, $tags = null
         */
        public function undelete( $timestamps, $comment = '', $fileVersions = [],
                $unsuppress = false, User $user = null, $tags = null
index e29e2b1..d65d87b 100644 (file)
@@ -3077,7 +3077,7 @@ class WikiPage implements Page, IDBAccessObject {
         * (with ChangeTags::canAddTagsAccompanyingChange)
         *
         * @return array Array of errors, each error formatted as
         * (with ChangeTags::canAddTagsAccompanyingChange)
         *
         * @return array Array of errors, each error formatted as
-        *   array(messagekey, param1, param2, ...).
+        *   [ messagekey, param1, param2, ... ].
         * On success, the array is empty.  This array can also be passed to
         * OutputPage::showPermissionsErrorPage().
         */
         * On success, the array is empty.  This array can also be passed to
         * OutputPage::showPermissionsErrorPage().
         */
index f76e3a9..d8e5e3e 100644 (file)
@@ -1245,7 +1245,7 @@ class Sanitizer {
         *   HTML5 definition of id attribute
         *
         * @param string $id Id to escape
         *   HTML5 definition of id attribute
         *
         * @param string $id Id to escape
-        * @param string|array $options String or array of strings (default is array()):
+        * @param string|array $options String or array of strings (default is []):
         *   'noninitial': This is a non-initial fragment of an id, not a full id,
         *       so don't pay attention if the first character isn't valid at the
         *       beginning of an id.
         *   'noninitial': This is a non-initial fragment of an id, not a full id,
         *       so don't pay attention if the first character isn't valid at the
         *       beginning of an id.
@@ -1948,7 +1948,7 @@ class Sanitizer {
                        # rbc
                        'rb'         => $common,
                        'rp'         => $common,
                        # rbc
                        'rb'         => $common,
                        'rp'         => $common,
-                       'rt'         => $common, # array_merge( $common, array( 'rbspan' ) ),
+                       'rt'         => $common, # array_merge( $common, [ 'rbspan' ] ),
                        'rtc'        => $common,
 
                        # MathML root element, where used for extensions
                        'rtc'        => $common,
 
                        # MathML root element, where used for extensions
index c954df1..66b1529 100644 (file)
  *
  * @par Example:
  * @code
  *
  * @par Example:
  * @code
- * $wgRCFeeds['redis'] = array(
+ * $wgRCFeeds['redis'] = [
  *      'formatter' => 'JSONRCFeedFormatter',
  *      'uri'       => "redis://127.0.0.1:6379/rc.$wgDBname",
  *      'formatter' => 'JSONRCFeedFormatter',
  *      'uri'       => "redis://127.0.0.1:6379/rc.$wgDBname",
- * );
+ * ];
  * @endcode
  *
  * @since 1.22
  * @endcode
  *
  * @since 1.22
index 87a4515..47c8987 100644 (file)
@@ -334,7 +334,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         *     to $IP
         * @param string|null $remoteBasePath Path to use if not provided in module definition. Defaults
         *     to $wgResourceBasePath
         *     to $IP
         * @param string|null $remoteBasePath Path to use if not provided in module definition. Defaults
         *     to $wgResourceBasePath
-        * @return array Array( localBasePath, remoteBasePath )
+        * @return array [ localBasePath, remoteBasePath ]
         */
        public static function extractBasePaths(
                $options = [],
         */
        public static function extractBasePaths(
                $options = [],
index eba406e..d7e39d5 100644 (file)
@@ -456,10 +456,10 @@ class SpecialPage implements MessageLocalizer {
         * For example, if a page supports subpages "foo", "bar" and "baz" (as in Special:PageName/foo,
         * etc.):
         *
         * For example, if a page supports subpages "foo", "bar" and "baz" (as in Special:PageName/foo,
         * etc.):
         *
-        *   - `prefixSearchSubpages( "ba" )` should return `array( "bar", "baz" )`
-        *   - `prefixSearchSubpages( "f" )` should return `array( "foo" )`
-        *   - `prefixSearchSubpages( "z" )` should return `array()`
-        *   - `prefixSearchSubpages( "" )` should return `array( foo", "bar", "baz" )`
+        *   - `prefixSearchSubpages( "ba" )` should return `[ "bar", "baz" ]`
+        *   - `prefixSearchSubpages( "f" )` should return `[ "foo" ]`
+        *   - `prefixSearchSubpages( "z" )` should return `[]`
+        *   - `prefixSearchSubpages( "" )` should return `[ foo", "bar", "baz" ]`
         *
         * @param string $search Prefix to search for
         * @param int $limit Maximum number of results to return (usually 10)
         *
         * @param string $search Prefix to search for
         * @param int $limit Maximum number of results to return (usually 10)
index 1053bda..9a793c3 100644 (file)
@@ -361,7 +361,7 @@ class SpecialPageFactory {
         * subpage.
         *
         * @param string $alias
         * subpage.
         *
         * @param string $alias
-        * @return array Array( String, String|null ), or array( null, null ) if the page is invalid
+        * @return array [ String, String|null ], or [ null, null ] if the page is invalid
         */
        public function resolveAlias( $alias ) {
                $bits = explode( '/', $alias, 2 );
         */
        public function resolveAlias( $alias ) {
                $bits = explode( '/', $alias, 2 );
index bedd2c5..c7e2a37 100644 (file)
@@ -162,7 +162,7 @@ class SpecialUnblock extends SpecialPage {
         * Submit callback for an HTMLForm object
         * @param array $data
         * @param HTMLForm $form
         * Submit callback for an HTMLForm object
         * @param array $data
         * @param HTMLForm $form
-        * @return array|bool Array(message key, parameters)
+        * @return array|bool [ message key, parameters ]
         */
        public static function processUIUnblock( array $data, HTMLForm $form ) {
                return self::processUnblock( $data, $form->getContext() );
         */
        public static function processUIUnblock( array $data, HTMLForm $form ) {
                return self::processUnblock( $data, $form->getContext() );
@@ -177,7 +177,7 @@ class SpecialUnblock extends SpecialPage {
         * @param array $data
         * @param IContextSource $context
         * @throws ErrorPageError
         * @param array $data
         * @param IContextSource $context
         * @throws ErrorPageError
-        * @return array|bool Array( Array( message key, parameters ) ) on failure, True on success
+        * @return array|bool [ [ message key, parameters ] ] on failure, True on success
         */
        public static function processUnblock( array $data, IContextSource $context ) {
                $performer = $context->getUser();
         */
        public static function processUnblock( array $data, IContextSource $context ) {
                $performer = $context->getUser();
index 87bc259..fc54890 100644 (file)
@@ -1001,12 +1001,12 @@ class UserrightsPage extends SpecialPage {
        /**
         * Returns $this->getUser()->changeableGroups()
         *
        /**
         * Returns $this->getUser()->changeableGroups()
         *
-        * @return array Array(
-        *   'add' => array( addablegroups ),
-        *   'remove' => array( removablegroups ),
-        *   'add-self' => array( addablegroups to self ),
-        *   'remove-self' => array( removable groups from self )
-        *  )
+        * @return array [
+        *   'add' => [ addablegroups ],
+        *   'remove' => [ removablegroups ],
+        *   'add-self' => [ addablegroups to self ],
+        *   'remove-self' => [ removable groups from self ]
+        *  ]
         */
        function changeableGroups() {
                return $this->getUser()->changeableGroups();
         */
        function changeableGroups() {
                return $this->getUser()->changeableGroups();
index 0c4959a..5456ce7 100644 (file)
@@ -812,7 +812,7 @@ class SpecialVersion extends SpecialPage {
                }
 
                // ... and generate the description; which can be a parameterized l10n message
                }
 
                // ... and generate the description; which can be a parameterized l10n message
-               // in the form array( <msgname>, <parameter>, <parameter>... ) or just a straight
+               // in the form [ <msgname>, <parameter>, <parameter>... ] or just a straight
                // up string
                if ( isset( $extension['descriptionmsg'] ) ) {
                        // Localized description of extension
                // up string
                if ( isset( $extension['descriptionmsg'] ) ) {
                        // Localized description of extension
index 2de90ed..3a57c0b 100644 (file)
@@ -3297,7 +3297,7 @@ class User implements IDBAccessObject, UserIdentity {
         * and 'all', which forces a reset of *all* preferences and overrides everything else.
         *
         * @param array|string $resetKinds Which kinds of preferences to reset. Defaults to
         * and 'all', which forces a reset of *all* preferences and overrides everything else.
         *
         * @param array|string $resetKinds Which kinds of preferences to reset. Defaults to
-        *  array( 'registered', 'registered-multiselect', 'registered-checkmatrix', 'unused' )
+        *  [ 'registered', 'registered-multiselect', 'registered-checkmatrix', 'unused' ]
         *  for backwards-compatibility.
         * @param IContextSource|null $context Context source used when $resetKinds
         *  does not contain 'all', passed to getOptionKinds().
         *  for backwards-compatibility.
         * @param IContextSource|null $context Context source used when $resetKinds
         *  does not contain 'all', passed to getOptionKinds().
@@ -5044,10 +5044,10 @@ class User implements IDBAccessObject, UserIdentity {
         * Returns an array of the groups that a particular group can add/remove.
         *
         * @param string $group The group to check for whether it can add/remove
         * Returns an array of the groups that a particular group can add/remove.
         *
         * @param string $group The group to check for whether it can add/remove
-        * @return array Array( 'add' => array( addablegroups ),
-        *     'remove' => array( removablegroups ),
-        *     'add-self' => array( addablegroups to self),
-        *     'remove-self' => array( removable groups from self) )
+        * @return array [ 'add' => [ addablegroups ],
+        *     'remove' => [ removablegroups ],
+        *     'add-self' => [ addablegroups to self ],
+        *     'remove-self' => [ removable groups from self ] ]
         */
        public static function changeableByGroup( $group ) {
                global $wgAddGroups, $wgRemoveGroups, $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf;
         */
        public static function changeableByGroup( $group ) {
                global $wgAddGroups, $wgRemoveGroups, $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf;
@@ -5117,10 +5117,10 @@ class User implements IDBAccessObject, UserIdentity {
 
        /**
         * Returns an array of groups that this user can add and remove
 
        /**
         * Returns an array of groups that this user can add and remove
-        * @return array Array( 'add' => array( addablegroups ),
-        *  'remove' => array( removablegroups ),
-        *  'add-self' => array( addablegroups to self),
-        *  'remove-self' => array( removable groups from self) )
+        * @return array [ 'add' => [ addablegroups ],
+        *  'remove' => [ removablegroups ],
+        *  'add-self' => [ addablegroups to self ],
+        *  'remove-self' => [ removable groups from self ] ]
         */
        public function changeableGroups() {
                if ( $this->isAllowed( 'userrights' ) ) {
         */
        public function changeableGroups() {
                if ( $this->isAllowed( 'userrights' ) ) {
index 9d7ce09..fd8aedf 100644 (file)
@@ -4537,7 +4537,7 @@ class Language {
         *
         * @since 1.22
         * @param string $code Language code
         *
         * @since 1.22
         * @param string $code Language code
-        * @return array Array( fallbacks, site fallbacks )
+        * @return array [ fallbacks, site fallbacks ]
         */
        public static function getFallbacksIncludingSiteLanguage( $code ) {
                global $wgLanguageCode;
         */
        public static function getFallbacksIncludingSiteLanguage( $code ) {
                global $wgLanguageCode;
index 5d9f63d..f9735c1 100644 (file)
@@ -69,7 +69,7 @@ class WfUrlencodeTest extends MediaWikiTestCase {
                        }
                } else {
                        throw new MWException( __METHOD__ . " given invalid expectation for "
                        }
                } else {
                        throw new MWException( __METHOD__ . " given invalid expectation for "
-                               . "'$server'. Should be a string or an array( <http server name> => <string> ).\n" );
+                               . "'$server'. Should be a string or an array [ <http server name> => <string> ].\n" );
                }
        }
 
                }
        }
 
index 999e0bb..388b914 100644 (file)
@@ -316,7 +316,7 @@ class HtmlTest extends MediaWikiTestCase {
 
        /**
         * How do we handle duplicate keys in HTML attributes expansion?
 
        /**
         * How do we handle duplicate keys in HTML attributes expansion?
-        * We could pass a "class" the values: 'GREEN' and array( 'GREEN' => false )
+        * We could pass a "class" the values: 'GREEN' and [ 'GREEN' => false ]
         * The latter will take precedence.
         *
         * Feature added by r96188
         * The latter will take precedence.
         *
         * Feature added by r96188
index 6e62afd..37ebf4c 100644 (file)
@@ -237,7 +237,7 @@ class StatusTest extends MediaWikiLangTestCase {
        }
 
        /**
        }
 
        /**
-        * @param array $messageDetails E.g. array( 'KEY' => array(/PARAMS/) )
+        * @param array $messageDetails E.g. [ 'KEY' => [ /PARAMS/ ] ]
         * @return Message[]
         */
        protected function getMockMessages( $messageDetails ) {
         * @return Message[]
         */
        protected function getMockMessages( $messageDetails ) {
index e50e1bc..fd45732 100644 (file)
@@ -73,8 +73,8 @@ class TestLogger extends \Psr\Log\AbstractLogger {
 
        /**
         * Return the collected logs
 
        /**
         * Return the collected logs
-        * @return array Array of array( string $level, string $message ), or
-        *   array( string $level, string $message, array $context ) if $collectContext was true.
+        * @return array Array of [ string $level, string $message ], or
+        *   [ string $level, string $message, array $context ] if $collectContext was true.
         */
        public function getBuffer() {
                return $this->buffer;
         */
        public function getBuffer() {
                return $this->buffer;
index d6c3401..529d9fb 100644 (file)
@@ -338,7 +338,7 @@ class TitleTest extends MediaWikiTestCase {
        public function testWgWhitelistReadRegexp( $whitelistRegexp, $source, $action, $expected ) {
                // $wgWhitelistReadRegexp must be an array. Since the provided test cases
                // usually have only one regex, it is more concise to write the lonely regex
        public function testWgWhitelistReadRegexp( $whitelistRegexp, $source, $action, $expected ) {
                // $wgWhitelistReadRegexp must be an array. Since the provided test cases
                // usually have only one regex, it is more concise to write the lonely regex
-               // as a string. Thus we cast to an array() to honor $wgWhitelistReadRegexp
+               // as a string. Thus we cast to a [] to honor $wgWhitelistReadRegexp
                // type requisite.
                if ( is_string( $whitelistRegexp ) ) {
                        $whitelistRegexp = [ $whitelistRegexp ];
                // type requisite.
                if ( is_string( $whitelistRegexp ) ) {
                        $whitelistRegexp = [ $whitelistRegexp ];
index 7869bbd..71a77b6 100644 (file)
@@ -86,7 +86,7 @@ STR;
        /**
         * Checks that the request's result matches the expected results.
         * Assumes no rawcontinue and a complete batch.
        /**
         * Checks that the request's result matches the expected results.
         * Assumes no rawcontinue and a complete batch.
-        * @param array $values Array is a two element array( request, expected_results )
+        * @param array $values Array is a two element [ request, expected_results ]
         * @param array|null $session
         * @param bool $appendModule
         * @param User|null $user
         * @param array|null $session
         * @param bool $appendModule
         * @param User|null $user
index 9ec53c0..9f2fb1c 100644 (file)
@@ -481,7 +481,7 @@ class IPTest extends PHPUnit\Framework\TestCase {
                $this->assertFalseCIDR( '192.0.2.0/33', "mask > 32" );
 
                // Check internal logic
                $this->assertFalseCIDR( '192.0.2.0/33', "mask > 32" );
 
                // Check internal logic
-               # 0 mask always result in array(0,0)
+               # 0 mask always result in [ 0, 0 ]
                $this->assertEquals( [ 0, 0 ], IP::parseCIDR( '192.0.0.2/0' ) );
                $this->assertEquals( [ 0, 0 ], IP::parseCIDR( '0.0.0.0/0' ) );
                $this->assertEquals( [ 0, 0 ], IP::parseCIDR( '255.255.255.255/0' ) );
                $this->assertEquals( [ 0, 0 ], IP::parseCIDR( '192.0.0.2/0' ) );
                $this->assertEquals( [ 0, 0 ], IP::parseCIDR( '0.0.0.0/0' ) );
                $this->assertEquals( [ 0, 0 ], IP::parseCIDR( '255.255.255.255/0' ) );
index 4f4fa25..4dd6c80 100644 (file)
@@ -15,9 +15,9 @@ class SpecialSearchTest extends MediaWikiTestCase {
         * @covers SpecialSearch::load
         * @dataProvider provideSearchOptionsTests
         * @param array $requested Request parameters. For example:
         * @covers SpecialSearch::load
         * @dataProvider provideSearchOptionsTests
         * @param array $requested Request parameters. For example:
-        *   array( 'ns5' => true, 'ns6' => true). Null to use default options.
+        *   [ 'ns5' => true, 'ns6' => true ]. Null to use default options.
         * @param array $userOptions User options to test with. For example:
         * @param array $userOptions User options to test with. For example:
-        *   array('searchNs5' => 1 );. Null to use default options.
+        *   [ 'searchNs5' => 1 ];. Null to use default options.
         * @param string $expectedProfile An expected search profile name
         * @param array $expectedNS Expected namespaces
         * @param string $message
         * @param string $expectedProfile An expected search profile name
         * @param array $expectedNS Expected namespaces
         * @param string $message
index 52b1433..dd21add 100644 (file)
@@ -49,7 +49,7 @@ class BatchRowUpdateTest extends MediaWikiTestCase {
                        $this->assertEquals( $response[$pos], $rows, "Testing row in position $pos" );
                        $pos++;
                }
                        $this->assertEquals( $response[$pos], $rows, "Testing row in position $pos" );
                        $pos++;
                }
-               // -1 is because the final array() marks the end and isnt included
+               // -1 is because the final [] marks the end and isn't included
                $this->assertEquals( count( $response ) - 1, $pos );
        }
 
                $this->assertEquals( count( $response ) - 1, $pos );
        }
 
index 6b81a66..e600021 100644 (file)
@@ -67,7 +67,7 @@ class UIDGeneratorTest extends PHPUnit\Framework\TestCase {
        }
 
        /**
        }
 
        /**
-        * array( method, length, bits, hostbits )
+        * [ method, length, bits, hostbits ]
         * NOTE: When adding a new method name here please update the covers tags for the tests!
         */
        public static function provider_testTimestampedUID() {
         * NOTE: When adding a new method name here please update the covers tags for the tests!
         */
        public static function provider_testTimestampedUID() {