@@ -42,24 +42,24 @@ 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( '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 ) { |
|
62 | - $parser->setHook( 'noglossary', function ( $input, array $args, \Parser $parser, \PPFrame $frame ) { |
|
61 | + \Hooks::register( 'ParserFirstCallInit', function( \Parser $parser ) { |
|
62 | + $parser->setHook( 'noglossary', function( $input, array $args, \Parser $parser, \PPFrame $frame ) { |
|
63 | 63 | $output = $parser->recursiveTagParse( $input, $frame ); |
64 | 64 | return '<span class="noglossary">' . $output . '</span>'; |
65 | 65 | } ); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | return true; |
68 | 68 | } ); |
69 | 69 | |
70 | - \Hooks::register( 'SpecialPageBeforeExecute', function ( \SpecialPage $specialPage, $subPage ) { |
|
70 | + \Hooks::register( 'SpecialPageBeforeExecute', function( \SpecialPage $specialPage, $subPage ) { |
|
71 | 71 | if ( $specialPage instanceof \SpecialVersion ) { |
72 | 72 | foreach ( $GLOBALS[ 'wgExtensionCredits' ][ 'parserhook' ] as $index => $description ) { |
73 | 73 | if ( $GLOBALS[ 'wgExtensionCredits' ][ 'parserhook' ][ $index ][ 'name' ] === 'Lingo' ) { |
@@ -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 | } |
@@ -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; |