Completed
Push — utc-datetime-storing ( 42f778 )
by Kamil
29:36
created

ShopExtension::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Sylius\Bundle\AdminBundle\Twig;
6
7
final class ShopExtension extends \Twig_Extension
8
{
9
    /**
10
     * @var bool
11
     */
12
    private $isShopEnabled;
13
14
    /**
15
     * @param bool $isShopEnabled
16
     */
17
    public function __construct(bool $isShopEnabled)
18
    {
19
        $this->isShopEnabled = $isShopEnabled;
20
    }
21
22
    /**
23
     * @return array|\Twig_Function[]
24
     */
25
    public function getFunctions(): array
26
    {
27
        return [
28
            new \Twig_Function('is_shop_enabled', function(): bool {
29
                return $this->isShopEnabled;
30
            })
31
        ];
32
    }
33
}
34