1 | <?php |
||
5 | class Chinese |
||
6 | { |
||
7 | /** |
||
8 | * $numberUnits. |
||
9 | * |
||
10 | * @var array |
||
11 | */ |
||
12 | public static $numberUnits = [ |
||
13 | '個' => 1, |
||
14 | '十' => 10, |
||
15 | '百' => 100, |
||
16 | '千' => 1000, |
||
17 | '萬' => 10000, |
||
18 | ]; |
||
19 | |||
20 | /** |
||
21 | * $subject. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $subject; |
||
26 | |||
27 | /** |
||
28 | * __construct. |
||
29 | * |
||
30 | * @param string $subject |
||
31 | */ |
||
32 | 7 | public function __construct($subject) |
|
36 | |||
37 | /** |
||
38 | * toNumber. |
||
39 | * |
||
40 | * @return int |
||
41 | */ |
||
42 | 7 | public function toNumber() |
|
83 | } |
||
84 |