I18n   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 28
ccs 0
cts 8
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFunctions() 0 10 1
A getName() 0 4 1
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\TwigFunction;
17
18
/**
19
 * Class I18n.
20
 * @package WyriHaximus\TwigView\Lib\Twig\Extension
21
 */
22
final class I18n extends AbstractExtension
23
{
24
    /**
25
     * Get declared functions.
26
     *
27
     * @return \Twig\TwigFunction[]
28
     */
29
    public function getFunctions(): array
30
    {
31
        return [
32
            new TwigFunction('__', '__'),
33
            new TwigFunction('__d', '__d'),
34
            new TwigFunction('__n', '__n'),
35
            new TwigFunction('__x', '__x'),
36
            new TwigFunction('__dn', '__dn'),
37
        ];
38
    }
39
40
    /**
41
     * Get extension name.
42
     *
43
     * @return string
44
     */
45
    public function getName(): string
46
    {
47
        return 'i18n';
48
    }
49
}
50