Skip to content

Commit a46679d

Browse files
authored
Update src/Analyser/ConstantResolver.php
1 parent ed0d74a commit a46679d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Analyser/ConstantResolver.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,17 +428,19 @@ public function resolveClassConstantType(string $className, string $constantName
428428
{
429429
$lookupConstantName = sprintf('%s::%s', $className, $constantName);
430430
if (array_key_exists($lookupConstantName, $this->dynamicConstantNames)) {
431-
if ($nativeType !== null) {
432-
return $nativeType;
433-
}
434-
435431
if ($constantType->isConstantValue()->yes()) {
436432
$phpdocTypes = $this->dynamicConstantNames[$lookupConstantName];
437433
if ($this->container !== null) {
438434
$typeStringResolver = $this->container->getByType(TypeStringResolver::class);
439435
return $typeStringResolver->resolve($phpdocTypes, new NameScope(null, [], $className));
440436
}
441437
}
438+
439+
if ($nativeType !== null) {
440+
return $nativeType;
441+
}
442+
443+
return $constantType;
442444
}
443445

444446
if (in_array($lookupConstantName, $this->dynamicConstantNames, true)) {

0 commit comments

Comments
 (0)