@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | public function provideData() { |
| 93 | - $data = []; |
|
| 93 | + $data = [ ]; |
|
| 94 | 94 | |
| 95 | 95 | $xmlFileProvider = new XmlFileProvider( __DIR__ . '/../Fixture/articleAnnotation' ); |
| 96 | 96 | $files = $xmlFileProvider->getFiles(); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $testCase = [ |
| 108 | 108 | 0 => substr( $file, strlen( __DIR__ . '/../Fixture/articleAnnotation' ) ), |
| 109 | 109 | 1 => trim( $decoded[ 'text' ] ), |
| 110 | - 2 => [], |
|
| 110 | + 2 => [ ], |
|
| 111 | 111 | 3 => trim( $decoded[ 'expected' ] ) . "\n", |
| 112 | 112 | ]; |
| 113 | 113 | |
@@ -116,12 +116,12 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | foreach ( $decoded[ 'glossary-entry' ] as $entry ) { |
| 119 | - $testCase[ 2 ][] = [ $entry[ 'term' ], $entry[ 'definition' ], $entry[ 'link' ], $entry[ 'style' ] ]; |
|
| 119 | + $testCase[ 2 ][ ] = [ $entry[ 'term' ], $entry[ 'definition' ], $entry[ 'link' ], $entry[ 'style' ] ]; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | \Wikimedia\restoreWarnings(); |
| 123 | 123 | |
| 124 | - $data[] = $testCase; |
|
| 124 | + $data[ ] = $testCase; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | return $data; |
@@ -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' ) { |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | } else { |
| 157 | 157 | |
| 158 | 158 | wfDebug( "Cache miss: Lingo tree not found in cache.\n" ); |
| 159 | - $this->mLingoTree =& $this->buildLingo(); |
|
| 159 | + $this->mLingoTree = & $this->buildLingo(); |
|
| 160 | 160 | wfDebug( "Cached lingo tree.\n" ); |
| 161 | 161 | } |
| 162 | 162 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | } else { |
| 169 | 169 | wfDebug( "Caching of lingo tree disabled.\n" ); |
| 170 | - $this->mLingoTree =& $this->buildLingo(); |
|
| 170 | + $this->mLingoTree = & $this->buildLingo(); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | } |
@@ -203,10 +203,10 @@ discard block |
||
| 203 | 203 | // Parse text identical to options used in includes/api/ApiParse.php |
| 204 | 204 | $params = $this->mApiParams; |
| 205 | 205 | $text = is_null( $params ) ? $parser->getOutput()->getText() : $parser->getOutput()->getText( [ |
| 206 | - 'allowTOC' => !$params['disabletoc'], |
|
| 207 | - 'enableSectionEditLinks' => !$params['disableeditsection'], |
|
| 208 | - 'wrapperDivClass' => $params['wrapoutputclass'], |
|
| 209 | - 'deduplicateStyles' => !$params['disablestylededuplication'], |
|
| 206 | + 'allowTOC' => !$params[ 'disabletoc' ], |
|
| 207 | + 'enableSectionEditLinks' => !$params[ 'disableeditsection' ], |
|
| 208 | + 'wrapperDivClass' => $params[ 'wrapoutputclass' ], |
|
| 209 | + 'deduplicateStyles' => !$params[ 'disablestylededuplication' ], |
|
| 210 | 210 | ] ); |
| 211 | 211 | |
| 212 | 212 | if ( $text === null || $text === '' ) { |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | |
| 225 | 225 | // TODO: Remove call to \MediaWiki\suppressWarnings() for MW 1.34+. |
| 226 | 226 | // \Wikimedia\AtEase\AtEase::suppressWarnings() is available from MW 1.34. |
| 227 | - if (method_exists( AtEase::class, 'suppressWarnings' ) ) { |
|
| 227 | + if ( method_exists( AtEase::class, 'suppressWarnings' ) ) { |
|
| 228 | 228 | \Wikimedia\AtEase\AtEase::suppressWarnings(); |
| 229 | 229 | } else { |
| 230 | 230 | \MediaWiki\suppressWarnings(); |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | // TODO: Remove call to \MediaWiki\restoreWarnings() for MW 1.34+. |
| 237 | 237 | // \Wikimedia\AtEase\AtEase::restoreWarnings() is available from MW 1.34. |
| 238 | - if (method_exists( AtEase::class, 'suppressWarnings' ) ) { |
|
| 238 | + if ( method_exists( AtEase::class, 'suppressWarnings' ) ) { |
|
| 239 | 239 | \Wikimedia\AtEase\AtEase::restoreWarnings(); |
| 240 | 240 | } else { |
| 241 | 241 | \MediaWiki\restoreWarnings(); |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | // Iterate all HTML text matches |
| 251 | 251 | $numberOfTextElements = $textElements->length; |
| 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, |