RequestDataCollector
extends DataCollector
in package
implements
EventSubscriberInterface, LateDataCollectorInterface
DataCollector.
Tags
Interfaces, Classes and Traits
- EventSubscriberInterface
- An EventSubscriber knows itself what events it is interested in.
- LateDataCollectorInterface
- LateDataCollectorInterface.
Table of Contents
- $data : array<string|int, mixed>|Data
- $cloner : ClonerInterface
- $controllers : SplObjectStorage<Request, callable>
- $requestStack : mixed
- $sessionUsages : mixed
- __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}|list
> - 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
ClonerInterface
$cloner
$controllers
private
SplObjectStorage<Request, callable>
$controllers
$requestStack
private
mixed
$requestStack
$sessionUsages
private
mixed
$sessionUsages
= []
Methods
__construct()
public
__construct([RequestStack|null $requestStack = null ]) : mixed
Parameters
- $requestStack : RequestStack|null = null
Return values
mixed —__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed> —__wakeup()
public
__wakeup() : mixed
Return values
mixed —collect()
{@inheritdoc}
public
collect(Request $request, Response $response[, Throwable|null $exception = null ]) : mixed
Parameters
Return values
mixed —collectSessionUsage()
public
collectSessionUsage() : void
Return values
void —getContent()
public
getContent() : mixed
Return values
mixed —getContentType()
public
getContentType() : mixed
Return values
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
Return values
mixed —getFlashes()
public
getFlashes() : mixed
Return values
mixed —getFormat()
public
getFormat() : mixed
Return values
mixed —getForwardToken()
public
getForwardToken() : mixed
Return values
mixed —getIdentifier()
public
getIdentifier() : mixed
Return values
mixed —getLocale()
public
getLocale() : mixed
Return values
mixed —getMethod()
public
getMethod() : mixed
Return values
mixed —getName()
{@inheritdoc}
public
getName() : string
Return values
string —getPathInfo()
public
getPathInfo() : mixed
Return values
mixed —getPrettyJson()
public
getPrettyJson() : mixed
Return values
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
Return values
mixed —getRequestCookies()
public
getRequestCookies([bool $raw = false ]) : mixed
Parameters
- $raw : bool = false
Return values
mixed —getRequestFiles()
public
getRequestFiles() : mixed
Return values
mixed —getRequestHeaders()
public
getRequestHeaders() : mixed
Return values
mixed —getRequestQuery()
public
getRequestQuery() : mixed
Return values
mixed —getRequestRequest()
public
getRequestRequest() : mixed
Return values
mixed —getRequestServer()
public
getRequestServer([bool $raw = false ]) : mixed
Parameters
- $raw : bool = false
Return values
mixed —getResponseCookies()
public
getResponseCookies() : mixed
Return values
mixed —getResponseHeaders()
public
getResponseHeaders() : mixed
Return values
mixed —getRoute()
Gets the route name.
public
getRoute() : string
The _route request attributes is automatically set by the Router Matcher.
Return values
string —getRouteParams()
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
Return values
mixed —getSessionMetadata()
public
getSessionMetadata() : mixed
Return values
mixed —getSessionUsages()
public
getSessionUsages() : mixed
Return values
mixed —getStatelessCheck()
public
getStatelessCheck() : mixed
Return values
mixed —getStatusCode()
public
getStatusCode() : mixed
Return values
mixed —getStatusText()
public
getStatusText() : mixed
Return values
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}|list>
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}|listisJsonRequest()
public
isJsonRequest() : mixed
Return values
mixed —lateCollect()
Collects data as late as possible.
public
lateCollect() : mixed
Return values
mixed —onKernelController()
public
onKernelController(ControllerEvent $event) : mixed
Parameters
- $event : ControllerEvent
Return values
mixed —onKernelResponse()
public
onKernelResponse(ResponseEvent $event) : mixed
Parameters
- $event : ResponseEvent
Return values
mixed —reset()
public
reset() : mixed
Return values
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
Data —getCasters()
protected
getCasters() : array<string|int, callable>
Return values
array<string|int, callable> —The casters to add to the cloner
parseController()
private
parseController(string|object|array<string|int, mixed>|null $controller) : array<string|int, mixed>|string
Parameters
- $controller : string|object|array<string|int, mixed>|null
-
The controller to parse
Return values
array<string|int, mixed>|string —An array of controller data or a simple string