Lines 100.00% 6 / 6
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% 5 / 5 100.00% 1 / 1 1
10final readonly class GitDeployConfig
11{
12    public function __construct(
13        public OptionalDuration $poll,
14        public Duration $prepareTimeout,
15    ) {}
16
17    /** @throws ConfigurationException */
18    public static function fromSection(ConfigSection $git): self
19    {
20        $oneSecond = Duration::seconds(1);
21
22        return new self(
23            poll: $git->readOptionalDuration('poll', $oneSecond),
24            prepareTimeout: $git->readDuration('prepare_timeout', $oneSecond),
25        );
26    }
27}