Lines
0.00%
0 / 6
Methods
0.00%
0 / 6
Classes
0.00%
0 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| listEntityDomains | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| listServiceDomains | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| countEntities | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| countAttributes | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| countServices | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| 13 | final readonly class GenerationModel | |
| 14 | { | |
| 15 | /** @param list<GenerationWarning> $warnings */ | |
| 16 | public function __construct( | |
| 17 | public DomainModelCollection $domains, | |
| 18 | public EntityIdCollection $entityIds, | |
| 19 | public EntityIdCollection $ignoredEntityIds, | |
| 20 | public array $warnings, | |
| 21 | public AreaIdCollection $areaIds, | |
| 22 | public FloorIdCollection $floorIds, | |
| 23 | public LabelIdCollection $labelIds, | |
| 24 | ) {} | |
| 25 | ||
| 26 | public function listEntityDomains(): DomainModelCollection | |
| 27 | { | |
| 28 | return $this->domains->havingEntities(); | |
| 29 | } | |
| 30 | ||
| 31 | public function listServiceDomains(): DomainModelCollection | |
| 32 | { | |
| 33 | return $this->domains->havingServices(); | |
| 34 | } | |
| 35 | ||
| 36 | public function countEntities(): int | |
| 37 | { | |
| 38 | return \count($this->entityIds); | |
| 39 | } | |
| 40 | ||
| 41 | public function countAttributes(): int | |
| 42 | { | |
| 43 | return $this->listEntityDomains()->countAttributes(); | |
| 44 | } | |
| 45 | ||
| 46 | public function countServices(): int | |
| 47 | { | |
| 48 | return array_sum($this->domains->mapToList(static fn(DomainModel $domain): int => \count($domain->services))); | |
| 49 | } | |
| 50 | } |