Clean array() syntax in docs, part V
authorAmir Sarabadani <Ladsgroup@gmail.com>
Sun, 4 Sep 2016 22:14:26 +0000 (02:44 +0430)
committerAmir Sarabadani <Ladsgroup@gmail.com>
Sun, 4 Sep 2016 22:14:26 +0000 (02:44 +0430)
Change-Id: Ic65b7b2f1c2396246a3825c8d06d42bd6d06c37e

includes/Preferences.php
includes/filebackend/FileBackend.php
includes/filerepo/FileRepo.php
includes/filerepo/ForeignAPIRepo.php
includes/jobqueue/jobs/NullJob.php
includes/page/WikiPage.php
includes/specials/SpecialUploadStash.php
includes/specials/pagers/AllMessagesTablePager.php
includes/utils/RowUpdateGenerator.php

index 5a9f0b0..9f8c06b 100644 (file)
@@ -1594,7 +1594,7 @@ class PreferencesForm extends HTMLForm {
         * Get extra parameters for the query string when redirecting after
         * successful save.
         *
-        * @return array()
+        * @return array
         */
        public function getExtraSuccessRedirectParameters() {
                return [];
index 10183f4..d59c703 100644 (file)
@@ -241,31 +241,31 @@ abstract class FileBackend {
         *
         * a) Create a new file in storage with the contents of a string
         * @code
-        *     array(
+        *     [
         *         'op'                  => 'create',
         *         'dst'                 => <storage path>,
         *         'content'             => <string of new file contents>,
         *         'overwrite'           => <boolean>,
         *         'overwriteSame'       => <boolean>,
         *         'headers'             => <HTTP header name/value map> # since 1.21
-        *     );
+        *     ]
         * @endcode
         *
         * b) Copy a file system file into storage
         * @code
-        *     array(
+        *     [
         *         'op'                  => 'store',
         *         'src'                 => <file system path, FSFile, or TempFSFile>,
         *         'dst'                 => <storage path>,
         *         'overwrite'           => <boolean>,
         *         'overwriteSame'       => <boolean>,
         *         'headers'             => <HTTP header name/value map> # since 1.21
-        *     )
+        *     ]
         * @endcode
         *
         * c) Copy a file within storage
         * @code
-        *     array(
+        *     [
         *         'op'                  => 'copy',
         *         'src'                 => <storage path>,
         *         'dst'                 => <storage path>,
@@ -273,12 +273,12 @@ abstract class FileBackend {
         *         'overwriteSame'       => <boolean>,
         *         'ignoreMissingSource' => <boolean>, # since 1.21
         *         'headers'             => <HTTP header name/value map> # since 1.21
-        *     )
+        *     ]
         * @endcode
         *
         * d) Move a file within storage
         * @code
-        *     array(
+        *     [
         *         'op'                  => 'move',
         *         'src'                 => <storage path>,
         *         'dst'                 => <storage path>,
@@ -286,32 +286,32 @@ abstract class FileBackend {
         *         'overwriteSame'       => <boolean>,
         *         'ignoreMissingSource' => <boolean>, # since 1.21
         *         'headers'             => <HTTP header name/value map> # since 1.21
-        *     )
+        *     ]
         * @endcode
         *
         * e) Delete a file within storage
         * @code
-        *     array(
+        *     [
         *         'op'                  => 'delete',
         *         'src'                 => <storage path>,
         *         'ignoreMissingSource' => <boolean>
-        *     )
+        *     ]
         * @endcode
         *
         * f) Update metadata for a file within storage
         * @code
-        *     array(
+        *     [
         *         'op'                  => 'describe',
         *         'src'                 => <storage path>,
         *         'headers'             => <HTTP header name/value map>
-        *     )
+        *     ]
         * @endcode
         *
         * g) Do nothing (no-op)
         * @code
-        *     array(
+        *     [
         *         'op'                  => 'null',
-        *     )
+        *     ]
         * @endcode
         *
         * Boolean flags for operations (operation-specific):
@@ -513,69 +513,69 @@ abstract class FileBackend {
         *
         * a) Create a new file in storage with the contents of a string
         * @code
-        *     array(
+        *     [
         *         'op'                  => 'create',
         *         'dst'                 => <storage path>,
         *         'content'             => <string of new file contents>,
         *         'headers'             => <HTTP header name/value map> # since 1.21
-        *     )
+        *     ]
         * @endcode
         *
         * b) Copy a file system file into storage
         * @code
-        *     array(
+        *     [
         *         'op'                  => 'store',
         *         'src'                 => <file system path, FSFile, or TempFSFile>,
         *         'dst'                 => <storage path>,
         *         'headers'             => <HTTP header name/value map> # since 1.21
-        *     )
+        *     ]
         * @endcode
         *
         * c) Copy a file within storage
         * @code
-        *     array(
+        *     [
         *         'op'                  => 'copy',
         *         'src'                 => <storage path>,
         *         'dst'                 => <storage path>,
         *         'ignoreMissingSource' => <boolean>, # since 1.21
         *         'headers'             => <HTTP header name/value map> # since 1.21
-        *     )
+        *     ]
         * @endcode
         *
         * d) Move a file within storage
         * @code
-        *     array(
+        *     [
         *         'op'                  => 'move',
         *         'src'                 => <storage path>,
         *         'dst'                 => <storage path>,
         *         'ignoreMissingSource' => <boolean>, # since 1.21
         *         'headers'             => <HTTP header name/value map> # since 1.21
-        *     )
+        *     ]
         * @endcode
         *
         * e) Delete a file within storage
         * @code
-        *     array(
+        *     [
         *         'op'                  => 'delete',
         *         'src'                 => <storage path>,
         *         'ignoreMissingSource' => <boolean>
-        *     )
+        *     ]
         * @endcode
         *
         * f) Update metadata for a file within storage
         * @code
-        *     array(
+        *     [
         *         'op'                  => 'describe',
         *         'src'                 => <storage path>,
         *         'headers'             => <HTTP header name/value map>
-        *     )
+        *     ]
         * @endcode
         *
         * g) Do nothing (no-op)
         * @code
-        *     array(
+        *     [
         *         'op'                  => 'null',
-        *     )
+        *     ]
         * @endcode
         *
         * @par Boolean flags for operations (operation-specific):
index 4ab913d..b8b1cf6 100644 (file)
@@ -482,8 +482,8 @@ class FileRepo {
         * @param array $items An array of titles, or an array of findFile() options with
         *    the "title" option giving the title. Example:
         *
-        *     $findItem = array( 'title' => $title, 'private' => true );
-        *     $findBatch = array( $findItem );
+        *     $findItem = [ 'title' => $title, 'private' => true ];
+        *     $findBatch = [ $findItem ];
         *     $repo->findFiles( $findBatch );
         *
         *    No title should appear in $items twice, as the result use titles as keys
index 8619ba6..645a59b 100644 (file)
@@ -28,13 +28,13 @@ use MediaWiki\Logger\LoggerFactory;
  *
  * Example config:
  *
- * $wgForeignFileRepos[] = array(
+ * $wgForeignFileRepos[] = [
  *   'class'                  => 'ForeignAPIRepo',
  *   'name'                   => 'shared',
  *   'apibase'                => 'https://en.wikipedia.org/w/api.php',
  *   'fetchDescription'       => true, // Optional
  *   'descriptionCacheExpiry' => 3600,
- * );
+ * ];
  *
  * @ingroup FileRepo
  */
index 26d3c5c..80826fe 100644 (file)
@@ -31,7 +31,7 @@
  * @code
  * $ php maintenance/eval.php
  * > $queue = JobQueueGroup::singleton();
- * > $job = new NullJob( Title::newMainPage(), array( 'lives' => 10 ) );
+ * > $job = new NullJob( Title::newMainPage(), [ 'lives' => 10 ] );
  * > $queue->push( $job );
  * @endcode
  * You can then confirm the job has been enqueued by using the showJobs.php
index 5459629..e5ce924 100644 (file)
@@ -2713,14 +2713,14 @@ class WikiPage implements Page, IDBAccessObject {
                $protectDescription = '';
 
                foreach ( array_filter( $limit ) as $action => $restrictions ) {
-                       # $action is one of $wgRestrictionTypes = array( 'create', 'edit', 'move', 'upload' ).
+                       # $action is one of $wgRestrictionTypes = [ 'create', 'edit', 'move', 'upload' ].
                        # All possible message keys are listed here for easier grepping:
                        # * restriction-create
                        # * restriction-edit
                        # * restriction-move
                        # * restriction-upload
                        $actionText = wfMessage( 'restriction-' . $action )->inContentLanguage()->text();
-                       # $restrictions is one of $wgRestrictionLevels = array( '', 'autoconfirmed', 'sysop' ),
+                       # $restrictions is one of $wgRestrictionLevels = [ '', 'autoconfirmed', 'sysop' ],
                        # with '' filtered out. All possible message keys are listed below:
                        # * protect-level-autoconfirmed
                        # * protect-level-sysop
index 1412324..9573f33 100644 (file)
@@ -181,7 +181,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
         * Scale a file (probably with a locally installed imagemagick, or similar)
         * and output it to STDOUT.
         * @param File $file
-        * @param array $params Scaling parameters ( e.g. array( width => '50' ) );
+        * @param array $params Scaling parameters ( e.g. [ width => '50' ] );
         * @param int $flags Scaling flags ( see File:: constants )
         * @throws MWException|UploadStashFileNotFoundException
         * @return bool Success
@@ -227,7 +227,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
         * client to cache it forever.
         *
         * @param File $file
-        * @param array $params Scaling parameters ( e.g. array( width => '50' ) );
+        * @param array $params Scaling parameters ( e.g. [ width => '50' ] );
         * @param int $flags Scaling flags ( see File:: constants )
         * @throws MWException
         * @return bool Success
index 60f642d..ee8b3da 100644 (file)
@@ -184,7 +184,7 @@ class AllMessagesTablePager extends TablePager {
 
        /**
         * Determine which of the MediaWiki and MediaWiki_talk namespace pages exist.
-        * Returns array( 'pages' => ..., 'talks' => ... ), where the subarrays have
+        * Returns [ 'pages' => ..., 'talks' => ... ], where the subarrays have
         * an entry for each existing page, with the key being the message name and
         * value arbitrary.
         *
index 6a4792c..342dffd 100644 (file)
@@ -26,10 +26,10 @@ interface RowUpdateGenerator {
         * updated value within the database row.
         *
         * Sample Response:
-        *   return array(
+        *   return [
         *       'some_col' => 'new value',
         *       'other_col' => 99,
-        *   );
+        *   ];
         *
         * @param stdClass $row A row from the database
         * @return array Map of column names to updated value within the