diff --git a/src/Downloader.php b/src/Downloader.php index 0df73d8..c6fa4a9 100644 --- a/src/Downloader.php +++ b/src/Downloader.php @@ -77,7 +77,7 @@ public function getCertificates(string $hostName): array $fullCertificateChain = array_merge([$peerCertificate], $peerCertificateChain); - return array_map(function($certificate) { + return array_map(function ($certificate) { $certificateFields = openssl_x509_parse($certificate); return new SslCertificate($certificateFields); @@ -127,11 +127,12 @@ protected function fetchCertificates(string $hostName): array $this->handleRequestFailure($hostName, $thrown); } - if (!$client) { + if (! $client) { throw CouldNotDownloadCertificate::unknownError($hostName, "Could not connect to `{$hostName}`."); } $response = stream_context_get_params($client); + return $response; }