Code Duplication    Length = 34-34 lines in 3 locations

lib/Doctrine/DBAL/Types/BigIntType.php 1 location

@@ 30-63 (lines=34) @@
27
 * @author robo
28
 * @since 2.0
29
 */
30
class BigIntType extends Type implements PhpIntegerMappingType
31
{
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function getName()
36
    {
37
        return Type::BIGINT;
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
44
    {
45
        return $platform->getBigIntTypeDeclarationSQL($fieldDeclaration);
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51
    public function getBindingType()
52
    {
53
        return \PDO::PARAM_STR;
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59
    public function convertToPHPValue($value, AbstractPlatform $platform)
60
    {
61
        return (null === $value) ? null : (string) $value;
62
    }
63
}
64

lib/Doctrine/DBAL/Types/IntegerType.php 1 location

@@ 30-63 (lines=34) @@
27
 * @author Roman Borschel <[email protected]>
28
 * @since 2.0
29
 */
30
class IntegerType extends Type implements PhpIntegerMappingType
31
{
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function getName()
36
    {
37
        return Type::INTEGER;
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
44
    {
45
        return $platform->getIntegerTypeDeclarationSQL($fieldDeclaration);
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51
    public function convertToPHPValue($value, AbstractPlatform $platform)
52
    {
53
        return (null === $value) ? null : (int) $value;
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59
    public function getBindingType()
60
    {
61
        return \PDO::PARAM_INT;
62
    }
63
}
64

lib/Doctrine/DBAL/Types/SmallIntType.php 1 location

@@ 29-62 (lines=34) @@
26
 *
27
 * @author robo
28
 */
29
class SmallIntType extends Type implements PhpIntegerMappingType
30
{
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function getName()
35
    {
36
        return Type::SMALLINT;
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
43
    {
44
        return $platform->getSmallIntTypeDeclarationSQL($fieldDeclaration);
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public function convertToPHPValue($value, AbstractPlatform $platform)
51
    {
52
        return (null === $value) ? null : (int) $value;
53
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58
    public function getBindingType()
59
    {
60
        return \PDO::PARAM_INT;
61
    }
62
}
63