1 | <?php declare(strict_types = 1); |
||
8 | class MessageResolver implements EmailPartResolver |
||
9 | { |
||
10 | /** |
||
11 | * {@inheritdoc} |
||
12 | */ |
||
13 | 3 | public function addPart(Email $email, EmailPart $part) |
|
19 | |||
20 | /** |
||
21 | * Resolve the body of the message. |
||
22 | * |
||
23 | * @return string |
||
24 | */ |
||
25 | 3 | private function resolveBody(Message $part) |
|
34 | } |
||
35 |
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.