Completed
Push — master ( 52cd2c...047880 )
by Kamil
47:26 queued 26:32
created

TemplateEventExtension::renderBlocksForEvent()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 2
nc 2
nop 2
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Sylius\Bundle\UiBundle\Twig;
15
16
use Sylius\Bundle\UiBundle\Renderer\TemplateEventRendererInterface;
17
use Twig\Extension\AbstractExtension;
18
use Twig\TwigFunction;
19
20
final class TemplateEventExtension extends AbstractExtension
21
{
22
    /** @var TemplateEventRendererInterface */
23
    private $templateEventRenderer;
24
25
    public function __construct(TemplateEventRendererInterface $templateEventRenderer)
26
    {
27
        $this->templateEventRenderer = $templateEventRenderer;
28
    }
29
30
    public function getFunctions(): array
31
    {
32
        return [
33
            new TwigFunction('sylius_template_event', [$this->templateEventRenderer, 'render'], ['is_safe' => ['html']]),
34
        ];
35
    }
36
}
37