Skip to content

Commit 046ade6

Browse files
committed
Fix resolve of constant fetch in expressions
1 parent 924469a commit 046ade6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/phpDocumentor/Reflection/Php/Expression/ExpressionPrinter.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,17 @@ protected function pName_FullyQualified(Name\FullyQualified $node): string
8383
protected function pExpr_ClassConstFetch(Expr\ClassConstFetch $node): string
8484
{
8585
$renderedName = parent::pObjectProperty($node->name);
86-
$className = $node->class instanceof Name ? parent::pName($node->class) : $this->p($node->class);
86+
87+
if ($node->class instanceof Name) {
88+
$className = parent::pName($node->class);
89+
$className = $this->typeResolver->resolve($className, $this->context);
90+
} else {
91+
$className = $this->p($node->class);
92+
}
93+
8794
$placeholder = Expression::generatePlaceholder((string) $renderedName);
8895
$this->parts[$placeholder] = new Fqsen(
89-
'\\' . $className . '::' . $renderedName,
96+
$className . '::' . $renderedName,
9097
);
9198

9299
return $placeholder;

0 commit comments

Comments
 (0)