1 | <?php |
||
31 | class PostEventSourced extends Post implements EventSourcedAggregateRootInterface |
||
32 | { |
||
33 | use EventSourcedAggregateRoot; |
||
34 | |||
35 | /** |
||
36 | * Post constructor. |
||
37 | * |
||
38 | * @param PostId $id |
||
39 | * @param string $title |
||
40 | * @param string $content |
||
41 | */ |
||
42 | public function __construct(PostId $id, $title, $content) |
||
50 | |||
51 | /** |
||
52 | * @param $newTitle |
||
53 | */ |
||
54 | public function changeTitle($newTitle) |
||
60 | |||
61 | /** |
||
62 | * Publish a post. |
||
63 | */ |
||
64 | public function publish() |
||
70 | |||
71 | /** |
||
72 | * Unpublish a post. |
||
73 | */ |
||
74 | public function unpublish() |
||
80 | |||
81 | /** |
||
82 | * Publish a post. |
||
83 | */ |
||
84 | public function remove() |
||
90 | |||
91 | /** |
||
92 | * @param PostWasCreated $event |
||
93 | */ |
||
94 | protected function applyPostWasCreated(PostWasCreated $event) |
||
99 | |||
100 | /** |
||
101 | * @param PostTitleWasChanged $event |
||
102 | */ |
||
103 | protected function applyPostTitleWasChanged(PostTitleWasChanged $event) |
||
107 | |||
108 | /** |
||
109 | * @param PostWasPublished $event |
||
110 | */ |
||
111 | protected function applyPostWasPublished(PostWasPublished $event) |
||
115 | |||
116 | /** |
||
117 | * @param PostWasUnPublished $event |
||
118 | */ |
||
119 | protected function applyPostWasUnPublished(PostWasUnPublished $event) |
||
123 | } |
||
124 |
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.