Passed
Push — master ( 486204...15f778 )
by Damien
03:09
created

TwigExtension::findUser()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
c 2
b 0
f 0
nc 2
nop 2
dl 0
loc 10
rs 10
1
<?php
2
3
namespace DH\DoctrineAuditBundle\Twig\Extension;
4
5
use Doctrine\Common\Persistence\ManagerRegistry;
6
use Twig\Extension\AbstractExtension;
7
use Twig\TwigFilter;
8
9
class TwigExtension extends AbstractExtension
10
{
11
    /**
12
     * @var ManagerRegistry
13
     */
14
    protected $doctrine;
15
16
    public function __construct(ManagerRegistry $doctrine)
17
    {
18
        $this->doctrine = $doctrine;
19
    }
20
21
    public function getFilters(): array
22
    {
23
        return [
24
            new TwigFilter('json_decode', 'json_decode'),
25
        ];
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function getName(): string
32
    {
33
        return 'twig_extensions';
34
    }
35
}
36