| Conditions | 3 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function compare(ReflectionProperty $fromProperty, ReflectionProperty $toProperty) : Changes |
||
| 23 | { |
||
| 24 | if ($fromProperty->isPrivate()) { |
||
| 25 | return Changes::new(); |
||
| 26 | } |
||
| 27 | |||
| 28 | $fromPropertyDefaultValue = $fromProperty->getDefaultValue(); |
||
| 29 | $toPropertyDefaultValue = $toProperty->getDefaultValue(); |
||
| 30 | |||
| 31 | if ($fromPropertyDefaultValue === $toPropertyDefaultValue) { |
||
| 32 | return Changes::new(); |
||
| 33 | } |
||
| 34 | |||
| 35 | return Changes::fromArray([ |
||
| 36 | Change::changed( |
||
| 37 | sprintf( |
||
| 38 | 'Property %s changed default value from %s to %s', |
||
| 39 | $this->formatProperty->__invoke($fromProperty), |
||
| 40 | var_export($fromPropertyDefaultValue, true), |
||
| 41 | var_export($toPropertyDefaultValue, true) |
||
| 42 | ), |
||
| 43 | true |
||
| 44 | ) |
||
| 48 |