@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | } else { |
| 167 | 167 | |
| 168 | 168 | wfDebug( "Cache miss: Lingo tree not found in cache.\n" ); |
| 169 | - $this->mLingoTree =& $this->buildLingo(); |
|
| 169 | + $this->mLingoTree = & $this->buildLingo(); |
|
| 170 | 170 | wfDebug( "Cached lingo tree.\n" ); |
| 171 | 171 | } |
| 172 | 172 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | |
| 178 | 178 | } else { |
| 179 | 179 | wfDebug( "Caching of lingo tree disabled.\n" ); |
| 180 | - $this->mLingoTree =& $this->buildLingo(); |
|
| 180 | + $this->mLingoTree = & $this->buildLingo(); |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | } |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | $numberOfTextElements = $textElements->length; |
| 251 | 251 | $changedDoc = false; |
| 252 | 252 | |
| 253 | - $definitions = []; |
|
| 253 | + $definitions = [ ]; |
|
| 254 | 254 | |
| 255 | 255 | for ( $textElementIndex = 0; $textElementIndex < $numberOfTextElements; $textElementIndex++ ) { |
| 256 | 256 | $textElement = $textElements->item( $textElementIndex ); |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | continue; |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | - $matches = []; |
|
| 262 | + $matches = [ ]; |
|
| 263 | 263 | preg_match_all( |
| 264 | 264 | $this->regex, |
| 265 | 265 | $textElement->nodeValue, |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | continue; |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | - $wordDescriptors = &$matches[ 0 ]; // See __construct() for definition of "word" |
|
| 274 | + $wordDescriptors = &$matches[ 0 ]; // See __construct() for definition of "word" |
|
| 275 | 275 | $numberOfWordDescriptors = count( $wordDescriptors ); |
| 276 | 276 | |
| 277 | 277 | $parentNode = &$textElement->parentNode; |
@@ -289,12 +289,12 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | if ( $skippedWords > 0 ) { // skipped some text, insert it as is |
| 291 | 291 | |
| 292 | - $start = $wordDescriptors[$wordDescriptorIndex][self::WORD_OFFSET]; |
|
| 293 | - $length = $wordDescriptors[$wordDescriptorIndex + $skippedWords][self::WORD_OFFSET] - $start; |
|
| 292 | + $start = $wordDescriptors[ $wordDescriptorIndex ][ self::WORD_OFFSET ]; |
|
| 293 | + $length = $wordDescriptors[ $wordDescriptorIndex + $skippedWords ][ self::WORD_OFFSET ] - $start; |
|
| 294 | 294 | |
| 295 | 295 | $parentNode->insertBefore( |
| 296 | 296 | $doc->createTextNode( |
| 297 | - substr( $textElement->nodeValue, $start, $length) |
|
| 297 | + substr( $textElement->nodeValue, $start, $length ) |
|
| 298 | 298 | ), |
| 299 | 299 | $textElement |
| 300 | 300 | ); |
@@ -315,11 +315,11 @@ discard block |
||
| 315 | 315 | // Only change element if found term before |
| 316 | 316 | if ( $changedElem === true ) { |
| 317 | 317 | |
| 318 | - $start = $wordDescriptors[$wordDescriptorIndex][self::WORD_OFFSET]; |
|
| 318 | + $start = $wordDescriptors[ $wordDescriptorIndex ][ self::WORD_OFFSET ]; |
|
| 319 | 319 | |
| 320 | 320 | $parentNode->insertBefore( |
| 321 | 321 | $doc->createTextNode( |
| 322 | - substr( $textElement->nodeValue, $start) |
|
| 322 | + substr( $textElement->nodeValue, $start ) |
|
| 323 | 323 | ), |
| 324 | 324 | $textElement |
| 325 | 325 | ); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public static function initExtension() { |
| 45 | 45 | |
| 46 | - $GLOBALS[ 'wgExtensionFunctions' ][] = function () { |
|
| 46 | + $GLOBALS[ 'wgExtensionFunctions' ][ ] = function() { |
|
| 47 | 47 | |
| 48 | 48 | $parser = LingoParser::getInstance(); |
| 49 | 49 | |
@@ -53,14 +53,14 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | \Hooks::register( 'ParserBeforeTidy', [ $parser, 'parse' ] ); |
| 55 | 55 | |
| 56 | - \Hooks::register('GetDoubleUnderscoreIDs', function ( array &$doubleUnderscoreIDs ) { |
|
| 57 | - $doubleUnderscoreIDs[] = 'noglossary'; |
|
| 56 | + \Hooks::register( 'GetDoubleUnderscoreIDs', function( array &$doubleUnderscoreIDs ) { |
|
| 57 | + $doubleUnderscoreIDs[ ] = 'noglossary'; |
|
| 58 | 58 | return true; |
| 59 | 59 | } ); |
| 60 | 60 | |
| 61 | - \Hooks::register( 'ParserFirstCallInit', function ( \Parser $parser ) { |
|
| 61 | + \Hooks::register( 'ParserFirstCallInit', function( \Parser $parser ) { |
|
| 62 | 62 | |
| 63 | - $parser->setHook( 'noglossary', function ( $input, array $args, \Parser $parser, \PPFrame $frame ) { |
|
| 63 | + $parser->setHook( 'noglossary', function( $input, array $args, \Parser $parser, \PPFrame $frame ) { |
|
| 64 | 64 | $output = $parser->recursiveTagParse( $input, $frame ); |
| 65 | 65 | return '<span class="noglossary">' . $output . '</span>'; |
| 66 | 66 | } ); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | return true; |
| 69 | 69 | } ); |
| 70 | 70 | |
| 71 | - \Hooks::register( 'SpecialPageBeforeExecute', function ( \SpecialPage $specialPage, $subPage ) { |
|
| 71 | + \Hooks::register( 'SpecialPageBeforeExecute', function( \SpecialPage $specialPage, $subPage ) { |
|
| 72 | 72 | |
| 73 | 73 | if ( $specialPage instanceof \SpecialVersion ) { |
| 74 | 74 | foreach ( $GLOBALS[ 'wgExtensionCredits' ][ 'parserhook' ] as $index => $description ) { |