ControllerDispatcher

class ControllerDispatcher (View source)

Traits

RouteDependencyResolverTrait

Properties

protected Router $router The router instance.
protected Container $container The IoC container instance.

Methods

mixed callWithDependencies(object $instance, string $method)

Call a class method with the resolved dependencies.

from RouteDependencyResolverTrait
array resolveClassMethodDependencies(array $parameters, object $instance, string $method)

Resolve the object method's type-hinted dependencies.

from RouteDependencyResolverTrait
array resolveMethodDependencies(array $parameters, ReflectionFunctionAbstract $reflector)

Resolve the given method's type-hinted dependencies.

from RouteDependencyResolverTrait
mixed transformDependency(ReflectionParameter $parameter, array $parameters, array $originalParameters)

Attempt to transform the given parameter into a class instance.

from RouteDependencyResolverTrait
bool alreadyInParameters(string $class, array $parameters)

Determine if an object of the given class is in a list of parameters.

from RouteDependencyResolverTrait
void spliceIntoParameters(array $parameters, string $key, mixed $instance)

Splice the given value into the parameter list.

from RouteDependencyResolverTrait
void __construct(Router $router, Container $container = null)

Create a new controller dispatcher instance.

mixed dispatch(Route $route, Request $request, string $controller, string $method)

Dispatch a request to a given controller and method.

mixed makeController(string $controller)

Make a controller instance via the IoC container.

mixed callWithinStack(Controller $instance, Route $route, Request $request, string $method)

Call the given controller instance method.

array getMiddleware(Controller $instance, string $method)

Get the middleware for the controller instance.

bool methodExcludedByOptions(string $method, array $options)

Determine if the given options exclude a particular method.

mixed call(Controller $instance, Route $route, string $method)

Call the given controller instance method.

Details

protected mixed callWithDependencies(object $instance, string $method)

Call a class method with the resolved dependencies.

Parameters

object $instance
string $method

Return Value

mixed

protected array resolveClassMethodDependencies(array $parameters, object $instance, string $method)

Resolve the object method's type-hinted dependencies.

Parameters

array $parameters
object $instance
string $method

Return Value

array

array resolveMethodDependencies(array $parameters, ReflectionFunctionAbstract $reflector)

Resolve the given method's type-hinted dependencies.

Parameters

array $parameters
ReflectionFunctionAbstract $reflector

Return Value

array

protected mixed transformDependency(ReflectionParameter $parameter, array $parameters, array $originalParameters)

Attempt to transform the given parameter into a class instance.

Parameters

ReflectionParameter $parameter
array $parameters
array $originalParameters

Return Value

mixed

protected bool alreadyInParameters(string $class, array $parameters)

Determine if an object of the given class is in a list of parameters.

Parameters

string $class
array $parameters

Return Value

bool

protected void spliceIntoParameters(array $parameters, string $key, mixed $instance)

Splice the given value into the parameter list.

Parameters

array $parameters
string $key
mixed $instance

Return Value

void

void __construct(Router $router, Container $container = null)

Create a new controller dispatcher instance.

Parameters

Router $router
Container $container

Return Value

void

mixed dispatch(Route $route, Request $request, string $controller, string $method)

Dispatch a request to a given controller and method.

Parameters

Route $route
Request $request
string $controller
string $method

Return Value

mixed

protected mixed makeController(string $controller)

Make a controller instance via the IoC container.

Parameters

string $controller

Return Value

mixed

protected mixed callWithinStack(Controller $instance, Route $route, Request $request, string $method)

Call the given controller instance method.

Parameters

Controller $instance
Route $route
Request $request
string $method

Return Value

mixed

array getMiddleware(Controller $instance, string $method)

Get the middleware for the controller instance.

Parameters

Controller $instance
string $method

Return Value

array

bool methodExcludedByOptions(string $method, array $options)

Determine if the given options exclude a particular method.

Parameters

string $method
array $options

Return Value

bool

protected mixed call(Controller $instance, Route $route, string $method)

Call the given controller instance method.

Parameters

Controller $instance
Route $route
string $method

Return Value

mixed

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.2/Illuminate/Routing/ControllerDispatcher.html