ApplePayDirectEnabled::getFunctions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 1
eloc 5
c 2
b 1
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
1
<?php
2
3
/*
4
 * This file has been created by developers from BitBag.
5
 * Feel free to contact us once you face any issues or want to start
6
 * You can find more information about us on https://bitbag.io and write us
7
 * an email on [email protected].
8
 */
9
10
declare(strict_types=1);
11
12
namespace BitBag\SyliusMolliePlugin\Twig\Extension;
13
14
use BitBag\SyliusMolliePlugin\Checker\ApplePay\ApplePayEnabledCheckerInterface;
15
use Twig\Extension\AbstractExtension;
16
use Twig\TwigFunction;
17
18
final class ApplePayDirectEnabled extends AbstractExtension
19
{
20
    /** @var ApplePayEnabledCheckerInterface */
21
    private $applePayEnabledChecker;
22
23
    public function __construct(ApplePayEnabledCheckerInterface $applePayEnabledChecker)
24
    {
25
        $this->applePayEnabledChecker = $applePayEnabledChecker;
26
    }
27
28
    public function getFunctions(): array
29
    {
30
        return [
31
            new TwigFunction(
32
                'bitbag_render_apple_pay_direct',
33
                [$this->applePayEnabledChecker, 'isEnabled'],
34
                ['is_safe' => ['html']]
35
            ),
36
        ];
37
    }
38
}
39