From 78807197bb3b47264782b352907caf28b0aaff62 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 7 Jul 2022 14:17:05 +0200 Subject: [PATCH] Improved type signature for `parse_cookie_header()` return type Ref: https://github.com/laminas/laminas-diactoros/pull/106#discussion_r915795683 --- psalm-baseline.xml | 8 ++++++++ src/functions/parse_cookie_header.legacy.php | 2 +- src/functions/parse_cookie_header.php | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index e80f22d4..17bb976e 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -471,6 +471,14 @@ func_get_args() + + + $cookies + + + array<non-empty-string, string> + + function () { diff --git a/src/functions/parse_cookie_header.legacy.php b/src/functions/parse_cookie_header.legacy.php index ee4f85ab..8c9a46a3 100644 --- a/src/functions/parse_cookie_header.legacy.php +++ b/src/functions/parse_cookie_header.legacy.php @@ -11,7 +11,7 @@ * @deprecated Use {@see \Laminas\Diactoros\parseCookieHeader} instead * * @param string $cookieHeader A string cookie header value. - * @return array key/value cookie pairs. + * @return array key/value cookie pairs. */ function parseCookieHeader($cookieHeader): array { diff --git a/src/functions/parse_cookie_header.php b/src/functions/parse_cookie_header.php index 10cac8fc..acb187fa 100644 --- a/src/functions/parse_cookie_header.php +++ b/src/functions/parse_cookie_header.php @@ -16,7 +16,7 @@ * overwriting. Thus, the server request should take the cookies from the request header instead. * * @param string $cookieHeader A string cookie header value. - * @return array key/value cookie pairs. + * @return array key/value cookie pairs. */ function parseCookieHeader($cookieHeader): array {