1 | <?php |
||
12 | class Balance |
||
13 | { |
||
14 | /** |
||
15 | * |
||
16 | */ |
||
17 | const TYPE_OPENING = 'opening'; |
||
18 | /** |
||
19 | * |
||
20 | */ |
||
21 | const TYPE_CLOSING = 'closing'; |
||
22 | |||
23 | /** |
||
24 | * @var Money |
||
25 | */ |
||
26 | private $amount; |
||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $type; |
||
31 | |||
32 | /** |
||
33 | * @var DateTimeImmutable |
||
34 | */ |
||
35 | private $date; |
||
36 | |||
37 | /** |
||
38 | * @param $type |
||
39 | * @param Money $amount |
||
40 | * @param DateTimeImmutable $date |
||
41 | */ |
||
42 | 10 | private function __construct($type, Money $amount, DateTimeImmutable $date) |
|
48 | |||
49 | /** |
||
50 | * @return DateTimeImmutable |
||
51 | */ |
||
52 | public function getDate() |
||
56 | |||
57 | /** |
||
58 | * @return Money |
||
59 | */ |
||
60 | 1 | public function getAmount() |
|
64 | |||
65 | /** |
||
66 | * @return string |
||
67 | */ |
||
68 | 1 | public function getType() |
|
72 | |||
73 | /** |
||
74 | * @param Money $amount |
||
75 | * @param DateTimeImmutable $date |
||
76 | * @return static |
||
77 | */ |
||
78 | 10 | public static function opening(Money $amount, DateTimeImmutable $date) |
|
82 | |||
83 | /** |
||
84 | * @param Money $amount |
||
85 | * @param DateTimeImmutable $date |
||
86 | * @return static |
||
87 | */ |
||
88 | 9 | public static function closing(Money $amount, DateTimeImmutable $date) |
|
92 | } |
||
93 |