Passed
Push — master ( 56e3ba...d2a4fa )
by İbrahim
03:24
created

MoneyFormatter::format()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
1
<?php
2
namespace Paranoia\Formatter;
3
4
use Paranoia\Exception\InvalidArgumentException;
5
6
class MoneyFormatter implements FormatterInterface
7
{
8
    public function format($input)
9
    {
10
        if (!is_numeric($input)) {
11
            throw new InvalidArgumentException('The input value must be numeric.');
12
        }
13
        return round($input * 100);
14
    }
15
}
16