docs: clarify attribute factory name resolution timing

master
韩天峰 1 week ago
parent 0f430e85a6
commit 4438c5807d
  1. 8
      src/Transform/RuntimeAttributeFactoryLowering.php

@ -278,9 +278,11 @@ final class RuntimeAttributeFactoryLowering extends NodeVisitorAbstract
} }
} }
if ($node instanceof Node\Name) { if ($node instanceof Node\Name) {
// Attribute factories are created while the outer // Attribute factories are created in leaveNode(), after
// traverser is entering the Attribute node, before its // their argument names have passed through NameResolver.
// argument names have been visited by NameResolver. // The compiler keeps the original node and records its
// target in resolvedName, while the stub pipeline may
// replace it with a FullyQualified node directly.
if ($node instanceof Node\Name\Relative) { if ($node instanceof Node\Name\Relative) {
$name = ltrim($this->namespace . '\\' . $node->toString(), '\\'); $name = ltrim($this->namespace . '\\' . $node->toString(), '\\');
return new Node\Name\FullyQualified($name, $node->getAttributes()); return new Node\Name\FullyQualified($name, $node->getAttributes());

Loading…
Cancel
Save