ReportTwigExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 8
c 1
b 0
f 1
dl 0
loc 16
ccs 7
cts 7
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFunctions() 0 5 1
A getFilters() 0 6 1
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