| Total Complexity | 6 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | trait TypedClassPrinterTrait |
||
| 8 | { |
||
| 9 | protected string $type; |
||
| 10 | |||
| 11 | protected bool $isDoingTypeMatch = false; |
||
| 12 | |||
| 13 | public function printFromType(): string |
||
| 22 | } |
||
| 23 | |||
| 24 | protected function getSignaturesFromType(): array |
||
| 39 | } |
||
| 40 | |||
| 41 | protected function matchTraitsToType(array $traits, array $map) |
||
| 42 | { |
||
| 43 | $extensions = array_values(class_implements($this->type)); |
||
| 44 | |||
| 45 | return array_filter( |
||
| 46 | $traits, |
||
| 47 | fn ($partial) => in_array($map[$partial], $extensions) |
||
| 48 | ); |
||
| 49 | } |
||
| 50 | |||
| 51 | protected function isDoingTypeMatch(): bool |
||
| 54 | } |
||
| 55 | |||
| 56 | abstract protected function print(array $methods): string; |
||
| 57 | |||
| 58 | abstract protected function getDefaultSignatures(): array; |
||
| 59 | } |
||
| 60 |