File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
tests/acceptance/acceptance Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ final class InputBag extends ParameterBag
7
7
/**
8
8
* Returns a string input value by name.
9
9
*
10
- * @template D of string|null
10
+ * @template D of string|int|float|bool| null
11
11
* @psalm-param D $default
12
- * @psalm-return string|D
12
+ * @psalm-return string|int|float|bool| D
13
13
* @psalm-taint-source input
14
14
*/
15
15
public function get(string $key, $default = null) {}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Feature: InputBag get return type
11
11
use Symfony\Component\HttpFoundation\Request;
12
12
"""
13
13
14
- Scenario Outline : Return type is string if default argument is string.
14
+ Scenario Outline : Return type is not null if default argument is string.
15
15
Given I have the following code
16
16
"""
17
17
class App
@@ -24,11 +24,14 @@ Feature: InputBag get return type
24
24
}
25
25
"""
26
26
When I run Psalm
27
- Then I see no errors
27
+ Then I see these errors
28
+ | Type | Message |
29
+ | InvalidScalarArgument | Argument 1 of trim expects string , scalar provided |
28
30
Examples :
29
31
| property |
30
32
| query |
31
33
| cookies |
34
+ | request |
32
35
33
36
Scenario Outline : Return type is nullable if default argument is not provided.
34
37
Given I have the following code
@@ -44,10 +47,11 @@ Feature: InputBag get return type
44
47
"""
45
48
When I run Psalm
46
49
Then I see these errors
47
- | Type | Message |
48
- | PossiblyNullArgument | Argument 1 of trim cannot be null , possibly null value provided |
50
+ | Type | Message |
51
+ | InvalidScalarArgument | Argument 1 of trim expects string , null \| scalar provided |
49
52
And I see no other errors
50
53
Examples :
51
54
| property |
52
55
| query |
53
56
| cookies |
57
+ | request |
You can’t perform that action at this time.
0 commit comments