Lines
100.00%
5 / 5
Functions and Methods
100.00%
5 / 5
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ServicesRootEmitter | 100.00% | 5 / 5 | 100.00% | 5 / 5 | 5 | 100.00% | 1 / 1 | |||
| getClassName | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| getClassComment | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| listDomains | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| getDomainClassName | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| buildPropertyComment | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Codegen\Emitter; | |
| 6 | ||
| 7 | use Stewart\Codegen\Model\Collection\DomainModelCollection; | |
| 8 | use Stewart\Codegen\Model\DomainModel; | |
| 9 | use Stewart\Codegen\Model\GenerationModel; | |
| 10 | ||
| 11 | final readonly class ServicesRootEmitter extends RootEmitter | |
| 12 | { | |
| 13 | protected function getClassName(): string | |
| 14 | { | |
| 15 | return 'Services'; | |
| 16 | } | |
| 17 | ||
| 18 | protected function getClassComment(): string | |
| 19 | { | |
| 20 | return 'Every service Home Assistant offers, by domain.'; | |
| 21 | } | |
| 22 | ||
| 23 | protected function listDomains(GenerationModel $model): DomainModelCollection | |
| 24 | { | |
| 25 | return $model->listServiceDomains(); | |
| 26 | } | |
| 27 | ||
| 28 | protected function getDomainClassName(DomainModel $domain): string | |
| 29 | { | |
| 30 | return $domain->getServicesClass(); | |
| 31 | } | |
| 32 | ||
| 33 | protected function buildPropertyComment(string $domain): string | |
| 34 | { | |
| 35 | return \sprintf('Services in the `%s` domain.', $domain); | |
| 36 | } | |
| 37 | } |