Documentation

RequestDataCollector extends DataCollector
in package
implements EventSubscriberInterface, LateDataCollectorInterface

DataCollector.

Tags
author

Fabien Potencier fabien@symfony.com

final

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

Methods

__sleep()

public __sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>

__wakeup()

public __wakeup() : 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'

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

getRequestCookies()

public getRequestCookies([bool $raw = false ]) : mixed
Parameters
$raw : bool = false
Return values
mixed

getRequestServer()

public getRequestServer([bool $raw = false ]) : mixed
Parameters
$raw : bool = false
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>

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}|list>

lateCollect()

Collects data as late as possible.

public lateCollect() : 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

Search results