Completed
Pull Request — master (#3660)
by Matthew
65:19
created

FloatType::getBindingType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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