This commit is contained in:
TomasVotruba 2020-01-31 10:52:10 +01:00
parent 5cc5f77bb2
commit d9b13a5e1b
2 changed files with 4 additions and 13 deletions

View File

@ -59,11 +59,6 @@ final class DocBlockManipulator
*/
private $staticTypeMapper;
/**
* @var bool
*/
private $hasPhpDocChanged = false;
/**
* @var DocBlockClassRenamer
*/
@ -302,14 +297,8 @@ final class DocBlockManipulator
$nameParts = explode('_', $staticType->getClassName());
$node->name = '\\' . implode('\\', $nameParts);
$this->hasPhpDocChanged = true;
return $node;
});
if (! $this->hasPhpDocChanged) {
return;
}
}
/**

View File

@ -18,6 +18,7 @@ use PhpParser\Node\Stmt\Property;
use PhpParser\Node\Stmt\Use_;
use PhpParser\Node\Stmt\UseUse;
use PHPStan\Type\ObjectType;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
use Rector\CodingStyle\Naming\ClassNaming;
use Rector\NodeTypeResolver\ClassExistenceStaticHelper;
use Rector\NodeTypeResolver\Node\AttributeKey;
@ -149,8 +150,9 @@ PHP
*/
private function refactorPhpDoc(Node $node): void
{
$nodePhpDocInfo = $node->getAttribute(AttributeKey::PHP_DOC_INFO);
if ($nodePhpDocInfo === null) {
/** @var PhpDocInfo|null $phpDocInfo */
$phpDocInfo = $node->getAttribute(AttributeKey::PHP_DOC_INFO);
if ($phpDocInfo === null) {
return;
}