Completed
Push — master ( c7af1e...46d491 )
by Konstantinos
06:03 queued 02:12
created

TwigExtension   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 10

Test Coverage

Coverage 100%

Importance

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

5 Methods

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