Passed
Push — master ( f4feef...3322ef )
by payever
10:36
created

PaymentDataEntity::setBirthdate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * PHP version 5.4 and 7
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 Cart Item 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 self             setConditionsAccepted()
27
 * @method self             setRiskSessionId()
28
 * @method self             setFrontendFinishUrl()
29
 * @method self             setFrontendCancelUrl()
30
 */
31
class PaymentDataEntity extends MessageEntity
32
{
33
    /** @var \DateTime|bool $birthdate */
34
    protected $birthdate;
35
36
    /** @var bool $conditionsAccepted */
37
    protected $conditionsAccepted;
38
39
    /** @var string $riskSessionId */
40
    protected $riskSessionId;
41
42
    /** @var string $frontendFinishUrl */
43
    protected $frontendFinishUrl;
44
45
    /** @var string frontendCancelUrl */
46
    protected $frontendCancelUrl;
47
48
    /**
49
     * Sets Birthdate
50
     *
51
     * @param string $birthdate
52
     *
53
     * @return $this
54
     */
55
    public function setBirthdate($birthdate)
56
    {
57
        $this->birthdate = date_create($birthdate);
58
59
        return $this;
60
    }
61
62
    /**
63
     * {@inheritdoc}
64
     */
65
    public function toArray($object = null)
66
    {
67
        return $object ? get_object_vars($object) : get_object_vars($this);
68
    }
69
}
70