Skip to content

Commit abe7d95

Browse files
Majkl578morozov
authored andcommitted
Remove Doctrine\DBAL\Types\Type::getDefaultLength()
1 parent ced6b6e commit abe7d95

File tree

4 files changed

+4
-25
lines changed

4 files changed

+4
-25
lines changed

UPGRADE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Upgrade to 3.0
22

3+
## BC BREAK: `Doctrine\DBAL\Types\Type::getDefaultLength()` removed
4+
5+
The `Doctrine\DBAL\Types\Type::getDefaultLength()` method has been removed as it served no purpose.
6+
37
## BC BREAK: `Doctrine\DBAL\Types\Type::__toString()` removed
48

59
Relying on string representation was discouraged and has been removed.

lib/Doctrine/DBAL/Types/StringType.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $pla
1717
return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration);
1818
}
1919

20-
/**
21-
* {@inheritdoc}
22-
*/
23-
public function getDefaultLength(AbstractPlatform $platform)
24-
{
25-
return $platform->getVarcharDefaultLength();
26-
}
27-
2820
/**
2921
* {@inheritdoc}
3022
*/

lib/Doctrine/DBAL/Types/Type.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,6 @@ public function convertToPHPValue($value, AbstractPlatform $platform)
114114
return $value;
115115
}
116116

117-
/**
118-
* Gets the default length of this type.
119-
*
120-
* @deprecated Rely on information provided by the platform instead.
121-
*
122-
* @return int|null
123-
*/
124-
public function getDefaultLength(AbstractPlatform $platform)
125-
{
126-
return null;
127-
}
128-
129117
/**
130118
* Gets the SQL declaration snippet for a field of this type.
131119
*

tests/Doctrine/Tests/DBAL/Types/StringTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ public function testReturnsSqlDeclarationFromPlatformVarchar()
2525
self::assertEquals('DUMMYVARCHAR()', $this->type->getSqlDeclaration([], $this->platform));
2626
}
2727

28-
public function testReturnsDefaultLengthFromPlatformVarchar()
29-
{
30-
self::assertEquals(255, $this->type->getDefaultLength($this->platform));
31-
}
32-
3328
public function testConvertToPHPValue()
3429
{
3530
self::assertInternalType('string', $this->type->convertToPHPValue('foo', $this->platform));

0 commit comments

Comments
 (0)