We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent df4d0e2 commit 4bc9e8cCopy full SHA for 4bc9e8c
1 file changed
src/AbstractGeocoder.php
@@ -67,12 +67,11 @@ protected function getJSONByFopen($query)
67
error_clear_last();
68
69
$ret = @file_get_contents($query);
70
-
71
if ($ret === false) {
72
- /** NOTE: https://github.com/phpstan/phpstan/issues/3213 */
73
- /** @phpstan-ignore-next-line */
74
- if (isset($http_response_header) && is_array($http_response_header)) {
75
- $error_message = $http_response_header[0];
+ $response_headers = function_exists('http_get_last_response_headers') ? http_get_last_response_headers() : (isset($http_response_header) ? $http_response_header : null);
+
+ if (isset($response_headers) && is_array($response_headers)) {
+ $error_message = $response_headers[0];
76
if ($error = error_get_last()) {
77
$error_message = $error['message'];
78
}
0 commit comments