@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | 'mwTitleExpectsGetNamespace' => null, |
49 | 49 | 'mwOutputExpectsGetText' => null, |
50 | 50 | |
51 | - 'mwParserProperties' => [], |
|
51 | + 'mwParserProperties' => [ ], |
|
52 | 52 | |
53 | 53 | 'namespace' => 0, |
54 | 54 | 'text' => null, |
55 | 55 | |
56 | - 'wgexLingoUseNamespaces' => [], |
|
56 | + 'wgexLingoUseNamespaces' => [ ], |
|
57 | 57 | 'wgexLingoBackend' => 'Lingo\\BasicBackend', |
58 | 58 | ]; |
59 | 59 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | /** |
167 | 167 | * @return \PHPUnit_Framework_MockObject_MockObject |
168 | 168 | */ |
169 | - protected function getParserMock( $config = [] ) { |
|
169 | + protected function getParserMock( $config = [ ] ) { |
|
170 | 170 | if ( array_key_exists( 'mwParser', $config ) ) { |
171 | 171 | return $config[ 'mwParser' ]; |
172 | 172 | } |
@@ -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( $GLOBALS[ 'wgParser' ] ); |
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' ) { |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | } else { |
156 | 156 | |
157 | 157 | wfDebug( "Cache miss: Lingo tree not found in cache.\n" ); |
158 | - $this->mLingoTree =& $this->buildLingo(); |
|
158 | + $this->mLingoTree = & $this->buildLingo(); |
|
159 | 159 | wfDebug( "Cached lingo tree.\n" ); |
160 | 160 | } |
161 | 161 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | } else { |
168 | 168 | wfDebug( "Caching of lingo tree disabled.\n" ); |
169 | - $this->mLingoTree =& $this->buildLingo(); |
|
169 | + $this->mLingoTree = & $this->buildLingo(); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | } |
@@ -202,10 +202,10 @@ discard block |
||
202 | 202 | // Parse text identical to options used in includes/api/ApiParse.php |
203 | 203 | $params = $this->mApiParams; |
204 | 204 | $text = is_null( $params ) ? $parser->getOutput()->getText() : $parser->getOutput()->getText( [ |
205 | - 'allowTOC' => !$params['disabletoc'], |
|
206 | - 'enableSectionEditLinks' => !$params['disableeditsection'], |
|
207 | - 'wrapperDivClass' => $params['wrapoutputclass'], |
|
208 | - 'deduplicateStyles' => !$params['disablestylededuplication'], |
|
205 | + 'allowTOC' => !$params[ 'disabletoc' ], |
|
206 | + 'enableSectionEditLinks' => !$params[ 'disableeditsection' ], |
|
207 | + 'wrapperDivClass' => $params[ 'wrapoutputclass' ], |
|
208 | + 'deduplicateStyles' => !$params[ 'disablestylededuplication' ], |
|
209 | 209 | ] ); |
210 | 210 | |
211 | 211 | if ( $text === null || $text === '' ) { |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | // Iterate all HTML text matches |
237 | 237 | $numberOfTextElements = $textElements->length; |
238 | 238 | |
239 | - $definitions = []; |
|
239 | + $definitions = [ ]; |
|
240 | 240 | |
241 | 241 | for ( $textElementIndex = 0; $textElementIndex < $numberOfTextElements; $textElementIndex++ ) { |
242 | 242 | $textElement = $textElements->item( $textElementIndex ); |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | continue; |
246 | 246 | } |
247 | 247 | |
248 | - $matches = []; |
|
248 | + $matches = [ ]; |
|
249 | 249 | preg_match_all( |
250 | 250 | $this->regex, |
251 | 251 | $textElement->nodeValue, |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | protected function shouldParse( &$parser ) { |
407 | 407 | global $wgexLingoUseNamespaces; |
408 | 408 | |
409 | - if ( !( $parser instanceof Parser || $parser instanceof StubObject) ) { |
|
409 | + if ( !( $parser instanceof Parser || $parser instanceof StubObject ) ) { |
|
410 | 410 | return false; |
411 | 411 | } |
412 | 412 |