This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
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\Entity; |
||
23 | |||
24 | use Parthenon\Athena\Entity\DeletableInterface; |
||
25 | use Symfony\Component\Serializer\Annotation\Ignore; |
||
26 | use Symfony\Component\Serializer\Annotation\SerializedName; |
||
27 | |||
28 | class PaymentCard implements DeletableInterface |
||
29 | { |
||
30 | protected $id; |
||
31 | |||
32 | #[Ignore] |
||
33 | protected $customer; |
||
34 | |||
35 | #[Ignore] |
||
36 | protected string $provider; |
||
37 | |||
38 | #[Ignore] |
||
39 | protected string $storedCustomerReference; |
||
40 | |||
41 | #[Ignore] |
||
42 | protected string $storedPaymentReference; |
||
43 | |||
44 | protected ?string $name = null; |
||
45 | |||
46 | #[SerializedName('default')] |
||
47 | protected bool $defaultPaymentOption = true; |
||
48 | |||
49 | protected ?string $brand = null; |
||
50 | |||
51 | #[SerializedName('last_four')] |
||
52 | protected ?string $lastFour = null; |
||
53 | |||
54 | #[SerializedName('expiry_month')] |
||
55 | protected ?string $expiryMonth = null; |
||
56 | |||
57 | #[SerializedName('expiry_year')] |
||
58 | protected ?string $expiryYear = null; |
||
59 | |||
60 | #[SerializedName('created_at')] |
||
61 | protected \DateTimeInterface $createdAt; |
||
62 | |||
63 | #[Ignore] |
||
64 | protected bool $deleted = false; |
||
65 | |||
66 | #[Ignore] |
||
67 | protected ?\DateTime $deletedAt = null; |
||
68 | |||
69 | public function getId() |
||
70 | { |
||
71 | return $this->id; |
||
72 | } |
||
73 | |||
74 | public function setId($id): void |
||
75 | { |
||
76 | $this->id = $id; |
||
77 | } |
||
78 | |||
79 | public function getCustomer() |
||
80 | { |
||
81 | return $this->customer; |
||
82 | } |
||
83 | |||
84 | public function setCustomer($customer): void |
||
85 | { |
||
86 | $this->customer = $customer; |
||
87 | } |
||
88 | |||
89 | public function getProvider(): string |
||
90 | { |
||
91 | return $this->provider; |
||
92 | } |
||
93 | |||
94 | public function setProvider(string $provider): void |
||
95 | { |
||
96 | $this->provider = $provider; |
||
97 | } |
||
98 | |||
99 | public function getStoredPaymentReference(): string |
||
100 | { |
||
101 | return $this->storedPaymentReference; |
||
102 | } |
||
103 | |||
104 | public function setStoredPaymentReference(string $storedPaymentReference): void |
||
105 | { |
||
106 | $this->storedPaymentReference = $storedPaymentReference; |
||
107 | } |
||
108 | |||
109 | public function getName(): ?string |
||
110 | { |
||
111 | return $this->name; |
||
112 | } |
||
113 | |||
114 | public function setName(?string $name): void |
||
115 | { |
||
116 | $this->name = $name; |
||
117 | } |
||
118 | |||
119 | public function isDefaultPaymentOption(): bool |
||
120 | { |
||
121 | return $this->defaultPaymentOption; |
||
122 | } |
||
123 | |||
124 | public function setDefaultPaymentOption(bool $defaultPaymentOption): void |
||
125 | { |
||
126 | $this->defaultPaymentOption = $defaultPaymentOption; |
||
127 | } |
||
128 | |||
129 | public function getStoredCustomerReference(): string |
||
130 | { |
||
131 | return $this->storedCustomerReference; |
||
132 | } |
||
133 | |||
134 | public function setStoredCustomerReference(string $storedCustomerReference): void |
||
135 | { |
||
136 | $this->storedCustomerReference = $storedCustomerReference; |
||
137 | } |
||
138 | |||
139 | public function getBrand(): ?string |
||
140 | { |
||
141 | return $this->brand; |
||
142 | } |
||
143 | |||
144 | public function setBrand(?string $brand): void |
||
145 | { |
||
146 | $this->brand = $brand; |
||
147 | } |
||
148 | |||
149 | public function getLastFour(): ?string |
||
150 | { |
||
151 | return $this->lastFour; |
||
152 | } |
||
153 | |||
154 | public function setLastFour(?string $lastFour): void |
||
155 | { |
||
156 | $this->lastFour = $lastFour; |
||
157 | } |
||
158 | |||
159 | public function getExpiryMonth(): ?string |
||
160 | { |
||
161 | return $this->expiryMonth; |
||
162 | } |
||
163 | |||
164 | public function setExpiryMonth(?string $expiryMonth): void |
||
165 | { |
||
166 | $this->expiryMonth = $expiryMonth; |
||
167 | } |
||
168 | |||
169 | public function getExpiryYear(): ?string |
||
170 | { |
||
171 | return $this->expiryYear; |
||
172 | } |
||
173 | |||
174 | public function setExpiryYear(?string $expiryYear): void |
||
175 | { |
||
176 | $this->expiryYear = $expiryYear; |
||
177 | } |
||
178 | |||
179 | public function getCreatedAt(): \DateTimeInterface |
||
180 | { |
||
181 | return $this->createdAt; |
||
182 | } |
||
183 | |||
184 | public function setCreatedAt(\DateTimeInterface $createdAt): void |
||
185 | { |
||
186 | $this->createdAt = $createdAt; |
||
187 | } |
||
188 | |||
189 | public function isDeleted(): bool |
||
190 | { |
||
191 | return $this->deleted; |
||
192 | } |
||
193 | |||
194 | public function setDeleted(bool $deleted): void |
||
195 | { |
||
196 | $this->deleted = $deleted; |
||
197 | } |
||
198 | |||
199 | public function setDeletedAt(\DateTimeInterface $dateTime): DeletableInterface |
||
200 | { |
||
201 | $this->deletedAt = $dateTime; |
||
0 ignored issues
–
show
|
|||
202 | } |
||
203 | |||
204 | public function markAsDeleted(): DeletableInterface |
||
205 | { |
||
206 | $this->deletedAt = new \DateTime(); |
||
207 | $this->deleted = true; |
||
0 ignored issues
–
show
In this branch, the function will implicitly return
null which is incompatible with the type-hinted return Parthenon\Athena\Entity\DeletableInterface . Consider adding a return statement or allowing null as return value.
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: interface ReturnsInt {
public function returnsIntHinted(): int;
}
class MyClass implements ReturnsInt {
public function returnsIntHinted(): int
{
if (foo()) {
return 123;
}
// here: null is implicitly returned
}
}
![]() |
|||
208 | } |
||
209 | |||
210 | public function unmarkAsDeleted(): DeletableInterface |
||
211 | { |
||
212 | $this->deletedAt = null; |
||
213 | $this->deleted = true; |
||
0 ignored issues
–
show
In this branch, the function will implicitly return
null which is incompatible with the type-hinted return Parthenon\Athena\Entity\DeletableInterface . Consider adding a return statement or allowing null as return value.
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: interface ReturnsInt {
public function returnsIntHinted(): int;
}
class MyClass implements ReturnsInt {
public function returnsIntHinted(): int
{
if (foo()) {
return 123;
}
// here: null is implicitly returned
}
}
![]() |
|||
214 | } |
||
215 | } |
||
216 |
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: