IntType::convertToPHP()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
cc 2
eloc 3
c 0
b 0
f 0
nc 2
nop 1
dl 0
loc 5
ccs 3
cts 4
cp 0.75
crap 2.0625
rs 10
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