detectors[ $id ] ) ) { throw new \InvalidArgumentException( 'Detector ID must be nonempty and unique.' ); } $this->detectors[ $id ] = $detector; } /** @return DetectorInterface[] */ public function all(): array { return array_values( $this->detectors ); } }