Lines 100.00% 3 / 3
Methods 100.00% 3 / 3
Classes 100.00% 1 / 1
Name Lines Methods CRAP
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
 admitsApp 100.00% 1 / 1 100.00% 1 / 1 2
 tracesApp 100.00% 1 / 1 100.00% 1 / 1 1
10final readonly class AppSelection
11{
12    public function __construct(
13        public ?AppIdCollection $onlyIds = null,
14        public ?AppIdCollection $tracedIds = null,
15    ) {}
16
17    public function admitsApp(AppId $appId, bool $enabled): bool
18    {
19        return $this->onlyIds === null ? $enabled : $this->onlyIds->containsId($appId);
20    }
21
22    public function tracesApp(AppId $appId): bool
23    {
24        return $this->tracedIds?->containsId($appId) ?? false;
25    }
26}