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