You are here

public function ProfilerSubscriber::__construct in Devel 8.3

Same name and namespace in other branches
  1. 8 webprofiler/src/EventSubscriber/ProfilerSubscriber.php \Drupal\webprofiler\EventSubscriber\ProfilerSubscriber::__construct()
  2. 8.2 webprofiler/src/EventSubscriber/ProfilerSubscriber.php \Drupal\webprofiler\EventSubscriber\ProfilerSubscriber::__construct()
  3. 4.x webprofiler/src/EventSubscriber/ProfilerSubscriber.php \Drupal\webprofiler\EventSubscriber\ProfilerSubscriber::__construct()

Parameters

\Symfony\Component\HttpKernel\Profiler\Profiler $profiler: A Profiler instance.

\Symfony\Component\HttpFoundation\RequestStack $requestStack: A RequestStack instance.

\Symfony\Component\HttpFoundation\RequestMatcherInterface|null $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.

File

webprofiler/src/EventSubscriber/ProfilerSubscriber.php, line 49

Class

ProfilerSubscriber

Namespace

Drupal\webprofiler\EventSubscriber

Code

public function __construct(Profiler $profiler, RequestStack $requestStack, RequestMatcherInterface $matcher = NULL, $onlyException = FALSE, $onlyMasterRequests = FALSE) {
  $this->profiler = $profiler;
  $this->matcher = $matcher;
  $this->onlyException = (bool) $onlyException;
  $this->onlyMasterRequests = (bool) $onlyMasterRequests;
  $this->profiles = new \SplObjectStorage();
  $this->parents = new \SplObjectStorage();
  $this->requestStack = $requestStack;
}