| Conditions | 3 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function compare(ReflectionMethod $fromMethod, ReflectionMethod $toMethod) : Changes |
||
| 19 | { |
||
| 20 | if ($fromMethod->isPrivate()) { |
||
| 21 | return Changes::new(); |
||
| 22 | } |
||
| 23 | |||
| 24 | $scopeFrom = $this->methodScope($fromMethod); |
||
| 25 | $scopeTo = $this->methodScope($toMethod); |
||
| 26 | |||
| 27 | if ($scopeFrom === $scopeTo) { |
||
| 28 | return Changes::new(); |
||
| 29 | } |
||
| 30 | |||
| 31 | return Changes::fromArray([Change::changed( |
||
| 32 | sprintf( |
||
| 33 | 'Method %s() of class %s changed scope from %s to %s', |
||
| 34 | $fromMethod->getName(), |
||
| 35 | $fromMethod->getDeclaringClass()->getName(), |
||
| 36 | $scopeFrom, |
||
| 37 | $scopeTo |
||
| 38 | ), |
||
| 39 | true |
||
| 40 | )]); |
||
| 48 |