| 1 | <?php |
||
| 21 | class Generator implements LoggerAwareInterface |
||
| 22 | { |
||
| 23 | use LoggerAwareTrait; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var Reflection |
||
| 27 | */ |
||
| 28 | private $reflection; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Generator constructor. |
||
| 32 | * @param Reflection $reflection |
||
| 33 | */ |
||
| 34 | public function __construct(Reflection $reflection) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param Readable $file |
||
| 41 | * @param iterable $ir |
||
| 42 | * @return Document |
||
| 43 | */ |
||
| 44 | public function generate(Readable $file, iterable $ir): Document |
||
| 54 | } |
||
| 55 |
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.