diff --git a/rules/coding-style/src/Rector/ClassConst/VarConstantCommentRector.php b/rules/coding-style/src/Rector/ClassConst/VarConstantCommentRector.php index 01d31b367acc..e638e72258e5 100644 --- a/rules/coding-style/src/Rector/ClassConst/VarConstantCommentRector.php +++ b/rules/coding-style/src/Rector/ClassConst/VarConstantCommentRector.php @@ -73,7 +73,7 @@ public function refactor(Node $node): ?Node /** @var PhpDocInfo|null $phpDocInfo */ $phpDocInfo = $node->getAttribute(AttributeKey::PHP_DOC_INFO); if ($phpDocInfo === null) { - $this->phpDocInfoFactory->createEmpty($node); + $phpDocInfo = $this->phpDocInfoFactory->createEmpty($node); } $phpDocInfo->changeVarType($constStaticType);