diff --git a/src/Transform/RuntimeAttributeFactoryLowering.php b/src/Transform/RuntimeAttributeFactoryLowering.php index 017d25de..fa77c144 100644 --- a/src/Transform/RuntimeAttributeFactoryLowering.php +++ b/src/Transform/RuntimeAttributeFactoryLowering.php @@ -124,6 +124,10 @@ private function requiresLazyValue(Expr $value): bool return true; } + if ($value instanceof Expr\ClassConstFetch) { + return true; + } + return (new NodeFinder())->findFirst($value, static function (Node $node): bool { return $node instanceof Expr\New_ || $node instanceof Expr\Closure