Passed
Pull Request — master (#360)
by Mateusz
08:07
created

RenderLinkExtension::getLinkForCode()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 10
rs 10
cc 3
nc 3
nop 2
1
<?php
2
3
/*
4
 * Created by Florian Merle - Dedi Agency <[email protected]> <[email protected]>
5
 */
6
7
declare(strict_types=1);
8
9
namespace BitBag\SyliusCmsPlugin\Twig\Extension;
10
11
use BitBag\SyliusCmsPlugin\Twig\Runtime\RenderLinkRuntime;
12
use Twig\Extension\AbstractExtension;
13
use Twig\TwigFunction;
14
15
class RenderLinkExtension extends AbstractExtension
16
{
17
    public function getFunctions(): array
18
    {
19
        return [
20
            new TwigFunction('bitbag_cms_render_link_for_code', [RenderLinkRuntime::class, 'renderLinkForCode'], [
21
                'needs_environment' => true,
22
                'is_safe' => ['html'],
23
            ]),
24
            new TwigFunction('bitbag_cms_get_link_for_code', [RenderLinkRuntime::class, 'getLinkForCode']),
25
        ];
26
    }
27
}
28