Make use of new PHP 8.4.0 function to replace implicit $http_response_header var (#11995)
parent
39981a0e2b
commit
17f4984601
|
@ -2045,11 +2045,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../src/Composer/Installer.php
|
||||
|
||||
-
|
||||
message: "#^Casting to bool something that's already bool\\.$#"
|
||||
count: 1
|
||||
path: ../src/Composer/Installer.php
|
||||
|
||||
-
|
||||
message: "#^Only booleans are allowed in &&, array\\<array\\<string, string\\>\\> given on the right side\\.$#"
|
||||
count: 1
|
||||
|
@ -4353,6 +4348,16 @@ parameters:
|
|||
count: 8
|
||||
path: ../src/Composer/Util/RemoteFilesystem.php
|
||||
|
||||
-
|
||||
message: "#^Function http_clear_last_response_headers not found\\.$#"
|
||||
count: 1
|
||||
path: ../src/Composer/Util/RemoteFilesystem.php
|
||||
|
||||
-
|
||||
message: "#^Function http_get_last_response_headers not found\\.$#"
|
||||
count: 1
|
||||
path: ../src/Composer/Util/RemoteFilesystem.php
|
||||
|
||||
-
|
||||
message: "#^Method Composer\\\\Util\\\\RemoteFilesystem\\:\\:copy\\(\\) should return bool but returns bool\\|string\\.$#"
|
||||
count: 1
|
||||
|
@ -5095,4 +5100,3 @@ parameters:
|
|||
message: "#^Only booleans are allowed in a ternary operator condition, array\\<string\\> given\\.$#"
|
||||
count: 1
|
||||
path: ../tests/Composer/Test/Util/TlsHelperTest.php
|
||||
|
||||
|
|
|
@ -1329,7 +1329,7 @@ class Installer
|
|||
*/
|
||||
public function setRunScripts(bool $runScripts = true): self
|
||||
{
|
||||
$this->runScripts = (bool) $runScripts;
|
||||
$this->runScripts = $runScripts;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
|
@ -533,7 +533,12 @@ class RemoteFilesystem
|
|||
}
|
||||
|
||||
// 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();
|
||||
http_clear_last_response_headers();
|
||||
} else {
|
||||
$responseHeaders = $http_response_header ?? [];
|
||||
}
|
||||
|
||||
if (null !== $e) {
|
||||
throw $e;
|
||||
|
|
Loading…
Reference in New Issue