MoneyFormatter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 8
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A format() 0 6 2
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