1 | <?php declare(strict_types=1); |
||
5 | final class PaymentCard |
||
6 | { |
||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | private $id; |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $number; |
||
15 | /** |
||
16 | * @var \DateTimeInterface |
||
17 | */ |
||
18 | private $expired; |
||
19 | |||
20 | /** |
||
21 | * Create a new instance. |
||
22 | * |
||
23 | * @param string $id |
||
24 | * @param string $number |
||
25 | * @param \DateTimeInterface $expired |
||
26 | */ |
||
27 | public function __construct(string $id, string $number, \DateTimeInterface $expired) |
||
33 | |||
34 | /** |
||
35 | * Create a new instance. |
||
36 | * |
||
37 | * @param mixed $id |
||
38 | * @param string $number |
||
39 | * @param string $expired |
||
40 | * @param string $dateFormat |
||
41 | * |
||
42 | * @return PaymentCard |
||
43 | */ |
||
44 | public static function make($id, string $number, string $expired, string $dateFormat = 'my'): self |
||
48 | |||
49 | /** |
||
50 | * @return string |
||
51 | */ |
||
52 | public function getId(): string |
||
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | public function getNumber(): string |
||
64 | |||
65 | /** |
||
66 | * @return \DateTimeInterface |
||
67 | */ |
||
68 | public function getExpired(): \DateTimeInterface |
||
72 | } |
||
73 |