public function registerCollector(CollectorInterface $collector)
    {
        if ($collector instanceof StartCollectorInterface) {
            $this->collectors['initial'][$collector->getPath()] = $collector;
        } elseif ($collector instanceof FinalCollectorInterface) {
            $this->collectors['final'][$collector->getPath()] = $collector;
        } elseif ($collector instanceof StreamCollectorInterface) {
            $this->collectors['stream'][$collector->getPath()] = $collector;
        } else {
            throw new \RuntimeException('Collector must be implementation of StartCollectorInterface, '
                . 'FinalCollectorInterface or StreamCollectorInterface Path=' . $collector->getPath());
        }
    }
public function registerCollector(CollectorInterface $collector)
    {
        if ($collector instanceof StartCollectorInterface) {
            $this->collectors['initial'][$collector->getPath()] = $collector;
        } elseif ($collector instanceof FinalCollectorInterface) {
            $this->collectors['final'][$collector->getPath()] = $collector;
        } elseif ($collector instanceof StreamCollectorInterface) {
            $this->collectors['stream'][$collector->getPath()] = $collector;
        } else {
            throw new \RuntimeException('Collector must be implementation of StartCollectorInterface, '
                . 'FinalCollectorInterface or StreamCollectorInterface Path=' . $collector->getPath());
        }
    }
public function registerCollector ( CollectorInterface $ collector ) { if ( $ collector instanceof StartCollectorInterface ) { $ this -> collectors [ 'initial' ] [ $ collector -> getPath ( ) ] = $ collector ; } elseif ( $ collector instanceof FinalCollectorInterface ) { $ this -> collectors [ 'final' ] [ $ collector -> getPath ( ) ] = $ collector ; } elseif ( $ collector instanceof StreamCollectorInterface ) { $ this -> collectors [ 'stream' ] [ $ collector -> getPath ( ) ] = $ collector ; } else { throw new \ RuntimeException ( 'Collector must be implementation of StartCollectorInterface, ' . 'FinalCollectorInterface or StreamCollectorInterface Path=' . $ collector -> getPath ( ) ) ; } }
Add a data collector to the profiler
@param CollectorInterface $collector
@throws \RuntimeException
Add a data collector to the profiler