1 | <?php |
||
29 | class Builder implements LoggerAwareInterface |
||
30 | { |
||
31 | use LoggerAwareTrait; |
||
32 | |||
33 | /** |
||
34 | * @var SystemManager |
||
35 | */ |
||
36 | private $systems; |
||
37 | |||
38 | /** |
||
39 | * @var Pipeline |
||
40 | */ |
||
41 | private $pipeline; |
||
42 | |||
43 | /** |
||
44 | * Process constructor. |
||
45 | */ |
||
46 | 119 | public function __construct() |
|
51 | |||
52 | /** |
||
53 | * @param Reflection $root |
||
54 | * @param Readable $file |
||
55 | * @param RuleInterface $ast |
||
56 | * @return Document |
||
57 | */ |
||
58 | 119 | public function run(Reflection $root, Readable $file, RuleInterface $ast): Document |
|
83 | |||
84 | /** |
||
85 | * @param RuleInterface $rule |
||
86 | * @param DefinitionInterface $parent |
||
87 | * @return DefinitionInterface |
||
88 | */ |
||
89 | 119 | public function build(RuleInterface $rule, DefinitionInterface $parent): DefinitionInterface |
|
93 | |||
94 | /** |
||
95 | * @param ProvidesDefinition|RuleInterface $rule |
||
96 | * @param DefinitionInterface $parent |
||
97 | * @return DefinitionInterface |
||
98 | * @throws CompilerException |
||
99 | */ |
||
100 | 119 | private function buildDefinition(RuleInterface $rule, DefinitionInterface $parent): DefinitionInterface |
|
119 | |||
120 | /** |
||
121 | * Sets a logger instance on the object. |
||
122 | * @param LoggerInterface $logger |
||
123 | * @return void |
||
124 | */ |
||
125 | public function setLogger(LoggerInterface $logger): void |
||
132 | } |
||
133 |
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.