Passed
Branch master (6220de)
by BruceScrutinizer
04:32
created
php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestCaseStaticMethodCallsFixer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -360,14 +360,14 @@  discard block
 block discarded – undo
360 360
                 ->getOption(),
361 361
             (new FixerOptionBuilder('methods', 'Dictionary of `method` => `call_type` values that differ from the default strategy.'))
362 362
                 ->setAllowedTypes(['array'])
363
-                ->setAllowedValues([static function (array $option) use ($thisFixer) {
363
+                ->setAllowedValues([static function(array $option) use ($thisFixer) {
364 364
                     foreach ($option as $method => $value) {
365 365
                         if (!isset($thisFixer->staticMethods[$method])) {
366 366
                             throw new InvalidOptionsException(
367 367
                                 sprintf(
368 368
                                     'Unexpected "methods" key, expected any of "%s", got "%s".',
369 369
                                     implode('", "', array_keys($thisFixer->staticMethods)),
370
-                                    \gettype($method).'#'.$method
370
+                                    \gettype($method) . '#' . $method
371 371
                                 )
372 372
                             );
373 373
                         }
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
                                     'Unexpected value for method "%s", expected any of "%s", got "%s".',
379 379
                                     $method,
380 380
                                     implode('", "', array_keys($thisFixer->allowedValues)),
381
-                                    \is_object($value) ? \get_class($value) : (null === $value ? 'null' : \gettype($value).'#'.$value)
381
+                                    \is_object($value) ? \get_class($value) : (null === $value ? 'null' : \gettype($value) . '#' . $value)
382 382
                                 )
383 383
                             );
384 384
                         }
Please login to merge, or discard this patch.
friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitExpectationFixer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
                 return;
208 208
             }
209 209
 
210
-            [$thisIndex, , $index] = array_keys($match);
210
+            [$thisIndex,, $index] = array_keys($match);
211 211
 
212 212
             if (!isset($this->methodMap[$tokens[$index]->getContent()])) {
213 213
                 continue;
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
             $argumentsReplacements = ['expectException', $this->methodMap[$tokens[$index]->getContent()], 'expectExceptionCode'];
228 228
 
229
-            $indent = $this->whitespacesConfig->getLineEnding().WhitespacesAnalyzer::detectIndent($tokens, $thisIndex);
229
+            $indent = $this->whitespacesConfig->getLineEnding() . WhitespacesAnalyzer::detectIndent($tokens, $thisIndex);
230 230
 
231 231
             $isMultilineWhitespace = false;
232 232
 
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
                 ];
267 267
 
268 268
                 if ($isMultilineWhitespace) {
269
-                    $tokensOverrideArgStart[] = new Token([T_WHITESPACE, $indent.$this->whitespacesConfig->getIndent()]);
269
+                    $tokensOverrideArgStart[] = new Token([T_WHITESPACE, $indent . $this->whitespacesConfig->getIndent()]);
270 270
                     array_unshift($tokensOverrideArgBefore, new Token([T_WHITESPACE, $indent]));
271 271
                 }
272 272
 
Please login to merge, or discard this patch.
php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestClassRequiresCoversFixer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
                 }
109 109
 
110 110
                 $tokens->insertAt($docIndex, [
111
-                    new Token([T_WHITESPACE, $extraNewLines.$indent]),
111
+                    new Token([T_WHITESPACE, $extraNewLines . $indent]),
112 112
                 ]);
113 113
                 ++$docIndex;
114 114
             }
Please login to merge, or discard this patch.
friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitInternalClassFixer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
         $lineEnd = $this->whitespacesConfig->getLineEnding();
118 118
         $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $tokens->getNextNonWhitespace($docBlockIndex));
119 119
         $toInsert = [
120
-            new Token([T_DOC_COMMENT, '/**'.$lineEnd."{$originalIndent} * @internal".$lineEnd."{$originalIndent} */"]),
121
-            new Token([T_WHITESPACE, $lineEnd.$originalIndent]),
120
+            new Token([T_DOC_COMMENT, '/**' . $lineEnd . "{$originalIndent} * @internal" . $lineEnd . "{$originalIndent} */"]),
121
+            new Token([T_WHITESPACE, $lineEnd . $originalIndent]),
122 122
         ];
123 123
         $index = $tokens->getNextMeaningfulToken($docBlockIndex);
124 124
         $tokens->insertAt($index, $toInsert);
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         $lines = $docBlock->getLines();
146 146
         $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $docBlockIndex);
147 147
         $lineEnd = $this->whitespacesConfig->getLineEnding();
148
-        array_splice($lines, -1, 0, $originalIndent.' *'.$lineEnd.$originalIndent.' * @internal'.$lineEnd);
148
+        array_splice($lines, -1, 0, $originalIndent . ' *' . $lineEnd . $originalIndent . ' * @internal' . $lineEnd);
149 149
 
150 150
         return $lines;
151 151
     }
Please login to merge, or discard this patch.
friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSizeClassFixer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
         $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $tokens->getNextNonWhitespace($docBlockIndex));
97 97
         $group = $this->configuration['group'];
98 98
         $toInsert = [
99
-            new Token([T_DOC_COMMENT, '/**'.$lineEnd."{$originalIndent} * @".$group.$lineEnd."{$originalIndent} */"]),
100
-            new Token([T_WHITESPACE, $lineEnd.$originalIndent]),
99
+            new Token([T_DOC_COMMENT, '/**' . $lineEnd . "{$originalIndent} * @" . $group . $lineEnd . "{$originalIndent} */"]),
100
+            new Token([T_WHITESPACE, $lineEnd . $originalIndent]),
101 101
         ];
102 102
         $index = $tokens->getNextMeaningfulToken($docBlockIndex);
103 103
         $tokens->insertAt($index, $toInsert);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $docBlockIndex);
126 126
         $lineEnd = $this->whitespacesConfig->getLineEnding();
127 127
         $group = $this->configuration['group'];
128
-        array_splice($lines, -1, 0, $originalIndent.' *'.$lineEnd.$originalIndent.' * @'.$group.$lineEnd);
128
+        array_splice($lines, -1, 0, $originalIndent . ' *' . $lineEnd . $originalIndent . ' * @' . $group . $lineEnd);
129 129
 
130 130
         return $lines;
131 131
     }
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
         $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $tokens->getNextNonWhitespace($docBlockIndex));
157 157
 
158 158
         return [
159
-            new Line('/**'.$lineEnd),
160
-            new Line($originalIndent.' * '.$lineContent.$lineEnd),
161
-            new Line($originalIndent.' */'),
159
+            new Line('/**' . $lineEnd),
160
+            new Line($originalIndent . ' * ' . $lineContent . $lineEnd),
161
+            new Line($originalIndent . ' */'),
162 162
         ];
163 163
     }
164 164
 
Please login to merge, or discard this patch.
php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNoExpectationAnnotationFixer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
             $newMethods = Tokens::fromCode($newMethodsCode);
206 206
             $newMethods[0] = new Token([
207 207
                 T_WHITESPACE,
208
-                $this->whitespacesConfig->getLineEnding().$originalIndent.$this->whitespacesConfig->getIndent(),
208
+                $this->whitespacesConfig->getLineEnding() . $originalIndent . $this->whitespacesConfig->getIndent(),
209 209
             ]);
210 210
 
211 211
             // apply changes
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
             $whitespaceIndex = $braceIndex + $newMethods->getSize() + 1;
220 220
             $tokens[$whitespaceIndex] = new Token([
221 221
                 T_WHITESPACE,
222
-                $this->whitespacesConfig->getLineEnding().$tokens[$whitespaceIndex]->getContent(),
222
+                $this->whitespacesConfig->getLineEnding() . $tokens[$whitespaceIndex]->getContent(),
223 223
             ]);
224 224
 
225 225
             $i = $docBlockIndex;
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     {
231 231
         $tag = $annotation->getTag()->getName();
232 232
 
233
-        if (1 !== Preg::match('/@'.$tag.'\s+(.+)$/s', $annotation->getContent(), $matches)) {
233
+        if (1 !== Preg::match('/@' . $tag . '\s+(.+)$/s', $annotation->getContent(), $matches)) {
234 234
             return '';
235 235
         }
236 236
 
Please login to merge, or discard this patch.
php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSetUpTearDownVisibilityFixer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
                 ),
55 55
             ],
56 56
             null,
57
-            'This fixer may change functions named `setUp()` or `tearDown()` outside of PHPUnit tests, '.
57
+            'This fixer may change functions named `setUp()` or `tearDown()` outside of PHPUnit tests, ' .
58 58
             'when a class is wrongly seen as a PHPUnit test.'
59 59
         );
60 60
     }
Please login to merge, or discard this patch.
friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNamespacedFixer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,8 +71,8 @@
 block discarded – undo
71 71
             ],
72 72
             "PHPUnit v6 has finally fully switched to namespaces.\n"
73 73
             ."You could start preparing the upgrade by switching from non-namespaced TestCase to namespaced one.\n"
74
-            .'Forward compatibility layer (`\PHPUnit\Framework\TestCase` class) was backported to PHPUnit v4.8.35 and PHPUnit v5.4.0.'."\n"
75
-            .'Extended forward compatibility layer (`PHPUnit\Framework\Assert`, `PHPUnit\Framework\BaseTestListener`, `PHPUnit\Framework\TestListener` classes) was introduced in v5.7.0.'."\n",
74
+            .'Forward compatibility layer (`\PHPUnit\Framework\TestCase` class) was backported to PHPUnit v4.8.35 and PHPUnit v5.4.0.' . "\n"
75
+            .'Extended forward compatibility layer (`PHPUnit\Framework\Assert`, `PHPUnit\Framework\BaseTestListener`, `PHPUnit\Framework\TestListener` classes) was introduced in v5.7.0.' . "\n",
76 76
             'Risky when PHPUnit classes are overridden or not accessible, or when project has PHPUnit incompatibilities.'
77 77
         );
78 78
     }
Please login to merge, or discard this patch.
friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestAnnotationFixer.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 public function testItDoesSomething() {}}'.$this->whitespacesConfig->getLineEnding(), ['style' => 'annotation']),
66 66
             ],
67 67
             null,
68
-            'This fixer may change the name of your tests, and could cause incompatibility with'.
68
+            'This fixer may change the name of your tests, and could cause incompatibility with' .
69 69
             ' abstract classes or interfaces.'
70 70
         );
71 71
     }
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 
226 226
     private function addTestPrefix(string $functionName): string
227 227
     {
228
-        return 'test'.ucfirst($functionName);
228
+        return 'test' . ucfirst($functionName);
229 229
     }
230 230
 
231 231
     private function createDocBlock(Tokens $tokens, int $docBlockIndex): void
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
         $lineEnd = $this->whitespacesConfig->getLineEnding();
234 234
         $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $tokens->getNextNonWhitespace($docBlockIndex));
235 235
         $toInsert = [
236
-            new Token([T_DOC_COMMENT, '/**'.$lineEnd."{$originalIndent} * @test".$lineEnd."{$originalIndent} */"]),
237
-            new Token([T_WHITESPACE, $lineEnd.$originalIndent]),
236
+            new Token([T_DOC_COMMENT, '/**' . $lineEnd . "{$originalIndent} * @test" . $lineEnd . "{$originalIndent} */"]),
237
+            new Token([T_WHITESPACE, $lineEnd . $originalIndent]),
238 238
         ];
239 239
         $index = $tokens->getNextMeaningfulToken($docBlockIndex);
240 240
         $tokens->insertAt($index, $toInsert);
@@ -305,9 +305,9 @@  discard block
 block discarded – undo
305 305
         $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $tokens->getNextNonWhitespace($docBlockIndex));
306 306
 
307 307
         return [
308
-            new Line('/**'.$lineEnd),
309
-            new Line($originalIndent.' * '.$lineContent.$lineEnd),
310
-            new Line($originalIndent.' */'),
308
+            new Line('/**' . $lineEnd),
309
+            new Line($originalIndent . ' * ' . $lineContent . $lineEnd),
310
+            new Line($originalIndent . ' */'),
311 311
         ];
312 312
     }
313 313
 
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
         }
359 359
         array_splice($line, $dependsIndex);
360 360
 
361
-        return new Line(implode('', $line).$dependsFunctionName);
361
+        return new Line(implode('', $line) . $dependsFunctionName);
362 362
     }
363 363
 
364 364
     private function addTestPrefixToDependsAnnotation(Line $line): Line
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 
374 374
         array_splice($line, $dependsIndex);
375 375
 
376
-        return new Line(implode('', $line).$dependsFunctionName);
376
+        return new Line(implode('', $line) . $dependsFunctionName);
377 377
     }
378 378
 
379 379
     /**
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
             $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $docBlockIndex);
404 404
             $lineEnd = $this->whitespacesConfig->getLineEnding();
405 405
 
406
-            array_splice($lines, -1, 0, $originalIndent.' *'.$lineEnd.$originalIndent.' * @test'.$lineEnd);
406
+            array_splice($lines, -1, 0, $originalIndent . ' *' . $lineEnd . $originalIndent . ' * @test' . $lineEnd);
407 407
         }
408 408
 
409 409
         return $lines;
Please login to merge, or discard this patch.