| Total Complexity | 5 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | class RomanService extends Component |
||
| 23 | { |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | private $result = ''; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var array |
||
| 32 | */ |
||
| 33 | public $romanNumerals = [ |
||
| 34 | 'M' => 1000, |
||
| 35 | 'CM' => 900, |
||
| 36 | 'D' => 500, |
||
| 37 | 'CD' => 400, |
||
| 38 | 'C' => 100, |
||
| 39 | 'XC' => 90, |
||
| 40 | 'L' => 50, |
||
| 41 | 'XL' => 40, |
||
| 42 | 'X' => 10, |
||
| 43 | 'IX' => 9, |
||
| 44 | 'V' => 5, |
||
| 45 | 'IV' => 4, |
||
| 46 | 'I' => 1 |
||
| 47 | ]; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param null $number |
||
|
|
|||
| 51 | * @return string|null |
||
| 52 | */ |
||
| 53 | public function getRoman($number = null) |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @param null $roman |
||
| 67 | * @return string|null |
||
| 68 | */ |
||
| 69 | public function getNumber($roman = null) |
||
| 84 |