Basic::getFilters()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1.0008

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 9
cts 10
cp 0.9
rs 9.7666
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1.0008
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * This file is part of TwigView.
6
 *
7
 ** (c) 2014 Cees-Jan Kiewiet
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace WyriHaximus\TwigView\Lib\Twig\Extension;
14
15
use Twig\Extension\AbstractExtension;
16
use Twig\TwigFilter;
17
18
/**
19
 * Class Basic.
20
 * @package WyriHaximus\TwigView\Lib\Twig\Extension
21
 */
22
final class Basic extends AbstractExtension
23
{
24
    /**
25
     * Get declared filters.
26
     *
27
     * @return \Twig\TwigFilter[]
28
     */
29 4
    public function getFilters(): array
30
    {
31
        return [
32 4
            new TwigFilter('debug', 'debug'),
33 4
            new TwigFilter('pr', 'pr'),
34 4
            new TwigFilter('low', 'low'),
35 4
            new TwigFilter('up', 'up'),
36 4
            new TwigFilter('env', 'env'),
37 4
            new TwigFilter('count', 'count'),
38 4
            new TwigFilter('h', 'h'),
39
            new TwigFilter('null', function () {
40
                return '';
41 4
            }),
42
        ];
43
    }
44
45
    /**
46
     * Get extension name.
47
     *
48
     * @return string
49
     */
50 1
    public function getName(): string
51
    {
52 1
        return 'basic';
53
    }
54
}
55