importers, $importer); } } public function import(UploadedFile $file, Album $location): array { foreach ($this->importers as $importer) { if($importer::supports($file)) { return (new $importer($file, $location))->import(); } } throw new UnsupportedMediaTypeHttpException("The provided MediaType is not supported"); } }