ViewStringTypeNodeResolverExtension
class ViewStringTypeNodeResolverExtension implements TypeNodeResolverExtension, TypeNodeResolverAwareExtension
Ensures a 'view-string' type in PHPDoc is recognized to be of type ViewStringType.
Whether a view-string accepts a name depends on which views exist, so what the class whose PHPDoc uses one declares depends on them. PHPStan resolves a type alias in the scope that defines it, not the class using it, so an alias is resolved here to see whether it holds one.
Methods
Create a new view-string type node resolver.
Resolve a view-string PHPDoc type, or a type alias that holds one.
Set the resolver used to resolve type aliases.
Details
at line 43
__construct(ReflectionProvider $reflectionProvider, RuntimeInputs $runtimeInputs, array $typeAliases)
Create a new view-string type node resolver.
at line 54
Type|null
resolve(TypeNode $typeNode, NameScope $nameScope)
Resolve a view-string PHPDoc type, or a type alias that holds one.
at line 90
void
setTypeNodeResolver(TypeNodeResolver $typeNodeResolver)
Set the resolver used to resolve type aliases.