RequestDataCollector
extends DataCollector
in package
implements
EventSubscriberInterface, LateDataCollectorInterface
DataCollector.
Tags
Table of Contents
Interfaces
- EventSubscriberInterface
- An EventSubscriber knows itself what events it is interested in.
- LateDataCollectorInterface
- LateDataCollectorInterface.
Properties
- $data : array<string|int, mixed>|Data
- $cloner : mixed
- $controllers : SplObjectStorage<Request, callable>
- $requestStack : mixed
- $sessionUsages : array<string|int, mixed>
Methods
- __construct() : mixed
- __sleep() : array<string|int, mixed>
- __wakeup() : mixed
- collect() : mixed
- {@inheritdoc}
- collectSessionUsage() : void
- getContent() : mixed
- getContentType() : mixed
- getController() : array<string|int, mixed>|string|Data
- Gets the parsed controller.
- getDotenvVars() : mixed
- getFlashes() : mixed
- getFormat() : mixed
- getForwardToken() : mixed
- getIdentifier() : mixed
- getLocale() : mixed
- getMethod() : mixed
- getName() : string
- {@inheritdoc}
- getPathInfo() : mixed
- getPrettyJson() : mixed
- getRedirect() : array<string|int, mixed>|Data|false
- Gets the previous request attributes.
- getRequestAttributes() : mixed
- getRequestCookies() : mixed
- getRequestFiles() : mixed
- getRequestHeaders() : mixed
- getRequestQuery() : mixed
- getRequestRequest() : mixed
- getRequestServer() : mixed
- getResponseCookies() : mixed
- getResponseHeaders() : mixed
- getRoute() : string
- Gets the route name.
- getRouteParams() : array<string|int, mixed>
- Gets the route parameters.
- getSessionAttributes() : mixed
- getSessionMetadata() : mixed
- getSessionUsages() : mixed
- getStatelessCheck() : mixed
- getStatusCode() : mixed
- getStatusText() : mixed
- getSubscribedEvents() : array<string, string|array{0: string, 1: int}|array<int, array{0: string, 1?: int}>>
- Returns an array of event names this subscriber wants to listen to.
- isJsonRequest() : mixed
- lateCollect() : mixed
- Collects data as late as possible.
- onKernelController() : mixed
- onKernelResponse() : mixed
- reset() : mixed
- cloneVar() : Data
- Converts the variable into a serializable Data instance.
- getCasters() : array<string|int, callable>
- parseController() : array<string|int, mixed>|string
Properties
$data
protected
array<string|int, mixed>|Data
$data
= []
$cloner
private
mixed
$cloner
$controllers
private
SplObjectStorage<Request, callable>
$controllers
$requestStack
private
mixed
$requestStack
$sessionUsages
private
array<string|int, mixed>
$sessionUsages
= []
Methods
__construct()
public
__construct([RequestStack $requestStack = null ]) : mixed
Parameters
- $requestStack : RequestStack = null
__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>__wakeup()
public
__wakeup() : mixed
collect()
{@inheritdoc}
public
collect(Request $request, Response $response[, Throwable $exception = null ]) : mixed
Parameters
collectSessionUsage()
public
collectSessionUsage() : void
getContent()
public
getContent() : mixed
getContentType()
public
getContentType() : mixed
getController()
Gets the parsed controller.
public
getController() : array<string|int, mixed>|string|Data
Return values
array<string|int, mixed>|string|Data —The controller as a string or array of data with keys 'class', 'method', 'file' and 'line'
getDotenvVars()
public
getDotenvVars() : mixed
getFlashes()
public
getFlashes() : mixed
getFormat()
public
getFormat() : mixed
getForwardToken()
public
getForwardToken() : mixed
getIdentifier()
public
getIdentifier() : mixed
getLocale()
public
getLocale() : mixed
getMethod()
public
getMethod() : mixed
getName()
{@inheritdoc}
public
getName() : string
Return values
stringgetPathInfo()
public
getPathInfo() : mixed
getPrettyJson()
public
getPrettyJson() : mixed
getRedirect()
Gets the previous request attributes.
public
getRedirect() : array<string|int, mixed>|Data|false
Return values
array<string|int, mixed>|Data|false —A legacy array of data from the previous redirection response or false otherwise
getRequestAttributes()
public
getRequestAttributes() : mixed
getRequestCookies()
public
getRequestCookies([bool $raw = false ]) : mixed
Parameters
- $raw : bool = false
getRequestFiles()
public
getRequestFiles() : mixed
getRequestHeaders()
public
getRequestHeaders() : mixed
getRequestQuery()
public
getRequestQuery() : mixed
getRequestRequest()
public
getRequestRequest() : mixed
getRequestServer()
public
getRequestServer([bool $raw = false ]) : mixed
Parameters
- $raw : bool = false
getResponseCookies()
public
getResponseCookies() : mixed
getResponseHeaders()
public
getResponseHeaders() : mixed
getRoute()
Gets the route name.
public
getRoute() : string
The _route request attributes is automatically set by the Router Matcher.
Return values
stringgetRouteParams()
Gets the route parameters.
public
getRouteParams() : array<string|int, mixed>
The _route_params request attributes is automatically set by the RouterListener.
Return values
array<string|int, mixed>getSessionAttributes()
public
getSessionAttributes() : mixed
getSessionMetadata()
public
getSessionMetadata() : mixed
getSessionUsages()
public
getSessionUsages() : mixed
getStatelessCheck()
public
getStatelessCheck() : mixed
getStatusCode()
public
getStatusCode() : mixed
getStatusText()
public
getStatusText() : mixed
getSubscribedEvents()
Returns an array of event names this subscriber wants to listen to.
public
static getSubscribedEvents() : array<string, string|array{0: string, 1: int}|array<int, array{0: string, 1?: int}>>
The array keys are event names and the value can be:
- The method name to call (priority defaults to 0)
- An array composed of the method name to call and the priority
- An array of arrays composed of the method names to call and respective priorities, or 0 if unset
For instance:
- ['eventName' => 'methodName']
- ['eventName' => ['methodName', $priority]]
- ['eventName' => [['methodName1', $priority], ['methodName2']]]
The code must not depend on runtime state as it will only be called at compile time. All logic depending on runtime state must be put into the individual methods handling the events.
Return values
array<string, string|array{0: string, 1: int}|array<int, array{0: string, 1?: int}>>isJsonRequest()
public
isJsonRequest() : mixed
lateCollect()
Collects data as late as possible.
public
lateCollect() : mixed
onKernelController()
public
onKernelController(ControllerEvent $event) : mixed
Parameters
- $event : ControllerEvent
onKernelResponse()
public
onKernelResponse(ResponseEvent $event) : mixed
Parameters
- $event : ResponseEvent
reset()
public
reset() : mixed
cloneVar()
Converts the variable into a serializable Data instance.
protected
cloneVar(mixed $var) : Data
This array can be displayed in the template using the VarDumper component.
Parameters
- $var : mixed
Return values
DatagetCasters()
protected
getCasters() : array<string|int, callable>
Return values
array<string|int, callable> —The casters to add to the cloner
parseController()
private
parseController(array<string|int, mixed>|object|string|null $controller) : array<string|int, mixed>|string
Parameters
- $controller : array<string|int, mixed>|object|string|null
Return values
array<string|int, mixed>|string —An array of controller data or a simple string