ReportTwigExtension::getFunctions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Administrador
5
 * Date: 20/01/2018
6
 * Time: 12:45 PM.
7
 */
8
9
namespace Greenter\Report\Extension;
10
11
use Twig\Extension\AbstractExtension;
12
use Twig\TwigFilter;
13
use Twig\TwigFunction;
14
15
/**
16
 * Class ReportTwigExtension.
17
 */
18
class ReportTwigExtension extends AbstractExtension
19
{
20 7
    public function getFilters()
21
    {
22
        return [
23 7
            new TwigFilter('catalog', ['Greenter\Report\Filter\DocumentFilter', 'getValueCatalog']),
24 7
            new TwigFilter('image_b64', ['Greenter\Report\Filter\ImageFilter', 'toBase64']),
25 7
            new TwigFilter('n_format', ['Greenter\Report\Filter\FormatFilter', 'number']),
26
        ];
27
    }
28
29 7
    public function getFunctions()
30
    {
31
        return [
32 7
            new TwigFunction('legend', ['Greenter\Report\Filter\ResolveFilter', 'getValueLegend']),
33 7
            new TwigFunction('qrCode', ['Greenter\Report\Render\QrRender', 'getImage']),
34
        ];
35
    }
36
}
37