Lines 0.00% 0 / 5
Methods 0.00% 0 / 4
Classes 0.00% 0 / 1
Name Lines Methods CRAP
 __construct 0.00% 0 / 1 0.00% 0 / 1 2
 passed 0.00% 0 / 1 0.00% 0 / 1 2
 failed 0.00% 0 / 2 0.00% 0 / 1 2
 hasPassed 0.00% 0 / 1 0.00% 0 / 1 2
14final readonly class ProjectCheckResult
15{
16    /** @param list<string> $errors */
17    private function __construct(
18        public array $errors,
19        public DiscoveryResult $discovered,
20        public AppCatalog $catalog,
21        public WorkerSlotCollection $workerSlots,
22        public ?CodegenConfig $codegen = null,
23        public ?string $httpListenerError = null,
24    ) {}
25
26    public static function passed(DiscoveryResult $discovered, AppCatalog $catalog, WorkerSlotCollection $workerSlots, CodegenConfig $codegen, ?string $httpListenerError): self
27    {
28        return new self([], $discovered, $catalog, $workerSlots, $codegen, $httpListenerError);
29    }
30
31    /** @param list<string> $errors */
32    public static function failed(array $errors): self
33    {
34        $none = AppIdCollection::empty();
35
36        return new self($errors, DiscoveryResult::createEmpty(), new AppCatalog(AppDefinitionCollection::keyedByAppId([]), $none, $none), WorkerSlotCollection::empty());
37    }
38
39    public function hasPassed(): bool
40    {
41        return $this->errors === [];
42    }
43}