| Total Complexity | 5 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | final class TraitBecameClass implements TraitBased |
||
| 17 | { |
||
| 18 | public function __invoke(ReflectionClass $fromTrait, ReflectionClass $toTrait) : Changes |
||
| 19 | { |
||
| 20 | if ($this->isClass($fromTrait) || ! $this->isClass($toTrait)) { |
||
| 21 | return Changes::empty(); |
||
| 22 | } |
||
| 23 | |||
| 24 | return Changes::fromList(Change::changed( |
||
| 25 | sprintf('Trait %s became a class', $fromTrait->getName()), |
||
| 26 | true |
||
| 27 | )); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * According to the current state of the PHP ecosystem, we only have traits, interfaces and classes |
||
| 32 | */ |
||
| 33 | private function isClass(ReflectionClass $class) : bool |
||
| 36 | } |
||
| 37 | } |
||
| 38 |