public function __construct(array $collectors) { foreach ($collectors as $collector) { $this->collectors[$collector->getType()] = $collector; } }