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 diff --git a/src/Cookie.php b/src/Cookie.php index ecfbcda..b79fe0a 100644 --- a/src/Cookie.php +++ b/src/Cookie.php @@ -511,7 +511,9 @@ 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 = '/';