From 4ffb6fc829d75263b6628892c58a0661dddb07ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Barto=C5=A1?= Date: Mon, 9 May 2022 20:36:27 +0200 Subject: [PATCH] UrlInterface->withQueryParameter() --- src/UriInterface.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/UriInterface.php b/src/UriInterface.php index 9d7ab9e..176105f 100644 --- a/src/UriInterface.php +++ b/src/UriInterface.php @@ -279,6 +279,23 @@ public function withPath($path); * @throws \InvalidArgumentException for invalid query strings. */ public function withQuery($query); + + /** + * Return an instance with the specified query parameter added to existing query string. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified query string. + * + * Users can provide both encoded and decoded query characters. + * Implementations ensure the correct encoding as outlined in getQuery(). + * + * A null query parameter value is equivalent to removing the query parameter. + * + * @param string $name The query parameter to use with the new instance. + * @param string|null $value Value of the query parameter. + * @return static A new instance with the specified query parameter. + */ + public function withQueryParameter($name, $value); /** * Return an instance with the specified URI fragment.