FloatType::convertToSQL()   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 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 3
c 1
b 0
f 1
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 FloatType implements Type
8
{
9 1
    public function convertToSQL($value)
10
    {
11 1
        return $value === null
12
            ? null
13 1
            : (string) $value;
14
    }
15
16
    public function convertToPHP($value)
17
    {
18
        return $value === null
19
            ? null
20
            : (float) $value;
21
    }
22
}
23