Removes non-existing @var annotations above the code
class SomeClass
{
public function get()
{
- /** @var Training[] $trainings */
return $this->getData();
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\Node\RemoveNonExistingVarAnnotationRector;
return RectorConfig::configure()
->withRules([
RemoveNonExistingVarAnnotationRector::class,
]);