| 1 | <?php declare(strict_types = 1); |
||
| 7 | class SubjectResolver implements EmailPartResolver |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * {@inheritdoc} |
||
| 11 | */ |
||
| 12 | 3 | public function addPart(Email $email, EmailPart $part) |
|
| 17 | |||
| 18 | /** |
||
| 19 | * Resolve the subject. |
||
| 20 | * |
||
| 21 | * @return string |
||
| 22 | */ |
||
| 23 | 3 | private function resolveSubject(Subject $part) |
|
| 32 | } |
||
| 33 |
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.