Clean up array() syntax in docs, part IV
authorAmir Sarabadani <Ladsgroup@gmail.com>
Fri, 26 Aug 2016 11:36:58 +0000 (16:06 +0430)
committerAmir Sarabadani <Ladsgroup@gmail.com>
Fri, 26 Aug 2016 11:36:58 +0000 (16:06 +0430)
Change-Id: If626409a93d31bf90c054c9bf7ba44a78ea9a621

includes/Message.php
includes/debug/logger/MonologSpi.php
includes/installer/Installer.php
includes/installer/LocalSettingsGenerator.php
includes/parser/Parser.php
includes/resourceloader/ResourceLoaderModule.php
includes/upload/UploadBase.php

index 2c979de..c2c954a 100644 (file)
  *
  * @code
  *     // old style:
- *     wfMsgExt( 'key', array( 'parseinline' ), 'apple' );
+ *     wfMsgExt( 'key', [ 'parseinline' ], 'apple' );
  *     // new style:
  *     wfMessage( 'key', 'apple' )->parse();
  * @endcode
  * Places where HTML cannot be used. {{-transformation is done.
  * @code
  *     // old style:
- *     wfMsgExt( 'key', array( 'parsemag' ), 'apple', 'pear' );
+ *     wfMsgExt( 'key', [ 'parsemag' ], 'apple', 'pear' );
  *     // new style:
  *     wfMessage( 'key', 'apple', 'pear' )->text();
  * @endcode
index 49ad9e6..f44ff1c 100644 (file)
@@ -39,73 +39,73 @@ use ObjectFactory;
  * global configuration variable used by LoggerFactory to construct its
  * default SPI provider:
  * @code
- * $wgMWLoggerDefaultSpi = array(
+ * $wgMWLoggerDefaultSpi = [
  *   'class' => '\\MediaWiki\\Logger\\MonologSpi',
- *   'args' => array( array(
- *       'loggers' => array(
- *           '@default' => array(
- *               'processors' => array( 'wiki', 'psr', 'pid', 'uid', 'web' ),
- *               'handlers'   => array( 'stream' ),
- *           ),
- *           'runJobs' => array(
- *               'processors' => array( 'wiki', 'psr', 'pid' ),
- *               'handlers'   => array( 'stream' ),
- *           )
- *       ),
- *       'processors' => array(
- *           'wiki' => array(
+ *   'args' => [ [
+ *       'loggers' => [
+ *           '@default' => [
+ *               'processors' => [ 'wiki', 'psr', 'pid', 'uid', 'web' ],
+ *               'handlers'   => [ 'stream' ],
+ *           ],
+ *           'runJobs' => [
+ *               'processors' => [ 'wiki', 'psr', 'pid' ],
+ *               'handlers'   => [ 'stream' ],
+ *           ]
+ *       ],
+ *       'processors' => [
+ *           'wiki' => [
  *               'class' => '\\MediaWiki\\Logger\\Monolog\\WikiProcessor',
- *           ),
- *           'psr' => array(
+ *           ],
+ *           'psr' => [
  *               'class' => '\\Monolog\\Processor\\PsrLogMessageProcessor',
- *           ),
- *           'pid' => array(
+ *           ],
+ *           'pid' => [
  *               'class' => '\\Monolog\\Processor\\ProcessIdProcessor',
- *           ),
- *           'uid' => array(
+ *           ],
+ *           'uid' => [
  *               'class' => '\\Monolog\\Processor\\UidProcessor',
- *           ),
- *           'web' => array(
+ *           ],
+ *           'web' => [
  *               'class' => '\\Monolog\\Processor\\WebProcessor',
- *           ),
- *       ),
- *       'handlers' => array(
- *           'stream' => array(
+ *           ],
+ *       ],
+ *       'handlers' => [
+ *           'stream' => [
  *               'class'     => '\\Monolog\\Handler\\StreamHandler',
- *               'args'      => array( 'path/to/your.log' ),
+ *               'args'      => [ 'path/to/your.log' ],
  *               'formatter' => 'line',
- *           ),
- *           'redis' => array(
+ *           ],
+ *           'redis' => [
  *               'class'     => '\\Monolog\\Handler\\RedisHandler',
- *               'args'      => array( function() {
+ *               'args'      => [ function() {
  *                       $redis = new Redis();
  *                       $redis->connect( '127.0.0.1', 6379 );
  *                       return $redis;
  *                   },
  *                   'logstash'
- *               ),
+ *               ],
  *               'formatter' => 'logstash',
  *               'buffer' => true,
- *           ),
- *           'udp2log' => array(
+ *           ],
+ *           'udp2log' => [
  *               'class' => '\\MediaWiki\\Logger\\Monolog\\LegacyHandler',
- *               'args' => array(
+ *               'args' => [
  *                   'udp://127.0.0.1:8420/mediawiki
- *               ),
+ *               ],
  *               'formatter' => 'line',
- *           ),
- *       ),
- *       'formatters' => array(
- *           'line' => array(
+ *           ],
+ *       ],
+ *       'formatters' => [
+ *           'line' => [
  *               'class' => '\\Monolog\\Formatter\\LineFormatter',
- *            ),
- *            'logstash' => array(
+ *            ],
+ *            'logstash' => [
  *                'class' => '\\Monolog\\Formatter\\LogstashFormatter',
- *                'args'  => array( 'mediawiki', php_uname( 'n' ), null, '', 1 ),
- *            ),
- *       ),
- *   ) ),
- * );
+ *                'args'  => [ 'mediawiki', php_uname( 'n' ), null, '', 1 ],
+ *            ],
+ *       ],
+ *   ] ],
+ * ];
  * @endcode
  *
  * @see https://github.com/Seldaek/monolog
index d508d76..eafb9d4 100644 (file)
@@ -1437,10 +1437,10 @@ abstract class Installer {
 
        /**
         * Get an array of install steps. Should always be in the format of
-        * array(
+        * [
         *   'name'     => 'someuniquename',
-        *   'callback' => array( $obj, 'method' ),
-        * )
+        *   'callback' => [ $obj, 'method' ],
+        * ]
         * There must be a config-install-$name message defined per step, which will
         * be shown on install.
         *
@@ -1724,7 +1724,7 @@ abstract class Installer {
         * Add an installation step following the given step.
         *
         * @param callable $callback A valid installation callback array, in this form:
-        *    array( 'name' => 'some-unique-name', 'callback' => array( $obj, 'function' ) );
+        *    [ 'name' => 'some-unique-name', 'callback' => [ $obj, 'function' ] ];
         * @param string $findStep The step to find. Omit to put the step at the beginning
         */
        public function addInstallStep( $callback, $findStep = 'BEGINNING' ) {
index 1d7c7f2..a9e3e85 100644 (file)
@@ -98,7 +98,7 @@ class LocalSettingsGenerator {
         * For $wgGroupPermissions, set a given ['group']['permission'] value.
         * @param string $group Group name
         * @param array $rightsArr An array of permissions, in the form of:
-        *   array( 'right' => true, 'right2' => false )
+        *   [ 'right' => true, 'right2' => false ]
         */
        public function setGroupRights( $group, $rightsArr ) {
                $this->groupPermissions[$group] = $rightsArr;
index b116bd4..035baac 100644 (file)
@@ -906,11 +906,11 @@ class Parser {
         * the form:
         *
         * @code
-        *   'UNIQ-xxxxx' => array(
+        *   'UNIQ-xxxxx' => [
         *     'element',
         *     'tag content',
-        *     array( 'param' => 'x' ),
-        *     '<element param="x">tag content</element>' ) )
+        *     [ 'param' => 'x' ],
+        *     '<element param="x">tag content</element>' ]
         * @endcode
         *
         * @param array $elements List of element names. Comments are always extracted.
index 48e7937..de89fc7 100644 (file)
@@ -264,8 +264,8 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
         *
         * @param ResourceLoaderContext $context
         * @return array List of CSS strings or array of CSS strings keyed by media type.
-        *  like array( 'screen' => '.foo { width: 0 }' );
-        *  or array( 'screen' => array( '.foo { width: 0 }' ) );
+        *  like [ 'screen' => '.foo { width: 0 }' ];
+        *  or [ 'screen' => [ '.foo { width: 0 }' ] ];
         */
        public function getStyles( ResourceLoaderContext $context ) {
                // Stub, override expected
@@ -279,7 +279,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
         * load the files directly. See also getScriptURLsForDebug()
         *
         * @param ResourceLoaderContext $context
-        * @return array Array( mediaType => array( URL1, URL2, ... ), ... )
+        * @return array [ mediaType => [ URL1, URL2, ... ], ... ]
         */
        public function getStyleURLsForDebug( ResourceLoaderContext $context ) {
                $resourceLoader = $context->getResourceLoader();
@@ -637,7 +637,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
                // Styles
                if ( $context->shouldIncludeStyles() ) {
                        $styles = [];
-                       // Don't create empty stylesheets like array( '' => '' ) for modules
+                       // Don't create empty stylesheets like [ '' => '' ] for modules
                        // that don't *have* any stylesheets (bug 38024).
                        $stylePairs = $this->getStyles( $context );
                        if ( count( $stylePairs ) ) {
index e2f7763..b37c831 100644 (file)
@@ -1659,7 +1659,7 @@ abstract class UploadBase {
         * @return array Containing the namespace URI and prefix
         */
        private static function splitXmlNamespace( $element ) {
-               // 'http://www.w3.org/2000/svg:script' -> array( 'http://www.w3.org/2000/svg', 'script' )
+               // 'http://www.w3.org/2000/svg:script' -> [ 'http://www.w3.org/2000/svg', 'script' ]
                $parts = explode( ':', strtolower( $element ) );
                $name = array_pop( $parts );
                $ns = implode( ':', $parts );