-
-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Naming] Skip used on next foreach on RenameForeachValueVariableToMat…
…chExprVariableRector (#4469) * [Naming] Skip used on next foreach on RenameForeachValueVariableToMatchExprVariableRector * clean up * more fixture rollback * more fixture rollback
- Loading branch information
1 parent
5b64258
commit 28412a4
Showing
3 changed files
with
92 additions
and
29 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...ameForeachValueVariableToMatchExprVariableRector/Fixture/skip_old_value_used_next.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,17 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchExprVariableRector\Fixture; | ||
|
||
final class SkipOldValueUsedNext | ||
{ | ||
public function run() | ||
{ | ||
$numbers = ['one', 'two']; | ||
|
||
foreach ($numbers as $txt) { | ||
echo "This is number ".$txt; | ||
} | ||
|
||
echo $txt; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...enameForeachValueVariableToMatchExprVariableRector/Fixture/skip_used_next_foreach.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,18 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchExprVariableRector\Fixture; | ||
|
||
class SkipUsedNextForeach | ||
{ | ||
public function run() | ||
{ | ||
$array = []; | ||
foreach ($variables as $property) { | ||
$array[] = $property; | ||
} | ||
|
||
echo $variable; | ||
} | ||
} | ||
|
||
?> |
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