RequestDataCollector
extends DataCollector
in package
implements
EventSubscriberInterface, LateDataCollectorInterface
DataCollector.
Tags
Interfaces, Classes, Traits and Enums
- EventSubscriberInterface
- An EventSubscriber knows itself what events it is interested in.
- LateDataCollectorInterface
- LateDataCollectorInterface.
Table of Contents
- $controllers : mixed
- $data : array<string|int, mixed>|Data
- $cloner : ClonerInterface
- __construct() : mixed
- __sleep() : array<string|int, mixed>
- __wakeup() : mixed
- collect() : mixed
- {@inheritdoc}
- getContent() : mixed
- getContentType() : mixed
- getController() : array<string|int, mixed>|string
- Gets the parsed controller.
- getDotenvVars() : mixed
- getFlashes() : mixed
- getFormat() : mixed
- getForwardToken() : mixed
- getIdentifier() : mixed
- getLocale() : mixed
- getMethod() : mixed
- getName() : mixed
- {@inheritdoc}
- getPathInfo() : mixed
- getPrettyJson() : mixed
- getRedirect() : array<string|int, mixed>|bool
- 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
- getStatusCode() : mixed
- getStatusText() : mixed
- getSubscribedEvents() : array<string, mixed>
- 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
- serialize() : mixed
- unserialize() : mixed
- cloneVar() : Data
- Converts the variable into a serializable Data instance.
- getCasters() : array<string|int, callable>
- parseController() : array<string|int, mixed>|string
- Parse a controller.
Properties
$controllers
protected
mixed
$controllers
$data
protected
array<string|int, mixed>|Data
$data
= []
$cloner
private
ClonerInterface
$cloner
Methods
__construct()
public
__construct() : mixed
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) : mixed
Parameters
- $request : Request
- $response : Response
Return values
mixed —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
Return values
array<string|int, mixed>|string —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() : mixed
Return values
mixed —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>|bool
Return values
array<string|int, mixed>|bool —A legacy array of data from the previous redirection response or false otherwise
getRequestAttributes()
public
getRequestAttributes() : mixed
Return values
mixed —getRequestCookies()
public
getRequestCookies([mixed $raw = false ]) : mixed
Parameters
- $raw : mixed = 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([mixed $raw = false ]) : mixed
Parameters
- $raw : mixed = 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 —The route
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> —The parameters
getSessionAttributes()
public
getSessionAttributes() : mixed
Return values
mixed —getSessionMetadata()
public
getSessionMetadata() : 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, mixed>
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, mixed> —The event names to listen to
isJsonRequest()
public
isJsonRequest() : mixed
Return values
mixed —lateCollect()
Collects data as late as possible.
public
lateCollect() : mixed
Return values
mixed —onKernelController()
public
onKernelController(FilterControllerEvent $event) : mixed
Parameters
- $event : FilterControllerEvent
Tags
Return values
mixed —onKernelResponse()
public
onKernelResponse(FilterResponseEvent $event) : mixed
Parameters
- $event : FilterResponseEvent
Tags
Return values
mixed —reset()
public
reset() : mixed
Return values
mixed —serialize()
public
serialize() : mixed
Tags
Return values
mixed —unserialize()
public
unserialize(mixed $data) : mixed
Parameters
- $data : mixed
Tags
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()
Parse a controller.
protected
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