1 | <?php |
||
20 | final class Coupon implements CreatableFromArray, ContainsMetadata |
||
21 | { |
||
22 | use LivemodeTrait; |
||
23 | use MetadataTrait; |
||
24 | |||
25 | const DURATION_FOREVER = 'forever'; |
||
26 | const DURATION_ONCE = 'once'; |
||
27 | const DURATION_REPEATING = 'repeating'; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $id; |
||
33 | |||
34 | /** |
||
35 | * @var ?Money |
||
36 | */ |
||
37 | private $amountOff; |
||
38 | |||
39 | /** |
||
40 | * @var \DateTimeImmutable |
||
41 | */ |
||
42 | private $createdAt; |
||
43 | |||
44 | /** |
||
45 | * @var ?Currency |
||
46 | */ |
||
47 | private $currency; |
||
48 | |||
49 | /** |
||
50 | * @var string |
||
51 | */ |
||
52 | private $duration; |
||
53 | |||
54 | /** |
||
55 | * @var int |
||
56 | */ |
||
57 | private $durationInMonths; |
||
58 | |||
59 | /** |
||
60 | * @var ?int |
||
61 | */ |
||
62 | private $maxRedemptions; |
||
63 | |||
64 | /** |
||
65 | * @var string |
||
66 | */ |
||
67 | private $name; |
||
68 | |||
69 | /** |
||
70 | * @var float |
||
71 | */ |
||
72 | private $percentOff; |
||
73 | |||
74 | /** |
||
75 | * @var ?\DateTimeImmutable |
||
76 | */ |
||
77 | private $redeemBy; |
||
78 | |||
79 | /** |
||
80 | * @var int |
||
81 | */ |
||
82 | private $timesRedeemed; |
||
83 | |||
84 | /** |
||
85 | * @var bool |
||
86 | */ |
||
87 | private $valid; |
||
88 | |||
89 | 9 | public static function createFromArray(array $data): self |
|
115 | |||
116 | public function isRepeating(): bool |
||
120 | |||
121 | public function isOnce(): bool |
||
125 | |||
126 | public function isForever(): bool |
||
130 | |||
131 | 1 | public function getId(): string |
|
135 | |||
136 | 1 | public function getAmountOff(): ?Money |
|
140 | |||
141 | 1 | public function getCreatedAt(): \DateTimeImmutable |
|
145 | |||
146 | 1 | public function getCurrency(): ?Currency |
|
150 | |||
151 | 1 | public function getDuration(): string |
|
155 | |||
156 | 1 | public function getDurationInMonths(): int |
|
160 | |||
161 | 1 | public function getMaxRedemptions(): ?int |
|
165 | |||
166 | 1 | public function getName(): ?string |
|
170 | |||
171 | public function getPercentOff(): float |
||
175 | |||
176 | 1 | public function getRedeemBy(): ?\DateTimeImmutable |
|
180 | |||
181 | 1 | public function getTimesRedeemed(): int |
|
185 | |||
186 | 1 | public function isValid(): bool |
|
190 | } |
||
191 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..