Class Definition
Property Summary
-
$alias protected
string -
$arguments protected
array -
$concrete protected
mixed -
$container protected
Cake\Container\ContainerInterface|null -
$methods protected
array -
$recursiveCheck protected
array -
$resolved protected
mixed -
$shared protected
bool -
$tags protected
array
Method Summary
-
__construct() public
-
addArgument() public
-
addArguments() public
-
addMethodCall() public
-
addMethodCalls() public
-
addTag() public
-
getAlias() public
-
getConcrete() public
-
getContainer() abstract public
-
getTags() public
-
hasTag() public
-
invokeMethods() protected
-
isShared() public
-
normaliseAlias() public static
-
reflectArguments() public
-
resolve() public
-
resolveArgumentFromAttribute() protected
Attempt to resolve a parameter's value from one of its PHP attributes.
-
resolveArguments() public
-
resolveCallable() protected
-
resolveClass() protected
-
resolveContextualArgumentFromAttribute() protected
Attempt to resolve a parameter's value from a contextual PHP attribute.
Contextual attributes receive the parameter being resolved alongside the container, enabling resolution by parameter name/type. Attributes not implementing {@see ContextualAttributeInterface} return false here and fall through to {@see resolveArgumentFromAttribute()}.
The container is deliberately passed as an argument instead of using {@see ContainerAwareInterface}: with a standalone ReflectionContainer there is no parent container to inject, while the resolving instance itself always satisfies the PSR interface expected here.
-
resolveNew() public
-
setAlias() public
-
setConcrete() public
-
setContainer() public
-
setShared() public
Method Detail
__construct() ¶ public
__construct(string $id, mixed|null $concrete = null)
Parameters
-
string$id -
mixed|null$concrete optional
addArgument() ¶ public
addArgument(mixed $arg, string|null $name = null): DefinitionInterface
Parameters
-
mixed$arg -
string|null$name optional
Returns
DefinitionInterfaceaddArguments() ¶ public
addArguments(array $args): DefinitionInterface
Parameters
-
array$args
Returns
DefinitionInterfaceaddMethodCall() ¶ public
addMethodCall(string $method, array $args = []): DefinitionInterface
Parameters
-
string$method -
array$args optional
Returns
DefinitionInterfaceaddMethodCalls() ¶ public
addMethodCalls(array $methods = []): DefinitionInterface
Parameters
-
array$methods optional
Returns
DefinitionInterfaceaddTag() ¶ public
addTag(string $tag): DefinitionInterface
Parameters
-
string$tag
Returns
DefinitionInterfacegetContainer() ¶ abstract public
getContainer(): Cake\Container\ContainerInterface
Returns
Cake\Container\ContainerInterfaceinvokeMethods() ¶ protected
invokeMethods(object $instance): object
Parameters
-
object$instance
Returns
objectnormaliseAlias() ¶ public static
normaliseAlias(string $alias): string
Parameters
-
string$alias
Returns
stringreflectArguments() ¶ public
reflectArguments(ReflectionFunctionAbstract $method, array $args = []): array
Parameters
-
ReflectionFunctionAbstract$method -
array$args optional
Returns
arrayresolveArgumentFromAttribute() ¶ protected
resolveArgumentFromAttribute(ReflectionAttribute<object> $attribute): Cake\Container\Argument\LiteralArgumentInterface|false
Attempt to resolve a parameter's value from one of its PHP attributes.
Parameters
-
ReflectionAttribute<object>$attribute The attribute to attempt to resolve.
Returns
Cake\Container\Argument\LiteralArgumentInterface|falseresolveArguments() ¶ public
resolveArguments(array<Cake\Container\Argument\ArgumentInterface> $arguments): array
Parameters
-
array<Cake\Container\Argument\ArgumentInterface>$arguments
Returns
arrayresolveCallable() ¶ protected
resolveCallable(callable $concrete): mixed
Parameters
-
callable$concrete
Returns
mixedresolveClass() ¶ protected
resolveClass(class-string $concrete): object
Parameters
-
class-string$concrete
Returns
objectThrows
ReflectionExceptionresolveContextualArgumentFromAttribute() ¶ protected
resolveContextualArgumentFromAttribute(ReflectionAttribute<object> $attribute, ReflectionParameter $parameter): Cake\Container\Argument\LiteralArgumentInterface|false
Attempt to resolve a parameter's value from a contextual PHP attribute.
Contextual attributes receive the parameter being resolved alongside the container, enabling resolution by parameter name/type. Attributes not implementing {@see ContextualAttributeInterface} return false here and fall through to {@see resolveArgumentFromAttribute()}.
The container is deliberately passed as an argument instead of using {@see ContainerAwareInterface}: with a standalone ReflectionContainer there is no parent container to inject, while the resolving instance itself always satisfies the PSR interface expected here.
Parameters
-
ReflectionAttribute<object>$attribute The attribute to attempt to resolve.
-
ReflectionParameter$parameter The parameter being resolved.
Returns
Cake\Container\Argument\LiteralArgumentInterface|falsesetAlias() ¶ public
setAlias(string $id): DefinitionInterface
Parameters
-
string$id
Returns
DefinitionInterfacesetConcrete() ¶ public
setConcrete(mixed $concrete): DefinitionInterface
Parameters
-
mixed$concrete
Returns
DefinitionInterfacesetContainer() ¶ public
setContainer(Cake\Container\ContainerInterface $container): ContainerAwareInterface
Parameters
-
Cake\Container\ContainerInterface$container
Returns
ContainerAwareInterfacesetShared() ¶ public
setShared(bool $shared = true): DefinitionInterface
Parameters
-
bool$shared optional
Returns
DefinitionInterface