diff --git a/src/Stubs/5/InputBag.stubphp b/src/Stubs/5/InputBag.stubphp new file mode 100644 index 00000000..78072fad --- /dev/null +++ b/src/Stubs/5/InputBag.stubphp @@ -0,0 +1,15 @@ + + + + + + + + + + + """ + And I have the following code preamble + """ + ->get('foo', 'bar'); + trim($string); + } + } + """ + When I run Psalm + Then I see no errors + Examples: + | property | + | query | + | cookies | + + Scenario Outline: Return type is nullable if default argument is not provided. + Given I have the following code + """ + class App + { + public function __invoke(Request $request): void + { + $nullableString = $request->->get('foo'); + trim($nullableString); + } + } + """ + When I run Psalm + Then I see these errors + | Type | Message | + | PossiblyNullArgument | Argument 1 of trim cannot be null, possibly null value provided | + And I see no other errors + Examples: + | property | + | query | + | cookies |