ContainerControllerResolver
extends ControllerResolver
in package
A controller resolver searching for a controller in a psr-11 container when using the "service::method" notation.
Tags
Table of Contents
- $container : mixed
- $logger : mixed
- __construct() : mixed
- getController() : callable|false
- Returns the Controller instance associated with a Request.
- createController() : callable
- Returns a callable for the given controller.
- instantiateController() : object
- Returns an instantiated controller.
- getClassMethodsWithoutMagicMethods() : array<string|int, mixed>
- getControllerError() : string
- throwExceptionIfControllerWasRemoved() : mixed
Properties
$container
protected
mixed
$container
$logger
private
mixed
$logger
Methods
__construct()
public
__construct(ContainerInterface $container[, LoggerInterface|null $logger = null ]) : mixed
Parameters
- $container : ContainerInterface
- $logger : LoggerInterface|null = null
Return values
mixed —getController()
Returns the Controller instance associated with a Request.
public
getController(Request $request) : callable|false
Parameters
- $request : Request
Return values
callable|false —A PHP callable representing the Controller, or false if this resolver is not able to determine the controller
createController()
Returns a callable for the given controller.
protected
createController(string $controller) : callable
Parameters
- $controller : string
Return values
callable —instantiateController()
Returns an instantiated controller.
protected
instantiateController(string $class) : object
Parameters
- $class : string
Return values
object —getClassMethodsWithoutMagicMethods()
private
getClassMethodsWithoutMagicMethods(mixed $classOrObject) : array<string|int, mixed>
Parameters
- $classOrObject : mixed
Return values
array<string|int, mixed> —getControllerError()
private
getControllerError(mixed $callable) : string
Parameters
- $callable : mixed
Return values
string —throwExceptionIfControllerWasRemoved()
private
throwExceptionIfControllerWasRemoved(string $controller, Throwable $previous) : mixed
Parameters
- $controller : string
- $previous : Throwable