From: Amir Sarabadani Date: Sun, 4 Sep 2016 22:14:26 +0000 (+0430) Subject: Clean array() syntax in docs, part V X-Git-Tag: 1.31.0-rc.0~5768^2 X-Git-Url: https://git.cyclocoop.org/?a=commitdiff_plain;h=381cffb9808faf14f37ede438fafe3c2bb92d7f2;p=lhc%2Fweb%2Fwiklou.git Clean array() syntax in docs, part V Change-Id: Ic65b7b2f1c2396246a3825c8d06d42bd6d06c37e --- diff --git a/includes/Preferences.php b/includes/Preferences.php index 5a9f0b055d..9f8c06b9bf 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -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 []; diff --git a/includes/filebackend/FileBackend.php b/includes/filebackend/FileBackend.php index 10183f490d..d59c70313c 100644 --- a/includes/filebackend/FileBackend.php +++ b/includes/filebackend/FileBackend.php @@ -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' => , * 'content' => , * 'overwrite' => , * 'overwriteSame' => , * 'headers' => # since 1.21 - * ); + * ] * @endcode * * b) Copy a file system file into storage * @code - * array( + * [ * 'op' => 'store', * 'src' => , * 'dst' => , * 'overwrite' => , * 'overwriteSame' => , * 'headers' => # since 1.21 - * ) + * ] * @endcode * * c) Copy a file within storage * @code - * array( + * [ * 'op' => 'copy', * 'src' => , * 'dst' => , @@ -273,12 +273,12 @@ abstract class FileBackend { * 'overwriteSame' => , * 'ignoreMissingSource' => , # since 1.21 * 'headers' => # since 1.21 - * ) + * ] * @endcode * * d) Move a file within storage * @code - * array( + * [ * 'op' => 'move', * 'src' => , * 'dst' => , @@ -286,32 +286,32 @@ abstract class FileBackend { * 'overwriteSame' => , * 'ignoreMissingSource' => , # since 1.21 * 'headers' => # since 1.21 - * ) + * ] * @endcode * * e) Delete a file within storage * @code - * array( + * [ * 'op' => 'delete', * 'src' => , * 'ignoreMissingSource' => - * ) + * ] * @endcode * * f) Update metadata for a file within storage * @code - * array( + * [ * 'op' => 'describe', * 'src' => , * 'headers' => - * ) + * ] * @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' => , * 'content' => , * 'headers' => # since 1.21 - * ) + * ] * @endcode * * b) Copy a file system file into storage * @code - * array( + * [ * 'op' => 'store', * 'src' => , * 'dst' => , * 'headers' => # since 1.21 - * ) + * ] * @endcode * * c) Copy a file within storage * @code - * array( + * [ * 'op' => 'copy', * 'src' => , * 'dst' => , * 'ignoreMissingSource' => , # since 1.21 * 'headers' => # since 1.21 - * ) + * ] * @endcode * * d) Move a file within storage * @code - * array( + * [ * 'op' => 'move', * 'src' => , * 'dst' => , * 'ignoreMissingSource' => , # since 1.21 * 'headers' => # since 1.21 - * ) + * ] * @endcode * * e) Delete a file within storage * @code - * array( + * [ * 'op' => 'delete', * 'src' => , * 'ignoreMissingSource' => - * ) + * ] * @endcode * * f) Update metadata for a file within storage * @code - * array( + * [ * 'op' => 'describe', * 'src' => , * 'headers' => - * ) + * ] * @endcode * * g) Do nothing (no-op) * @code - * array( + * [ * 'op' => 'null', - * ) + * ] * @endcode * * @par Boolean flags for operations (operation-specific): diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index 4ab913da0c..b8b1cf6a17 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -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 diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index 8619ba6ec5..645a59bc16 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -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 */ diff --git a/includes/jobqueue/jobs/NullJob.php b/includes/jobqueue/jobs/NullJob.php index 26d3c5c840..80826fe112 100644 --- a/includes/jobqueue/jobs/NullJob.php +++ b/includes/jobqueue/jobs/NullJob.php @@ -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 diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 54596298a5..e5ce924b95 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -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 diff --git a/includes/specials/SpecialUploadStash.php b/includes/specials/SpecialUploadStash.php index 14123242a1..9573f33e7c 100644 --- a/includes/specials/SpecialUploadStash.php +++ b/includes/specials/SpecialUploadStash.php @@ -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 diff --git a/includes/specials/pagers/AllMessagesTablePager.php b/includes/specials/pagers/AllMessagesTablePager.php index 60f642d9c3..ee8b3dae7d 100644 --- a/includes/specials/pagers/AllMessagesTablePager.php +++ b/includes/specials/pagers/AllMessagesTablePager.php @@ -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. * diff --git a/includes/utils/RowUpdateGenerator.php b/includes/utils/RowUpdateGenerator.php index 6a4792cb56..342dffd6fe 100644 --- a/includes/utils/RowUpdateGenerator.php +++ b/includes/utils/RowUpdateGenerator.php @@ -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