Completed
Push — master ( 586888...6f962e )
by Kamil
14s
created

SettingsExtension::hasSettingsParameter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
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
namespace Sylius\Bundle\SettingsBundle\Twig;
13
14
use Sylius\Bundle\SettingsBundle\Templating\Helper\SettingsHelperInterface;
15
16
/**
17
 * @author Paweł Jędrzejewski <[email protected]>
18
 */
19
final class SettingsExtension extends \Twig_Extension
20
{
21
    /**
22
     * @var SettingsHelperInterface
23
     */
24
    private $helper;
25
26
    /**
27
     * @param SettingsHelperInterface $helper
28
     */
29
    public function __construct(SettingsHelperInterface $helper)
30
    {
31
        $this->helper = $helper;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getFunctions()
38
    {
39
        return [
40
             new \Twig_SimpleFunction('sylius_settings', [$this->helper, 'getSettings']),
41
        ];
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getName()
48
    {
49
        return 'sylius_settings';
50
    }
51
}
52