You are here

public function Profiler::add in Devel 8.3

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

File

webprofiler/src/Profiler/Profiler.php, line 53

Class

Profiler
Class Profiler.

Namespace

Drupal\webprofiler\Profiler

Code

public function add(DataCollectorInterface $collector) {

  // Drupal collector should not be disabled.
  if ($collector
    ->getName() == 'drupal') {
    parent::add($collector);
  }
  else {
    if ($this->activeToolbarItems && array_key_exists($collector
      ->getName(), $this->activeToolbarItems) && $this->activeToolbarItems[$collector
      ->getName()] !== '0') {
      parent::add($collector);
    }
  }
}