1 | <?php |
||
16 | trait TripletTransformer |
||
17 | { |
||
18 | /** |
||
19 | * Trả về từ điển hổ trợ cho việc chuyển đổi. |
||
20 | * |
||
21 | * @return DictionaryInterface |
||
22 | */ |
||
23 | abstract protected function getDictionary(): DictionaryInterface; |
||
24 | |||
25 | /** |
||
26 | * Chuyển đổi cụm 3 số thành chữ số. |
||
27 | * |
||
28 | * @param int $triplet |
||
29 | * @param bool $isFirst |
||
30 | * @param int $exponent |
||
31 | * @return string |
||
32 | */ |
||
33 | protected function tripletToWords(int $triplet, bool $isFirst, int $exponent): string |
||
59 | |||
60 | /** |
||
61 | * Chia 3 số thành mảng 3 phần tử tương ứng với hàng trăm, hàng chục, hàng đơn vị. |
||
62 | * |
||
63 | * @param int $triplet |
||
64 | * @return array |
||
65 | */ |
||
66 | private function splitTriplet(int $triplet): array |
||
74 | |||
75 | /** |
||
76 | * Chuyển đổi số hàng đơn vị sang chữ số ở một số trường hợp đặc biệt. |
||
77 | * |
||
78 | * @param int $unit |
||
79 | * @param int $ten |
||
80 | * @return null|string |
||
81 | */ |
||
82 | private function getTripletUnit(int $unit, int $ten): string |
||
102 | } |
||
103 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.