Skip to content

Commit

Permalink
Make use of new PHP 8.4.0 function to replace implicit $http_response…
Browse files Browse the repository at this point in the history
…_header var
  • Loading branch information
Seldaek committed May 31, 2024
1 parent a5285d7 commit 03c6f61
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Composer/Util/RemoteFilesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,12 @@ protected function getRemoteContents(string $originUrl, string $fileUrl, $contex
}

// https://www.php.net/manual/en/reserved.variables.httpresponseheader.php
$responseHeaders = $http_response_header ?? [];
if (PHP_VERSION_ID > 80400) {
$responseHeaders = http_get_last_response_headers();

Check failure on line 537 in src/Composer/Util/RemoteFilesystem.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.2, false)

Function http_get_last_response_headers not found.

Check failure on line 537 in src/Composer/Util/RemoteFilesystem.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, true)

Function http_get_last_response_headers not found.
http_clear_last_response_header();

Check failure on line 538 in src/Composer/Util/RemoteFilesystem.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.2, false)

Function http_clear_last_response_header not found.

Check failure on line 538 in src/Composer/Util/RemoteFilesystem.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, true)

Function http_clear_last_response_header not found.
} else {
$responseHeaders = $http_response_header ?? [];
}

if (null !== $e) {
throw $e;
Expand Down

0 comments on commit 03c6f61

Please sign in to comment.