CallableDispatcher
class CallableDispatcher implements CallableDispatcher
Traits
Properties
| static protected array<string, bool> | $enumCache | Cached isEnum results keyed by class name. |
from ResolvesRouteDependencies |
| static protected null|ReflectionParameter>> | $reflectionCache | Cached ReflectionParameter arrays keyed by callable object. |
|
| protected Container | $container | The container instance. |
|
| protected PrecognitionCallableDispatcher|null | $precognitionDispatcher | The cached precognition dispatcher instance. |
Methods
Resolve the object method's type-hinted dependencies.
Resolve the given method's type-hinted dependencies.
Attempt to transform the given parameter into a class instance.
Determine if an object of the given class is in a list of parameters.
Splice the given value into the parameter list.
Flush the static reflection cache.
Flush all static state.
Details
in
ResolvesRouteDependencies at line 33
static void
flushEnumCache()
Flush the static enum cache.
Boot or tests only. Clears the process-wide enum lookup cache shared by every coroutine; next resolution re-resolves.
in
ResolvesRouteDependencies at line 41
protected array
resolveClassMethodDependencies(array $parameters, object $instance, string $method)
Resolve the object method's type-hinted dependencies.
in
ResolvesRouteDependencies at line 58
array
resolveMethodDependencies(array $parameters, array $reflectedParameters)
Resolve the given method's type-hinted dependencies.
in
ResolvesRouteDependencies at line 87
protected mixed
transformDependency(ReflectionParameter $parameter, array $parameters, object $skippableValue)
Attempt to transform the given parameter into a class instance.
in
ResolvesRouteDependencies at line 112
protected bool
alreadyInParameters(string $class, array $parameters)
Determine if an object of the given class is in a list of parameters.
in
ResolvesRouteDependencies at line 120
protected void
spliceIntoParameters(array $parameters, int $offset, mixed $value)
Splice the given value into the parameter list.
at line 45
__construct(Container $container)
Create a new callable dispatcher instance.
at line 53
mixed
dispatch(Route $route, callable $callable)
Dispatch a request to a given callable.
at line 71
protected array
resolveParameters(Route $route, callable $callable)
Resolve the parameters for the callable.
Routes supply closures or invokable objects, while the public dispatcher contract also permits other native callable forms.
at line 98
static void
flushCache()
Flush the static reflection cache.
Boot or tests only. Clears the process-wide reflection cache shared by every coroutine; next dispatch re-reflects.
at line 106
static void
flushState()
Flush all static state.