| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function compare(ReflectionClass $fromClass, ReflectionClass $toClass) : Changes |
||
| 25 | { |
||
| 26 | $propertiesFrom = $fromClass->getProperties(); |
||
| 27 | $propertiesTo = $toClass->getProperties(); |
||
| 28 | $commonProperties = array_intersect_key($propertiesFrom, $propertiesTo); |
||
| 29 | |||
| 30 | return array_reduce( |
||
| 31 | array_keys($commonProperties), |
||
| 32 | function (Changes $accumulator, string $propertyName) use ($propertiesFrom, $propertiesTo) : Changes { |
||
| 33 | return $accumulator->mergeWith($this->checkProperty->compare( |
||
| 34 | $propertiesFrom[$propertyName], |
||
| 35 | $propertiesTo[$propertyName] |
||
| 36 | )); |
||
| 37 | }, |
||
| 38 | Changes::new() |
||
| 39 | ); |
||
| 42 |