Documentation

BoundMethod
in package

Table of Contents

call()  : mixed
Call the given Closure / class@method and inject its dependencies.
addDependencyForCallParameter()  : mixed
Get the dependency for the given call parameter.
callBoundMethod()  : mixed
Call a method that has been bound to the container.
callClass()  : mixed
Call a string reference to a class using Class@method syntax.
getCallReflector()  : ReflectionFunctionAbstract
Get the proper reflection instance for the given callback.
getMethodDependencies()  : array<string|int, mixed>
Get all dependencies for a given method.
isCallableWithAtSign()  : bool
Determine if the given string is in Class@method syntax.
normalizeMethod()  : string
Normalize the given callback into a Class@method string.

Methods

call()

Call the given Closure / class@method and inject its dependencies.

public static call(Container $container, callable|string $callback[, array<string|int, mixed> $parameters = [] ][, string|null $defaultMethod = null ]) : mixed
Parameters
$container : Container
$callback : callable|string
$parameters : array<string|int, mixed> = []
$defaultMethod : string|null = null
Return values
mixed

addDependencyForCallParameter()

Get the dependency for the given call parameter.

protected static addDependencyForCallParameter(Container $container, ReflectionParameter $parameter, array<string|int, mixed> &$parameters, array<string|int, mixed> &$dependencies) : mixed
Parameters
$container : Container
$parameter : ReflectionParameter
$parameters : array<string|int, mixed>
$dependencies : array<string|int, mixed>
Return values
mixed

callBoundMethod()

Call a method that has been bound to the container.

protected static callBoundMethod(Container $container, callable $callback, mixed $default) : mixed
Parameters
$container : Container
$callback : callable
$default : mixed
Return values
mixed

callClass()

Call a string reference to a class using Class@method syntax.

protected static callClass(Container $container, string $target[, array<string|int, mixed> $parameters = [] ][, string|null $defaultMethod = null ]) : mixed
Parameters
$container : Container
$target : string
$parameters : array<string|int, mixed> = []
$defaultMethod : string|null = null
Tags
throws
InvalidArgumentException
Return values
mixed

getCallReflector()

Get the proper reflection instance for the given callback.

protected static getCallReflector(callable|string $callback) : ReflectionFunctionAbstract
Parameters
$callback : callable|string
Return values
ReflectionFunctionAbstract

getMethodDependencies()

Get all dependencies for a given method.

protected static getMethodDependencies(Container $container, callable|string $callback[, array<string|int, mixed> $parameters = [] ]) : array<string|int, mixed>
Parameters
$container : Container
$callback : callable|string
$parameters : array<string|int, mixed> = []
Return values
array<string|int, mixed>

isCallableWithAtSign()

Determine if the given string is in Class@method syntax.

protected static isCallableWithAtSign(mixed $callback) : bool
Parameters
$callback : mixed
Return values
bool

normalizeMethod()

Normalize the given callback into a Class@method string.

protected static normalizeMethod(callable $callback) : string
Parameters
$callback : callable
Return values
string

Search results