StartSubscriptionDto::setPaymentDetailsId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * Copyright (C) 2020-2025 Iain Cambridge
7
 *
8
 * This program is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as published by
10
 * the Free Software Foundation, either version 2.1 of the License, or
11
 * (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU Lesser General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
 */
21
22
namespace Parthenon\Billing\Dto;
23
24
use Symfony\Component\Serializer\Annotation\SerializedName;
25
use Symfony\Component\Validator\Constraints as Assert;
26
27
class StartSubscriptionDto
28
{
29
    #[Assert\NotBlank]
30
    #[Assert\Type('string')]
31
    #[SerializedName('plan_name')]
32
    private $planName;
33
34
    #[Assert\NotBlank]
35
    #[SerializedName('schedule')]
36
    #[Assert\Type('string')]
37
    private $schedule;
38
39
    #[SerializedName('seat_numbers')]
40
    private $seatNumbers = 1;
41
42
    #[SerializedName('currency')]
43
    #[Assert\Currency]
44
    private $currency = 'usd';
45
46
    #[SerializedName('payment_details')]
47
    private $paymentDetailsId;
48
49
    public function getPlanName(): string
50
    {
51
        return $this->planName;
52
    }
53
54
    public function setPlanName(string $planName): void
55
    {
56
        $this->planName = $planName;
57
    }
58
59
    public function getSeatNumbers(): int
60
    {
61
        return $this->seatNumbers;
62
    }
63
64
    public function setSeatNumbers(int $seatNumbers): void
65
    {
66
        $this->seatNumbers = $seatNumbers;
67
    }
68
69
    public function getSchedule(): string
70
    {
71
        return $this->schedule;
72
    }
73
74
    public function setSchedule(string $schedule): void
75
    {
76
        $this->schedule = $schedule;
77
    }
78
79
    public function getCurrency(): string
80
    {
81
        return $this->currency;
82
    }
83
84
    public function setCurrency(string $currency): void
85
    {
86
        $this->currency = $currency;
87
    }
88
89
    public function getPaymentDetailsId(): ?string
90
    {
91
        return $this->paymentDetailsId;
92
    }
93
94
    /**
95
     * @param null $paymentDetailsId
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $paymentDetailsId is correct as it would always require null to be passed?
Loading history...
96
     */
97
    public function setPaymentDetailsId($paymentDetailsId): void
98
    {
99
        $this->paymentDetailsId = $paymentDetailsId;
100
    }
101
102
    public function hasPaymentDetailsId(): bool
103
    {
104
        return isset($this->paymentDetailsId);
105
    }
106
}
107