1 | <?php |
||
11 | abstract class Converter |
||
12 | { |
||
13 | // i don't want readers to think it's a white |
||
14 | // space, it's just an empty string |
||
15 | const EMPTY_CHARACTER = ''; |
||
16 | |||
17 | const GEEZ_NUMBERS = [ |
||
18 | 0 => '', '፩', '፪', '፫', '፬', '፭', '፮', '፯', '፰', '፱', '፲', |
||
19 | 20 => '፳', |
||
20 | 30 => '፴', |
||
21 | 40 => '፵', |
||
22 | 50 => '፶', |
||
23 | 60 => '፷', |
||
24 | 70 => '፸', |
||
25 | 80 => '፹', |
||
26 | 90 => '፺', |
||
27 | 100 => '፻', |
||
28 | 10000 => '፼', |
||
29 | ]; |
||
30 | |||
31 | /** |
||
32 | * Check if a number is strictly ZERO. |
||
33 | * |
||
34 | * @param int $number |
||
35 | * |
||
36 | * @return bool if true it's zero |
||
37 | */ |
||
38 | public static function isZero($number) |
||
42 | |||
43 | abstract public function convert($number); |
||
44 | |||
45 | /** |
||
46 | * Checks if the number is ፻. |
||
47 | * |
||
48 | * @param string $geez_number |
||
49 | * |
||
50 | * @return bool |
||
51 | */ |
||
52 | protected function isGeezNumberHundred($geez_number) |
||
56 | |||
57 | /** |
||
58 | * Checks if the geez number character is equal to ascii number. |
||
59 | * |
||
60 | * @param string $geez_number |
||
61 | * @param int $number |
||
62 | * |
||
63 | * @return bool |
||
64 | */ |
||
65 | protected function isGeezNumber($geez_number, $number) |
||
69 | |||
70 | /** |
||
71 | * Checks if the number is ፩. |
||
72 | * |
||
73 | * @param $geez_number |
||
74 | * |
||
75 | * @return bool |
||
76 | */ |
||
77 | protected function isGeezNumberOne($geez_number) |
||
81 | |||
82 | /** |
||
83 | * Checks if the number is ፼ |
||
84 | * |
||
85 | * @param $geez_number |
||
86 | * |
||
87 | * @return bool |
||
88 | */ |
||
89 | protected function isGeezNumberTenThousand($geez_number) |
||
93 | } |
||
94 |