From 85b4f17a80656553d48c9570e513360931bbb6b2 Mon Sep 17 00:00:00 2001 From: fluffycondor <62219548+fluffycondor@users.noreply.github.com> Date: Sun, 17 Jul 2022 14:00:06 +0000 Subject: [PATCH] [http foundation] mark bag's getters as mutation free (#268) --- src/Stubs/4/Component/HttpFoundation/ParameterBag.stubphp | 4 ++++ src/Stubs/5/Component/HttpFoundation/InputBag.stubphp | 2 ++ src/Stubs/5/Component/HttpFoundation/ParameterBag.stubphp | 2 ++ src/Stubs/6/Component/HttpFoundation/InputBag.stubphp | 2 ++ src/Stubs/6/Component/HttpFoundation/ParameterBag.stubphp | 2 ++ src/Stubs/common/Component/HttpFoundation/Request.stubphp | 1 + 6 files changed, 13 insertions(+) diff --git a/src/Stubs/4/Component/HttpFoundation/ParameterBag.stubphp b/src/Stubs/4/Component/HttpFoundation/ParameterBag.stubphp index 83ec59c..0f7462b 100644 --- a/src/Stubs/4/Component/HttpFoundation/ParameterBag.stubphp +++ b/src/Stubs/4/Component/HttpFoundation/ParameterBag.stubphp @@ -12,6 +12,7 @@ class ParameterBag implements \IteratorAggregate, \Countable * * @return mixed * @psalm-taint-source input + * @psalm-mutation-free */ public function get(string $key, $default = null) {} @@ -19,6 +20,9 @@ class ParameterBag implements \IteratorAggregate, \Countable * Returns the parameters. * * @return array An array of parameters + + * @psalm-taint-source input + * @psalm-mutation-free */ public function all() {} } diff --git a/src/Stubs/5/Component/HttpFoundation/InputBag.stubphp b/src/Stubs/5/Component/HttpFoundation/InputBag.stubphp index 48a25fa..b52d267 100644 --- a/src/Stubs/5/Component/HttpFoundation/InputBag.stubphp +++ b/src/Stubs/5/Component/HttpFoundation/InputBag.stubphp @@ -14,6 +14,7 @@ final class InputBag extends ParameterBag * @psalm-param D $default * @psalm-return D|T * @psalm-taint-source input + * @psalm-mutation-free */ public function get(string $key, $default = null) {} @@ -25,6 +26,7 @@ final class InputBag extends ParameterBag * @return array An array of parameters * * @psalm-taint-source input + * @psalm-mutation-free */ public function all(string $key = null) {} } diff --git a/src/Stubs/5/Component/HttpFoundation/ParameterBag.stubphp b/src/Stubs/5/Component/HttpFoundation/ParameterBag.stubphp index 4c5e8bd..48920cc 100644 --- a/src/Stubs/5/Component/HttpFoundation/ParameterBag.stubphp +++ b/src/Stubs/5/Component/HttpFoundation/ParameterBag.stubphp @@ -12,6 +12,7 @@ class ParameterBag implements \IteratorAggregate, \Countable * * @return mixed * @psalm-taint-source input + * @psalm-mutation-free */ public function get(string $key, $default = null) {} @@ -23,6 +24,7 @@ class ParameterBag implements \IteratorAggregate, \Countable * @return array An array of parameters * * @psalm-taint-source input + * @psalm-mutation-free */ public function all(string $key = null) {} } diff --git a/src/Stubs/6/Component/HttpFoundation/InputBag.stubphp b/src/Stubs/6/Component/HttpFoundation/InputBag.stubphp index 48a25fa..b52d267 100644 --- a/src/Stubs/6/Component/HttpFoundation/InputBag.stubphp +++ b/src/Stubs/6/Component/HttpFoundation/InputBag.stubphp @@ -14,6 +14,7 @@ final class InputBag extends ParameterBag * @psalm-param D $default * @psalm-return D|T * @psalm-taint-source input + * @psalm-mutation-free */ public function get(string $key, $default = null) {} @@ -25,6 +26,7 @@ final class InputBag extends ParameterBag * @return array An array of parameters * * @psalm-taint-source input + * @psalm-mutation-free */ public function all(string $key = null) {} } diff --git a/src/Stubs/6/Component/HttpFoundation/ParameterBag.stubphp b/src/Stubs/6/Component/HttpFoundation/ParameterBag.stubphp index 4c5e8bd..48920cc 100644 --- a/src/Stubs/6/Component/HttpFoundation/ParameterBag.stubphp +++ b/src/Stubs/6/Component/HttpFoundation/ParameterBag.stubphp @@ -12,6 +12,7 @@ class ParameterBag implements \IteratorAggregate, \Countable * * @return mixed * @psalm-taint-source input + * @psalm-mutation-free */ public function get(string $key, $default = null) {} @@ -23,6 +24,7 @@ class ParameterBag implements \IteratorAggregate, \Countable * @return array An array of parameters * * @psalm-taint-source input + * @psalm-mutation-free */ public function all(string $key = null) {} } diff --git a/src/Stubs/common/Component/HttpFoundation/Request.stubphp b/src/Stubs/common/Component/HttpFoundation/Request.stubphp index fb8ce15..e0664ae 100644 --- a/src/Stubs/common/Component/HttpFoundation/Request.stubphp +++ b/src/Stubs/common/Component/HttpFoundation/Request.stubphp @@ -26,6 +26,7 @@ class Request * @param mixed $default The default value if the parameter key does not exist * * @psalm-taint-source input + * @psalm-mutation-free */ public function get($key, $default = null) {} }