Skip to content

Commit 4136b4b

Browse files
Php 8.1 fixes
In PHP 8.1, passing null to a function/method parameter that is not declared nullable is not allowed. See https://php.watch/versions/8.1/internal-func-non-nullable-null-deprecation
1 parent 8a3e3f1 commit 4136b4b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Curl/Curl.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ protected function exec()
217217
$this->http_error = $this->isError();
218218
$this->error = $this->curl_error || $this->http_error;
219219
$this->error_code = $this->error ? ($this->curl_error ? $this->getErrorCode() : $this->getHttpStatus()) : 0;
220-
$this->request_headers = preg_split('/\r\n/', curl_getinfo($this->curl, CURLINFO_HEADER_OUT), null, PREG_SPLIT_NO_EMPTY);
220+
$this->request_headers = preg_split('/\r\n/', curl_getinfo($this->curl, CURLINFO_HEADER_OUT), -1, PREG_SPLIT_NO_EMPTY);
221221
$this->http_error_message = $this->error ? (isset($this->response_headers['0']) ? $this->response_headers['0'] : '') : '';
222222
$this->error_message = $this->curl_error ? $this->getErrorMessage() : $this->http_error_message;
223223

@@ -715,8 +715,8 @@ public function getResponseHeaders($headerKey = null)
715715
foreach ($this->response_headers as $header) {
716716
$parts = explode(":", $header, 2);
717717

718-
$key = isset($parts[0]) ? $parts[0] : null;
719-
$value = isset($parts[1]) ? $parts[1] : null;
718+
$key = isset($parts[0]) ? $parts[0] : '';
719+
$value = isset($parts[1]) ? $parts[1] : '';
720720

721721
$headers[trim(strtolower($key))] = trim($value);
722722
}

0 commit comments

Comments
 (0)