*
* @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
* 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
/**
* 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.
*
* 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' ) {
* 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;
* 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.
*
* @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
* 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();
// 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 ) ) {
* @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 );