IntType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 12
ccs 5
cts 6
cp 0.8333
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A convertToPHP() 0 5 2
A convertToSQL() 0 3 1
1
<?php
2
3
namespace mindplay\sql\model\types;
4
5
use mindplay\sql\model\schema\Type;
6
7
class IntType implements Type
8
{
9 1
    public function convertToSQL($value)
10
    {
11 1
        return $value;
12
    }
13
14 1
    public function convertToPHP($value)
15
    {
16 1
        return $value === null
17
            ? null
18 1
            : (int) $value;
19
    }
20
}
21