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

FloatType   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 16
ccs 0
cts 12
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A convertToSQL() 0 6 2
A convertToPHP() 0 6 2
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