fyydService, $this->itunesService]; foreach ($providers as $provider) { try { $podcasts = [...$podcasts, ...$provider->search($value)]; } catch (\Exception $e) { $this->logger->error($e->getMessage(), $e->getTrace()); } } usort($podcasts, fn (array $a, array $b) => new \DateTime((string) $b['last_pub']) <=> new \DateTime((string) $a['last_pub'])); $podcasts = array_intersect_key($podcasts, array_unique(array_map(fn (array $feed) => $feed['feed_url'], $podcasts))); return new JSONResponse($podcasts); } }