1 | <?php |
||
19 | class ItemDiffer implements EntityDifferStrategy { |
||
20 | |||
21 | /** |
||
22 | * @var MapDiffer |
||
23 | */ |
||
24 | private $recursiveMapDiffer; |
||
25 | |||
26 | /** |
||
27 | * @var StatementListDiffer |
||
28 | */ |
||
29 | private $statementListDiffer; |
||
30 | |||
31 | 6 | public function __construct() { |
|
35 | |||
36 | /** |
||
37 | * @param string $entityType |
||
38 | * |
||
39 | * @return bool |
||
40 | */ |
||
41 | public function canDiffEntityType( $entityType ) { |
||
44 | |||
45 | /** |
||
46 | * @param EntityDocument $from |
||
47 | * @param EntityDocument $to |
||
48 | * |
||
49 | * @return ItemDiff |
||
50 | * @throws InvalidArgumentException |
||
51 | */ |
||
52 | 4 | public function diffEntities( EntityDocument $from, EntityDocument $to ) { |
|
58 | |||
59 | 4 | private function assertIsItem( EntityDocument $item ) { |
|
64 | |||
65 | 6 | public function diffItems( Item $from, Item $to ) { |
|
75 | |||
76 | 6 | private function toDiffArray( Item $item ) { |
|
86 | |||
87 | 6 | private function getSiteLinksInDiffFormat( SiteLinkList $siteLinks ) { |
|
104 | |||
105 | 6 | /** |
|
106 | * @param EntityDocument $entity |
||
107 | * |
||
108 | * @return ItemDiff |
||
109 | * @throws InvalidArgumentException |
||
110 | */ |
||
111 | public function getConstructionDiff( EntityDocument $entity ) { |
||
115 | 2 | ||
116 | 2 | /** |
|
117 | * @param EntityDocument $entity |
||
118 | * |
||
119 | * @return ItemDiff |
||
120 | * @throws InvalidArgumentException |
||
121 | */ |
||
122 | public function getDestructionDiff( EntityDocument $entity ) { |
||
126 | 1 | ||
127 | } |
||
128 |
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.