diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
index 37f88617..462158f9 100644
--- a/.github/workflows/continuous-integration.yml
+++ b/.github/workflows/continuous-integration.yml
@@ -130,6 +130,7 @@ jobs:
matrix:
php-version:
- "7.2"
+ - "7.3"
- "7.4"
- "8.0"
- "8.1"
diff --git a/Makefile b/Makefile
index ebaa4c08..c8f4d99e 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,13 @@ test-report: vendor
test-fix: vendor
./bin/test-fix
+update-compatibility-patch-73:
+ @git apply tests/php73-compatibility.patch
+ @printf "Please open your editor and apply your changes\n"
+ @until [ "$${compatibility_resolved}" == "y" ]; do read -p "Have finished your changes (y|n)? " compatibility_resolved; done && compatibility_resolved=
+ @git diff -- tests/expected_report.txt tests/fixed tests/input > .tmp-patch && mv .tmp-patch tests/php73-compatibility.patch && git apply -R tests/php73-compatibility.patch
+ @git commit -m 'Update compatibility patch' tests/php73-compatibility.patch
+
update-compatibility-patch-74:
@git apply tests/php74-compatibility.patch
@printf "Please open your editor and apply your changes\n"
diff --git a/lib/Doctrine/ruleset.xml b/lib/Doctrine/ruleset.xml
index e6ada383..71cacee4 100644
--- a/lib/Doctrine/ruleset.xml
+++ b/lib/Doctrine/ruleset.xml
@@ -291,12 +291,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/fixed/TrailingCommaOnFunctions.php b/tests/fixed/TrailingCommaOnFunctions.php
index 6e5cca4d..f3ffa91d 100644
--- a/tests/fixed/TrailingCommaOnFunctions.php
+++ b/tests/fixed/TrailingCommaOnFunctions.php
@@ -4,6 +4,10 @@
namespace Doctrine;
+use function var_dump;
+
+// phpcs:disable PSR1.Files.SideEffects
+
class TrailingCommaOnFunctions
{
public function a(int $arg): void
@@ -14,4 +18,27 @@ public function b(
int $arg
): void {
}
+
+ public function uses(): void
+ {
+ $var = null;
+
+ $singleLine = static function (int $arg) use ($var): void {
+ var_dump($var);
+ };
+
+ $multiLine = static function (int $arg) use (
+ $var
+ ): void {
+ var_dump($var);
+ };
+ }
}
+
+$class = new TrailingCommaOnFunctions();
+
+$class->a(1);
+
+$class->a(
+ 1
+);
diff --git a/tests/input/TrailingCommaOnFunctions.php b/tests/input/TrailingCommaOnFunctions.php
index 6e5cca4d..f3ffa91d 100644
--- a/tests/input/TrailingCommaOnFunctions.php
+++ b/tests/input/TrailingCommaOnFunctions.php
@@ -4,6 +4,10 @@
namespace Doctrine;
+use function var_dump;
+
+// phpcs:disable PSR1.Files.SideEffects
+
class TrailingCommaOnFunctions
{
public function a(int $arg): void
@@ -14,4 +18,27 @@ public function b(
int $arg
): void {
}
+
+ public function uses(): void
+ {
+ $var = null;
+
+ $singleLine = static function (int $arg) use ($var): void {
+ var_dump($var);
+ };
+
+ $multiLine = static function (int $arg) use (
+ $var
+ ): void {
+ var_dump($var);
+ };
+ }
}
+
+$class = new TrailingCommaOnFunctions();
+
+$class->a(1);
+
+$class->a(
+ 1
+);
diff --git a/tests/php73-compatibility.patch b/tests/php73-compatibility.patch
new file mode 100644
index 00000000..8e056058
--- /dev/null
+++ b/tests/php73-compatibility.patch
@@ -0,0 +1,109 @@
+diff --git a/tests/expected_report.txt b/tests/expected_report.txt
+index 1d5a7d3..fae9e70 100644
+--- a/tests/expected_report.txt
++++ b/tests/expected_report.txt
+@@ -39,6 +39,7 @@ tests/input/strings.php 1 0
+ tests/input/superfluous-naming.php 11 0
+ tests/input/test-case.php 8 0
+ tests/input/trailing_comma_on_array.php 1 0
++tests/input/TrailingCommaOnFunctions.php 2 0
+ tests/input/traits-uses.php 11 0
+ tests/input/type-hints.php 7 0
+ tests/input/UnusedVariables.php 1 0
+@@ -46,9 +47,9 @@ tests/input/use-ordering.php 1 0
+ tests/input/useless-semicolon.php 2 0
+ tests/input/UselessConditions.php 20 0
+ ----------------------------------------------------------------------
+-A TOTAL OF 381 ERRORS AND 0 WARNINGS WERE FOUND IN 42 FILES
++A TOTAL OF 383 ERRORS AND 0 WARNINGS WERE FOUND IN 43 FILES
+ ----------------------------------------------------------------------
+-PHPCBF CAN FIX 315 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
++PHPCBF CAN FIX 317 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
+ ----------------------------------------------------------------------
+
+
+diff --git a/tests/fixed/TrailingCommaOnFunctions.php b/tests/fixed/TrailingCommaOnFunctions.php
+index f3ffa91..67173b3 100644
+--- a/tests/fixed/TrailingCommaOnFunctions.php
++++ b/tests/fixed/TrailingCommaOnFunctions.php
+@@ -37,8 +37,9 @@ class TrailingCommaOnFunctions
+
+ $class = new TrailingCommaOnFunctions();
+
++// phpcs:ignore Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma
+ $class->a(1);
+
+ $class->a(
+- 1
++ 1,
+ );
+diff --git a/tests/fixed/arrow-functions-format.php b/tests/fixed/arrow-functions-format.php
+index a45074f..4da39b8 100644
+--- a/tests/fixed/arrow-functions-format.php
++++ b/tests/fixed/arrow-functions-format.php
+@@ -18,10 +18,10 @@ $returningObject = static fn () => new stdClass();
+
+ $multiLineArrowFunctions = Collection::from([1, 2])
+ ->map(
+- static fn (int $v): int => $v * 2
++ static fn (int $v): int => $v * 2,
+ )
+ ->reduce(
+- static fn (int $tmp, int $v): int => $tmp + $v
++ static fn (int $tmp, int $v): int => $tmp + $v,
+ );
+
+ $thisIsNotAnArrowFunction = [$this->fn => 'value'];
+diff --git a/tests/fixed/namespaces-spacing.php b/tests/fixed/namespaces-spacing.php
+index d42bbfe..36cbae2 100644
+--- a/tests/fixed/namespaces-spacing.php
++++ b/tests/fixed/namespaces-spacing.php
+@@ -16,5 +16,5 @@ use const DATE_RFC3339;
+ strrev(
+ (new DateTimeImmutable('@' . time(), new DateTimeZone('UTC')))
+ ->sub(new DateInterval('P1D'))
+- ->format(DATE_RFC3339)
++ ->format(DATE_RFC3339),
+ );
+diff --git a/tests/input/TrailingCommaOnFunctions.php b/tests/input/TrailingCommaOnFunctions.php
+index f3ffa91..8adcedf 100644
+--- a/tests/input/TrailingCommaOnFunctions.php
++++ b/tests/input/TrailingCommaOnFunctions.php
+@@ -37,7 +37,8 @@ class TrailingCommaOnFunctions
+
+ $class = new TrailingCommaOnFunctions();
+
+-$class->a(1);
++// phpcs:ignore Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma
++$class->a(1,);
+
+ $class->a(
+ 1
+diff --git a/tests/input/arrow-functions-format.php b/tests/input/arrow-functions-format.php
+index 8a358e8..d3903ff 100644
+--- a/tests/input/arrow-functions-format.php
++++ b/tests/input/arrow-functions-format.php
+@@ -18,10 +18,10 @@ $returningObject = static fn () => new stdClass();
+
+ $multiLineArrowFunctions = Collection::from([1, 2])
+ ->map(
+- static fn (int $v): int => $v * 2
++ static fn (int $v): int => $v * 2,
+ )
+ ->reduce(
+- static fn (int $tmp, int $v): int => $tmp + $v
++ static fn (int $tmp, int $v): int => $tmp + $v,
+ );
+
+ $thisIsNotAnArrowFunction = [$this->fn => 'value'];
+diff --git a/tests/input/namespaces-spacing.php b/tests/input/namespaces-spacing.php
+index e1ab639..e7be018 100644
+--- a/tests/input/namespaces-spacing.php
++++ b/tests/input/namespaces-spacing.php
+@@ -11,5 +11,5 @@ use const DATE_RFC3339;
+ strrev(
+ (new DateTimeImmutable('@' . time(), new DateTimeZone('UTC')))
+ ->sub(new DateInterval('P1D'))
+- ->format(DATE_RFC3339)
++ ->format(DATE_RFC3339),
+ );
diff --git a/tests/php74-compatibility.patch b/tests/php74-compatibility.patch
index d4b5f29c..55366f8b 100644
--- a/tests/php74-compatibility.patch
+++ b/tests/php74-compatibility.patch
@@ -1,5 +1,5 @@
diff --git a/tests/expected_report.txt b/tests/expected_report.txt
-index c644926..7d122d2 100644
+index 1d5a7d3..91e97e7 100644
--- a/tests/expected_report.txt
+++ b/tests/expected_report.txt
@@ -15,7 +15,7 @@ tests/input/ControlStructures.php 28 0
@@ -23,14 +23,11 @@ index c644926..7d122d2 100644
tests/input/null_coalesce_operator.php 3 0
tests/input/optimized-functions.php 1 0
tests/input/PropertyDeclaration.php 6 0
-@@ -35,20 +35,20 @@ tests/input/semicolon_spacing.php 3 0
- tests/input/single-line-array-spacing.php 5 0
- tests/input/spread-operator.php 6 0
- tests/input/static-closures.php 1 0
- tests/input/strings.php 1 0
+@@ -39,16 +39,17 @@ tests/input/strings.php 1 0
tests/input/superfluous-naming.php 11 0
tests/input/test-case.php 8 0
tests/input/trailing_comma_on_array.php 1 0
++tests/input/TrailingCommaOnFunctions.php 2 0
tests/input/traits-uses.php 11 0
-tests/input/type-hints.php 7 0
+tests/input/type-hints.php 8 0
@@ -40,13 +37,45 @@ index c644926..7d122d2 100644
tests/input/UselessConditions.php 20 0
----------------------------------------------------------------------
-A TOTAL OF 381 ERRORS AND 0 WARNINGS WERE FOUND IN 42 FILES
-+A TOTAL OF 390 ERRORS AND 0 WARNINGS WERE FOUND IN 42 FILES
++A TOTAL OF 392 ERRORS AND 0 WARNINGS WERE FOUND IN 43 FILES
----------------------------------------------------------------------
-PHPCBF CAN FIX 315 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
-+PHPCBF CAN FIX 324 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
++PHPCBF CAN FIX 326 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
+diff --git a/tests/fixed/TrailingCommaOnFunctions.php b/tests/fixed/TrailingCommaOnFunctions.php
+index f3ffa91..67173b3 100644
+--- a/tests/fixed/TrailingCommaOnFunctions.php
++++ b/tests/fixed/TrailingCommaOnFunctions.php
+@@ -37,8 +37,9 @@ class TrailingCommaOnFunctions
+
+ $class = new TrailingCommaOnFunctions();
+
++// phpcs:ignore Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma
+ $class->a(1);
+
+ $class->a(
+- 1
++ 1,
+ );
+diff --git a/tests/fixed/arrow-functions-format.php b/tests/fixed/arrow-functions-format.php
+index a45074f..4da39b8 100644
+--- a/tests/fixed/arrow-functions-format.php
++++ b/tests/fixed/arrow-functions-format.php
+@@ -18,10 +18,10 @@ $returningObject = static fn () => new stdClass();
+
+ $multiLineArrowFunctions = Collection::from([1, 2])
+ ->map(
+- static fn (int $v): int => $v * 2
++ static fn (int $v): int => $v * 2,
+ )
+ ->reduce(
+- static fn (int $tmp, int $v): int => $tmp + $v
++ static fn (int $tmp, int $v): int => $tmp + $v,
+ );
+
+ $thisIsNotAnArrowFunction = [$this->fn => 'value'];
diff --git a/tests/fixed/example-class.php b/tests/fixed/example-class.php
index 998e51d..7866379 100644
--- a/tests/fixed/example-class.php
@@ -69,6 +98,17 @@ index 998e51d..7866379 100644
/** @var ControlStructureSniff|int|string|null */
private $baxBax;
+diff --git a/tests/fixed/namespaces-spacing.php b/tests/fixed/namespaces-spacing.php
+index d42bbfe..36cbae2 100644
+--- a/tests/fixed/namespaces-spacing.php
++++ b/tests/fixed/namespaces-spacing.php
+@@ -16,5 +16,5 @@ use const DATE_RFC3339;
+ strrev(
+ (new DateTimeImmutable('@' . time(), new DateTimeZone('UTC')))
+ ->sub(new DateInterval('P1D'))
+- ->format(DATE_RFC3339)
++ ->format(DATE_RFC3339),
+ );
diff --git a/tests/fixed/new_with_parentheses.php b/tests/fixed/new_with_parentheses.php
index 6e81bbe..47a06ec 100644
--- a/tests/fixed/new_with_parentheses.php
@@ -129,3 +169,45 @@ index 10e6f34..bfa6d4f 100644
/**
* @param Iterator $iterator
+diff --git a/tests/input/TrailingCommaOnFunctions.php b/tests/input/TrailingCommaOnFunctions.php
+index f3ffa91..8adcedf 100644
+--- a/tests/input/TrailingCommaOnFunctions.php
++++ b/tests/input/TrailingCommaOnFunctions.php
+@@ -37,7 +37,8 @@ class TrailingCommaOnFunctions
+
+ $class = new TrailingCommaOnFunctions();
+
+-$class->a(1);
++// phpcs:ignore Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma
++$class->a(1,);
+
+ $class->a(
+ 1
+diff --git a/tests/input/arrow-functions-format.php b/tests/input/arrow-functions-format.php
+index 8a358e8..d3903ff 100644
+--- a/tests/input/arrow-functions-format.php
++++ b/tests/input/arrow-functions-format.php
+@@ -18,10 +18,10 @@ $returningObject = static fn () => new stdClass();
+
+ $multiLineArrowFunctions = Collection::from([1, 2])
+ ->map(
+- static fn (int $v): int => $v * 2
++ static fn (int $v): int => $v * 2,
+ )
+ ->reduce(
+- static fn (int $tmp, int $v): int => $tmp + $v
++ static fn (int $tmp, int $v): int => $tmp + $v,
+ );
+
+ $thisIsNotAnArrowFunction = [$this->fn => 'value'];
+diff --git a/tests/input/namespaces-spacing.php b/tests/input/namespaces-spacing.php
+index e1ab639..e7be018 100644
+--- a/tests/input/namespaces-spacing.php
++++ b/tests/input/namespaces-spacing.php
+@@ -11,5 +11,5 @@ use const DATE_RFC3339;
+ strrev(
+ (new DateTimeImmutable('@' . time(), new DateTimeZone('UTC')))
+ ->sub(new DateInterval('P1D'))
+- ->format(DATE_RFC3339)
++ ->format(DATE_RFC3339),
+ );
diff --git a/tests/php80-compatibility.patch b/tests/php80-compatibility.patch
index ac70d56d..c6923131 100644
--- a/tests/php80-compatibility.patch
+++ b/tests/php80-compatibility.patch
@@ -1,5 +1,5 @@
diff --git a/tests/expected_report.txt b/tests/expected_report.txt
-index 1d5a7d3..bfdc3f5 100644
+index 1d5a7d3..03460f2 100644
--- a/tests/expected_report.txt
+++ b/tests/expected_report.txt
@@ -14,23 +14,24 @@ tests/input/constants-var.php 6 0
@@ -39,7 +39,7 @@ index 1d5a7d3..bfdc3f5 100644
tests/input/superfluous-naming.php 11 0
tests/input/test-case.php 8 0
tests/input/trailing_comma_on_array.php 1 0
-+tests/input/TrailingCommaOnFunctions.php 2 0
++tests/input/TrailingCommaOnFunctions.php 6 0
tests/input/traits-uses.php 11 0
-tests/input/type-hints.php 7 0
+tests/input/type-hints.php 9 0
@@ -50,10 +50,10 @@ index 1d5a7d3..bfdc3f5 100644
+tests/input/UselessConditions.php 21 0
----------------------------------------------------------------------
-A TOTAL OF 381 ERRORS AND 0 WARNINGS WERE FOUND IN 42 FILES
-+A TOTAL OF 416 ERRORS AND 0 WARNINGS WERE FOUND IN 44 FILES
++A TOTAL OF 420 ERRORS AND 0 WARNINGS WERE FOUND IN 44 FILES
----------------------------------------------------------------------
-PHPCBF CAN FIX 315 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
-+PHPCBF CAN FIX 350 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
++PHPCBF CAN FIX 354 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
@@ -109,10 +109,10 @@ index 5c3f27b..7821d5c 100644
+ }
}
diff --git a/tests/fixed/TrailingCommaOnFunctions.php b/tests/fixed/TrailingCommaOnFunctions.php
-index 6e5cca4..c5fdccb 100644
+index f3ffa91..4248238 100644
--- a/tests/fixed/TrailingCommaOnFunctions.php
+++ b/tests/fixed/TrailingCommaOnFunctions.php
-@@ -11,7 +11,7 @@ class TrailingCommaOnFunctions
+@@ -15,7 +15,7 @@ class TrailingCommaOnFunctions
}
public function b(
@@ -120,7 +120,27 @@ index 6e5cca4..c5fdccb 100644
+ int $arg,
): void {
}
- }
+
+@@ -28,7 +28,7 @@ class TrailingCommaOnFunctions
+ };
+
+ $multiLine = static function (int $arg) use (
+- $var
++ $var,
+ ): void {
+ var_dump($var);
+ };
+@@ -37,8 +37,9 @@ class TrailingCommaOnFunctions
+
+ $class = new TrailingCommaOnFunctions();
+
++// phpcs:ignore Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma
+ $class->a(1);
+
+ $class->a(
+- 1
++ 1,
+ );
diff --git a/tests/fixed/UselessConditions.php b/tests/fixed/UselessConditions.php
index 2151b17..71e0cfb 100644
--- a/tests/fixed/UselessConditions.php
@@ -134,6 +154,23 @@ index 2151b17..71e0cfb 100644
{
if (! $this->isAdmin) {
return null;
+diff --git a/tests/fixed/arrow-functions-format.php b/tests/fixed/arrow-functions-format.php
+index a45074f..4da39b8 100644
+--- a/tests/fixed/arrow-functions-format.php
++++ b/tests/fixed/arrow-functions-format.php
+@@ -18,10 +18,10 @@ $returningObject = static fn () => new stdClass();
+
+ $multiLineArrowFunctions = Collection::from([1, 2])
+ ->map(
+- static fn (int $v): int => $v * 2
++ static fn (int $v): int => $v * 2,
+ )
+ ->reduce(
+- static fn (int $tmp, int $v): int => $tmp + $v
++ static fn (int $tmp, int $v): int => $tmp + $v,
+ );
+
+ $thisIsNotAnArrowFunction = [$this->fn => 'value'];
diff --git a/tests/fixed/example-class.php b/tests/fixed/example-class.php
index 998e51d..56cd902 100644
--- a/tests/fixed/example-class.php
@@ -172,6 +209,17 @@ index 998e51d..56cd902 100644
{
return $this->foo;
}
+diff --git a/tests/fixed/namespaces-spacing.php b/tests/fixed/namespaces-spacing.php
+index d42bbfe..36cbae2 100644
+--- a/tests/fixed/namespaces-spacing.php
++++ b/tests/fixed/namespaces-spacing.php
+@@ -16,5 +16,5 @@ use const DATE_RFC3339;
+ strrev(
+ (new DateTimeImmutable('@' . time(), new DateTimeZone('UTC')))
+ ->sub(new DateInterval('P1D'))
+- ->format(DATE_RFC3339)
++ ->format(DATE_RFC3339),
+ );
diff --git a/tests/fixed/new_with_parentheses.php b/tests/fixed/new_with_parentheses.php
index 6e81bbe..47a06ec 100644
--- a/tests/fixed/new_with_parentheses.php
@@ -362,10 +410,10 @@ index 0891e12..4eb8164 100644
+ }
}
diff --git a/tests/input/TrailingCommaOnFunctions.php b/tests/input/TrailingCommaOnFunctions.php
-index 6e5cca4..1d24bb6 100644
+index f3ffa91..fc5480e 100644
--- a/tests/input/TrailingCommaOnFunctions.php
+++ b/tests/input/TrailingCommaOnFunctions.php
-@@ -6,7 +6,7 @@ namespace Doctrine;
+@@ -10,7 +10,7 @@ use function var_dump;
class TrailingCommaOnFunctions
{
@@ -374,3 +422,50 @@ index 6e5cca4..1d24bb6 100644
{
}
+@@ -23,7 +23,7 @@ class TrailingCommaOnFunctions
+ {
+ $var = null;
+
+- $singleLine = static function (int $arg) use ($var): void {
++ $singleLine = static function (int $arg) use ($var,): void {
+ var_dump($var);
+ };
+
+@@ -37,7 +37,8 @@ class TrailingCommaOnFunctions
+
+ $class = new TrailingCommaOnFunctions();
+
+-$class->a(1);
++// phpcs:ignore Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma
++$class->a(1,);
+
+ $class->a(
+ 1
+diff --git a/tests/input/arrow-functions-format.php b/tests/input/arrow-functions-format.php
+index 8a358e8..d3903ff 100644
+--- a/tests/input/arrow-functions-format.php
++++ b/tests/input/arrow-functions-format.php
+@@ -18,10 +18,10 @@ $returningObject = static fn () => new stdClass();
+
+ $multiLineArrowFunctions = Collection::from([1, 2])
+ ->map(
+- static fn (int $v): int => $v * 2
++ static fn (int $v): int => $v * 2,
+ )
+ ->reduce(
+- static fn (int $tmp, int $v): int => $tmp + $v
++ static fn (int $tmp, int $v): int => $tmp + $v,
+ );
+
+ $thisIsNotAnArrowFunction = [$this->fn => 'value'];
+diff --git a/tests/input/namespaces-spacing.php b/tests/input/namespaces-spacing.php
+index e1ab639..e7be018 100644
+--- a/tests/input/namespaces-spacing.php
++++ b/tests/input/namespaces-spacing.php
+@@ -11,5 +11,5 @@ use const DATE_RFC3339;
+ strrev(
+ (new DateTimeImmutable('@' . time(), new DateTimeZone('UTC')))
+ ->sub(new DateInterval('P1D'))
+- ->format(DATE_RFC3339)
++ ->format(DATE_RFC3339),
+ );
diff --git a/tests/php81-compatibility.patch b/tests/php81-compatibility.patch
index 57e26374..771076f7 100644
--- a/tests/php81-compatibility.patch
+++ b/tests/php81-compatibility.patch
@@ -1,5 +1,5 @@
diff --git a/tests/expected_report.txt b/tests/expected_report.txt
-index 1d5a7d3..86e94e3 100644
+index 1d5a7d3..a10bb10 100644
--- a/tests/expected_report.txt
+++ b/tests/expected_report.txt
@@ -14,23 +14,24 @@ tests/input/constants-var.php 6 0
@@ -39,7 +39,7 @@ index 1d5a7d3..86e94e3 100644
tests/input/superfluous-naming.php 11 0
tests/input/test-case.php 8 0
tests/input/trailing_comma_on_array.php 1 0
-+tests/input/TrailingCommaOnFunctions.php 2 0
++tests/input/TrailingCommaOnFunctions.php 6 0
tests/input/traits-uses.php 11 0
-tests/input/type-hints.php 7 0
+tests/input/type-hints.php 9 0
@@ -50,10 +50,10 @@ index 1d5a7d3..86e94e3 100644
+tests/input/UselessConditions.php 21 0
----------------------------------------------------------------------
-A TOTAL OF 381 ERRORS AND 0 WARNINGS WERE FOUND IN 42 FILES
-+A TOTAL OF 419 ERRORS AND 0 WARNINGS WERE FOUND IN 44 FILES
++A TOTAL OF 423 ERRORS AND 0 WARNINGS WERE FOUND IN 44 FILES
----------------------------------------------------------------------
-PHPCBF CAN FIX 315 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
-+PHPCBF CAN FIX 353 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
++PHPCBF CAN FIX 357 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
@@ -109,10 +109,10 @@ index 5c3f27b..9703897 100644
+ }
}
diff --git a/tests/fixed/TrailingCommaOnFunctions.php b/tests/fixed/TrailingCommaOnFunctions.php
-index 6e5cca4..c5fdccb 100644
+index f3ffa91..4248238 100644
--- a/tests/fixed/TrailingCommaOnFunctions.php
+++ b/tests/fixed/TrailingCommaOnFunctions.php
-@@ -11,7 +11,7 @@ class TrailingCommaOnFunctions
+@@ -15,7 +15,7 @@ class TrailingCommaOnFunctions
}
public function b(
@@ -120,7 +120,27 @@ index 6e5cca4..c5fdccb 100644
+ int $arg,
): void {
}
- }
+
+@@ -28,7 +28,7 @@ class TrailingCommaOnFunctions
+ };
+
+ $multiLine = static function (int $arg) use (
+- $var
++ $var,
+ ): void {
+ var_dump($var);
+ };
+@@ -37,8 +37,9 @@ class TrailingCommaOnFunctions
+
+ $class = new TrailingCommaOnFunctions();
+
++// phpcs:ignore Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma
+ $class->a(1);
+
+ $class->a(
+- 1
++ 1,
+ );
diff --git a/tests/fixed/UselessConditions.php b/tests/fixed/UselessConditions.php
index 2151b17..71e0cfb 100644
--- a/tests/fixed/UselessConditions.php
@@ -134,6 +154,23 @@ index 2151b17..71e0cfb 100644
{
if (! $this->isAdmin) {
return null;
+diff --git a/tests/fixed/arrow-functions-format.php b/tests/fixed/arrow-functions-format.php
+index a45074f..4da39b8 100644
+--- a/tests/fixed/arrow-functions-format.php
++++ b/tests/fixed/arrow-functions-format.php
+@@ -18,10 +18,10 @@ $returningObject = static fn () => new stdClass();
+
+ $multiLineArrowFunctions = Collection::from([1, 2])
+ ->map(
+- static fn (int $v): int => $v * 2
++ static fn (int $v): int => $v * 2,
+ )
+ ->reduce(
+- static fn (int $tmp, int $v): int => $tmp + $v
++ static fn (int $tmp, int $v): int => $tmp + $v,
+ );
+
+ $thisIsNotAnArrowFunction = [$this->fn => 'value'];
diff --git a/tests/fixed/example-class.php b/tests/fixed/example-class.php
index 998e51d..56cd902 100644
--- a/tests/fixed/example-class.php
@@ -172,6 +209,17 @@ index 998e51d..56cd902 100644
{
return $this->foo;
}
+diff --git a/tests/fixed/namespaces-spacing.php b/tests/fixed/namespaces-spacing.php
+index d42bbfe..36cbae2 100644
+--- a/tests/fixed/namespaces-spacing.php
++++ b/tests/fixed/namespaces-spacing.php
+@@ -16,5 +16,5 @@ use const DATE_RFC3339;
+ strrev(
+ (new DateTimeImmutable('@' . time(), new DateTimeZone('UTC')))
+ ->sub(new DateInterval('P1D'))
+- ->format(DATE_RFC3339)
++ ->format(DATE_RFC3339),
+ );
diff --git a/tests/fixed/new_with_parentheses.php b/tests/fixed/new_with_parentheses.php
index 6e81bbe..47a06ec 100644
--- a/tests/fixed/new_with_parentheses.php
@@ -362,10 +410,10 @@ index 0891e12..acdc445 100644
+ }
}
diff --git a/tests/input/TrailingCommaOnFunctions.php b/tests/input/TrailingCommaOnFunctions.php
-index 6e5cca4..1d24bb6 100644
+index f3ffa91..fc5480e 100644
--- a/tests/input/TrailingCommaOnFunctions.php
+++ b/tests/input/TrailingCommaOnFunctions.php
-@@ -6,7 +6,7 @@ namespace Doctrine;
+@@ -10,7 +10,7 @@ use function var_dump;
class TrailingCommaOnFunctions
{
@@ -374,3 +422,50 @@ index 6e5cca4..1d24bb6 100644
{
}
+@@ -23,7 +23,7 @@ class TrailingCommaOnFunctions
+ {
+ $var = null;
+
+- $singleLine = static function (int $arg) use ($var): void {
++ $singleLine = static function (int $arg) use ($var,): void {
+ var_dump($var);
+ };
+
+@@ -37,7 +37,8 @@ class TrailingCommaOnFunctions
+
+ $class = new TrailingCommaOnFunctions();
+
+-$class->a(1);
++// phpcs:ignore Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma
++$class->a(1,);
+
+ $class->a(
+ 1
+diff --git a/tests/input/arrow-functions-format.php b/tests/input/arrow-functions-format.php
+index 8a358e8..d3903ff 100644
+--- a/tests/input/arrow-functions-format.php
++++ b/tests/input/arrow-functions-format.php
+@@ -18,10 +18,10 @@ $returningObject = static fn () => new stdClass();
+
+ $multiLineArrowFunctions = Collection::from([1, 2])
+ ->map(
+- static fn (int $v): int => $v * 2
++ static fn (int $v): int => $v * 2,
+ )
+ ->reduce(
+- static fn (int $tmp, int $v): int => $tmp + $v
++ static fn (int $tmp, int $v): int => $tmp + $v,
+ );
+
+ $thisIsNotAnArrowFunction = [$this->fn => 'value'];
+diff --git a/tests/input/namespaces-spacing.php b/tests/input/namespaces-spacing.php
+index e1ab639..e7be018 100644
+--- a/tests/input/namespaces-spacing.php
++++ b/tests/input/namespaces-spacing.php
+@@ -11,5 +11,5 @@ use const DATE_RFC3339;
+ strrev(
+ (new DateTimeImmutable('@' . time(), new DateTimeZone('UTC')))
+ ->sub(new DateInterval('P1D'))
+- ->format(DATE_RFC3339)
++ ->format(DATE_RFC3339),
+ );