mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-20 06:38:46 +01:00
report @var changes (#4063)
This commit is contained in:
parent
6b39193992
commit
4a2ba04b05
@ -14,6 +14,7 @@ use Rector\AttributeAwarePhpDoc\Ast\PhpDoc\AttributeAwareVarTagValueNode;
|
||||
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
||||
use Rector\ChangesReporting\Collector\RectorChangeCollector;
|
||||
use Rector\Core\Configuration\CurrentNodeProvider;
|
||||
use Rector\Core\Exception\ShouldNotHappenException;
|
||||
use Rector\NodeTypeResolver\PHPStan\TypeComparator;
|
||||
use Rector\StaticTypeMapper\StaticTypeMapper;
|
||||
use Rector\TypeDeclaration\PhpDocParser\ParamPhpDocNodeFactory;
|
||||
@ -85,8 +86,7 @@ final class PhpDocTypeChanger
|
||||
}
|
||||
|
||||
// notify about node change
|
||||
$node = $this->currentNodeProvider->getNode();
|
||||
$this->rectorChangeCollector->notifyNodeFileInfo($node);
|
||||
$this->notifyChange();
|
||||
}
|
||||
|
||||
public function changeReturnType(PhpDocInfo $phpDocInfo, Type $newType): void
|
||||
@ -126,4 +126,14 @@ final class PhpDocTypeChanger
|
||||
|
||||
$phpDocInfo->addTagValueNode($paramTagValueNode);
|
||||
}
|
||||
|
||||
private function notifyChange(): void
|
||||
{
|
||||
$node = $this->currentNodeProvider->getNode();
|
||||
if ($node === null) {
|
||||
throw new ShouldNotHappenException();
|
||||
}
|
||||
|
||||
$this->rectorChangeCollector->notifyNodeFileInfo($node);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user