* 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
*
* @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
*
* $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 );
*
* - 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
*
* Usage:
* @code
- * $wgMWLoggerDefaultSpi = array(
+ * $wgMWLoggerDefaultSpi = [
* 'class' => '\\MediaWiki\\Logger\\LegacySpi',
- * );
+ * ];
* @endcode
*
* @see \MediaWiki\Logger\LoggerFactory
*
* Usage:
*
- * $wgMWLoggerDefaultSpi = array(
+ * $wgMWLoggerDefaultSpi = [
* 'class' => '\\MediaWiki\\Logger\\NullSpi',
- * );
+ * ];
*
* @see \MediaWiki\Logger\LoggerFactory
* @since 1.25
* @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',
* Values considered empty:
*
* - null
- * - array()
+ * - []
* - new XmlJsCode( '{}' )
- * - new stdClass() // (object) array()
+ * - new stdClass() // (object) []
*
* @param Array $array
*/
* // 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
* 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
* '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
*/
*
* @code
* $summary = parent::getDefinitionSummary( $context );
- * $summary[] = array(
+ * $summary[] = [
* 'foo' => 123,
* 'bar' => 'quux',
- * );
+ * ];
* return $summary;
* @endcode
*
*
* 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'
*
* 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.
*
* 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