Completed
Pull Request — 4.x (#75)
by AD
04:36
created

Basic   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 94.12%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 46
ccs 16
cts 17
cp 0.9412
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFilters() 0 15 1
A getFunctions() 0 6 1
A getName() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of TwigView.
5
 *
6
 ** (c) 2014 Cees-Jan Kiewiet
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace WyriHaximus\TwigView\Lib\Twig\Extension;
12
13
/**
14
 * Class Basic
15
 * @package WyriHaximus\TwigView\Lib\Twig\Extension
16
 */
17
class Basic extends \Twig_Extension
18
{
19
20
    /**
21
     * Get declared filters.
22
     *
23
     * @return \Twig_SimpleFilter[]
24
     */
25 4
    public function getFilters()
26
    {
27
        return [
28 4
            new \Twig_SimpleFilter('debug', 'debug'),
29 4
            new \Twig_SimpleFilter('pr', 'pr'),
30 4
            new \Twig_SimpleFilter('low', 'low'),
31 4
            new \Twig_SimpleFilter('up', 'up'),
32 4
            new \Twig_SimpleFilter('env', 'env'),
33 4
            new \Twig_SimpleFilter('count', 'count'),
34 4
            new \Twig_SimpleFilter('h', 'h'),
35 4
            new \Twig_SimpleFilter('null', function () {
36
                return '';
37 4
            }),
38 4
        ];
39
    }
40
41
    /**
42
     * Get declared functions.
43
     *
44
     * @return \Twig_SimpleFunction[]
45
     */
46 1
    public function getFunctions()
47
    {
48
        return [
49 1
            new \Twig_SimpleFunction('config', 'Cake\Core\Configure::read'),
50 1
        ];
51
    }
52
53
    /**
54
     * Get extension name.
55
     *
56
     * @return string
57
     */
58 1
    public function getName()
59
    {
60 1
        return 'basic';
61
    }
62
}
63