Skip to content

Commit cb4977f

Browse files
committed
fix: πŸ› Warning with PHP 8.5 on $http_response_header
Assign $http_response_header with the result of the function http_get_last_response_headers(); when available other use the variable $http_response_header coming from fopen. βœ… Closes: #18
1 parent ff6e830 commit cb4977f

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ jobs:
3737
3838
- name: Run phpunit tests (with and without cURL)
3939
run: |
40-
composer check
40+
./vendor/bin/phpunit --display-deprecations
41+
SKIP_CURL=1 ./vendor/bin/phpunit --display-deprecations
4142
42-
- name: Run proxy tests
43+
- name: Run proxy tests (with and without cURL)
4344
run: |
4445
docker run -d --name=tinyproxy -p 8888:8888 monokal/tinyproxy:latest ANY
4546
PROXY=http://0.0.0.0:8888 ./vendor/bin/phpunit

β€Žcomposer.lockβ€Ž

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žsrc/AbstractGeocoder.phpβ€Ž

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ protected function getJSONByFopen($query)
6868

6969
$ret = @file_get_contents($query);
7070
if ($ret === false) {
71-
$response_headers = function_exists('http_get_last_response_headers')
72-
? http_get_last_response_headers()
73-
/** NOTE: https://github.com/phpstan/phpstan/issues/3213 */
74-
/** @phpstan-ignore-next-line */
75-
: (isset($http_response_header) ? $http_response_header : null);
71+
if (function_exists('http_get_last_response_headers')) {
72+
$http_response_header = http_get_last_response_headers();
73+
}
74+
75+
$response_headers = isset($http_response_header) ? $http_response_header : null;
7676

7777
/** @phpstan-ignore-next-line */
7878
if (isset($response_headers) && is_array($response_headers)) {

0 commit comments

Comments
Β (0)