* > (string) links table name
* > (int) batch size
* > 'numRows' : Number of rows for this link table
- * > 'batches' : array( $start, $end )
+ * > 'batches' : [ $start, $end ]
*
* @see BacklinkCache::partitionResult()
*
/**
* Gets an array of aliased table names
*
- * @param array $tables Array( [alias] => table )
+ * @param array $tables [ [alias] => table ]
* @return string[] See tableNameWithAlias()
*/
public function tableNamesWithAlias( $tables ) {
/**
* Gets an array of aliased field names
*
- * @param array $fields Array( [alias] => field )
+ * @param array $fields [ [alias] => field ]
* @return string[] See fieldNameWithAlias()
*/
public function fieldNamesWithAlias( $fields ) {
is_string( $hook ) ||
( is_array( $hook ) && count( $hook ) >= 2 && is_string( $hook[0] ) )
) {
- // 'function' or array( 'class', hook' )
+ // 'function' or [ 'class', 'hook' ]
$result = call_user_func_array( $hook, $callargs );
} else {
$result = null;
* @param array $inputItems 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
* ObjectCache::getLocalServerInstance( $fallbackType );
*
* // From $wgObjectCaches via newFromParams()
- * ObjectCache::getLocalServerInstance( array( 'fallback' => $fallbackType ) );
+ * ObjectCache::getLocalServerInstance( [ 'fallback' => $fallbackType ] );
*
* @param int|string|array $fallback Fallback cache or parameter map with 'fallback'
* @return BagOStuff
* not be used in the pager offset or in any links for users.
*
* If getIndexField() returns an array of 'querykey' => 'indexfield' pairs then
- * this must return a corresponding array of 'querykey' => array( fields...) pairs
- * in order for a request with &count=querykey to use array( fields...) to sort.
+ * this must return a corresponding array of 'querykey' => [ fields... ] pairs
+ * in order for a request with &count=querykey to use [ fields... ] to sort.
*
* This is useful for pagers that GROUP BY a unique column (say page_id)
* and ORDER BY another (say page_len). Using GROUP BY and ORDER BY both on
/**
* Associative array mapping framework ids to a list of names of test suite modules
- * like array( 'qunit' => array( 'mediawiki.tests.qunit.suites', 'ext.foo.tests', .. ), .. )
+ * like [ 'qunit' => [ 'mediawiki.tests.qunit.suites', 'ext.foo.tests', ... ], ... ]
* @var array
*/
protected $testModuleNames = [];
/**
- * E.g. array( 'source-id' => 'http://.../load.php' )
+ * E.g. [ 'source-id' => 'http://.../load.php' ]
* @var array
*/
protected $sources = [];
*
* Source IDs are typically the same as the Wiki ID or database name (e.g. lowercase a-z).
*
- * @param array|string $id Source ID (string), or array( id1 => loadUrl, id2 => loadUrl, ... )
+ * @param array|string $id Source ID (string), or [ id1 => loadUrl, id2 => loadUrl, ... ]
* @param string|array $loadUrl load.php url (string), or array with loadUrl key for
* backwards-compatibility.
* @throws MWException
/**
* Get the list of sources.
*
- * @return array Like array( id => load.php url, .. )
+ * @return array Like [ id => load.php url, ... ]
*/
public function getSources() {
return $this->sources;
* - ResourceLoader::makeLoaderStateScript( $name, $state ):
* Set the state of a single module called $name to $state
*
- * - ResourceLoader::makeLoaderStateScript( array( $name => $state, ... ) ):
+ * - ResourceLoader::makeLoaderStateScript( [ $name => $state, ... ] ):
* Set the state of modules with the given names to the given states
*
* @param string $name
* ):
* Register a single module.
*
- * - ResourceLoader::makeLoaderRegisterScript( array( $name1, $name2 ) ):
+ * - ResourceLoader::makeLoaderRegisterScript( [ $name1, $name2 ] ):
* Register modules with the given names.
*
- * - ResourceLoader::makeLoaderRegisterScript( array(
- * array( $name1, $version1, $dependencies1, $group1, $source1, $skip1 ),
- * array( $name2, $version2, $dependencies1, $group2, $source2, $skip2 ),
+ * - ResourceLoader::makeLoaderRegisterScript( [
+ * [ $name1, $version1, $dependencies1, $group1, $source1, $skip1 ],
+ * [ $name2, $version2, $dependencies1, $group2, $source2, $skip2 ],
* ...
- * ) ):
+ * ] ):
* Registers modules with the given names and parameters.
*
* @param string $name Module name
* - ResourceLoader::makeLoaderSourcesScript( $id, $properties ):
* Register a single source
*
- * - ResourceLoader::makeLoaderSourcesScript( array( $id1 => $loadUrl, $id2 => $loadUrl, ... ) );
+ * - ResourceLoader::makeLoaderSourcesScript( [ $id1 => $loadUrl, $id2 => $loadUrl, ... ] );
* Register sources with the given IDs and properties.
*
* @param string $id Source ID
/**
* Convert an array of module names to a packed query string.
*
- * For example, array( 'foo.bar', 'foo.baz', 'bar.baz', 'bar.quux' )
+ * For example, [ 'foo.bar', 'foo.baz', 'bar.baz', 'bar.quux' ]
* becomes 'foo.bar,baz|bar.baz,quux'
* @param array $modules List of module names (strings)
* @return string Packed query string
*/
public static function makePackedModulesString( $modules ) {
- $groups = []; // array( prefix => array( suffixes ) )
+ $groups = []; // [ prefix => [ suffixes ] ]
foreach ( $modules as $module ) {
$pos = strrpos( $module, '.' );
$prefix = $pos === false ? '' : substr( $module, 0, $pos );
/**
* Expand a string of the form jquery.foo,bar|jquery.ui.baz,quux to
- * an array of module names like array( 'jquery.foo', 'jquery.bar',
- * 'jquery.ui.baz', 'jquery.ui.quux' )
+ * an array of module names like [ 'jquery.foo', 'jquery.bar',
+ * 'jquery.ui.baz', 'jquery.ui.quux' ]
* @param string $modules Packed module name list
* @return array Array of module names
*/
} else {
// We have a prefix and a bunch of suffixes
$prefix = substr( $group, 0, $pos ); // 'foo'
- $suffixes = explode( ',', substr( $group, $pos + 1 ) ); // array( 'bar', 'baz' )
+ $suffixes = explode( ',', substr( $group, $pos + 1 ) ); // [ 'bar', 'baz' ]
foreach ( $suffixes as $suffix ) {
$retval[] = "$prefix.$suffix";
}
* @var array List of paths to JavaScript files to always include
* @par Usage:
* @code
- * array( [file-path], [file-path], ... )
+ * [ [file-path], [file-path], ... ]
* @endcode
*/
protected $scripts = [];
* @var array List of JavaScript files to include when using a specific language
* @par Usage:
* @code
- * array( [language-code] => array( [file-path], [file-path], ... ), ... )
+ * [ [language-code] => [ [file-path], [file-path], ... ], ... ]
* @endcode
*/
protected $languageScripts = [];
* @var array List of JavaScript files to include when using a specific skin
* @par Usage:
* @code
- * array( [skin-name] => array( [file-path], [file-path], ... ), ... )
+ * [ [skin-name] => [ [file-path], [file-path], ... ], ... ]
* @endcode
*/
protected $skinScripts = [];
* @var array List of paths to JavaScript files to include in debug mode
* @par Usage:
* @code
- * array( [skin-name] => array( [file-path], [file-path], ... ), ... )
+ * [ [skin-name] => [ [file-path], [file-path], ... ], ... ]
* @endcode
*/
protected $debugScripts = [];
* @var array List of paths to CSS files to always include
* @par Usage:
* @code
- * array( [file-path], [file-path], ... )
+ * [ [file-path], [file-path], ... ]
* @endcode
*/
protected $styles = [];
* @var array List of paths to CSS files to include when using specific skins
* @par Usage:
* @code
- * array( [file-path], [file-path], ... )
+ * [ [file-path], [file-path], ... ]
* @endcode
*/
protected $skinStyles = [];
* @var array List of modules this module depends on
* @par Usage:
* @code
- * array( [file-path], [file-path], ... )
+ * [ [file-path], [file-path], ... ]
* @endcode
*/
protected $dependencies = [];
* @var array List of message keys used by this module
* @par Usage:
* @code
- * array( [message-key], [message-key], ... )
+ * [ [message-key], [message-key], ... ]
* @endcode
*/
protected $messages = [];
* @var array Place where readStyleFile() tracks file dependencies
* @par Usage:
* @code
- * array( [file-path], [file-path], ... )
+ * [ [file-path], [file-path], ... ]
* @endcode
*/
protected $localFileRefs = [];
* @throws InvalidArgumentException
* @par Construction options:
* @code
- * array(
+ * [
* // Base path to prepend to all local paths in $options. Defaults to $IP
* 'localBasePath' => [base path],
* // Base path to prepend to all remote paths in $options. Defaults to $wgResourceBasePath
* // The file must contain valid JavaScript for execution in a private function.
* // The file must not contain the "function () {" and "}" wrapper though.
* 'skipFunction' => [file path]
- * )
+ * ]
* @endcode
*/
public function __construct(
$this->variants = $variants;
// Expand shorthands:
- // array( "en,de,fr" => "foo.svg" )
- // → array( "en" => "foo.svg", "de" => "foo.svg", "fr" => "foo.svg" )
+ // [ "en,de,fr" => "foo.svg" ]
+ // → [ "en" => "foo.svg", "de" => "foo.svg", "fr" => "foo.svg" ]
if ( is_array( $this->descriptor ) && isset( $this->descriptor['lang'] ) ) {
foreach ( array_keys( $this->descriptor['lang'] ) as $langList ) {
if ( strpos( $langList, ',' ) !== false ) {