TypeResolver
in package
implements
TypeResolverInterface
FinalYes
Resolves type for a given subject by delegating resolving to nested type resolvers.
Tags
Table of Contents
Interfaces
- TypeResolverInterface
- Resolves type for a given subject.
Properties
Methods
- __construct() : mixed
- create() : self
- resolve() : Type
- Try to resolve a {@see Type} on a $subject.
Properties
$resolvers read-only
private
ContainerInterface
$resolvers
Methods
__construct()
public
__construct(ContainerInterface $resolvers) : mixed
Parameters
- $resolvers : ContainerInterface
-
Locator of type resolvers, keyed by supported subject type
create()
public
static create([array<string, TypeResolverInterface>|null $resolvers = null ]) : self
Parameters
- $resolvers : array<string, TypeResolverInterface>|null = null
Return values
selfresolve()
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