Lines 0.00% 0 / 14
Methods 0.00% 0 / 2
Classes 0.00% 0 / 1
Name Lines Methods CRAP
 __construct 0.00% 0 / 1 0.00% 0 / 1 2
 summary 0.00% 0 / 13 0.00% 0 / 1 2
10final readonly class GenerationReport
11{
12    /** @param list<GenerationWarning> $warnings */
13    public function __construct(
14        public FileChangeCollection $changes,
15        public int $entities,
16        public int $domains,
17        public int $services,
18        public int $ignored,
19        public int $attributes,
20        public array $warnings,
21        public string $haVersion,
22    ) {}
23
24    public function summary(): string
25    {
26        return \sprintf(
27            'entities: %d in %d domains · attributes: %d typed · services: %d · files created/updated/unchanged/deleted: %d/%d/%d/%d · ignored: %d · from Home Assistant %s',
28            $this->entities,
29            $this->domains,
30            $this->attributes,
31            $this->services,
32            $this->changes->countWithOutcome(FileOutcome::Created),
33            $this->changes->countWithOutcome(FileOutcome::Updated),
34            $this->changes->countWithOutcome(FileOutcome::Unchanged),
35            $this->changes->countWithOutcome(FileOutcome::Deleted),
36            $this->ignored,
37            $this->haVersion,
38        );
39    }
40}