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