-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add rules for trailing commas in function calls and closure
use
- Loading branch information
Showing
6 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
|
||
<!-- Show progress of the run --> | ||
<arg value="p"/> | ||
<arg value="s"/> | ||
|
||
<rule ref="Doctrine"/> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
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/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']; |