IntToStringDataFormatter   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 10
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A formatData() 0 3 2
A formatInput() 0 3 2
1
<?php
2
3
namespace WebTheory\Saveyour\Formatting;
4
5
use WebTheory\Saveyour\Contracts\Formatting\DataFormatterInterface;
6
7
class IntToStringDataFormatter implements DataFormatterInterface
8
{
9 9
    public function formatData($value)
10
    {
11 9
        return is_array($value) ? array_map('strval', $value) : (string) $value;
12
    }
13
14 3
    public function formatInput($value)
15
    {
16 3
        return is_array($value) ? array_map('intval', $value) : (int) $value;
17
    }
18
}
19