-
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DeadCode] Skip assign if cond on RemoveUnusedNonEmptyArrayBeforeFore…
…achRector (#2918) * [DeadCode] Skip assign if cond empty array used in foreach on RemoveUnusedNonEmptyArrayBeforeForeachRector * [ci-review] Rector Rectify * phpstan * completely skip assign in if * [ci-review] Rector Rectify Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
3de25c9
commit 90adbf0
Showing
5 changed files
with
11 additions
and
38 deletions.
There are no files selected for viewing
22 changes: 0 additions & 22 deletions
22
...de/Rector/If_/RemoveUnusedNonEmptyArrayBeforeForeachRector/Fixture/assign_if_cond.php.inc
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
...ctor/If_/RemoveUnusedNonEmptyArrayBeforeForeachRector/Fixture/skip_assign_if_cond.php.inc
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,9 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\If_\RemoveUnusedNonEmptyArrayBeforeForeachRector\Fixture; | ||
|
||
function foo(): array {} | ||
// a comment | ||
if ($data = foo()) { | ||
foreach ($data as $row) {} | ||
} |
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