| Total Complexity | 5 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | final class InterfaceBecameClass implements InterfaceBased |
||
| 17 | { |
||
| 18 | public function __invoke(ReflectionClass $fromInterface, ReflectionClass $toInterface) : Changes |
||
| 19 | { |
||
| 20 | if (! $this->isClass($toInterface) || ! $fromInterface->isInterface()) { |
||
| 21 | // checking whether a class became an interface is done in `ClassBecameInterface` |
||
| 22 | return Changes::empty(); |
||
| 23 | } |
||
| 24 | |||
| 25 | return Changes::fromList(Change::changed( |
||
| 26 | sprintf('Interface %s became a class', $fromInterface->getName()), |
||
| 27 | true |
||
| 28 | )); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * According to the current state of the PHP ecosystem, we only have traits, interfaces and classes |
||
| 33 | */ |
||
| 34 | private function isClass(ReflectionClass $class) : bool |
||
| 37 | } |
||
| 38 | } |
||
| 39 |