Methods |
public
static
|
getService<T is object>(
ContainerInterface $container,
class-string<T> $service,
): static<T, AbstractProvider, AbstractEntity, ProviderContext<AbstractProvider, AbstractEntity>>
Get an introspector for a service
Get an introspector for a service
Uses a container to resolve a service to a concrete class and returns an
introspector for it.
Overriden by
|
#
|
public
static
|
get<T is object>(
class-string<T> $class,
): static<T, AbstractProvider, AbstractEntity, ProviderContext<AbstractProvider, AbstractEntity>>
Get an introspector for a class
Get an introspector for a class
Overriden by
|
#
|
final
protected
|
__construct(
class-string $service,
class-string<TClass> $class,
class-string<TProvider> $provider,
class-string<TEntity> $entity,
class-string<TContext> $context,
)
|
#
|
protected
|
getIntrospectionClass(class-string<TClass> $class): IntrospectionClass<TClass>
|
#
|
final
public
|
getCreateFromClosure(
bool $strict = false,
): Closure(mixed[], ContainerInterface, DateFormatterInterface|null, Treeable|null): TClass
Get a closure that creates instances of the class from arrays
Get a closure that creates instances of the class from arrays
Wraps {@see Introspector::getCreateFromSignatureClosure()} in a closure
that resolves array signatures to closures on-demand.
Parameters
$strict |
If true , the closure will throw an exception if it
receives any data that would be discarded.
|
|
#
|
final
public
|
getCreateFromSignatureClosure(
string[] $keys,
bool $strict = false,
): Closure(mixed[], ContainerInterface, DateFormatterInterface|null, Treeable|null): TClass
Get a closure that creates instances of the class from arrays with a
given signature
Get a closure that creates instances of the class from arrays with a
given signature
Parameters
$strict |
If true , throw an exception if any data would be
discarded.
|
|
#
|
final
public
|
getCreateProvidableFromClosure(bool $strict = false): Closure(mixed[], TProvider, TContext): TClass
Get a closure that creates provider-serviced instances of the class from
arrays
Get a closure that creates provider-serviced instances of the class from
arrays
Wraps {@see Introspector::getCreateProvidableFromSignatureClosure()} in a
closure that resolves array signatures to closures on-demand.
Parameters
$strict |
If true , the closure will throw an exception if it
receives any data that would be discarded.
|
|
#
|
final
public
|
getCreateProvidableFromSignatureClosure(
string[] $keys,
bool $strict = false,
): Closure(mixed[], TProvider, TContext): TClass
Get a closure that creates provider-serviced instances of the class from
arrays with a given signature
Get a closure that creates provider-serviced instances of the class from
arrays with a given signature
Parameters
$strict |
If true , throw an exception if any data would be
discarded.
|
|
#
|
protected
|
getKeyTargets(
string[] $keys,
bool $forNewInstance,
bool $strict,
bool $normalised = false,
array<static::*_KEY, string> $customKeys = [],
array<string, Closure(mixed[] $data, string|null $service, TClass $entity, TProvider|null, TContext|null): void> $keyClosures = [],
): IntrospectorKeyTargets<static, TClass, TProvider, TContext>
Get a list of actions required to apply values from an array to a new or
existing instance of the class
Get a list of actions required to apply values from an array to a new or
existing instance of the class
Parameters
$forNewInstance |
If true , keys are matched with constructor
parameters if possible.
|
$strict |
If true , an exception is thrown if any keys cannot
be applied to the class.
|
$normalised |
If true , the $keys array has already been
normalised.
|
$customKeys |
An array that maps key
types to keys as they appear in $keys .
|
$keyClosures |
Normalised key => closure
|
Overriden by
|
#
|
final
protected
|
_getConstructor(
IntrospectorKeyTargets<out static, TClass, TProvider, TContext> $targets,
): Closure(mixed[], class-string|null, ContainerInterface): TClass
|
#
|
final
public
|
getPropertyActionClosure(string $name, string $action): Closure
Get a static closure to perform an action on a property of the class
Get a static closure to perform an action on a property of the class
If $name and $action correspond to a "magic" property method (e.g.
_get<Property>() ), a closure to invoke the method is returned.
Otherwise, if $name corresponds to an accessible declared property, or
the class implements {@see Extensible}), a closure to perform the
requested $action on the property directly is returned.
Fails with an exception if {@see Extensible} is not implemented and no
declared or "magic" property matches $name and $action .
Closure signature:
static function ($instance, ...$params)
Parameters
$action |
Either {@see IntrospectionClass::ACTION_SET},
{@see IntrospectionClass::ACTION_GET},
{@see IntrospectionClass::ACTION_ISSET} or
{@see IntrospectionClass::ACTION_UNSET}.
|
|
#
|
final
public
|
getGetNameClosure(): Closure(TClass): string
Get a closure that returns the name of an instance on a best-effort basis
Get a closure that returns the name of an instance on a best-effort basis
|
#
|
final
public
|
getSerializeClosure(SerializeRulesInterface<TClass>|null $rules = null): Closure
|
#
|
final
protected
|
_getUpdater(
IntrospectorKeyTargets<out static, TClass, TProvider, TContext> $targets,
): Closure(mixed[], TClass, ContainerInterface, TProvider|null, TContext|null, DateFormatterInterface|null, Treeable|null): TClass
|
#
|
final
protected
|
_getResolver(
IntrospectorKeyTargets<out static, TClass, TProvider, TContext> $targets,
): Closure(mixed[], string|null, TClass, TProvider|null, TContext|null): TClass
|
#
|