-
-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeQuality] Skip re use variable in assign Expr on InlineArrayRetur…
…nAssignRector (#2325) * [CodeQuality] Skip re use variable in assign Expr on InlineArrayReturnAssignRector * Fixed 🎉 * [ci-review] Rector Rectify * final touch: move check for reuse * matchKeyOnArrayDimFetchOfVariable never reuse Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
15d93fa
commit 50943ea
Showing
2 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...ssMethod/InlineArrayReturnAssignRector/Fixture/skip_reuse_variable_in_assign_expr.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\CodeQuality\Rector\ClassMethod\InlineArrayReturnAssignRector\Fixture; | ||
|
||
final class SkipReuseVariableInAssignExpr | ||
{ | ||
public function run() | ||
{ | ||
$continuation = []; | ||
$continuation['descriptions'] = ['a']; | ||
$continuation['descriptions'] = \array_map(function ($description) { | ||
$description = 'b'; | ||
return $description; | ||
}, $continuation['descriptions']); | ||
|
||
return $continuation; | ||
} | ||
} |
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