Symfony API
Class

Symfony\Component\HttpKernel\EventListener\ProfilerListener

class ProfilerListener implements EventSubscriberInterface

ProfilerListener collects data for the current request by listening to the kernel events.

Methods

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

Constructor.

onKernelException(GetResponseForExceptionEvent $event)

Handles the onKernelException 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 48
public __construct(Profiler $profiler, RequestStack $requestStack, RequestMatcherInterface $matcher = null, bool $onlyException = false, bool $onlyMasterRequests = false)

Constructor.

Parameters

Profiler $profiler A Profiler instance
RequestStack $requestStack A RequestStack 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

at line 64
public onKernelException(GetResponseForExceptionEvent $event)

Handles the onKernelException event.

Parameters

GetResponseForExceptionEvent $event A GetResponseForExceptionEvent instance

at line 78
public onKernelResponse(FilterResponseEvent $event)

Handles the onKernelResponse event.

Parameters

FilterResponseEvent $event A FilterResponseEvent instance

at line 106
public onKernelTerminate(PostResponseEvent $event)

Parameters

PostResponseEvent $event

at line 127
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