Skip to content

Commit 9a26ac2

Browse files
authored
Merge pull request #11 from PHPCSStandards/feature/minor-tweaks
UpdateXsdFiles: minor tweaks
2 parents 9dda874 + ca15842 commit 9a26ac2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Build/UpdateXsdFiles.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,20 +142,16 @@ private function getReleasesFallback(): void
142142
$releasesJson = \curl_exec($curl);
143143

144144
if (\is_string($releasesJson) === false) {
145-
\curl_close($curl);
146145
throw new RuntimeException('GitHub API request to retrieve the releases failed');
147146
}
148147

149148
\curl_setopt($curl, \CURLOPT_URL, self::API_LATEST_TAG_URL);
150149
$latestReleaseJson = \curl_exec($curl);
151150

152151
if (\is_string($latestReleaseJson) === false) {
153-
\curl_close($curl);
154152
throw new RuntimeException('GitHub API request to retrieve the latest release failed');
155153
}
156154

157-
\curl_close($curl);
158-
159155
$latestRelease = \json_decode($latestReleaseJson, flags: \JSON_THROW_ON_ERROR | \JSON_OBJECT_AS_ARRAY);
160156
$latestRelease = $latestRelease['tag_name'];
161157

@@ -230,7 +226,7 @@ private function getXsdFile(string $tagName): string
230226
{
231227
$url = \sprintf(self::XSD_URL, $tagName);
232228
$contents = \file_get_contents($url);
233-
if (!$contents) {
229+
if (is_string($contents) === false) {
234230
throw new RuntimeException(\sprintf('Failed to read XSD file: %s', $url));
235231
}
236232

0 commit comments

Comments
 (0)