Remove initialization with null value from property declarations
class SunshineCommand extends ParentClassWithNewConstructor
{
- private $myVar = null;
+ private $myVar;
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\PropertyProperty\RemoveNullPropertyInitializationRector;
return RectorConfig::configure()
->withRules([
RemoveNullPropertyInitializationRector::class,
]);