Clean up array() syntax in docs, part IV
Change-Id: If626409a93d31bf90c054c9bf7ba44a78ea9a621
This commit is contained in:
parent
cfa04ceb2b
commit
6b221fa96a
7 changed files with 61 additions and 61 deletions
|
|
@ -120,7 +120,7 @@
|
|||
*
|
||||
* @code
|
||||
* // old style:
|
||||
* wfMsgExt( 'key', array( 'parseinline' ), 'apple' );
|
||||
* wfMsgExt( 'key', [ 'parseinline' ], 'apple' );
|
||||
* // new style:
|
||||
* wfMessage( 'key', 'apple' )->parse();
|
||||
* @endcode
|
||||
|
|
@ -131,7 +131,7 @@
|
|||
* 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
|
||||
|
|
|
|||
|
|
@ -39,73 +39,73 @@ use ObjectFactory;
|
|||
* 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
|
||||
|
|
|
|||
|
|
@ -1437,10 +1437,10 @@ abstract class Installer {
|
|||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
|
|
@ -1724,7 +1724,7 @@ abstract class Installer {
|
|||
* 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' ) {
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class LocalSettingsGenerator {
|
|||
* 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;
|
||||
|
|
|
|||
|
|
@ -906,11 +906,11 @@ class Parser {
|
|||
* 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.
|
||||
|
|
|
|||
|
|
@ -264,8 +264,8 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
|
|||
*
|
||||
* @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
|
||||
|
|
@ -279,7 +279,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
|
|||
* 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();
|
||||
|
|
@ -637,7 +637,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
|
|||
// 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 ) ) {
|
||||
|
|
|
|||
|
|
@ -1659,7 +1659,7 @@ abstract class UploadBase {
|
|||
* @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 );
|
||||
|
|
|
|||
Loading…
Reference in a new issue