Completed
Push — master ( 3785c8...e3dbba )
by Konstantinos
03:58
created

TwigExtension::getOperators()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 10
ccs 0
cts 0
cp 0
rs 9.4286
c 1
b 0
f 0
cc 1
eloc 6
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 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
        );
32
    }
33
34
    /**
35
     * @{inheritdoc}
36
     */
37 1
    public function getTests()
38
    {
39
        return array(
40 1
            ValidTest::get(),
41 1
            InvalidTest::get()
42
        );
43
    }
44
45
    /**
46
     * @{inheritdoc}
47
     */
48 1
    public function getName()
49
    {
50 1
        return 'bzion_extension';
51
    }
52
53
    public function getOperators()
54
    {
55
        return array(
56
            array(),
57
            array(
58
                '~~'  => array('precedence' => 20, 'class' => '\BZIon\Twig\ModelEqualityOperator', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
59
                '~/~' => array('precedence' => 20, 'class' => '\BZIon\Twig\ModelInequalityOperator', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
60
            ),
61
        );
62
    }
63
}
64