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
 accept 100.00% 1 / 1 100.00% 1 / 1 1
 reject 100.00% 1 / 1 100.00% 1 / 1 1
7final readonly class ComponentCommandAnswer
8{
9    private function __construct(
10        public string $commandId,
11        public bool $accepted,
12        public ?string $message,
13    ) {}
14
15    public static function accept(string $commandId): self
16    {
17        return new self($commandId, true, null);
18    }
19
20    public static function reject(string $commandId, string $message): self
21    {
22        return new self($commandId, false, $message);
23    }
24}