Documentation

TestMultipleHttpKernel extends HttpKernel
in package
implements ControllerResolverInterface, ArgumentResolverInterface

HttpKernel notifies events to convert a Request object to a Response one.

Interfaces, Classes and Traits

ControllerResolverInterface
A ControllerResolverInterface implementation knows how to determine the controller to execute based on a Request object.
ArgumentResolverInterface
An ArgumentResolverInterface instance knows how to determine the arguments for a specific action.

Table of Contents

$backendRequest  : mixed
$bodies  : mixed
$called  : mixed
$dispatcher  : mixed
$headers  : mixed
$requestStack  : mixed
$resolver  : mixed
$statuses  : mixed
$argumentResolver  : mixed
__construct()  : mixed
callController()  : mixed
getArguments()  : array<string|int, mixed>
Returns the arguments to pass to the controller.
getBackendRequest()  : mixed
getController()  : callable|false
Returns the Controller instance associated with a Request.
handle()  : Response
Handles a Request to convert it to a Response.
hasBeenCalled()  : mixed
reset()  : mixed
terminate()  : mixed
Terminates a request/response cycle.
filterResponse()  : Response
Filters a response object.
finishRequest()  : mixed
Publishes the finish request event, then pop the request from the stack.
handleException()  : Response
Handles an exception by trying to convert it to a Response.
handleRaw()  : Response
Handles a request to convert it to a response.
varToString()  : mixed
Returns a human-readable string for the specified variable.

Properties

$argumentResolver

private mixed $argumentResolver

Methods

__construct()

public __construct(mixed $responses) : mixed
Parameters
$responses : mixed
Return values
mixed

getArguments()

Returns the arguments to pass to the controller.

public getArguments(Request $request, mixed $controller) : array<string|int, mixed>
Parameters
$request : Request

A Request instance

$controller : mixed

A PHP callable

Return values
array<string|int, mixed>

An array of arguments to pass to the controller

getController()

Returns the Controller instance associated with a Request.

public getController(Request $request) : callable|false

As several resolvers can exist for a single application, a resolver must return false when it is not able to determine the controller.

The resolver must only throw an exception when it should be able to load a controller but cannot because of some errors made by the developer.

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

handle()

Handles a Request to convert it to a Response.

public handle(Request $request[, mixed $type = HttpKernelInterface::MASTER_REQUEST ][, mixed $catch = false ]) : Response
Parameters
$request : Request

A Request instance

$type : mixed = HttpKernelInterface::MASTER_REQUEST

The type of the request (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST)

$catch : mixed = false

Whether to catch exceptions or not

Return values
Response

A Response instance

filterResponse()

Filters a response object.

private filterResponse(Response $response, Request $request, int $type) : Response
Parameters
$response : Response

A Response instance

$request : Request

An error message in case the response is not a Response object

$type : int

The type of the request (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST)

Tags
throws
RuntimeException

if the passed object is not a Response instance

Return values
Response

The filtered Response instance

finishRequest()

Publishes the finish request event, then pop the request from the stack.

private finishRequest(Request $request, int $type) : mixed

Note that the order of the operations is important here, otherwise operations such as can lead to weird results.

Parameters
$request : Request
$type : int
Return values
mixed

handleException()

Handles an exception by trying to convert it to a Response.

private handleException(Exception $e, Request $request, int $type) : Response
Parameters
$e : Exception

An \Exception instance

$request : Request

A Request instance

$type : int

The type of the request

Tags
throws
Exception
Return values
Response

A Response instance

handleRaw()

Handles a request to convert it to a response.

private handleRaw(Request $request[, int $type = self::MASTER_REQUEST ]) : Response

Exceptions are not caught.

Parameters
$request : Request

A Request instance

$type : int = self::MASTER_REQUEST

The type of the request (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST)

Tags
throws
LogicException

If one of the listener does not behave as expected

throws
NotFoundHttpException

When controller cannot be found

Return values
Response

A Response instance

varToString()

Returns a human-readable string for the specified variable.

private varToString(mixed $var) : mixed
Parameters
$var : mixed
Return values
mixed

Search results