StringTypeResolver
in package
implements
TypeResolverInterface
FinalYes
Resolves type for a given string.
Tags
Table of Contents
Interfaces
- TypeResolverInterface
- Resolves type for a given subject.
Properties
- $classExistCache : array<string, bool>
- $extraTypeAliases : array<string|int, mixed>
- $lexer : Lexer
- $parser : TypeParser
Methods
- __construct() : mixed
- resolve() : Type
- Try to resolve a {@see Type} on a $subject.
- getTypeFromNode() : Type
- resolveCustomIdentifier() : Type
Properties
$classExistCache
private
static array<string, bool>
$classExistCache
= []
$extraTypeAliases read-only
private
array<string|int, mixed>
$extraTypeAliases
= []
$lexer read-only
private
Lexer
$lexer
$parser read-only
private
TypeParser
$parser
Methods
__construct()
public
__construct([Lexer|null $lexer = null ][, TypeParser|null $parser = null ][, array<string, string> $extraTypeAliases = [] ]) : mixed
Parameters
- $lexer : Lexer|null = null
- $parser : TypeParser|null = null
- $extraTypeAliases : array<string, string> = []
resolve()
Try to resolve a {@see Type} on a $subject.
public
resolve(mixed $subject[, TypeContext|null $typeContext = null ]) : Type
If the resolver cannot resolve the type, it will throw a UnsupportedException.
Parameters
- $subject : mixed
- $typeContext : TypeContext|null = null
Return values
TypegetTypeFromNode()
private
getTypeFromNode(TypeNode $node, TypeContext|null $typeContext) : Type
Parameters
- $node : TypeNode
- $typeContext : TypeContext|null
Return values
TyperesolveCustomIdentifier()
private
resolveCustomIdentifier(string $identifier, TypeContext|null $typeContext) : Type
Parameters
- $identifier : string
- $typeContext : TypeContext|null