Total Complexity | 9 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class NodeBuilder implements NodeBuilderInterface, DirectorInterface |
||
9 | { |
||
10 | |||
11 | /** |
||
12 | * @var BuilderInterface[] |
||
13 | */ |
||
14 | protected $builders; |
||
15 | |||
16 | /** |
||
17 | * NodeBuilder constructor. |
||
18 | * |
||
19 | * @param BuilderInterface[] $builders |
||
20 | */ |
||
21 | public function __construct($builders) |
||
22 | { |
||
23 | foreach ($builders as $builder) { |
||
24 | $builder->setDirector($this); |
||
25 | } |
||
26 | |||
27 | $this->builders = $builders; |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @param array $ast |
||
32 | * @return NodeInterface |
||
33 | * @throws LanguageException |
||
34 | */ |
||
35 | public function build(array $ast): NodeInterface |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * @param string $kind |
||
52 | * @return BuilderInterface|null |
||
53 | */ |
||
54 | protected function getBuilder(string $kind): ?BuilderInterface |
||
65 |