Lines 100.00% 5 / 5
Methods 100.00% 2 / 2
Classes 100.00% 1 / 1
Name Lines Methods CRAP
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
 fromSection 100.00% 4 / 4 100.00% 1 / 1 1
10final readonly class ControlConfig
11{
12    public function __construct(
13        public ?ControlAddress $listen,
14        #[SensitiveParameter]
15        public ?string $token,
16    ) {}
17
18    /** @throws ConfigurationException */
19    public static function fromSection(#[SensitiveParameter] ConfigSection $control): self
20    {
21        return new self(
22            listen: $control->findSwitchableValue('listen', ControlAddress::parse(...)),
23            token: $control->findSwitchableValue('token', strval(...)),
24        );
25    }
26}