[dead-code] Add RemoveUnusedClosureVariableUseRector#7430
Conversation
| continue; | ||
| } | ||
|
|
||
| $isUseUsed = (bool) $this->betterNodeFinder->findVariableOfName($node->stmts, $useVariableName); |
There was a problem hiding this comment.
this should verify compact use as well, better use ExprUsedInNodeAnalyzer for it, I will create new PR for it.
There was a problem hiding this comment.
I created new PR to skip used via compact()
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Rector\DeadCode\Rector\Concat; |
There was a problem hiding this comment.
this should under Closure namespace:
-namespace Rector\DeadCode\Rector\Concat;
+namespace Rector\DeadCode\Rector\Closure;I will create new PR for it.
There was a problem hiding this comment.
I create new PR to fix namespace to Closure
| // reset keys, to keep as expected | ||
| $node->uses = array_values($node->uses); |
There was a problem hiding this comment.
this is not needed, already covered at NodeAttributeReIndexer, see
rector-src/src/Application/NodeAttributeReIndexer.php
Lines 69 to 71 in d948383
There was a problem hiding this comment.
I created new PR for it:
|
This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work. |
Reported by PHPStan, now fixed by Rector 👍
class Fixture { public function run($value) { - return function () use ($value) { + return function () { return 'value'; }; } }