1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace hanneskod\readmetester\Compiler; |
||
6 | |||
7 | use hanneskod\readmetester\Example\ExampleStoreInterface; |
||
8 | |||
9 | final class MultipassCompiler implements CompilerInterface |
||
10 | { |
||
11 | /** |
||
12 | * @param array<CompilerPassInterface> $compilerPasses |
||
13 | */ |
||
14 | public function __construct( |
||
15 | private CompilerInterface $decoratedCompiler, |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
16 | private array $compilerPasses = [], |
||
17 | ) {} |
||
18 | |||
19 | public function compile(iterable $inputs): ExampleStoreInterface |
||
20 | { |
||
21 | $store = $this->decoratedCompiler->compile($inputs); |
||
22 | |||
23 | foreach ($this->compilerPasses as $pass) { |
||
24 | $store = $pass->process($store); |
||
25 | } |
||
26 | |||
27 | return $store; |
||
28 | } |
||
29 | } |
||
30 |