rector icon indicating copy to clipboard operation
rector copied to clipboard

Remove -inline- unused variable assign

Open darthf1 opened this issue 1 year ago • 0 comments

Feature Request

It would be great if there is a rule (or an upgrade of RemoveUnusedVariableAssignRector?) to also remove unused variables assigns if they are inline.

Diff

<?php

final class DemoFile
{
    public function run(bool $param): array
    {
        $returnValue = [
-            $innerValue = [
+           [
                'ok',
            ],
        ];
        
-	return $yes = $returnValue;
+       return $returnValue;
    }
}

darthf1 avatar Aug 21 '24 11:08 darthf1