ControllerDispatcher
in package
implements
ControllerDispatcher
Uses
RouteDependencyResolverTrait
Interfaces, Classes and Traits
Table of Contents
- $container : Container
- The container instance.
- __construct() : void
- Create a new controller dispatcher instance.
- dispatch() : mixed
- Dispatch a request to a given controller and method.
- getMiddleware() : array<string|int, mixed>
- Get the middleware for the controller instance.
- resolveMethodDependencies() : array<string|int, mixed>
- Resolve the given method's type-hinted dependencies.
- alreadyInParameters() : bool
- Determine if an object of the given class is in a list of parameters.
- methodExcludedByOptions() : bool
- Determine if the given options exclude a particular method.
- resolveClassMethodDependencies() : array<string|int, mixed>
- Resolve the object method's type-hinted dependencies.
- spliceIntoParameters() : void
- Splice the given value into the parameter list.
- transformDependency() : mixed
- Attempt to transform the given parameter into a class instance.
Properties
$container
The container instance.
protected
Container
$container
Methods
__construct()
Create a new controller dispatcher instance.
public
__construct(Container $container) : void
Parameters
- $container : Container
Return values
void —dispatch()
Dispatch a request to a given controller and method.
public
dispatch(Route $route, mixed $controller, string $method) : mixed
Parameters
- $route : Route
- $controller : mixed
- $method : string
Return values
mixed —getMiddleware()
Get the middleware for the controller instance.
public
getMiddleware(Controller $controller, string $method) : array<string|int, mixed>
Parameters
- $controller : Controller
- $method : string
Return values
array<string|int, mixed> —resolveMethodDependencies()
Resolve the given method's type-hinted dependencies.
public
resolveMethodDependencies(array<string|int, mixed> $parameters, ReflectionFunctionAbstract $reflector) : array<string|int, mixed>
Parameters
- $parameters : array<string|int, mixed>
- $reflector : ReflectionFunctionAbstract
Return values
array<string|int, mixed> —alreadyInParameters()
Determine if an object of the given class is in a list of parameters.
protected
alreadyInParameters(string $class, array<string|int, mixed> $parameters) : bool
Parameters
- $class : string
- $parameters : array<string|int, mixed>
Return values
bool —methodExcludedByOptions()
Determine if the given options exclude a particular method.
protected
static methodExcludedByOptions(string $method, array<string|int, mixed> $options) : bool
Parameters
- $method : string
- $options : array<string|int, mixed>
Return values
bool —resolveClassMethodDependencies()
Resolve the object method's type-hinted dependencies.
protected
resolveClassMethodDependencies(array<string|int, mixed> $parameters, object $instance, string $method) : array<string|int, mixed>
Parameters
- $parameters : array<string|int, mixed>
- $instance : object
- $method : string
Return values
array<string|int, mixed> —spliceIntoParameters()
Splice the given value into the parameter list.
protected
spliceIntoParameters(array<string|int, mixed> &$parameters, string $offset, mixed $value) : void
Parameters
- $parameters : array<string|int, mixed>
- $offset : string
- $value : mixed
Return values
void —transformDependency()
Attempt to transform the given parameter into a class instance.
protected
transformDependency(ReflectionParameter $parameter, array<string|int, mixed> $parameters) : mixed
Parameters
- $parameter : ReflectionParameter
- $parameters : array<string|int, mixed>