PaymentDataEntity   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 119
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 9
eloc 24
c 1
b 0
f 0
dl 0
loc 119
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A setBirthdate() 0 7 2
A getOrganizationName() 0 3 1
A setOrganizationName() 0 5 1
A getStreetType() 0 3 1
A setStreetType() 0 5 1
A toArray() 0 3 2
A setForceRedirect() 0 5 1
1
<?php
2
3
/**
4
 * PHP version 5.4 and 8
5
 *
6
 * @category  MessageEntity
7
 * @package   Payever\Payments
8
 * @author    payever GmbH <[email protected]>
9
 * @copyright 2017-2021 payever GmbH
10
 * @license   MIT <https://opensource.org/licenses/MIT>
11
 * @link      https://docs.payever.org/shopsystems/api/getting-started
12
 */
13
14
namespace Payever\ExternalIntegration\Payments\Http\MessageEntity;
15
16
use Payever\ExternalIntegration\Core\Base\MessageEntity;
17
18
/**
19
 * This class represents Payment Data Entity
20
 *
21
 * @method \DateTime|false  getBirthdate()
22
 * @method bool             getConditionsAccepted()
23
 * @method string           getRiskSessionId()
24
 * @method string           getFrontendFinishUrl()
25
 * @method string           getFrontendCancelUrl()
26
 * @method bool             getForceRedirect()
27
 * @method string           getFloor()
28
 * @method string           getDoor()
29
 * @method string           getBlock()
30
 * @method self             setConditionsAccepted(bool $conditionsAccepted)
31
 * @method self             setRiskSessionId(string $riskSessionId)
32
 * @method self             setFrontendFinishUrl(string $frontendFinishUrl)
33
 * @method self             setFrontendCancelUrl(string $frontendCancelUrl)
34
 * @method self             setFloor(string $floor)
35
 * @method self             setDoor(string $door)
36
 * @method self             setBlock(string $block)
37
 */
38
class PaymentDataEntity extends MessageEntity
39
{
40
    /** @var \DateTime|bool $birthdate */
41
    protected $birthdate;
42
43
    /** @var bool $conditionsAccepted */
44
    protected $conditionsAccepted;
45
46
    /** @var string $riskSessionId */
47
    protected $riskSessionId;
48
49
    /** @var string $frontendFinishUrl */
50
    protected $frontendFinishUrl;
51
52
    /** @var string frontendCancelUrl */
53
    protected $frontendCancelUrl;
54
55
    /** @var boolean $force_redirect */
56
    protected $force_redirect;
57
58
    /** @var string $organization_name */
59
    protected $organization_name;
60
61
    /** @var string $street_type */
62
    protected $street_type;
63
64
    /** @var string $floor */
65
    protected $floor;
66
67
    /** @var string $door */
68
    protected $door;
69
70
    /** @var string $block */
71
    protected $block;
72
73
    /**
74
     * Sets Birthdate
75
     *
76
     * @param string $birthdate
77
     *
78
     * @return $this
79
     */
80
    public function setBirthdate($birthdate)
81
    {
82
        if ($birthdate) {
83
            $this->birthdate = date_create($birthdate);
84
        }
85
86
        return $this;
87
    }
88
89
    /**
90
     * Sets force redirect value
91
     *
92
     * @param string $forceRedirect
93
     *
94
     * @return $this
95
     */
96
    public function setForceRedirect($forceRedirect)
97
    {
98
        $this->force_redirect = $forceRedirect;
0 ignored issues
show
Documentation Bug introduced by
The property $force_redirect was declared of type boolean, but $forceRedirect is of type string. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
99
100
        return $this;
101
    }
102
103
    /**
104
     * Gets Organization name value
105
     *
106
     * @return string
107
     */
108
    public function getOrganizationName()
109
    {
110
        return $this->organization_name;
111
    }
112
113
    /**
114
     * Sets Organization name value
115
     *
116
     * @param string $organizationName
117
     *
118
     * @return $this
119
     */
120
    public function setOrganizationName($organizationName)
121
    {
122
        $this->organization_name = $organizationName;
123
124
        return $this;
125
    }
126
127
    /**
128
     * Gets Street Type value
129
     *
130
     * @return string
131
     */
132
    public function getStreetType()
133
    {
134
        return $this->street_type;
135
    }
136
137
    /**
138
     * Sets Street Type value
139
     *
140
     * @param string $streetType
141
     *
142
     * @return $this
143
     */
144
    public function setStreetType($streetType)
145
    {
146
        $this->street_type = $streetType;
147
148
        return $this;
149
    }
150
151
    /**
152
     * {@inheritdoc}
153
     */
154
    public function toArray($object = null)
155
    {
156
        return $object ? get_object_vars($object) : get_object_vars($this);
157
    }
158
}
159