PaymentSecurityToken   A
last analyzed

Complexity

Total Complexity 12

Size/Duplication

Total Lines 122
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 12
lcom 0
cbo 1
dl 0
loc 122
rs 10
c 0
b 0
f 0

12 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 4 1
A setDetails() 0 4 1
A getDetails() 0 4 1
A getHash() 0 4 1
A setHash() 0 4 1
A getTargetUrl() 0 4 1
A setTargetUrl() 0 4 1
A getAfterUrl() 0 4 1
A setAfterUrl() 0 4 1
A getGatewayName() 0 4 1
A setGatewayName() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PH\Bundle\PayumBundle\Model;
6
7
use Payum\Core\Security\TokenInterface;
8
use Payum\Core\Security\Util\Random;
9
use Payum\Core\Storage\IdentityInterface;
10
use Sylius\Component\Resource\Model\ResourceInterface;
11
12
class PaymentSecurityToken implements ResourceInterface, TokenInterface
13
{
14
    /**
15
     * @var string
16
     */
17
    protected $hash;
18
19
    /**
20
     * @var IdentityInterface
21
     */
22
    protected $details;
23
24
    /**
25
     * @var string
26
     */
27
    protected $afterUrl;
28
29
    /**
30
     * @var string
31
     */
32
    protected $targetUrl;
33
34
    /**
35
     * @var string
36
     */
37
    protected $gatewayName;
38
39
    public function __construct()
40
    {
41
        $this->hash = Random::generateToken();
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getId()
48
    {
49
        return $this->hash;
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55
    public function setDetails($details)
56
    {
57
        $this->details = $details;
58
    }
59
60
    /**
61
     * {@inheritdoc}
62
     *
63
     * @return IdentityInterface|null
64
     */
65
    public function getDetails()
66
    {
67
        return $this->details;
68
    }
69
70
    /**
71
     * {@inheritdoc}
72
     */
73
    public function getHash()
74
    {
75
        return $this->hash;
76
    }
77
78
    /**
79
     * {@inheritdoc}
80
     */
81
    public function setHash($hash)
82
    {
83
        $this->hash = $hash;
84
    }
85
86
    /**
87
     * {@inheritdoc}
88
     */
89
    public function getTargetUrl()
90
    {
91
        return $this->targetUrl;
92
    }
93
94
    /**
95
     * {@inheritdoc}
96
     */
97
    public function setTargetUrl($targetUrl)
98
    {
99
        $this->targetUrl = $targetUrl;
100
    }
101
102
    /**
103
     * {@inheritdoc}
104
     */
105
    public function getAfterUrl()
106
    {
107
        return $this->afterUrl;
108
    }
109
110
    /**
111
     * {@inheritdoc}
112
     */
113
    public function setAfterUrl($afterUrl)
114
    {
115
        $this->afterUrl = $afterUrl;
116
    }
117
118
    /**
119
     * {@inheritdoc}
120
     */
121
    public function getGatewayName()
122
    {
123
        return $this->gatewayName;
124
    }
125
126
    /**
127
     * {@inheritdoc}
128
     */
129
    public function setGatewayName($gatewayName)
130
    {
131
        $this->gatewayName = $gatewayName;
132
    }
133
}
134