@@ -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, |
@@ -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 |