Completed
Push — master ( c26f0f...c7af1e )
by Konstantinos
18:52
created

TwigExtension   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 10

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 5
c 3
b 0
f 1
lcom 0
cbo 10
dl 0
loc 57
ccs 0
cts 23
cp 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getFilters() 0 10 1
A getFunctions() 0 7 1
A getTests() 0 7 1
A getName() 0 4 1
A getOperators() 0 10 1
1
<?php
2
3
namespace BZIon\Twig;
4
5
/**
6
 * A twig global that provides information about the app
7
 */
8
class TwigExtension extends \Twig_Extension
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function getFilters()
14
    {
15
        return array(
16
            HumanDateFilter::get(),
17
            TruncateFilter::get(),
18
            MarkdownFilter::get(),
19
            PluralFilter::get(),
20
            YesNoFilter::get()
21
        );
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function getFunctions()
28
    {
29
        return array(
30
            LinkToFunction::get(),
31
            UrlModifyFunction::get()
32
        );
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function getTests()
39
    {
40
        return array(
41
            ValidTest::get(),
42
            InvalidTest::get()
43
        );
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public function getName()
50
    {
51
        return 'bzion_extension';
52
    }
53
54
    public function getOperators()
55
    {
56
        return array(
57
            array(),
58
            array(
59
                '~~'  => array('precedence' => 20, 'class' => '\BZIon\Twig\ModelEqualityOperator', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
60
                '~/~' => array('precedence' => 20, 'class' => '\BZIon\Twig\ModelInequalityOperator', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
61
            ),
62
        );
63
    }
64
}
65