Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | public static function arab2roman(int $number): ?string |
||
35 | { |
||
36 | if ($number <= 0) { |
||
37 | return null; |
||
38 | } |
||
39 | $result = ''; |
||
40 | foreach (static::ROMAN_GLYPH as $limit => $glyph) { |
||
41 | while ($number >= $limit) { |
||
42 | $result .= $glyph; |
||
43 | $number -= $limit; |
||
44 | } |
||
45 | } |
||
46 | |||
47 | return $result; |
||
48 | } |
||
51 |