Completed
Push — ezp-31088-refactor-content-mod... ( ab3ba3...3726c8 )
by
unknown
14:09
created

ContextAwareTwigVariablesExtension::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace eZ\Bundle\EzPublishCoreBundle\Templating\Twig;
10
11
use eZ\Publish\Core\MVC\ConfigResolverInterface;
12
use Twig\Extension\AbstractExtension;
13
use Twig\Extension\GlobalsInterface;
14
15
final class ContextAwareTwigVariablesExtension extends AbstractExtension implements GlobalsInterface
16
{
17
    /** @var \eZ\Publish\Core\MVC\ConfigResolverInterface */
18
    private $configResolver;
19
20
    public function __construct(
21
        ConfigResolverInterface $configResolver
22
    ) {
23
        $this->configResolver = $configResolver;
24
    }
25
26
    public function getGlobals(): array
27
    {
28
        return $this->configResolver->getParameter('twig_variables');
29
    }
30
}
31