1 | <?php |
||
28 | class PublishedPostProjector extends Projector |
||
29 | { |
||
30 | /** |
||
31 | * @param PostWasCreated $event |
||
32 | * |
||
33 | * @return PublishedPost |
||
34 | */ |
||
35 | public function projectPostWasCreated(PostWasCreated $event) |
||
42 | |||
43 | /** |
||
44 | * @param PostTitleWasChanged $event |
||
45 | * @param PublishedPost $readModel |
||
46 | */ |
||
47 | public function projectPostTitleWasChanged(PostTitleWasChanged $event, PublishedPost $readModel) |
||
51 | |||
52 | /** |
||
53 | * @param EventStream $eventStream |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | protected function shouldBeProjected(EventStream $eventStream) |
||
68 | |||
69 | /** |
||
70 | * @param EventStream $eventStream |
||
71 | * |
||
72 | * @return bool |
||
73 | */ |
||
74 | protected function shouldBeRemoved(EventStream $eventStream) |
||
85 | |||
86 | /** |
||
87 | * @return string |
||
88 | */ |
||
89 | protected function writeModelClass() |
||
93 | } |
||
94 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.