XlsLeftTokenParser   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 28
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A parse() 0 11 1
A getTag() 0 4 1
1
<?php
2
3
namespace MewesK\TwigExcelBundle\Twig\TokenParser;
4
5
use MewesK\TwigExcelBundle\Twig\Node\XlsLeftNode;
6
use Twig_Token;
7
8
/**
9
 * Class XlsLeftTokenParser
10
 *
11
 * @package MewesK\TwigExcelBundle\Twig\TokenParser
12
 */
13
class XlsLeftTokenParser extends AbstractTokenParser
14
{
15
    /**
16
     * @param Twig_Token $token
17
     *
18
     * @return XlsLeftNode
19
     * @throws \Twig_Error_Syntax
20
     */
21
    public function parse(Twig_Token $token)
22
    {
23
        // parse attributes
24
        $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
25
26
        // parse body
27
        $body = $this->parseBody();
28
29
        // return node
30
        return new XlsLeftNode($body, $token->getLine(), $this->getTag());
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getTag()
37
    {
38
        return 'xlsleft';
39
    }
40
}
41