[http foundation] mark bag's getters as mutation free (#268)

This commit is contained in:
fluffycondor 2022-07-17 14:00:06 +00:00 committed by GitHub
parent 28983ded3b
commit 85b4f17a80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 0 deletions

View File

@ -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() {}
}

View File

@ -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) {}
}

View File

@ -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) {}
}

View File

@ -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) {}
}

View File

@ -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) {}
}

View File

@ -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) {}
}