clientService->newClient(); $response = $client->get(self::BASE_URL.'search', [ 'query' => [ 'media' => 'podcast', 'term' => $value, 'country' => $this->userService->getCountryCode(), ], ]); $json = (array) json_decode((string) $response->getBody(), true, flags: JSON_THROW_ON_ERROR); if (array_key_exists('results', $json) && is_array($json['results'])) { /** @var string[] $feed */ foreach ($json['results'] as $feed) { $podcasts[] = new PodcastData( $feed['trackName'], $feed['artistName'], $feed['feedUrl'], $feed['primaryGenreName'], $feed['artworkUrl600'], strtotime($feed['releaseDate']) ); } } return $podcasts; } }