Skip to content

Commit 9da0dec

Browse files
authored
Add php 8.5 to test pipeline for ^3.0 (#31)
Use http_get_last_response_headers instead of $http_response_header if possible #30.
1 parent 0b1962f commit 9da0dec

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
operating-system: [ubuntu-latest]
13-
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
13+
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
1414
name: ${{ matrix.php-version }}
1515
runs-on: ${{ matrix.operating-system }}
1616
steps:

‎phpstan.neon.dist‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ parameters:
22
paths:
33
- src
44
level: max
5+
reportUnmatchedIgnoredErrors: false
6+
ignoreErrors:
7+
- '#^Function http_get_last_response_headers not found.$#'

‎src/HttpAdapter/HttpStreamWrapperClient.php‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ private function request(string $method, Request $request): Response
8080
);
8181
}
8282

83-
return HttpStreamWrapperResponse::fromResponse($http_response_header, $responseBody);
83+
$responseHeaders = (PHP_VERSION_ID >= 80500
84+
? http_get_last_response_headers()
85+
: $http_response_header) ?? [];
86+
87+
return HttpStreamWrapperResponse::fromResponse($responseHeaders, $responseBody);
8488
}
8589

8690
/**

0 commit comments

Comments
 (0)