Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
22 | 22 | public function toBase($value, $base = 62) |
|
23 | { |
||
24 | 22 | $r = $value % $base; |
|
25 | 22 | $result = $this->base[$r]; |
|
26 | 22 | $q = floor($value / $base); |
|
27 | |||
28 | 22 | while ($q) { |
|
29 | 4 | $r = $q % $base; |
|
30 | 4 | $q = floor($q / $base); |
|
31 | 4 | $result = $this->base[$r].$result; |
|
32 | } |
||
33 | |||
34 | 22 | return $result; |
|
35 | } |
||
36 | } |
||
37 |