Passed
Pull Request — master (#3645)
by Matthew
14:01
created

FloatType   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 5
eloc 5
c 0
b 0
f 0
dl 0
loc 32
rs 10
ccs 6
cts 8
cp 0.75

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A convertToPHPValue() 0 3 2
A getSQLDeclaration() 0 3 1
A getBindingType() 0 3 1
1
<?php
2
3
namespace Doctrine\DBAL\Types;
4
5
use Doctrine\DBAL\ParameterType;
6
use Doctrine\DBAL\Platforms\AbstractPlatform;
7
8
class FloatType extends Type
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13 558
    public function getName()
14
    {
15 558
        return Types::FLOAT;
16
    }
17
18
    /**
19
     * {@inheritdoc}
20
     */
21 522
    public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
22
    {
23 522
        return $platform->getFloatDeclarationSQL($fieldDeclaration);
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29 357
    public function convertToPHPValue($value, AbstractPlatform $platform)
30
    {
31 357
        return $value === null ? null : (float) $value;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getBindingType()
38
    {
39
        return ParameterType::DOUBLE;
40
    }
41
}
42