Completed
Branch master (734dbe)
by G
12:13
created

DepositExtension::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gweb\SyliusProductDepositPlugin\Templating\Helper;
6
7
use Symfony\Component\Templating\Helper\Helper;
8
use Twig\Extension\AbstractExtension;
9
use Twig\TwigFilter;
10
11
/**
12
 * Template extension to get deposit fee
13
 *
14
 * @author Gerd Weitenberg <[email protected]>
15
 */
16
class DepositExtension extends AbstractExtension
17
{
18
    /**
19
     * @var Helper
20
     */
21
    private $helper;
22
23
    /**
24
     * @param Helper $helper
25
     */
26
    public function __construct(Helper $helper)
27
    {
28
        $this->helper = $helper;
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function getFilters(): array
35
    {
36
        return [
37
          new TwigFilter('gweb_calculate_deposit', [$this->helper, 'getPrice']),
38
        ];
39
    }
40
}
41