| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function compare(ReflectionProperty $fromProperty, ReflectionProperty $toProperty) : Changes |
||
| 21 | { |
||
| 22 | $visibilityFrom = $this->propertyVisibility($fromProperty); |
||
| 23 | $visibilityTo = $this->propertyVisibility($toProperty); |
||
| 24 | |||
| 25 | if ($visibilityFrom <= $visibilityTo) { |
||
| 26 | return Changes::new(); |
||
| 27 | } |
||
| 28 | |||
| 29 | return Changes::fromArray([Change::changed( |
||
| 30 | sprintf( |
||
| 31 | 'Property %s#$%s visibility reduced from %s to %s', |
||
| 32 | $fromProperty->getDeclaringClass()->getName(), |
||
| 33 | $fromProperty->getName(), |
||
| 34 | $visibilityFrom, |
||
| 35 | $visibilityTo |
||
| 36 | ), |
||
| 37 | true |
||
| 38 | )]); |
||
| 54 |