Total Complexity | 2 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
8 | class BlockDirective extends Directive |
||
9 | { |
||
10 | |||
11 | protected $extensions = [ |
||
12 | 'reset' => Blocks::RESET, |
||
13 | 'append' => Blocks::APPEND, |
||
14 | 'prepend' => Blocks::PREPEND, |
||
15 | ]; |
||
16 | |||
17 | /** |
||
18 | * @return string |
||
19 | */ |
||
20 | 1 | public function render(): string |
|
21 | { |
||
22 | 1 | $name = $this->data['name']['lexer']['fragment']; |
|
23 | 1 | $type = $this->data['type']['lexer']['fragment'] ?? 'reset'; |
|
24 | |||
25 | 1 | return '<?php $this->ext->blocks()->start(\'' . $name . '\', \'' . $this->extensions[$type] . '\')?>'; |
|
26 | } |
||
27 | |||
28 | /** |
||
29 | * @return string |
||
30 | */ |
||
31 | 1 | public function endDirective(): string |
|
34 | } |
||
35 | |||
37 |