From d8ebf61722f23dc2ec02bc39ea804fe90a79f193 Mon Sep 17 00:00:00 2001 From: Michael Sievenpiper Date: Fri, 15 May 2026 14:47:13 +0100 Subject: [PATCH] - php 8.4 deprecations and warnings --- phpunit.xml | 14 ++++---------- src/Cookies/CookieJar.php | 2 +- src/LinkBuilder/LinkBuilder.php | 4 ++-- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 4e4df63..c4fd876 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,17 +1,11 @@ - + stopOnFailure="false"> tests diff --git a/src/Cookies/CookieJar.php b/src/Cookies/CookieJar.php index c4fff50..da5e405 100644 --- a/src/Cookies/CookieJar.php +++ b/src/Cookies/CookieJar.php @@ -111,7 +111,7 @@ public function has(string $name, bool $checkQueued = false): bool return isset($this->_requestCookies[$name]) || ($checkQueued && isset($this->_responseCookies[$name])); } - public function store(string $name, string $value = null, $expireSeconds = 0) + public function store(string $name, ?string $value = null, $expireSeconds = 0) { unset($this->_deleteCookies[$name]); $this->_responseCookies[$name] = ['v' => $value, 'e' => $expireSeconds > 0 ? (time() + $expireSeconds) : 0]; diff --git a/src/LinkBuilder/LinkBuilder.php b/src/LinkBuilder/LinkBuilder.php index 97c0ea1..4dd3696 100644 --- a/src/LinkBuilder/LinkBuilder.php +++ b/src/LinkBuilder/LinkBuilder.php @@ -54,9 +54,9 @@ public function asUrl(): string . ($this->_fragment ? '#' . $this->_fragment : null); } - protected function _isStandardPort($scheme, $port) + protected function _isStandardPort($scheme, $port): bool { - return ('http' === $scheme && $port === 80) || ('https' === $scheme && $port === 443); + return ('http' === $scheme && (int)$port === 80) || ('https' === $scheme && (int)$port === 443); } /**