@@ 10-44 (lines=35) @@ | ||
7 | /** |
|
8 | * Class CellTokenParser. |
|
9 | */ |
|
10 | class CellTokenParser 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 | 'properties' => [ |
|
23 | 'type' => self::PARAMETER_TYPE_ARRAY, |
|
24 | 'default' => new \Twig_Node_Expression_Array([], $token->getLine()), |
|
25 | ], |
|
26 | ]; |
|
27 | } |
|
28 | ||
29 | /** |
|
30 | * {@inheritdoc} |
|
31 | */ |
|
32 | public function createNode(array $nodes = [], int $lineNo = 0): \Twig_Node |
|
33 | { |
|
34 | return new CellNode($nodes, $this->getAttributes(), $lineNo, $this->getTag()); |
|
35 | } |
|
36 | ||
37 | /** |
|
38 | * {@inheritdoc} |
|
39 | */ |
|
40 | public function getTag() |
|
41 | { |
|
42 | return 'xlscell'; |
|
43 | } |
|
44 | } |
|
45 |
@@ 10-52 (lines=43) @@ | ||
7 | /** |
|
8 | * Class DrawingTokenParser. |
|
9 | */ |
|
10 | class DrawingTokenParser extends BaseTokenParser |
|
11 | { |
|
12 | /** |
|
13 | * {@inheritdoc} |
|
14 | */ |
|
15 | public function configureParameters(\Twig_Token $token): array |
|
16 | { |
|
17 | return [ |
|
18 | 'path' => [ |
|
19 | 'type' => self::PARAMETER_TYPE_VALUE, |
|
20 | 'default' => false, |
|
21 | ], |
|
22 | 'properties' => [ |
|
23 | 'type' => self::PARAMETER_TYPE_ARRAY, |
|
24 | 'default' => new \Twig_Node_Expression_Array([], $token->getLine()), |
|
25 | ], |
|
26 | ]; |
|
27 | } |
|
28 | ||
29 | /** |
|
30 | * {@inheritdoc} |
|
31 | */ |
|
32 | public function createNode(array $nodes = [], int $lineNo = 0): \Twig_Node |
|
33 | { |
|
34 | return new DrawingNode($nodes, $this->getAttributes(), $lineNo, $this->getTag()); |
|
35 | } |
|
36 | ||
37 | /** |
|
38 | * {@inheritdoc} |
|
39 | */ |
|
40 | public function getTag() |
|
41 | { |
|
42 | return 'xlsdrawing'; |
|
43 | } |
|
44 | ||
45 | /** |
|
46 | * {@inheritdoc} |
|
47 | */ |
|
48 | public function hasBody(): bool |
|
49 | { |
|
50 | return false; |
|
51 | } |
|
52 | } |
|
53 |
@@ 10-44 (lines=35) @@ | ||
7 | /** |
|
8 | * Class SheetTokenParser. |
|
9 | */ |
|
10 | class SheetTokenParser 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 | 'properties' => [ |
|
23 | 'type' => self::PARAMETER_TYPE_ARRAY, |
|
24 | 'default' => new \Twig_Node_Expression_Array([], $token->getLine()), |
|
25 | ], |
|
26 | ]; |
|
27 | } |
|
28 | ||
29 | /** |
|
30 | * {@inheritdoc} |
|
31 | */ |
|
32 | public function createNode(array $nodes = [], int $lineNo = 0): \Twig_Node |
|
33 | { |
|
34 | return new SheetNode($nodes, $this->getAttributes(), $lineNo, $this->getTag()); |
|
35 | } |
|
36 | ||
37 | /** |
|
38 | * {@inheritdoc} |
|
39 | */ |
|
40 | public function getTag() |
|
41 | { |
|
42 | return 'xlssheet'; |
|
43 | } |
|
44 | } |
|
45 |