TwigExtension   B
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 18

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 18
dl 0
loc 65
ccs 24
cts 24
cp 1
rs 7.3333
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getFunctions() 0 8 1
A getTests() 0 8 1
A getName() 0 4 1
A getOperators() 0 10 1
A getFilters() 0 16 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 1
    public function getFilters()
14
    {
15
        return array(
16 1
            ArrayValuesFilter::get(),
17 1
            DateArrayFormatter::get(),
18 1
            EvaluateFilter::get(),
19 1
            ExtendHashFilter::get(),
20 1
            HumanDateFilter::get(),
21 1
            NumberAbbreviation::get(),
22 1
            TruncateFilter::get(),
23 1
            MarkdownFilter::get(),
24 1
            CanonicalUrl::get(),
25 1
            PluralFilter::get(),
26
            YesNoFilter::get()
27
        );
28
    }
29
30
    /**
31
     * {@inheritdoc}
32 1
     */
33
    public function getFunctions()
34
    {
35 1
        return array(
36 1
            Ionicon::get(),
37
            LinkToFunction::get(),
38
            UrlModifyFunction::get()
39
        );
40
    }
41
42
    /**
43 1
     * {@inheritdoc}
44
     */
45
    public function getTests()
46 1
    {
47 1
        return array(
48 1
            ValidTest::get(),
49
            InvalidTest::get(),
50
            InstanceOfTest::get()
51
        );
52
    }
53
54
    /**
55 2
     * {@inheritdoc}
56
     */
57 2
    public function getName()
58
    {
59
        return 'bzion_extension';
60 1
    }
61
62
    public function getOperators()
63 1
    {
64
        return array(
65 1
            array(),
66 1
            array(
67
                '~~'  => array('precedence' => 20, 'class' => '\BZIon\Twig\ModelEqualityOperator', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
68
                '~/~' => array('precedence' => 20, 'class' => '\BZIon\Twig\ModelInequalityOperator', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
69
            ),
70
        );
71
    }
72
}
73