Conditions | 5 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public function to($input) |
||
32 | { |
||
33 | if ($input === 0) { |
||
34 | return '0'; |
||
35 | } |
||
36 | |||
37 | if ($input < 0) { |
||
38 | return '-' . $this->to(-$input); |
||
39 | } |
||
40 | |||
41 | $res = ''; |
||
42 | |||
43 | foreach (self::$table as $symbol => $value) { |
||
44 | while ($input >= $value) { |
||
45 | $res .= $symbol; |
||
46 | $input -= $value; |
||
47 | } |
||
48 | } |
||
49 | |||
50 | return $res; |
||
51 | } |
||
90 |