PaymentMethod   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 1
dl 0
loc 60
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setGatewayConfig() 0 4 1
A getGatewayConfig() 0 4 1
A getTranslationClass() 0 4 1
A isSupportsRecurring() 0 4 1
A setSupportsRecurring() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PH\Component\Core\Model;
6
7
use Payum\Core\Model\GatewayConfigInterface;
8
use Sylius\Component\Payment\Model\PaymentMethod as BasePaymentMethod;
9
use Sylius\Component\Payment\Model\PaymentMethodTranslation;
10
11
class PaymentMethod extends BasePaymentMethod implements PaymentMethodInterface
12
{
13
    /**
14
     * @var GatewayConfigInterface
15
     */
16
    protected $gatewayConfig;
17
18
    /**
19
     * @var bool
20
     */
21
    protected $supportsRecurring = false;
22
23
    /**
24
     * PaymentMethod constructor.
25
     */
26
    public function __construct()
27
    {
28
        parent::__construct();
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function setGatewayConfig(GatewayConfigInterface $gatewayConfig)
35
    {
36
        $this->gatewayConfig = $gatewayConfig;
37
    }
38
39
    /**
40
     * @return GatewayConfigInterface
41
     */
42
    public function getGatewayConfig()
43
    {
44
        return $this->gatewayConfig;
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public static function getTranslationClass()
51
    {
52
        return PaymentMethodTranslation::class;
53
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58
    public function isSupportsRecurring(): bool
59
    {
60
        return $this->supportsRecurring;
61
    }
62
63
    /**
64
     * {@inheritdoc}
65
     */
66
    public function setSupportsRecurring(bool $supportsRecurring): void
67
    {
68
        $this->supportsRecurring = $supportsRecurring;
69
    }
70
}
71