/** * @param DataCollectorInterface $collector */ public function addCollector(DataCollectorInterface $collector, $panelTemplate = null, $toolbarTemplate = null) { $name = $collector->getName(); $this->data['collectors'][$name] = $collector; $this->data['panelTemplates'][$name] = $panelTemplate; $this->data['toolbarTemplates'][$name] = $toolbarTemplate; }
/** * {@inheritdoc} */ 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); } } }
/** * Adds a Collector. * * @param DataCollectorInterface $collector A DataCollectorInterface instance */ public function add(DataCollectorInterface $collector) { $this->collectors[$collector->getName()] = $collector; }
/** * {@inheritdoc} * @param TimeDataCollector $dataCollector */ public function convert(DataCollectorInterface $dataCollector) { return round(microtime(true) * 1000 - $dataCollector->getStartTime()) . ' ms'; }
/** * Adds a Collector. * * @param DataCollectorInterface $collector * @param string $toolbar * @param string $panel * @param int $priority */ public function add(DataCollectorInterface $collector, $toolbar = null, $panel = null, $priority = 0) { $this->viewCollectorMap[$collector->getName()] = compact('toolbar', 'panel'); $this->order[$collector->getName()] = $priority; parent::add($collector); }
/** * {@inheritdoc} * @param DoctrineDataCollector $dataCollector */ public function convert(DataCollectorInterface $dataCollector) { return ['mappingErrors' => $dataCollector->getMappingErrors(), 'invalidEntities' => $dataCollector->getInvalidEntityCount(), 'queryCount' => $dataCollector->getQueryCount(), 'queryTime' => round($dataCollector->getTime()) . ' ms']; }
/** * {@inheritdoc} * @param MemoryDataCollector $dataCollector */ public function convert(DataCollectorInterface $dataCollector) { return $this->formatBytes($dataCollector->getMemory()); }
/** * {@inheritdoc} * @param SecurityDataCollector $dataCollector */ public function convert(DataCollectorInterface $dataCollector) { return ['enabled' => $dataCollector->isEnabled(), 'user' => (string) $dataCollector->getUser(), 'roles' => $dataCollector->getRoles(), 'authenticated' => $dataCollector->isAuthenticated(), 'token' => $dataCollector->getTokenClass()]; }