ProfileExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFunctions() 0 5 1
A getFilters() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Zikula package.
7
 *
8
 * Copyright Zikula - https://ziku.la/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Zikula\UsersBundle\Twig\Extension;
15
16
use Twig\Extension\AbstractExtension;
17
use Twig\TwigFilter;
18
use Twig\TwigFunction;
19
use Zikula\UsersBundle\Twig\Runtime\ProfileRuntime;
20
21
class ProfileExtension extends AbstractExtension
22
{
23
    public function getFunctions()
24
    {
25
        return [
26
            new TwigFunction('displayRegistrationDate', [ProfileRuntime::class, 'displayRegistrationDate']),
27
            new TwigFunction('userAvatar', [ProfileRuntime::class, 'getUserAvatar'], ['is_safe' => ['html']])
28
        ];
29
    }
30
31
    public function getFilters()
32
    {
33
        return [
34
            new TwigFilter('profileLinkByUserId', [ProfileRuntime::class, 'profileLinkByUserId'], ['is_safe' => ['html']]),
35
            new TwigFilter('profileLinkByUserName', [ProfileRuntime::class, 'profileLinkByUserName'], ['is_safe' => ['html']])
36
        ];
37
    }
38
}
39