Passed
Push — master ( bead6a...6dc797 )
by
unknown
04:30
created
src/Tree.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
 
53 53
 	const TREE_VERSION = 2;
54 54
 
55
-	private $mTree = [];
56
-	private $mList = [];
55
+	private $mTree = [ ];
56
+	private $mList = [ ];
57 57
 	private $mMinLength = 1000;
58 58
 
59 59
 	/**
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 			$this->mList[ $term ]->addDefinition( $definition );
72 72
 		} else {
73 73
 
74
-			$matches = [];
74
+			$matches = [ ];
75 75
 			preg_match_all( LingoParser::getInstance()->regex, $term, $matches );
76 76
 
77 77
 			$element = $this->addElement( $matches[ 0 ], $term, $definition );
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 		while ( ( $step = array_shift( $path ) ) !== null ) {
98 98
 
99 99
 			if ( !isset( $tree[ $step ] ) ) {
100
-				$tree[ $step ] = [];
100
+				$tree[ $step ] = [ ];
101 101
 			}
102 102
 
103 103
 			$tree = &$tree[ $step ];
Please login to merge, or discard this patch.
src/MessageLog.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
  */
42 42
 class MessageLog {
43 43
 
44
-	private $mMessages = [];
44
+	private $mMessages = [ ];
45 45
 	private $mParser = null;
46 46
 
47 47
 	const MESSAGE_ERROR = 1;
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 * @param int $severity
54 54
 	 */
55 55
 	public function addMessage( $message, $severity = self::MESSAGE_NOTICE ) {
56
-		$this->mMessages[] = [ $message, $severity ];
56
+		$this->mMessages[ ] = [ $message, $severity ];
57 57
 
58 58
 		// log errors and warnings in debug log
59 59
 		if ( $severity == self::MESSAGE_WARNING ||
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 * @param $message
68 68
 	 */
69 69
 	public function addError( $message ) {
70
-		$this->mMessages[] = [ $message, self::MESSAGE_ERROR ];
70
+		$this->mMessages[ ] = [ $message, self::MESSAGE_ERROR ];
71 71
 		wfDebug( "Error: $message\n" );
72 72
 	}
73 73
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 * @param $message
76 76
 	 */
77 77
 	public function addWarning( $message ) {
78
-		$this->mMessages[] = [ $message, self::MESSAGE_WARNING ];
78
+		$this->mMessages[ ] = [ $message, self::MESSAGE_WARNING ];
79 79
 		wfDebug( "Warning: $message\n" );
80 80
 	}
81 81
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 * @param $message
84 84
 	 */
85 85
 	public function addNotice( $message ) {
86
-		$this->mMessages[] = [ $message, self::MESSAGE_NOTICE ];
86
+		$this->mMessages[ ] = [ $message, self::MESSAGE_NOTICE ];
87 87
 	}
88 88
 
89 89
 	/**
Please login to merge, or discard this patch.
src/Lingo.i18n.magic.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
  * @ingroup Extensions
7 7
  */
8 8
 
9
-$magicWords = [];
9
+$magicWords = [ ];
10 10
 
11 11
 /** English (English) */
12 12
 $magicWords[ 'en' ] = [
Please login to merge, or discard this patch.
src/LingoParser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 				} else {
156 156
 
157 157
 					wfDebug( "Cache miss: Lingo tree not found in cache.\n" );
158
-					$this->mLingoTree =& $this->buildLingo();
158
+					$this->mLingoTree = & $this->buildLingo();
159 159
 					wfDebug( "Cached lingo tree.\n" );
160 160
 				}
161 161
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 
167 167
 			} else {
168 168
 				wfDebug( "Caching of lingo tree disabled.\n" );
169
-				$this->mLingoTree =& $this->buildLingo();
169
+				$this->mLingoTree = & $this->buildLingo();
170 170
 			}
171 171
 
172 172
 		}
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 		// Iterate all HTML text matches
232 232
 		$numberOfTextElements = $textElements->length;
233 233
 
234
-		$definitions = [];
234
+		$definitions = [ ];
235 235
 
236 236
 		for ( $textElementIndex = 0; $textElementIndex < $numberOfTextElements; $textElementIndex++ ) {
237 237
 			$textElement = $textElements->item( $textElementIndex );
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 				continue;
241 241
 			}
242 242
 
243
-			$matches = [];
243
+			$matches = [ ];
244 244
 			preg_match_all(
245 245
 				$this->regex,
246 246
 				$textElement->nodeValue,
Please login to merge, or discard this patch.
tests/phpunit/Unit/LingoI18NTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,12 +54,12 @@
 block discarded – undo
54 54
 		$data = json_decode( json_encode( $defined_vars[ 'magicWords' ] ) );
55 55
 
56 56
 		$validator = new \JsonSchema\Validator();
57
-		$validator->check( $data, (object)[ '$ref' =>
57
+		$validator->check( $data, (object) [ '$ref' =>
58 58
 			'file://' . realpath( __DIR__ . '/../Fixture/magicWordsSchema.json' ) ] );
59 59
 
60 60
 		// format error message
61 61
 		$errors = implode( '', array_map(
62
-			function ( $error ) {
62
+			function( $error ) {
63 63
 				return "* [{$error[ 'property' ]}] {$error[ 'message' ]}\n";
64 64
 			},
65 65
 			$validator->getErrors()
Please login to merge, or discard this patch.
tests/phpunit/Unit/ElementTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	public function testCanConstruct() {
55 55
 		$term = 'someTerm';
56
-		$definition = [];
56
+		$definition = [ ];
57 57
 		$element = new Element( $term, $definition );
58 58
 
59 59
 		$this->assertInstanceOf( '\Lingo\Element', $element );
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	public function testGetFormattedTerm_2() {
101 101
 		// Setup
102 102
 		$term = 'someTerm';
103
-		$definition = [];
103
+		$definition = [ ];
104 104
 		$element = new Element( $term, $definition );
105 105
 
106 106
 		$GLOBALS[ 'wgexLingoDisplayOnce' ] = true;
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
 		$element = new Element( $term, $definition );
144 144
 
145
-		$expectedAttributes = [ 'class' => [ 'mw-lingo-term', 'new' ],  'title' => wfMessage( 'red-link-title', $title )->text() ];
145
+		$expectedAttributes = [ 'class' => [ 'mw-lingo-term', 'new' ], 'title' => wfMessage( 'red-link-title', $title )->text() ];
146 146
 
147 147
 		$GLOBALS[ 'wgexLingoDisplayOnce' ] = false;
148 148
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 
179 179
 		$element = new Element( $term, $definition );
180 180
 
181
-		$expectedAttributes = [ 'class' => [ 'mw-lingo-term' ],  'title' => $title ];
181
+		$expectedAttributes = [ 'class' => [ 'mw-lingo-term' ], 'title' => $title ];
182 182
 
183 183
 		$GLOBALS[ 'wgexLingoDisplayOnce' ] = false;
184 184
 
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
 	 * @param string[] $expectedAttributes
477 477
 	 * @param array $unexpectedAttributes
478 478
 	 */
479
-	protected function checkTermIsDomElement( $node, $tagName, $text, $expectedAttributes = [], $unexpectedAttributes = [] ) {
479
+	protected function checkTermIsDomElement( $node, $tagName, $text, $expectedAttributes = [ ], $unexpectedAttributes = [ ] ) {
480 480
 		$nodeText = $this->doc->saveHTML( $node );
481 481
 
482 482
 		$this->assertInstanceOf( 'DOMElement', $node );
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 
488 488
 			$classes = array_flip( array_filter( explode( ' ', $node->getAttribute( 'class' ) ) ) );
489 489
 
490
-			foreach ( (array)$expectedAttributes[ 'class' ] as $expectedClass ) {
490
+			foreach ( (array) $expectedAttributes[ 'class' ] as $expectedClass ) {
491 491
 				$this->assertTrue( array_key_exists( $expectedClass, $classes ) );
492 492
 			}
493 493
 
Please login to merge, or discard this patch.
tests/phpunit/Unit/BasicBackendTest.php 1 patch
Upper-Lower-Casing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 <<<'TESTTEXT'
186 186
 ;CIP:Common image point
187 187
 ;CMP:Common midpoint
188
-TESTTEXT
188
+testtext
189 189
 			,
190 190
 				[
191 191
 					[ 'CMP', 'Common midpoint', null, null ],
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 :Common image point
201 201
 ;CMP
202 202
 :Common midpoint
203
-TESTTEXT
203
+testtext
204 204
 			,
205 205
 				[
206 206
 					[ 'CMP', 'Common midpoint', null, null ],
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 ;CIP
215 215
 ;CMP
216 216
 :Common midpoint
217
-TESTTEXT
217
+testtext
218 218
 			,
219 219
 				[
220 220
 					[ 'CMP', 'Common midpoint', null, null ],
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 ;CIP
229 229
 :Common image point
230 230
 :Common midpoint
231
-TESTTEXT
231
+testtext
232 232
 			,
233 233
 				[
234 234
 					[ 'CIP', 'Common image point', null, null ],
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 ;CMP
244 244
 :Common image point
245 245
 :Common midpoint
246
-TESTTEXT
246
+testtext
247 247
 			,
248 248
 				[
249 249
 					[ 'CMP', 'Common image point', null, null ],
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 Sed ut perspiciatis unde; omnis iste natus error: sit voluptatem accusantium...
268 268
 
269 269
 ;NMO:Normal move-out
270
-TESTTEXT
270
+testtext
271 271
 			,
272 272
 				[
273 273
 					[ 'NMO', 'Normal move-out', null, null ],
Please login to merge, or discard this patch.
tests/phpunit/Integration/ArticleAnnotationTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	}
89 89
 
90 90
 	public function provideData() {
91
-		$data = [];
91
+		$data = [ ];
92 92
 
93 93
 		$xmlFileProvider = new XmlFileProvider( __DIR__ . '/../Fixture/articleAnnotation' );
94 94
 		$files = $xmlFileProvider->getFiles();
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 			$testCase = [
106 106
 				0 => substr( $file, strlen( __DIR__ . '/../Fixture/articleAnnotation' ) ),
107 107
 				1 => trim( $decoded[ 'text' ] ),
108
-				2 => [],
108
+				2 => [ ],
109 109
 				3 => trim( $decoded[ 'expected' ] ) . "\n",
110 110
 			];
111 111
 
@@ -114,12 +114,12 @@  discard block
 block discarded – undo
114 114
 			}
115 115
 
116 116
 			foreach ( $decoded[ 'glossary-entry' ] as $entry ) {
117
-				$testCase[ 2 ][] = [ $entry[ 'term' ], $entry[ 'definition' ], $entry[ 'link' ], $entry[ 'style' ] ];
117
+				$testCase[ 2 ][ ] = [ $entry[ 'term' ], $entry[ 'definition' ], $entry[ 'link' ], $entry[ 'style' ] ];
118 118
 			}
119 119
 
120 120
 			\MediaWiki\restoreWarnings();
121 121
 
122
-			$data[] = $testCase;
122
+			$data[ ] = $testCase;
123 123
 		}
124 124
 
125 125
 		return $data;
Please login to merge, or discard this patch.
tests/mw-phpunit-runner.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,6 +70,6 @@
 block discarded – undo
70 70
 $config = isReadablePath( "$extDirectory/phpunit.xml.dist" );
71 71
 $mw = isReadablePath( dirname( dirname( $extDirectory ) ) . "/tests/phpunit/phpunit.php" );
72 72
 
73
-echo "php {$mw} -c {$config} " . implode( ' ', addArguments( $GLOBALS['argv'] ) ) . "\n\n";
73
+echo "php {$mw} -c {$config} " . implode( ' ', addArguments( $GLOBALS[ 'argv' ] ) ) . "\n\n";
74 74
 
75
-passthru( "php {$mw} -c {$config} " . implode( ' ', addArguments( $GLOBALS['argv'] ) ) );
75
+passthru( "php {$mw} -c {$config} " . implode( ' ', addArguments( $GLOBALS[ 'argv' ] ) ) );
Please login to merge, or discard this patch.