clientService = $clientService; } public function download(string $url): ?string { $client = $this->clientService->newClient(); try { $resp = $client->get($url); } catch (Exception $e) { return null; } $body = $resp->getBody(); if (is_resource($body)) { return stream_get_contents($body) ?: null; } return $body; } }