| @@ 8-34 (lines=27) @@ | ||
| 5 | /** |
|
| 6 | * Class DrawingNode. |
|
| 7 | */ |
|
| 8 | class DrawingNode extends BaseNode |
|
| 9 | { |
|
| 10 | /** |
|
| 11 | * @param \Twig_Compiler $compiler |
|
| 12 | */ |
|
| 13 | public function compile(\Twig_Compiler $compiler) |
|
| 14 | { |
|
| 15 | $compiler->addDebugInfo($this) |
|
| 16 | ->write(self::CODE_FIX_CONTEXT) |
|
| 17 | ->write(self::CODE_INSTANCE.'->startDrawing(') |
|
| 18 | ->subcompile($this->getNode('path'))->raw(', ') |
|
| 19 | ->subcompile($this->getNode('properties')) |
|
| 20 | ->raw(');'.PHP_EOL) |
|
| 21 | ->write(self::CODE_INSTANCE.'->endDrawing();'.PHP_EOL); |
|
| 22 | } |
|
| 23 | ||
| 24 | /** |
|
| 25 | * {@inheritdoc} |
|
| 26 | */ |
|
| 27 | public function getAllowedParents(): array |
|
| 28 | { |
|
| 29 | return [ |
|
| 30 | SheetNode::class, |
|
| 31 | AlignmentNode::class, |
|
| 32 | ]; |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||
| @@ 8-34 (lines=27) @@ | ||
| 5 | /** |
|
| 6 | * Class RowNode. |
|
| 7 | */ |
|
| 8 | class RowNode extends BaseNode |
|
| 9 | { |
|
| 10 | /** |
|
| 11 | * @param \Twig_Compiler $compiler |
|
| 12 | */ |
|
| 13 | public function compile(\Twig_Compiler $compiler) |
|
| 14 | { |
|
| 15 | $compiler->addDebugInfo($this) |
|
| 16 | ->write(self::CODE_FIX_CONTEXT) |
|
| 17 | ->write(self::CODE_INSTANCE.'->startRow(') |
|
| 18 | ->subcompile($this->getNode('index')) |
|
| 19 | ->raw(');'.PHP_EOL) |
|
| 20 | ->subcompile($this->getNode('body')) |
|
| 21 | ->addDebugInfo($this) |
|
| 22 | ->write(self::CODE_INSTANCE.'->endRow();'.PHP_EOL); |
|
| 23 | } |
|
| 24 | ||
| 25 | /** |
|
| 26 | * {@inheritdoc} |
|
| 27 | */ |
|
| 28 | public function getAllowedParents(): array |
|
| 29 | { |
|
| 30 | return [ |
|
| 31 | SheetNode::class, |
|
| 32 | ]; |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||