$detectors */ public function __construct(private readonly iterable $detectors) { } public function detect(string $sourcePath, int $sourceWidth, int $sourceHeight, array $context = []): ?SubjectDetectionResultData { foreach ($this->detectors as $detector) { $result = $detector->detect($sourcePath, $sourceWidth, $sourceHeight, $context); if ($result !== null) { return $result; } } return null; } }