Skip to content

Commit b7aa982

Browse files
committed
Improve the GitHub API class, always print the HTTP code
1 parent 10d57dc commit b7aa982

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/Controller/Component/GithubApiComponent.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,12 @@ public function sendRequest(
162162
return ['', 0];
163163
}
164164

165+
$status = curl_getinfo($curlHandle, CURLINFO_HTTP_CODE);// phpcs:ignore SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFallbackGlobalName
166+
// phpcs ignored patterns for mock testing reasons
167+
Log::debug('Response-code: ' . $status . ' for: ' . $url);
168+
165169
$decodedResponse = json_decode($response, true);
166170
if ($returnCode) {
167-
$status = curl_getinfo($curlHandle, CURLINFO_HTTP_CODE);// phpcs:ignore SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFallbackGlobalName
168-
// phpcs ignored patterns for mock testing reasons
169-
curl_close($curlHandle);
170-
Log::debug('Response-code: ' . $status . ' for: ' . $url);
171-
172171
return [
173172
$decodedResponse,
174173
$status,

0 commit comments

Comments
 (0)