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