Lines 100.00% 3 / 3
Functions and Methods 100.00% 2 / 2
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
DaemonLaunchOptions 100.00% 3 / 3 100.00% 2 / 2 4 100.00% 1 / 1
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
 listConfigOverrides 100.00% 2 / 2 100.00% 1 / 1 3
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Runtime\Broker;
6
7use Stewart\Runtime\App\AppSelection;
8
9final readonly class DaemonLaunchOptions
10{
11    public function __construct(
12        public ?string $configFile = null,
13        public AppSelection $selection = new AppSelection(),
14        public ?string $logLevel = null,
15        public bool $watch = false,
16        public bool $dryRun = false,
17    ) {}
18
19    /** @return array<string, mixed> */
20    public function listConfigOverrides(): array
21    {
22        $overrides = $this->logLevel === null ? [] : ['log_level' => $this->logLevel];
23
24        return $this->dryRun ? [...$overrides, 'ha_calls' => ['dry_run' => true]] : $overrides;
25    }
26}