1 | <?php |
||
20 | class MissingObjectTripleNodeSimplifier implements NodeSimplifier { |
||
21 | |||
22 | /** |
||
23 | * @var ResourceListNodeParser |
||
24 | */ |
||
25 | private $resourceListNodeParser; |
||
26 | |||
27 | /** |
||
28 | * @var ResourceListForEntityProperty |
||
29 | */ |
||
30 | private $resourceListForEntityProperty; |
||
31 | |||
32 | /** |
||
33 | * @param ResourceListNodeParser $resourceListNodeParser |
||
34 | * @param ResourceListForEntityProperty $resourceListForEntityProperty |
||
35 | */ |
||
36 | 13 | public function __construct(ResourceListNodeParser $resourceListNodeParser, ResourceListForEntityProperty $resourceListForEntityProperty) { |
|
40 | |||
41 | /** |
||
42 | * @see NodeSimplifier::isSimplifierFor |
||
43 | */ |
||
44 | 12 | public function isSimplifierFor(AbstractNode $node) { |
|
50 | |||
51 | /** |
||
52 | * @see NodeSimplifier::doSimplification |
||
53 | */ |
||
54 | 7 | public function simplify(AbstractNode $node) { |
|
61 | |||
62 | 4 | private function doSimplification(TripleNode $node) { |
|
76 | |||
77 | 4 | protected function getNodesForObject(WikibaseResourceNode $subject, WikibaseResourceNode $predicate) { |
|
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.