Completed
Push — master ( 5da106...cd03ca )
by Cees-Jan
02:11
created

Basic   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 90.91%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 31
ccs 10
cts 11
cp 0.9091
rs 10

2 Methods

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