Example #1
0
 /**
  * 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;
 }
Example #2
0
 /**
  * @param DataCollectorInterface $collector
  */
 public function addCollector(DataCollectorInterface $collector)
 {
     $this->collectors[$collector->getName()] = $collector;
 }