I18n::getFunctions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 10
ccs 0
cts 6
cp 0
rs 9.9332
cc 1
nc 1
nop 0
crap 2
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