diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93bfef3..ca9ca0d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] name: ${{ matrix.php-version }} runs-on: ${{ matrix.operating-system }} steps: diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 85f3ab2..1fc3399 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -2,3 +2,6 @@ parameters: paths: - src level: max + reportUnmatchedIgnoredErrors: false + ignoreErrors: + - '#^Function http_get_last_response_headers not found.$#' diff --git a/src/HttpAdapter/HttpStreamWrapperClient.php b/src/HttpAdapter/HttpStreamWrapperClient.php index 97cf2b8..f74acf2 100644 --- a/src/HttpAdapter/HttpStreamWrapperClient.php +++ b/src/HttpAdapter/HttpStreamWrapperClient.php @@ -80,7 +80,11 @@ private function request(string $method, Request $request): Response ); } - return HttpStreamWrapperResponse::fromResponse($http_response_header, $responseBody); + $responseHeaders = (PHP_VERSION_ID >= 80500 + ? http_get_last_response_headers() + : $http_response_header) ?? []; + + return HttpStreamWrapperResponse::fromResponse($responseHeaders, $responseBody); } /**