clientService->newClient(); try { $response = $client->get($url); } catch (Exception $e) { // Ignore any error, like the parent method return false; } return $response->getBody(); } /** * @return (mixed|string)[]|false * * @psalm-return array{0: mixed|string,...}|false */ #[\Override] public function retrieveHeader($url) { $client = $this->clientService->newClient(); try { $response = $client->get($url, [ 'allow_redirects' => [ 'max' => 1, ], ]); } catch (Exception $e) { // Ignore any error, like the parent method return false; } // Build the data structure get_headers returns. The status reason // and protocol are inaccurate, but the favicon lib will only extract // the status code. return array_merge( [ 0 => 'HTTP/1.1 ' . $response->getStatusCode() . ' FOO', ], array_change_key_case($response->getHeaders()), ); } }