initialize(); } public function list(): Response { $data = (new PodcastModel())->findAll(); array_map(function ($podcast): void { $podcast->feed_url = $podcast->getFeedUrl(); }, $data); return $this->respond($data); } public function view(int $id): Response { $data = (new PodcastModel())->getPodcastById($id); if (! $data instanceof Podcast) { return $this->failNotFound('Podcast not found'); } $data->feed_url = $data->getFeedUrl(); return $this->respond($data); } }