Completed
Pull Request — master (#3660)
by Matthew
62:41
created

FloatType   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

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 487
     */
13
    public function getName()
14 487
    {
15
        return Types::FLOAT;
16
    }
17
18
    /**
19
     * {@inheritdoc}
20 451
     */
21
    public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
22 451
    {
23
        return $platform->getFloatDeclarationSQL($fieldDeclaration);
24
    }
25
26
    /**
27
     * {@inheritdoc}
28 241
     */
29
    public function convertToPHPValue($value, AbstractPlatform $platform)
30 241
    {
31
        return $value === null ? null : (float) $value;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getBindingType()
38
    {
39
        return ParameterType::DOUBLE;
40
    }
41
}
42