HttpKernel
in package
implements
HttpKernelInterface, TerminableInterface
HttpKernel notifies events to convert a Request object to a Response one.
Tags
Interfaces, Classes and Traits
- HttpKernelInterface
- HttpKernelInterface handles a Request to convert it to a Response.
- TerminableInterface
- Terminable extends the Kernel request/response cycle with dispatching a post response event after sending the response and before shutting down the kernel.
Table of Contents
- $dispatcher : mixed
- $requestStack : mixed
- $resolver : mixed
- $argumentResolver : mixed
- __construct() : mixed
- handle() : Response
- Handles a Request to convert it to a Response.
- 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.
- handleRaw() : Response
- Handles a request to convert it to a response.
- handleThrowable() : Response
- Handles a throwable by trying to convert it to a Response.
- varToString() : string
- Returns a human-readable string for the specified variable.
Properties
$dispatcher
protected
mixed
$dispatcher
$requestStack
protected
mixed
$requestStack
$resolver
protected
mixed
$resolver
$argumentResolver
private
mixed
$argumentResolver
Methods
__construct()
public
__construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver[, RequestStack|null $requestStack = null ][, ArgumentResolverInterface|null $argumentResolver = null ]) : mixed
Parameters
- $dispatcher : EventDispatcherInterface
- $resolver : ControllerResolverInterface
- $requestStack : RequestStack|null = null
- $argumentResolver : ArgumentResolverInterface|null = null
Return values
mixed —handle()
Handles a Request to convert it to a Response.
public
handle(Request $request[, int $type = HttpKernelInterface::MAIN_REQUEST ][, bool $catch = true ]) : Response
Parameters
- $request : Request
- $type : int = HttpKernelInterface::MAIN_REQUEST
-
The type of the request (one of HttpKernelInterface::MAIN_REQUEST or HttpKernelInterface::SUB_REQUEST)
- $catch : bool = true
-
Whether to catch exceptions or not
Return values
Response —terminate()
Terminates a request/response cycle.
public
terminate(Request $request, Response $response) : mixed
Parameters
Return values
mixed —filterResponse()
Filters a response object.
private
filterResponse(Response $response, Request $request, int $type) : Response
Parameters
Tags
Return values
Response —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 —handleRaw()
Handles a request to convert it to a response.
private
handleRaw(Request $request[, int $type = self::MAIN_REQUEST ]) : Response
Exceptions are not caught.
Parameters
- $request : Request
- $type : int = self::MAIN_REQUEST
Tags
Return values
Response —handleThrowable()
Handles a throwable by trying to convert it to a Response.
private
handleThrowable(Throwable $e, Request $request, int $type) : Response
Parameters
- $e : Throwable
- $request : Request
- $type : int
Tags
Return values
Response —varToString()
Returns a human-readable string for the specified variable.
private
varToString(mixed $var) : string
Parameters
- $var : mixed