1 | <?php |
||
20 | final class Coupon implements CreatableFromArray, ContainsMetadata |
||
21 | { |
||
22 | use LivemodeTrait, MetadataTrait; |
||
23 | |||
24 | const DURATION_FOREVER = 'forever'; |
||
25 | const DURATION_ONCE = 'once'; |
||
26 | const DURATION_REPEATING = 'repeating'; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $id; |
||
32 | |||
33 | /** |
||
34 | * @var ?Money |
||
35 | */ |
||
36 | private $amountOff; |
||
37 | |||
38 | /** |
||
39 | * @var \DateTimeImmutable |
||
40 | */ |
||
41 | private $createdAt; |
||
42 | |||
43 | /** |
||
44 | * @var ?Currency |
||
45 | */ |
||
46 | private $currency; |
||
47 | |||
48 | /** |
||
49 | * @var string |
||
50 | */ |
||
51 | private $duration; |
||
52 | |||
53 | /** |
||
54 | * @var int |
||
55 | */ |
||
56 | private $durationInMonths; |
||
57 | |||
58 | /** |
||
59 | * @var ?int |
||
60 | */ |
||
61 | private $maxRedemptions; |
||
62 | |||
63 | /** |
||
64 | * @var string |
||
65 | */ |
||
66 | private $name; |
||
67 | |||
68 | /** |
||
69 | * @var float |
||
70 | */ |
||
71 | private $percentOff; |
||
72 | |||
73 | /** |
||
74 | * @var ?\DateTimeImmutable |
||
75 | */ |
||
76 | private $redeemBy; |
||
77 | |||
78 | /** |
||
79 | * @var int |
||
80 | */ |
||
81 | private $timesRedeemed; |
||
82 | |||
83 | /** |
||
84 | * @var bool |
||
85 | */ |
||
86 | private $valid; |
||
87 | |||
88 | 8 | public static function createFromArray(array $data): self |
|
114 | |||
115 | 1 | public function getId(): string |
|
119 | |||
120 | 1 | public function getAmountOff(): ?Money |
|
124 | |||
125 | 1 | public function getCreatedAt(): \DateTimeImmutable |
|
129 | |||
130 | 1 | public function getCurrency(): ?Currency |
|
134 | |||
135 | 1 | public function getDuration(): string |
|
139 | |||
140 | 1 | public function getDurationInMonths(): int |
|
144 | |||
145 | 1 | public function getMaxRedemptions(): ?int |
|
149 | |||
150 | 1 | public function getName(): ?string |
|
154 | |||
155 | public function getPercentOff(): float |
||
159 | |||
160 | 1 | public function getRedeemBy(): ?\DateTimeImmutable |
|
164 | |||
165 | 1 | public function getTimesRedeemed(): int |
|
169 | |||
170 | 1 | public function isValid(): bool |
|
174 | } |
||
175 |
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..