Skip to content

Commit

Permalink
[http foundation] mark bag's getters as mutation free (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
fluffycondor authored Jul 17, 2022
1 parent 28983de commit 85b4f17
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Stubs/4/Component/HttpFoundation/ParameterBag.stubphp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ class ParameterBag implements \IteratorAggregate, \Countable
*
* @return mixed
* @psalm-taint-source input
* @psalm-mutation-free
*/
public function get(string $key, $default = null) {}

/**
* Returns the parameters.
*
* @return array An array of parameters

* @psalm-taint-source input
* @psalm-mutation-free
*/
public function all() {}
}
2 changes: 2 additions & 0 deletions src/Stubs/5/Component/HttpFoundation/InputBag.stubphp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}

Expand All @@ -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) {}
}
2 changes: 2 additions & 0 deletions src/Stubs/5/Component/HttpFoundation/ParameterBag.stubphp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}

Expand All @@ -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) {}
}
2 changes: 2 additions & 0 deletions src/Stubs/6/Component/HttpFoundation/InputBag.stubphp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}

Expand All @@ -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) {}
}
2 changes: 2 additions & 0 deletions src/Stubs/6/Component/HttpFoundation/ParameterBag.stubphp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}

Expand All @@ -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) {}
}
1 change: 1 addition & 0 deletions src/Stubs/common/Component/HttpFoundation/Request.stubphp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
}

0 comments on commit 85b4f17

Please sign in to comment.