MoneyFormatter::format()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 2
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