Skip to content

Commit 85b4f17

Browse files
authored
[http foundation] mark bag's getters as mutation free (#268)
1 parent 28983de commit 85b4f17

File tree

6 files changed

+13
-0
lines changed

6 files changed

+13
-0
lines changed

src/Stubs/4/Component/HttpFoundation/ParameterBag.stubphp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ class ParameterBag implements \IteratorAggregate, \Countable
1212
*
1313
* @return mixed
1414
* @psalm-taint-source input
15+
* @psalm-mutation-free
1516
*/
1617
public function get(string $key, $default = null) {}
1718

1819
/**
1920
* Returns the parameters.
2021
*
2122
* @return array An array of parameters
23+
24+
* @psalm-taint-source input
25+
* @psalm-mutation-free
2226
*/
2327
public function all() {}
2428
}

src/Stubs/5/Component/HttpFoundation/InputBag.stubphp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ final class InputBag extends ParameterBag
1414
* @psalm-param D $default
1515
* @psalm-return D|T
1616
* @psalm-taint-source input
17+
* @psalm-mutation-free
1718
*/
1819
public function get(string $key, $default = null) {}
1920

@@ -25,6 +26,7 @@ final class InputBag extends ParameterBag
2526
* @return array An array of parameters
2627
*
2728
* @psalm-taint-source input
29+
* @psalm-mutation-free
2830
*/
2931
public function all(string $key = null) {}
3032
}

src/Stubs/5/Component/HttpFoundation/ParameterBag.stubphp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
1212
*
1313
* @return mixed
1414
* @psalm-taint-source input
15+
* @psalm-mutation-free
1516
*/
1617
public function get(string $key, $default = null) {}
1718

@@ -23,6 +24,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
2324
* @return array An array of parameters
2425
*
2526
* @psalm-taint-source input
27+
* @psalm-mutation-free
2628
*/
2729
public function all(string $key = null) {}
2830
}

src/Stubs/6/Component/HttpFoundation/InputBag.stubphp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ final class InputBag extends ParameterBag
1414
* @psalm-param D $default
1515
* @psalm-return D|T
1616
* @psalm-taint-source input
17+
* @psalm-mutation-free
1718
*/
1819
public function get(string $key, $default = null) {}
1920

@@ -25,6 +26,7 @@ final class InputBag extends ParameterBag
2526
* @return array An array of parameters
2627
*
2728
* @psalm-taint-source input
29+
* @psalm-mutation-free
2830
*/
2931
public function all(string $key = null) {}
3032
}

src/Stubs/6/Component/HttpFoundation/ParameterBag.stubphp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
1212
*
1313
* @return mixed
1414
* @psalm-taint-source input
15+
* @psalm-mutation-free
1516
*/
1617
public function get(string $key, $default = null) {}
1718

@@ -23,6 +24,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
2324
* @return array An array of parameters
2425
*
2526
* @psalm-taint-source input
27+
* @psalm-mutation-free
2628
*/
2729
public function all(string $key = null) {}
2830
}

src/Stubs/common/Component/HttpFoundation/Request.stubphp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class Request
2626
* @param mixed $default The default value if the parameter key does not exist
2727
*
2828
* @psalm-taint-source input
29+
* @psalm-mutation-free
2930
*/
3031
public function get($key, $default = null) {}
3132
}

0 commit comments

Comments
 (0)