| Conditions | 3 |
| Paths | 3 |
| Total Lines | 23 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function compare(ReflectionProperty $fromProperty, ReflectionProperty $toProperty) : Changes |
||
| 14 | { |
||
| 15 | if ($fromProperty->isPrivate()) { |
||
| 16 | return Changes::new(); |
||
| 17 | } |
||
| 18 | |||
| 19 | $fromPropertyDefaultValue = $fromProperty->getDefaultValue(); |
||
| 20 | $toPropertyDefaultValue = $toProperty->getDefaultValue(); |
||
| 21 | |||
| 22 | if ($fromPropertyDefaultValue === $toPropertyDefaultValue) { |
||
| 23 | return Changes::new(); |
||
| 24 | } |
||
| 25 | |||
| 26 | return Changes::fromArray([ |
||
| 27 | Change::changed( |
||
| 28 | sprintf( |
||
| 29 | 'Property %s::$%s changed default value from %s to %s', |
||
| 30 | $fromProperty->getDeclaringClass()->getName(), |
||
| 31 | $fromProperty->getName(), |
||
| 32 | var_export($fromPropertyDefaultValue, true), |
||
| 33 | var_export($toPropertyDefaultValue, true) |
||
| 34 | ), |
||
| 35 | true |
||
| 36 | ) |
||
| 40 |