Class

Symfony\Component\HttpKernel\EventListener\ProfilerListener

class ProfilerListener implements EventSubscriberInterface

ProfilerListener collects data for the current request by listening to the onKernelResponse event.

Methods

__construct(Profiler $profiler, RequestMatcherInterface $matcher = null, bool $onlyException = false, bool $onlyMasterRequests = false, RequestStack $requestStack = null)

Constructor.

onKernelException(GetResponseForExceptionEvent $event)

Handles the onKernelException event.

onKernelRequest(GetResponseEvent $event)

onKernelResponse(FilterResponseEvent $event)

Handles the onKernelResponse event.

onKernelTerminate(PostResponseEvent $event)

static array getSubscribedEvents()

Returns an array of event names this subscriber wants to listen to.

Details

at line 50
public __construct(Profiler $profiler, RequestMatcherInterface $matcher = null, bool $onlyException = false, bool $onlyMasterRequests = false, RequestStack $requestStack = null)

Constructor.

Parameters

Profiler $profiler A Profiler instance
RequestMatcherInterface $matcher A RequestMatcher instance
bool $onlyException true if the profiler only collects data when an exception occurs, false otherwise
bool $onlyMasterRequests true if the profiler only collects data when the request is a master request, false otherwise
RequestStack $requestStack A RequestStack instance

at line 66
public onKernelException(GetResponseForExceptionEvent $event)

Handles the onKernelException event.

Parameters

GetResponseForExceptionEvent $event A GetResponseForExceptionEvent instance

at line 78
public onKernelRequest(GetResponseEvent $event)

Parameters

GetResponseEvent $event

at line 90
public onKernelResponse(FilterResponseEvent $event)

Handles the onKernelResponse event.

Parameters

FilterResponseEvent $event A FilterResponseEvent instance

at line 125
public onKernelTerminate(PostResponseEvent $event)

Parameters

PostResponseEvent $event

at line 147
static public array getSubscribedEvents()

Returns an array of event names this subscriber wants to listen to.

The array keys are event names and the value can be:

For instance:

Return Value

array The event names to listen to