-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
phpstan/phpstan-src
#4174Labels
Description
Bug report
When is omitted annotation that specifies Template type no error is reported.
Look at code snippet.
On lines 26-28 is good example, repository expects Id<Foo> type and Id<Foo> is given.
On lines 31-33 is error example, repository expects Id<Foo> but Id<Bar> is given and expected error is reported.
Problems are on lines 38-39
When annotation is omittetd / forgotten, whole use case is broken. Repository expects Id<Foo> but unspecified Id is given and no error is reported.
Code snippet that reproduces the problem
https://phpstan.org/r/b96abaaf-99b2-48d5-bb1a-f29462bfe337
Expected output
- line 38 - Template Tpl is not specified
- line 39 - Parameter Require nette/di 2.3.6 for PHP7 typehints support #1 $fooId of method FooRepository::load() expects Id, nonspecified Id given.
Reactions are currently unavailable