ControllerDispatcher
class ControllerDispatcher implements ControllerDispatcher
Traits
Properties
| static protected array<string, bool> | $enumCache | Cached isEnum results keyed by class name. |
from ResolvesRouteDependencies |
| static protected ReflectionParameter>> | $reflectionCache | Cached ReflectionParameter arrays keyed by "class::method". |
|
| protected Container | $container | The container instance. |
|
| protected PrecognitionControllerDispatcher|null | $precognitionDispatcher | The cached precognition dispatcher instance. |
Methods
Determine if the given options exclude a particular method.
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.
Resolve the parameters for the controller.
Pre-warm the reflection parameter cache for a controller action.
Flush the static reflection cache.
Get the middleware for the controller instance.
Flush all static state.
Details
in
FiltersControllerMiddleware at line 12
static bool
methodExcludedByOptions(string $method, array $options)
Determine if the given options exclude a particular method.
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.
at line 86
protected array
resolveClassMethodDependencies(array $parameters, object $instance, string $method)
Resolve the object method's type-hinted dependencies.
Overrides ResolvesRouteDependencies to use a static parameter cache.
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 43
__construct(Container $container)
Create a new controller dispatcher instance.
at line 51
mixed
dispatch(Route $route, mixed $controller, string $method)
Dispatch a request to a given controller and method.
at line 72
protected array
resolveParameters(Route $route, mixed $controller, string $method)
Resolve the parameters for the controller.
at line 105
static void
warmReflection(string $class, string $method)
Pre-warm the reflection parameter cache for a controller action.
Boot-only. Called during server boot to populate reflection data in a process-wide cache before fork so workers inherit it copy-on-write.
at line 117
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 125
array
getMiddleware(mixed $controller, string $method)
Get the middleware for the controller instance.
at line 140
static void
flushState()
Flush all static state.