Conditions | 3 |
Paths | 3 |
Total Lines | 23 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function compare(ReflectionProperty $fromProperty, ReflectionProperty $toProperty) : Changes |
||
18 | { |
||
19 | if ($fromProperty->isPrivate()) { |
||
20 | return Changes::new(); |
||
21 | } |
||
22 | |||
23 | $fromScope = $this->scopeAsString($fromProperty); |
||
24 | $toScope = $this->scopeAsString($toProperty); |
||
25 | |||
26 | if ($fromScope === $toScope) { |
||
27 | return Changes::new(); |
||
28 | } |
||
29 | |||
30 | return Changes::fromArray([ |
||
31 | Change::changed( |
||
32 | sprintf( |
||
33 | 'Property $%s of %s changed scope from %s to %s', |
||
34 | $fromProperty->getName(), |
||
35 | $fromProperty->getDeclaringClass()->getName(), |
||
36 | $fromScope, |
||
37 | $toScope |
||
38 | ), |
||
39 | true |
||
40 | ), |
||
49 |