function 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);
        }
    }
}