-
-
Notifications
You must be signed in to change notification settings - Fork 337
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 closure bind by reference on RemoveUnusedVaria…
…bleAssignRector (#3942) * [DeadCode] Skip assign closure bind by reference on RemoveUnusedVariableAssignRector * Fixed 🎉
- Loading branch information
1 parent
a354eda
commit 62ecc90
Showing
2 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
...ssign/RemoveUnusedVariableAssignRector/Fixture/skip_assign_closure_bind_reference.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,12 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector\Fixture; | ||
|
||
final class SkipAssignClosureBindReference | ||
{ | ||
public function run(object $container) | ||
{ | ||
$containerLocked = &Closure::bind(static fn &($container) => $container->locked, null, $container)($container); | ||
$containerLocked = false; | ||
} | ||
} |
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