Skip to content

Commit 2d9377a

Browse files
committed
PHP 8.4 compatibility
Fix cookie parsing with timezone
1 parent 483f5c7 commit 2d9377a

File tree

6 files changed

+16
-5
lines changed

6 files changed

+16
-5
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
continue-on-error: ${{ !matrix.stable }}
1212
strategy:
1313
matrix:
14-
php-versions: ['8.0', '8.1', '8.2']
14+
php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4']
1515
stable: [true]
1616
coverage: [true]
1717
composer-flags: ['']

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. This projec
44
to [Semantic Versioning] (http://semver.org/). For change log format,
55
use [Keep a Changelog] (http://keepachangelog.com/).
66

7+
## [2.3.0] - 2025-03-14
8+
9+
### Changed
10+
11+
- PHP 8.4 compatibility
12+
13+
### Fixed
14+
15+
- Cookie parsing with timezone
16+
717
## [2.2.0] - 2025-01-14
818

919
### Added

src/Adapter/CurlAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ protected function clearOptions(): void
104104
/**
105105
* @inheritDoc
106106
*/
107-
public function sendRequest(RequestInterface $request, HttpContext $context = null): ResponseInterface
107+
public function sendRequest(RequestInterface $request, ?HttpContext $context = null): ResponseInterface
108108
{
109109
$headersStream = new MemoryStream();
110110
$bodyStream = new MemoryStream();

src/Components/CookieParserTrait.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ function (&$value) {
8383
}
8484
}
8585
if (array_key_exists('expires', $cookieTmp)) {
86+
$cookieTmp['expires'] = preg_replace('/\s*\([^)]+\)\s*$/i', '', $cookieTmp['expires']);
8687
$cookie['expires'] = new DateTime($cookieTmp['expires']);
8788
}
8889

src/Components/LogTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ trait LogTrait
3838
*
3939
* @throws HttpClientException if unable to write logs
4040
*/
41-
protected function log(RequestInterface $request, ResponseInterface $response = null): void
41+
protected function log(RequestInterface $request, ?ResponseInterface $response = null): void
4242
{
4343
// Logger
4444
if (!empty($this->logger)) {

src/Components/RequestFactoryTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function constructRequest(
109109
public function request(
110110
string $method,
111111
UriInterface|string $uri,
112-
array $parameters = null,
112+
?array $parameters = null,
113113
StreamInterface|string|null $body = null,
114114
array $options = []
115115
): ResponseInterface {
@@ -130,7 +130,7 @@ public function request(
130130
*/
131131
public function get(
132132
UriInterface|string $uri,
133-
array $parameters = null,
133+
?array $parameters = null,
134134
array $options = []
135135
): ResponseInterface {
136136
return $this->request('GET', $uri, $parameters, null, $options);

0 commit comments

Comments
 (0)