1 | <?php |
||
23 | class Builder implements LoggerAwareInterface |
||
24 | { |
||
25 | use LoggerAwareTrait; |
||
26 | |||
27 | /** |
||
28 | * @var GlobalContext |
||
29 | */ |
||
30 | private $context; |
||
31 | |||
32 | /** |
||
33 | * @var Reflection |
||
34 | */ |
||
35 | private $root; |
||
36 | |||
37 | /** |
||
38 | * Process constructor. |
||
39 | * @param Reflection $root |
||
40 | */ |
||
41 | public function __construct(Reflection $root) |
||
47 | |||
48 | /** |
||
49 | * @param Reflection $reflection |
||
50 | */ |
||
51 | private function exportTypes(Reflection $reflection): void |
||
61 | |||
62 | /** |
||
63 | * @param Readable $file |
||
64 | * @param iterable $opcodes |
||
65 | * @return Document|DocumentInterface |
||
66 | */ |
||
67 | public function run(Readable $file, iterable $opcodes): Document |
||
83 | } |
||
84 |
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.