Clean up array() syntax from docs, part VI
authorAmir Sarabadani <Ladsgroup@gmail.com>
Mon, 12 Sep 2016 10:06:37 +0000 (14:36 +0430)
committerAmir Sarabadani <Ladsgroup@gmail.com>
Mon, 12 Sep 2016 10:06:37 +0000 (14:36 +0430)
Change-Id: Ib0eea494e2065c7ab356dc45fd174544a9c1c942

12 files changed:
includes/EditPage.php
includes/MagicWord.php
includes/PathRouter.php
includes/debug/logger/LegacySpi.php
includes/debug/logger/NullSpi.php
includes/exception/UserNotLoggedIn.php
includes/resourceloader/ResourceLoader.php
includes/resourceloader/ResourceLoaderFileModule.php
includes/resourceloader/ResourceLoaderImageModule.php
includes/resourceloader/ResourceLoaderModule.php
includes/skins/BaseTemplate.php
includes/skins/Skin.php

index 7e4e411..c5330ee 100644 (file)
@@ -3042,14 +3042,14 @@ class EditPage {
         * subclasses may reorganize the form.
         * Note that you do not need to worry about the label's for=, it will be
         * inferred by the id given to the input. You can remove them both by
-        * passing array( 'id' => false ) to $userInputAttrs.
+        * passing [ 'id' => false ] to $userInputAttrs.
         *
         * @param string $summary The value of the summary input
         * @param string $labelText The html to place inside the label
         * @param array $inputAttrs Array of attrs to use on the input
         * @param array $spanLabelAttrs Array of attrs to use on the span inside the label
         *
-        * @return array An array in the format array( $label, $input )
+        * @return array An array in the format [ $label, $input ]
         */
        function getSummaryInput( $summary = "", $labelText = null,
                $inputAttrs = null, $spanLabelAttrs = null
index 13f706d..391e05a 100644 (file)
  *
  * @par Example:
  * @code
- * $magicWords = array();
+ * $magicWords = [];
  *
- * $magicWords['en'] = array(
- *     'magicwordkey' => array( 0, 'case_insensitive_magic_word' ),
- *     'magicwordkey2' => array( 1, 'CASE_sensitive_magic_word2' ),
- * );
+ * $magicWords['en'] = [
+ *     'magicwordkey' => [ 0, 'case_insensitive_magic_word' ],
+ *     'magicwordkey2' => [ 1, 'CASE_sensitive_magic_word2' ],
+ * ];
  * @endcode
  *
  * For magic words which are also Parser variables, add a MagicWordwgVariableIDs
index 005c341..049b32f 100644 (file)
  *
  * $router->add( "/wiki/$1" );
  *   - Matches /wiki/Foo style urls and extracts the title
- * $router->add( array( 'edit' => "/edit/$key" ), array( 'action' => '$key' ) );
+ * $router->add( [ 'edit' => "/edit/$key" ], [ 'action' => '$key' ] );
  *   - Matches /edit/Foo style urls and sets action=edit
  * $router->add( '/$2/$1',
- *   array( 'variant' => '$2' ),
- *   array( '$2' => array( 'zh-hant', 'zh-hans' )
+ *   [ 'variant' => '$2' ],
+ *   [ '$2' => [ 'zh-hant', 'zh-hans' ] ]
  * );
  *   - Matches /zh-hant/Foo or /zh-hans/Foo
- * $router->addStrict( "/foo/Bar", array( 'title' => 'Baz' ) );
+ * $router->addStrict( "/foo/Bar", [ 'title' => 'Baz' ] );
  *   - Matches /foo/Bar explicitly and uses "Baz" as the title
- * $router->add( '/help/$1', array( 'title' => 'Help:$1' ) );
+ * $router->add( '/help/$1', [ 'title' => 'Help:$1' ] );
  *   - Matches /help/Foo with "Help:Foo" as the title
- * $router->add( '/$1', array( 'foo' => array( 'value' => 'bar$2' ) );
+ * $router->add( '/$1', [ 'foo' => [ 'value' => 'bar$2' ] ] );
  *   - Matches /Foo and sets 'foo' to 'bar$2' without $2 being replaced
- * $router->add( '/$1', array( 'data:foo' => 'bar' ), array( 'callback' => 'functionname' ) );
+ * $router->add( '/$1', [ 'data:foo' => 'bar' ], [ 'callback' => 'functionname' ] );
  *   - Matches /Foo, adds the key 'foo' with the value 'bar' to the data array
  *     and calls functionname( &$matches, $data );
  *
@@ -56,7 +56,7 @@
  *   - The default behavior is equivalent to `array( 'title' => '$1' )`,
  *     if you don't want the title parameter you can explicitly use `array( 'title' => false )`
  *   - You can specify a value that won't have replacements in it
- *     using `'foo' => array( 'value' => 'bar' );`
+ *     using `'foo' => [ 'value' => 'bar' ];`
  *
  * Options:
  *   - The option keys $1, $2, etc... can be specified to restrict the possible values
index a6b53ec..4cf8313 100644 (file)
@@ -25,9 +25,9 @@ namespace MediaWiki\Logger;
  *
  * Usage:
  * @code
- * $wgMWLoggerDefaultSpi = array(
+ * $wgMWLoggerDefaultSpi = [
  *   'class' => '\\MediaWiki\\Logger\\LegacySpi',
- * );
+ * ];
  * @endcode
  *
  * @see \MediaWiki\Logger\LoggerFactory
index f92ff7d..82308d0 100644 (file)
@@ -28,9 +28,9 @@ use Psr\Log\NullLogger;
  *
  * Usage:
  *
- *     $wgMWLoggerDefaultSpi = array(
+ *     $wgMWLoggerDefaultSpi = [
  *         'class' => '\\MediaWiki\\Logger\\NullSpi',
- *     );
+ *     ];
  *
  * @see \MediaWiki\Logger\LoggerFactory
  * @since 1.25
index b7c3489..43c5b09 100644 (file)
@@ -62,7 +62,7 @@ class UserNotLoggedIn extends ErrorPageError {
         * @param string $titleMsg A message key to set the page title.
         *        Optional, default: 'exception-nologin'
         * @param array $params Parameters to wfMessage().
-        *        Optional, default: array()
+        *        Optional, default: []
         */
        public function __construct(
                $reasonMsg = 'exception-nologin-text',
index ad1ed49..97a86c3 100644 (file)
@@ -1273,9 +1273,9 @@ MESSAGE;
         * Values considered empty:
         *
         * - null
-        * - array()
+        * - []
         * - new XmlJsCode( '{}' )
-        * - new stdClass() // (object) array()
+        * - new stdClass() // (object) []
         *
         * @param Array $array
         */
index 574e535..2dcc841 100644 (file)
@@ -177,26 +177,26 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         *         // Scripts to always include
         *         'scripts' => [file path string or array of file path strings],
         *         // Scripts to include in specific language contexts
-        *         'languageScripts' => array(
+        *         'languageScripts' => [
         *             [language code] => [file path string or array of file path strings],
-        *         ),
+        *         ],
         *         // Scripts to include in specific skin contexts
-        *         'skinScripts' => array(
+        *         'skinScripts' => [
         *             [skin name] => [file path string or array of file path strings],
-        *         ),
+        *         ],
         *         // Scripts to include in debug contexts
         *         'debugScripts' => [file path string or array of file path strings],
         *         // Modules which must be loaded before this module
         *         'dependencies' => [module name string or array of module name strings],
-        *         'templates' => array(
+        *         'templates' => [
         *             [template alias with file.ext] => [file path to a template file],
-        *         ),
+        *         ],
         *         // Styles to always load
         *         'styles' => [file path string or array of file path strings],
         *         // Styles to include in specific skin contexts
-        *         'skinStyles' => array(
+        *         'skinStyles' => [
         *             [skin name] => [file path string or array of file path strings],
-        *         ),
+        *         ],
         *         // Messages to always load
         *         'messages' => [array of message key strings],
         *         // Group which this module should be loaded together with
index 43327c9..6a8957e 100644 (file)
@@ -59,7 +59,7 @@ class ResourceLoaderImageModule extends ResourceLoaderModule {
         * Below is a description for the $options array:
         * @par Construction options:
         * @code
-        *     array(
+        *     [
         *         // Base path to prepend to all local paths in $options. Defaults to $IP
         *         'localBasePath' => [base path],
         *         // Path to JSON file that contains any of the settings below
@@ -72,33 +72,33 @@ class ResourceLoaderImageModule extends ResourceLoaderModule {
         *         'selectorWithoutVariant' => [CSS selector template, variables: {prefix} {name}],
         *         'selectorWithVariant' => [CSS selector template, variables: {prefix} {name} {variant}],
         *         // List of variants that may be used for the image files
-        *         'variants' => array(
-        *             [theme name] => array(
-        *                 [variant name] => array(
+        *         'variants' => [
+        *             [theme name] => [
+        *                 [variant name] => [
         *                     'color' => [color string, e.g. '#ffff00'],
         *                     'global' => [boolean, if true, this variant is available
         *                                  for all images of this type],
-        *                 ),
+        *                 ],
         *                 ...
-        *             ),
+        *             ],
         *             ...
-        *         ),
+        *         ],
         *         // List of image files and their options
-        *         'images' => array(
-        *             [theme name] => array(
-        *                 [icon name] => array(
+        *         'images' => [
+        *             [theme name] => [
+        *                 [icon name] => [
         *                     'file' => [file path string or array whose values are file path strings
         *                                    and whose keys are 'default', 'ltr', 'rtl', a single
         *                                    language code like 'en', or a list of language codes like
         *                                    'en,de,ar'],
         *                     'variants' => [array of variant name strings, variants
         *                                    available for this image],
-        *                 ),
+        *                 ],
         *                 ...
-        *             ),
+        *             ],
         *             ...
-        *         ),
-        *     )
+        *         ],
+        *     ]
         * @endcode
         * @throws InvalidArgumentException
         */
index 44f7e12..2351efd 100644 (file)
@@ -789,10 +789,10 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
         *
         * @code
         *     $summary = parent::getDefinitionSummary( $context );
-        *     $summary[] = array(
+        *     $summary[] = [
         *         'foo' => 123,
         *         'bar' => 'quux',
-        *     );
+        *     ];
         *     return $summary;
         * @endcode
         *
index 71ca57b..2d37a0f 100644 (file)
@@ -320,10 +320,10 @@ abstract class BaseTemplate extends QuickTemplate {
         *
         * If a "data" key is present, it must be an array, where the keys represent
         * the data-xxx properties with their provided values. For example,
-        *  $item['data'] = array(
+        *  $item['data'] = [
         *       'foo' => 1,
         *       'bar' => 'baz',
-        *  );
+        *  ];
         * will render as element properties:
         *  data-foo='1' data-bar='baz'
         *
@@ -333,7 +333,7 @@ abstract class BaseTemplate extends QuickTemplate {
         *   a link in. This should be an array of arrays containing a 'tag' and
         *   optionally an 'attributes' key. If you only have one element you don't
         *   need to wrap it in another array. eg: To use <a><span>...</span></a>
-        *   in all links use array( 'text-wrapper' => array( 'tag' => 'span' ) )
+        *   in all links use [ 'text-wrapper' => [ 'tag' => 'span' ] ]
         *   for your options.
         *   - 'link-class' key can be used to specify additional classes to apply
         *   to all links.
index 6b4acfa..b60aa10 100644 (file)
@@ -1169,7 +1169,7 @@ abstract class Skin extends ContextSource {
         *
         * BaseTemplate::getSidebar can be used to simplify the format and id generation in new skins.
         *
-        * The format of the returned array is array( heading => content, ... ), where:
+        * The format of the returned array is [ heading => content, ... ], where:
         * - heading is the heading of a navigation portlet. It is either:
         *   - magic string to be handled by the skins ('SEARCH' / 'LANGUAGES' / 'TOOLBOX' / ...)
         *   - a message name (e.g. 'navigation'), the message should be HTML-escaped by the skin