Integer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 14
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A filterSingle() 0 11 3
1
<?php
2
declare(strict_types=1);
3
namespace Sirius\Filtration\Filter;
4
5
class Integer extends AbstractFilter
6
{
7 3
    public function filterSingle($value, string $valueIdentifier = null)
8
    {
9 3
        if (is_object($value)) {
10 1
            return $value;
11
        }
12 2
        if ($value == 0) {
13 1
            return 0;
14
        }
15 1
        $value = floatval($value);
16 1
        return (int) $value;
17
    }
18
}
19