mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-05-13 16:55:17 +02:00
Fix NameResolver for class constant native type
This commit is contained in:
parent
e453389866
commit
2a5e81f7ca
@ -118,6 +118,9 @@ class NameResolver extends NodeVisitorAbstract
|
|||||||
$this->addNamespacedName($const);
|
$this->addNamespacedName($const);
|
||||||
}
|
}
|
||||||
} else if ($node instanceof Stmt\ClassConst) {
|
} else if ($node instanceof Stmt\ClassConst) {
|
||||||
|
if (null !== $node->type) {
|
||||||
|
$node->type = $this->resolveType($node->type);
|
||||||
|
}
|
||||||
$this->resolveAttrGroups($node);
|
$this->resolveAttrGroups($node);
|
||||||
} else if ($node instanceof Stmt\EnumCase) {
|
} else if ($node instanceof Stmt\EnumCase) {
|
||||||
$this->resolveAttrGroups($node);
|
$this->resolveAttrGroups($node);
|
||||||
|
@ -198,6 +198,10 @@ class A extends B implements C, D {
|
|||||||
|
|
||||||
#[X]
|
#[X]
|
||||||
const C = 1;
|
const C = 1;
|
||||||
|
|
||||||
|
public const X A = X::Bar;
|
||||||
|
public const X\Foo B = X\Foo::Bar;
|
||||||
|
public const \X\Foo C = \X\Foo::Bar;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[X]
|
#[X]
|
||||||
@ -263,6 +267,9 @@ class A extends \NS\B implements \NS\C, \NS\D
|
|||||||
public \NS\A|\NS\B|int $prop;
|
public \NS\A|\NS\B|int $prop;
|
||||||
#[\NS\X]
|
#[\NS\X]
|
||||||
const C = 1;
|
const C = 1;
|
||||||
|
public const \NS\X A = \NS\X::Bar;
|
||||||
|
public const \NS\X\Foo B = \NS\X\Foo::Bar;
|
||||||
|
public const \X\Foo C = \X\Foo::Bar;
|
||||||
}
|
}
|
||||||
#[\NS\X]
|
#[\NS\X]
|
||||||
interface A extends \NS\C, \NS\D
|
interface A extends \NS\C, \NS\D
|
||||||
|
Loading…
x
Reference in New Issue
Block a user