@@ 10-40 (lines=31) @@ | ||
7 | /** |
|
8 | * Class DocumentTokenParser. |
|
9 | */ |
|
10 | class DocumentTokenParser extends BaseTokenParser |
|
11 | { |
|
12 | /** |
|
13 | * {@inheritdoc} |
|
14 | */ |
|
15 | public function configureParameters(\Twig_Token $token): array |
|
16 | { |
|
17 | return [ |
|
18 | 'properties' => [ |
|
19 | 'type' => self::PARAMETER_TYPE_ARRAY, |
|
20 | 'default' => new \Twig_Node_Expression_Array([], $token->getLine()), |
|
21 | ], |
|
22 | ]; |
|
23 | } |
|
24 | ||
25 | /** |
|
26 | * {@inheritdoc} |
|
27 | */ |
|
28 | public function createNode(array $nodes = [], int $lineNo = 0): \Twig_Node |
|
29 | { |
|
30 | return new DocumentNode($nodes, $this->getAttributes(), $lineNo, $this->getTag()); |
|
31 | } |
|
32 | ||
33 | /** |
|
34 | * {@inheritdoc} |
|
35 | */ |
|
36 | public function getTag() |
|
37 | { |
|
38 | return 'xlsdocument'; |
|
39 | } |
|
40 | } |
|
41 |
@@ 10-40 (lines=31) @@ | ||
7 | /** |
|
8 | * Class RowTokenParser. |
|
9 | */ |
|
10 | class RowTokenParser extends BaseTokenParser |
|
11 | { |
|
12 | /** |
|
13 | * {@inheritdoc} |
|
14 | */ |
|
15 | public function configureParameters(\Twig_Token $token): array |
|
16 | { |
|
17 | return [ |
|
18 | 'index' => [ |
|
19 | 'type' => self::PARAMETER_TYPE_VALUE, |
|
20 | 'default' => new \Twig_Node_Expression_Constant(null, $token->getLine()), |
|
21 | ], |
|
22 | ]; |
|
23 | } |
|
24 | ||
25 | /** |
|
26 | * {@inheritdoc} |
|
27 | */ |
|
28 | public function createNode(array $nodes = [], int $lineNo = 0): \Twig_Node |
|
29 | { |
|
30 | return new RowNode($nodes, $this->getAttributes(), $lineNo, $this->getTag()); |
|
31 | } |
|
32 | ||
33 | /** |
|
34 | * {@inheritdoc} |
|
35 | */ |
|
36 | public function getTag() |
|
37 | { |
|
38 | return 'xlsrow'; |
|
39 | } |
|
40 | } |
|
41 |