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 | $constantsFrom = $fromClass->getReflectionConstants(); |
||
27 | $constantsTo = $toClass->getReflectionConstants(); |
||
28 | $commonConstants = array_intersect_key($constantsFrom, $constantsTo); |
||
29 | |||
30 | return array_reduce( |
||
31 | array_keys($commonConstants), |
||
32 | function (Changes $accumulator, string $constantName) use ($constantsFrom, $constantsTo) : Changes { |
||
33 | return $accumulator->mergeWith($this->checkConstant->compare( |
||
34 | $constantsFrom[$constantName], |
||
35 | $constantsTo[$constantName] |
||
36 | )); |
||
37 | }, |
||
38 | Changes::new() |
||
39 | ); |
||
42 |