@@ -49,12 +49,12 @@ discard block |
||
| 49 | 49 | 'mwTitleExpectsGetNamespace' => null, |
| 50 | 50 | 'mwOutputExpectsGetText' => null, |
| 51 | 51 | |
| 52 | - 'mwParserProperties' => [], |
|
| 52 | + 'mwParserProperties' => [ ], |
|
| 53 | 53 | |
| 54 | 54 | 'namespace' => 0, |
| 55 | 55 | 'text' => null, |
| 56 | 56 | |
| 57 | - 'wgexLingoUseNamespaces' => [], |
|
| 57 | + 'wgexLingoUseNamespaces' => [ ], |
|
| 58 | 58 | 'wgexLingoBackend' => 'Lingo\\BasicBackend', |
| 59 | 59 | ]; |
| 60 | 60 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | /** |
| 168 | 168 | * @return MockObject |
| 169 | 169 | */ |
| 170 | - protected function getParserMock( $config = [] ) { |
|
| 170 | + protected function getParserMock( $config = [ ] ) { |
|
| 171 | 171 | if ( array_key_exists( 'mwParser', $config ) ) { |
| 172 | 172 | return $config[ 'mwParser' ]; |
| 173 | 173 | } |
@@ -72,8 +72,8 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function next() { |
| 74 | 74 | static $term = null; |
| 75 | - static $definitions = []; |
|
| 76 | - static $ret = []; |
|
| 75 | + static $definitions = [ ]; |
|
| 76 | + static $ret = [ ]; |
|
| 77 | 77 | |
| 78 | 78 | $this->collectDictionaryLines(); |
| 79 | 79 | |
@@ -109,11 +109,11 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | // wipe the data if it's a totally new term definition |
| 111 | 111 | if ( !empty( $term ) && count( $definitions ) > 0 ) { |
| 112 | - $definitions = []; |
|
| 112 | + $definitions = [ ]; |
|
| 113 | 113 | $term = null; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - $definitions[] = trim( $chunks[ 1 ] ); |
|
| 116 | + $definitions[ ] = trim( $chunks[ 1 ] ); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | // found a new term? |
@@ -130,10 +130,10 @@ discard block |
||
| 130 | 130 | * @return array |
| 131 | 131 | */ |
| 132 | 132 | protected function queueDefinitions( $definitions, $term ) { |
| 133 | - $ret = []; |
|
| 133 | + $ret = [ ]; |
|
| 134 | 134 | |
| 135 | 135 | foreach ( $definitions as $definition ) { |
| 136 | - $ret[] = [ |
|
| 136 | + $ret[ ] = [ |
|
| 137 | 137 | Element::ELEMENT_TERM => $term, |
| 138 | 138 | Element::ELEMENT_DEFINITION => $definition, |
| 139 | 139 | Element::ELEMENT_LINK => null, |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | if ( $content instanceof TextContent ) { |
| 213 | 213 | |
| 214 | 214 | // FIXME: getNativeData() is deprecated for MW 1.33+. Use getText(). |
| 215 | - if ( ! method_exists( $content, 'getText')) { |
|
| 215 | + if ( !method_exists( $content, 'getText' ) ) { |
|
| 216 | 216 | return $content->getNativeData(); |
| 217 | 217 | } |
| 218 | 218 | |
@@ -42,28 +42,28 @@ discard block |
||
| 42 | 42 | * @since 2.0.2 |
| 43 | 43 | */ |
| 44 | 44 | public static function initExtension() { |
| 45 | - $GLOBALS[ 'wgExtensionFunctions' ][] = function () { |
|
| 45 | + $GLOBALS[ 'wgExtensionFunctions' ][ ] = function() { |
|
| 46 | 46 | $parser = LingoParser::getInstance(); |
| 47 | 47 | |
| 48 | 48 | $backend = new $GLOBALS[ 'wgexLingoBackend' ](); |
| 49 | 49 | |
| 50 | 50 | $parser->setBackend( $backend ); |
| 51 | 51 | |
| 52 | - \Hooks::register( 'ContentAlterParserOutput', function () use ( $parser ){ |
|
| 52 | + \Hooks::register( 'ContentAlterParserOutput', function() use ( $parser ){ |
|
| 53 | 53 | $parser->parse( MediaWikiServices::getInstance()->getParser() ); |
| 54 | 54 | } ); |
| 55 | 55 | |
| 56 | - \Hooks::register( 'ApiMakeParserOptions', function ( \ParserOptions $popts, \Title $title, array $params ) use ( $parser ){ |
|
| 56 | + \Hooks::register( 'ApiMakeParserOptions', function( \ParserOptions $popts, \Title $title, array $params ) use ( $parser ){ |
|
| 57 | 57 | $parser->setApiParams( $params ); |
| 58 | 58 | } ); |
| 59 | 59 | |
| 60 | - \Hooks::register( 'GetDoubleUnderscoreIDs', function ( array &$doubleUnderscoreIDs ) { |
|
| 61 | - $doubleUnderscoreIDs[] = 'noglossary'; |
|
| 60 | + \Hooks::register( 'GetDoubleUnderscoreIDs', function( array &$doubleUnderscoreIDs ) { |
|
| 61 | + $doubleUnderscoreIDs[ ] = 'noglossary'; |
|
| 62 | 62 | return true; |
| 63 | 63 | } ); |
| 64 | 64 | |
| 65 | - \Hooks::register( 'ParserFirstCallInit', function ( \Parser $parser ) { |
|
| 66 | - $parser->setHook( 'noglossary', function ( $input, array $args, \Parser $parser, \PPFrame $frame ) { |
|
| 65 | + \Hooks::register( 'ParserFirstCallInit', function( \Parser $parser ) { |
|
| 66 | + $parser->setHook( 'noglossary', function( $input, array $args, \Parser $parser, \PPFrame $frame ) { |
|
| 67 | 67 | $output = $parser->recursiveTagParse( $input, $frame ); |
| 68 | 68 | return '<span class="noglossary">' . $output . '</span>'; |
| 69 | 69 | } ); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | return true; |
| 72 | 72 | } ); |
| 73 | 73 | |
| 74 | - \Hooks::register( 'SpecialPageBeforeExecute', function ( \SpecialPage $specialPage, $subPage ) { |
|
| 74 | + \Hooks::register( 'SpecialPageBeforeExecute', function( \SpecialPage $specialPage, $subPage ) { |
|
| 75 | 75 | if ( $specialPage instanceof \SpecialVersion ) { |
| 76 | 76 | foreach ( $GLOBALS[ 'wgExtensionCredits' ][ 'parserhook' ] as $index => $description ) { |
| 77 | 77 | if ( $GLOBALS[ 'wgExtensionCredits' ][ 'parserhook' ][ $index ][ 'name' ] === 'Lingo' ) { |