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

TwigExtension::getFilters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 10
ccs 0
cts 7
cp 0
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
crap 2
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