1 | <?php |
||
19 | class SentenceNodeSimplifier implements NodeSimplifier { |
||
20 | |||
21 | /** |
||
22 | * @var ResourceListNodeParser |
||
23 | */ |
||
24 | private $resourceListNodeParser; |
||
25 | |||
26 | /** |
||
27 | * @param ResourceListNodeParser $resourceListNodeParser |
||
28 | */ |
||
29 | 4 | public function __construct(ResourceListNodeParser $resourceListNodeParser) { |
|
32 | |||
33 | /** |
||
34 | * @see NodeSimplifier::isSimplifierFor |
||
35 | */ |
||
36 | 3 | public function isSimplifierFor(AbstractNode $node) { |
|
39 | |||
40 | /** |
||
41 | * @see NodeSimplifier::doSimplification |
||
42 | */ |
||
43 | 1 | public function simplify(AbstractNode $node) { |
|
50 | |||
51 | public function doSimplification(SentenceNode $node) { |
||
57 | } |
||
58 |
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.