Remove useless re-assign from property promotion
class SomeClass
{
public function __construct(private \stdClass $std)
{
- $this->std = $std;
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessAssignFromPropertyPromotionRector;
return RectorConfig::configure()
->withRules([
RemoveUselessAssignFromPropertyPromotionRector::class,
]);