1
1
diff --git a/tests/expected_report.txt b/tests/expected_report.txt
2
- index d1e1fad..ea3b611 100644
2
+ index a646ff6..84c9474 100644
3
3
--- a/tests/expected_report.txt
4
4
+++ b/tests/expected_report.txt
5
- @@ -17,26 +17,23 @@
5
+ @@ -5,7 +5,7 @@ FILE ERRORS WARNINGS
6
+ ----------------------------------------------------------------------
7
+ tests/input/annotation-name.php 8 0
8
+ tests/input/array_indentation.php 10 0
9
+ - tests/input/arrow-functions-format.php 12 0
10
+ + tests/input/arrow-functions-format.php 10 0
11
+ tests/input/assignment-operators.php 4 0
12
+ tests/input/attributes.php 15 0
13
+ tests/input/binary_operators.php 9 0
14
+ @@ -17,26 +17,23 @@ tests/input/constants-var.php 6 0
6
15
tests/input/ControlStructures.php 28 0
7
16
tests/input/doc-comment-spacing.php 11 0
8
17
tests/input/duplicate-assignment-variable.php 1 0
@@ -37,7 +46,7 @@ index d1e1fad..ea3b611 100644
37
46
tests/input/semicolon_spacing.php 3 0
38
47
tests/input/single-line-array-spacing.php 5 0
39
48
tests/input/spread-operator.php 6 0
40
- @@ -46,17 +43,16 @@
49
+ @@ -46,17 +43,16 @@ tests/input/strings.php 3 0
41
50
tests/input/superfluous-naming.php 11 0
42
51
tests/input/test-case.php 8 0
43
52
tests/input/trailing_comma_on_array.php 1 0
@@ -51,10 +60,10 @@ index d1e1fad..ea3b611 100644
51
60
- tests/input/UselessConditions.php 21 0
52
61
+ tests/input/UselessConditions.php 20 0
53
62
----------------------------------------------------------------------
54
- - A TOTAL OF 462 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES
63
+ - A TOTAL OF 464 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES
55
64
+ A TOTAL OF 415 ERRORS AND 2 WARNINGS WERE FOUND IN 46 FILES
56
65
----------------------------------------------------------------------
57
- - PHPCBF CAN FIX 378 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
66
+ - PHPCBF CAN FIX 380 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
58
67
+ PHPCBF CAN FIX 331 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
59
68
----------------------------------------------------------------------
60
69
@@ -63,7 +72,7 @@ diff --git a/tests/fixed/ControlStructures.php b/tests/fixed/ControlStructures.p
63
72
index f8f7f65..a653086 100644
64
73
--- a/tests/fixed/ControlStructures.php
65
74
+++ b/tests/fixed/ControlStructures.php
66
- @@ -104,7 +104,7 @@ class ControlStructures
75
+ @@ -104,7 +104,7 @@ public function spaceBelowBlocks(): void
67
76
68
77
try {
69
78
echo 4;
@@ -76,7 +85,7 @@ diff --git a/tests/fixed/EarlyReturn.php b/tests/fixed/EarlyReturn.php
76
85
index fc734db..caf1dbb 100644
77
86
--- a/tests/fixed/EarlyReturn.php
78
87
+++ b/tests/fixed/EarlyReturn.php
79
- @@ -11,7 +11,7 @@ class EarlyReturn
88
+ @@ -11,7 +11,7 @@ public function bar(): bool
80
89
return $bar === 'bar';
81
90
}
82
91
@@ -117,7 +126,7 @@ diff --git a/tests/fixed/NamingCamelCase.php b/tests/fixed/NamingCamelCase.php
117
126
index 5493471..57d9f2b 100644
118
127
--- a/tests/fixed/NamingCamelCase.php
119
128
+++ b/tests/fixed/NamingCamelCase.php
120
- @@ -6,11 +6,14 @@ namespace Example;
129
+ @@ -6,11 +6,14 @@
121
130
122
131
class NamingCamelCase
123
132
{
@@ -155,7 +164,7 @@ diff --git a/tests/fixed/TrailingCommaOnFunctions.php b/tests/fixed/TrailingComm
155
164
index 4248238..f3ffa91 100644
156
165
--- a/tests/fixed/TrailingCommaOnFunctions.php
157
166
+++ b/tests/fixed/TrailingCommaOnFunctions.php
158
- @@ -15,7 +15,7 @@ class TrailingCommaOnFunctions
167
+ @@ -15,7 +15,7 @@ public function a(int $arg): void
159
168
}
160
169
161
170
public function b(
@@ -164,7 +173,7 @@ index 4248238..f3ffa91 100644
164
173
): void {
165
174
}
166
175
167
- @@ -28,7 +28,7 @@ class TrailingCommaOnFunctions
176
+ @@ -28,7 +28,7 @@ public function uses(): void
168
177
};
169
178
170
179
$multiLine = static function (int $arg) use (
@@ -173,7 +182,7 @@ index 4248238..f3ffa91 100644
173
182
): void {
174
183
var_dump($var);
175
184
};
176
- @@ -37,9 +37,8 @@ class TrailingCommaOnFunctions
185
+ @@ -37,9 +37,8 @@ public function uses(): void
177
186
178
187
$class = new TrailingCommaOnFunctions();
179
188
@@ -188,7 +197,7 @@ diff --git a/tests/fixed/UselessConditions.php b/tests/fixed/UselessConditions.p
188
197
index 71e0cfb..2151b17 100644
189
198
--- a/tests/fixed/UselessConditions.php
190
199
+++ b/tests/fixed/UselessConditions.php
191
- @@ -95,7 +95,7 @@ class UselessConditions
200
+ @@ -95,7 +95,7 @@ public function necessaryIfConditionWithMethodCall(): bool
192
201
return false;
193
202
}
194
203
@@ -198,10 +207,10 @@ index 71e0cfb..2151b17 100644
198
207
if (! $this->isAdmin) {
199
208
return null;
200
209
diff --git a/tests/fixed/arrow-functions-format.php b/tests/fixed/arrow-functions-format.php
201
- index 4da39b8 ..a45074f 100644
210
+ index dcb5a3e ..a45074f 100644
202
211
--- a/tests/fixed/arrow-functions-format.php
203
212
+++ b/tests/fixed/arrow-functions-format.php
204
- @@ -18,10 +18,10 @@ $returningObject = static fn () => new stdClass();
213
+ @@ -18,10 +18,10 @@
205
214
206
215
$multiLineArrowFunctions = Collection::from([1, 2])
207
216
->map(
@@ -214,6 +223,21 @@ index 4da39b8..a45074f 100644
214
223
);
215
224
216
225
$thisIsNotAnArrowFunction = [$this->fn => 'value'];
226
+ @@ -32,12 +32,12 @@
227
+ ];
228
+
229
+ $singleLineArrayReturn = Collection::map(
230
+ - static fn () => [1, 2],
231
+ + static fn () => [1, 2]
232
+ );
233
+
234
+ $wrongMultiLineArrayReturn = Collection::map(
235
+ static fn () => [
236
+ 1,
237
+ 2,
238
+ - ],
239
+ + ]
240
+ );
217
241
diff --git a/tests/fixed/example-class.php b/tests/fixed/example-class.php
218
242
index 4988dab..2df56a0 100644
219
243
--- a/tests/fixed/example-class.php
@@ -244,7 +268,7 @@ index 4988dab..2df56a0 100644
244
268
$this->baxBax = $baxBax;
245
269
246
270
parent::__construct();
247
- @@ -41,7 +54,7 @@ class Example extends ParentClass implements IteratorAggregate
271
+ @@ -41,7 +54,7 @@ public function __construct(private int|null $foo = null, private array $bar = [
248
272
/**
249
273
* Description
250
274
*/
@@ -257,7 +281,7 @@ diff --git a/tests/fixed/namespaces-spacing.php b/tests/fixed/namespaces-spacing
257
281
index 36cbae2..d42bbfe 100644
258
282
--- a/tests/fixed/namespaces-spacing.php
259
283
+++ b/tests/fixed/namespaces-spacing.php
260
- @@ -16,5 +16,5 @@ use const DATE_RFC3339;
284
+ @@ -16,5 +16,5 @@
261
285
strrev(
262
286
(new DateTimeImmutable('@' . time(), new DateTimeZone('UTC')))
263
287
->sub(new DateInterval('P1D'))
@@ -268,7 +292,7 @@ diff --git a/tests/fixed/new_with_parentheses.php b/tests/fixed/new_with_parenth
268
292
index 47a06ec..6e81bbe 100644
269
293
--- a/tests/fixed/new_with_parentheses.php
270
294
+++ b/tests/fixed/new_with_parentheses.php
271
- @@ -24,5 +24,5 @@ $y = [new stdClass()];
295
+ @@ -24,5 +24,5 @@
272
296
273
297
$z = new stdClass() ? new stdClass() : new stdClass();
274
298
@@ -302,7 +326,7 @@ diff --git a/tests/fixed/null_coalesce_operator.php b/tests/fixed/null_coalesce_
302
326
index 51c361c..8846dd1 100644
303
327
--- a/tests/fixed/null_coalesce_operator.php
304
328
+++ b/tests/fixed/null_coalesce_operator.php
305
- @@ -4,7 +4,7 @@ declare(strict_types=1);
329
+ @@ -4,7 +4,7 @@
306
330
307
331
$foo = $_GET['foo'] ?? 'foo';
308
332
@@ -373,7 +397,7 @@ diff --git a/tests/fixed/return_type_on_methods.php b/tests/fixed/return_type_on
373
397
index 0c897ae..8e2c6f7 100644
374
398
--- a/tests/fixed/return_type_on_methods.php
375
399
+++ b/tests/fixed/return_type_on_methods.php
376
- @@ -31,7 +31,7 @@ class Test
400
+ @@ -31,7 +31,7 @@ public function f(
377
401
int $c,
378
402
int $d,
379
403
int $e,
@@ -382,7 +406,7 @@ index 0c897ae..8e2c6f7 100644
382
406
): void {
383
407
}
384
408
385
- @@ -40,7 +40,7 @@ class Test
409
+ @@ -40,7 +40,7 @@ public function g(
386
410
int $c,
387
411
int $d,
388
412
int $e,
@@ -391,7 +415,7 @@ index 0c897ae..8e2c6f7 100644
391
415
): void {
392
416
}
393
417
394
- @@ -49,7 +49,7 @@ class Test
418
+ @@ -49,7 +49,7 @@ public function h(
395
419
int $c,
396
420
int $d,
397
421
int $e,
@@ -400,7 +424,7 @@ index 0c897ae..8e2c6f7 100644
400
424
): void {
401
425
}
402
426
403
- @@ -58,7 +58,7 @@ class Test
427
+ @@ -58,7 +58,7 @@ public function i(
404
428
int $c,
405
429
int $d,
406
430
int $e,
@@ -409,7 +433,7 @@ index 0c897ae..8e2c6f7 100644
409
433
): void {
410
434
}
411
435
412
- @@ -67,7 +67,7 @@ class Test
436
+ @@ -67,7 +67,7 @@ public function j(
413
437
int $c,
414
438
int $d,
415
439
int $e,
@@ -422,7 +446,7 @@ diff --git a/tests/fixed/type-hints.php b/tests/fixed/type-hints.php
422
446
index 5e26ed8..10e6f34 100644
423
447
--- a/tests/fixed/type-hints.php
424
448
+++ b/tests/fixed/type-hints.php
425
- @@ -10,7 +10,7 @@ use Traversable;
449
+ @@ -10,7 +10,7 @@
426
450
class TraversableTypeHints
427
451
{
428
452
/** @var Traversable */
@@ -431,7 +455,7 @@ index 5e26ed8..10e6f34 100644
431
455
432
456
/**
433
457
* @param Iterator $iterator
434
- @@ -25,5 +25,6 @@ class TraversableTypeHints
458
+ @@ -25,5 +25,6 @@ public function get(Iterator $iterator): Traversable
435
459
436
460
class UnionTypeHints
437
461
{
@@ -443,7 +467,7 @@ diff --git a/tests/input/ControlStructures.php b/tests/input/ControlStructures.p
443
467
index 73944e3..a0e0b2e 100644
444
468
--- a/tests/input/ControlStructures.php
445
469
+++ b/tests/input/ControlStructures.php
446
- @@ -93,7 +93,7 @@ class ControlStructures
470
+ @@ -93,7 +93,7 @@ public function spaceBelowBlocks(): void
447
471
}
448
472
try {
449
473
echo 4;
@@ -498,7 +522,7 @@ diff --git a/tests/input/TrailingCommaOnFunctions.php b/tests/input/TrailingComm
498
522
index fc5480e..f3ffa91 100644
499
523
--- a/tests/input/TrailingCommaOnFunctions.php
500
524
+++ b/tests/input/TrailingCommaOnFunctions.php
501
- @@ -10,7 +10,7 @@ use function var_dump;
525
+ @@ -10,7 +10,7 @@
502
526
503
527
class TrailingCommaOnFunctions
504
528
{
@@ -507,7 +531,7 @@ index fc5480e..f3ffa91 100644
507
531
{
508
532
}
509
533
510
- @@ -23,7 +23,7 @@ class TrailingCommaOnFunctions
534
+ @@ -23,7 +23,7 @@ public function uses(): void
511
535
{
512
536
$var = null;
513
537
@@ -516,7 +540,7 @@ index fc5480e..f3ffa91 100644
516
540
var_dump($var);
517
541
};
518
542
519
- @@ -37,8 +37,7 @@ class TrailingCommaOnFunctions
543
+ @@ -37,8 +37,7 @@ public function uses(): void
520
544
521
545
$class = new TrailingCommaOnFunctions();
522
546
@@ -530,7 +554,7 @@ diff --git a/tests/input/arrow-functions-format.php b/tests/input/arrow-function
530
554
index d3903ff..8a358e8 100644
531
555
--- a/tests/input/arrow-functions-format.php
532
556
+++ b/tests/input/arrow-functions-format.php
533
- @@ -18,10 +18,10 @@ $returningObject = static fn () => new stdClass();
557
+ @@ -18,10 +18,10 @@
534
558
535
559
$multiLineArrowFunctions = Collection::from([1, 2])
536
560
->map(
@@ -547,7 +571,7 @@ diff --git a/tests/input/namespaces-spacing.php b/tests/input/namespaces-spacing
547
571
index e7be018..e1ab639 100644
548
572
--- a/tests/input/namespaces-spacing.php
549
573
+++ b/tests/input/namespaces-spacing.php
550
- @@ -11,5 +11,5 @@ use const DATE_RFC3339;
574
+ @@ -11,5 +11,5 @@
551
575
strrev(
552
576
(new DateTimeImmutable('@' . time(), new DateTimeZone('UTC')))
553
577
->sub(new DateInterval('P1D'))
0 commit comments