Test Setup Failed
Push — master ( 4b4c9f...f1b16c )
by
unknown
44:14 queued 09:14
created
src/Lingo.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -42,28 +42,28 @@  discard block
 block discarded – undo
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
 block discarded – undo
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' ) {
Please login to merge, or discard this patch.
src/LingoParser.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
259 259
 				continue;
260 260
 			}
261 261
 
262
-			$matches = [];
262
+			$matches = [ ];
263 263
 			preg_match_all(
264 264
 				$this->regex,
265 265
 				$textElement->nodeValue,
Please login to merge, or discard this patch.
tests/phpunit/Unit/LingoParserTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.