From d391078801fa9c3e0f32edaf00cbd126c8eb326a Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Sat, 16 Mar 2024 17:17:26 +0100 Subject: [PATCH 1/3] feat: fix deprecation --- src/Cookie.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Cookie.php b/src/Cookie.php index ecfbcda..5e2f8e6 100644 --- a/src/Cookie.php +++ b/src/Cookie.php @@ -511,7 +511,10 @@ private function normalizeDomain($domain) */ private function normalizePath($path) { - $path = rtrim($path, '/'); + if(null !== $path) + { + $path = rtrim($path, '/'); + } if (empty($path) or '/' !== substr($path, 0, 1)) { $path = '/'; From e516a1eb22fd17d38ed656e5044f2e1688fdd953 Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Sat, 16 Mar 2024 17:21:56 +0100 Subject: [PATCH 2/3] feat: fix deprecation --- phpstan-baseline.neon | 5 ----- 1 file changed, 5 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index a5cda2b..31bd899 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -60,11 +60,6 @@ parameters: count: 1 path: src/Cookie.php - - - message: "#^Parameter \\#1 \\$string of function rtrim expects string, string\\|null given\\.$#" - count: 1 - path: src/Cookie.php - - message: "#^Class Http\\\\Message\\\\CookieJar implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" count: 1 From ddaef02f8814bed66553c2937ef3777da3677e2b Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Sat, 16 Mar 2024 17:23:51 +0100 Subject: [PATCH 3/3] feat: fix deprecation --- src/Cookie.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Cookie.php b/src/Cookie.php index 5e2f8e6..b79fe0a 100644 --- a/src/Cookie.php +++ b/src/Cookie.php @@ -511,9 +511,8 @@ private function normalizeDomain($domain) */ private function normalizePath($path) { - if(null !== $path) - { - $path = rtrim($path, '/'); + if (null !== $path) { + $path = rtrim($path, '/'); } if (empty($path) or '/' !== substr($path, 0, 1)) {