Completed
Push — master ( 7d0a28...471540 )
by Rasmus
02:27
created

FloatType::convertToPHP()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
crap 6
1
<?php
2
3
namespace mindplay\sql\model\types;
4
5
use mindplay\sql\model\schema\Type;
6
7
class FloatType implements Type
8
{
9
    public function convertToSQL($value)
10
    {
11
        return $value === null
12
            ? null
13
            : (string) $value;
14
    }
15
16
    public function convertToPHP($value)
17
    {
18
        return $value === null
19
            ? null
20
            : (float) $value;
21
    }
22
}
23