downloadMetadata($url); } /** * download Metadata from a link * * @param string $url * * @return array * @throws ReleaseMetadataException * @since 30.0.0 */ public function downloadMetadata(string $url): array { $client = $this->clientService->newClient(); try { $response = $client->get($url, [ 'timeout' => 10, 'connect_timeout' => 10 ]); } catch (Exception $e) { throw new ReleaseMetadataException('could not reach metadata at ' . $url, previous: $e); } try { return json_decode($response->getBody(), true, flags: JSON_THROW_ON_ERROR); } catch (JsonException) { throw new ReleaseMetadataException('remote document is not valid'); } } }