Total Complexity | 4 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
10 | final class LazyRunner implements Runner |
||
11 | { |
||
12 | private ?Runner $runner = null; |
||
13 | |||
14 | private RunnerFactory $factory; |
||
15 | |||
16 | 7 | public function __construct(RunnerFactory $factory) |
|
17 | { |
||
18 | 7 | $this->factory = $factory; |
|
19 | } |
||
20 | |||
21 | /** |
||
22 | * @throws ContainerExceptionInterface |
||
23 | * @throws NotFoundExceptionInterface |
||
24 | */ |
||
25 | 3 | public function run(Command $command): int |
|
26 | { |
||
27 | 3 | return $this->runner()->run($command); |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * @throws ContainerExceptionInterface |
||
32 | * @throws NotFoundExceptionInterface |
||
33 | */ |
||
34 | 3 | private function runner(): Runner |
|
41 | } |
||
42 | } |
||
43 |