1 | <?php |
||
18 | class PropertyDiffer implements EntityDifferStrategy { |
||
19 | |||
20 | /** |
||
21 | * @var MapDiffer |
||
22 | */ |
||
23 | private $recursiveMapDiffer; |
||
24 | |||
25 | /** |
||
26 | * @var StatementListDiffer |
||
27 | */ |
||
28 | private $statementListDiffer; |
||
29 | |||
30 | public function __construct() { |
||
34 | 3 | ||
35 | /** |
||
36 | * @param string $entityType |
||
37 | * |
||
38 | * @return bool |
||
39 | */ |
||
40 | public function canDiffEntityType( $entityType ) { |
||
43 | |||
44 | /** |
||
45 | * @param EntityDocument $from |
||
46 | * @param EntityDocument $to |
||
47 | * |
||
48 | * @return EntityDiff |
||
49 | * @throws InvalidArgumentException |
||
50 | */ |
||
51 | public function diffEntities( EntityDocument $from, EntityDocument $to ) { |
||
57 | |||
58 | private function assertIsProperty( EntityDocument $property ) { |
||
63 | 2 | ||
64 | public function diffProperties( Property $from, Property $to ) { |
||
74 | |||
75 | /** |
||
76 | * @param array[] $from |
||
77 | * @param array[] $to |
||
78 | * |
||
79 | * @return DiffOp[] |
||
80 | */ |
||
81 | private function diffPropertyArrays( array $from, array $to ) { |
||
84 | |||
85 | /** |
||
86 | * @param Property $property |
||
87 | * |
||
88 | * @return array[] |
||
89 | */ |
||
90 | private function toDiffArray( Property $property ) { |
||
99 | |||
100 | /** |
||
101 | * @param EntityDocument $entity |
||
102 | * |
||
103 | * @return EntityDiff |
||
104 | * @throws InvalidArgumentException |
||
105 | */ |
||
106 | public function getConstructionDiff( EntityDocument $entity ) { |
||
115 | |||
116 | /** |
||
117 | * @param EntityDocument $entity |
||
118 | * |
||
119 | * @return EntityDiff |
||
120 | * @throws InvalidArgumentException |
||
121 | */ |
||
122 | public function getDestructionDiff( EntityDocument $entity ) { |
||
131 | |||
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.