Conditions | 3 |
Paths | 3 |
Total Lines | 23 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function compare(ReflectionClassConstant $fromConstant, ReflectionClassConstant $toConstant) : Changes |
||
16 | { |
||
17 | if ($fromConstant->isPrivate()) { |
||
18 | return Changes::new(); |
||
19 | } |
||
20 | |||
21 | $fromValue = $fromConstant->getValue(); |
||
22 | $toValue = $toConstant->getValue(); |
||
23 | |||
24 | if ($fromValue === $toValue) { |
||
25 | return Changes::new(); |
||
26 | } |
||
27 | |||
28 | return Changes::fromArray([ |
||
29 | Change::changed( |
||
30 | sprintf( |
||
31 | 'Value of constant %s::%s changed from %s to %s', |
||
32 | $fromConstant->getDeclaringClass()->getName(), |
||
33 | $fromConstant->getName(), |
||
34 | var_export($fromValue, true), |
||
35 | var_export($toValue, true) |
||
36 | ), |
||
37 | true |
||
38 | ), |
||
42 |