BoundMethod
class BoundMethod
Properties
| static protected ParameterRecipe[]> | $methodRecipes | Cache of method parameter recipes, keyed by "ClassName::methodName". |
|
| static protected ParameterRecipe[]> | $functionRecipes | Cache of function parameter recipes, keyed by fully-qualified function name. |
Methods
Call the given Closure / class@method and inject its dependencies.
Call a method that has been bound to the container.
Normalize the given callback into a Class@method string.
Get cached parameter recipes for a method, computing on first access.
Compute parameter recipes for a method via reflection.
Get cached parameter recipes for a global function, computing on first access.
Compute parameter recipes for a global function via reflection.
Flush all static state.
Resolve method parameters using cached recipe metadata.
Get all dependencies for a given method.
Get the dependency for the given call parameter.
Determine if the given string is in Class@method syntax.
Details
at line 48
static mixed
call(Container $container, callable|string $callback, array $parameters = [], string|null $defaultMethod = null, ReflectionFunction|null $reflection = null)
Call the given Closure / class@method and inject its dependencies.
at line 68
static protected mixed
callClass(Container $container, string $target, array $parameters = [], string|null $defaultMethod = null)
Call a string reference to a class using Class@method syntax.
at line 93
static protected mixed
callBoundMethod(Container $container, callable|string $callback, mixed $default)
Call a method that has been bound to the container.
at line 114
static protected string
normalizeMethod(array $callback)
Normalize the given callback into a Class@method string.
at line 126
static protected array
getMethodRecipe(string $className, string $methodName)
Get cached parameter recipes for a method, computing on first access.
at line 138
static protected array
computeMethodRecipe(string $className, string $methodName)
Compute parameter recipes for a method via reflection.
at line 159
static protected array
getFunctionRecipe(string $functionName)
Get cached parameter recipes for a global function, computing on first access.
at line 169
static protected array
computeFunctionRecipe(string $functionName)
Compute parameter recipes for a global function via reflection.
at line 188
static void
flushState()
Flush all static state.
at line 201
static protected array
resolveMethodRecipeParameters(Container $container, array $recipes, array $parameters)
Resolve method parameters using cached recipe metadata.
at line 259
static protected array
getMethodDependencies(Container $container, callable|string $callback, array $parameters = [], ReflectionFunction|null $reflection = null)
Get all dependencies for a given method.
Deterministic callables (array callables, Class::method strings, invocable objects, global function strings) use cached ParameterRecipe metadata. Closures use per-call reflection via addDependencyForCallParameter, with an optional pre-built ReflectionFunction to avoid redundant allocation.
at line 309
static protected void
addDependencyForCallParameter(Container $container, ReflectionParameter $parameter, array $parameters, array $dependencies)
Get the dependency for the given call parameter.
at line 366
static protected bool
isCallableWithAtSign(mixed $callback)
Determine if the given string is in Class@method syntax.