-
-
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.
[DeadCode] Skip RemoveUnusedAssignVariableRector on used after if else (
#213) Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
6888049
commit 5fd67ab
Showing
2 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
...de/Rector/Assign/RemoveUnusedAssignVariableRector/Fixture/skip_used_after_if_else.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,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Assign\RemoveUnusedAssignVariableRector\Fixture; | ||
|
||
class SkipUsedAfterIfElse { | ||
function test() { | ||
if ( true ) { | ||
$test1 = '123'; | ||
$test2 = '123'; | ||
} else { | ||
$test1 = 'abc'; | ||
$test2 = 'abc'; | ||
} | ||
|
||
echo $test1 . $test2; | ||
} | ||
} | ||
|
||
?> |
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