/** * Adds a data collector * * @param DataCollectorInterface $collector * * @throws DebugBarException * @return $this */ public function addCollector(DataCollectorInterface $collector) { if ($collector->getName() === '__meta') { throw new DebugBarException("'__meta' is a reserved name and cannot be used as a collector name"); } if (isset($this->collectors[$collector->getName()])) { throw new DebugBarException("'{$collector->getName()}' is already a registered collector"); } $this->collectors[$collector->getName()] = $collector; return $this; }
/** * @param DataCollectorInterface $collector */ public function addCollector(DataCollectorInterface $collector) { $this->collectors[$collector->getName()] = $collector; }