Skip to content

Commit 40c4f38

Browse files
authored
Merge pull request #3255 from Majkl578/dev/removal/Type-getDefaultLength
Remove Doctrine\DBAL\Types\Type::getDefaultLength()
2 parents b59f84b + 1306c3d commit 40c4f38

File tree

4 files changed

+4
-27
lines changed

4 files changed

+4
-27
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
@@ -19,14 +19,6 @@ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $pla
1919
return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration);
2020
}
2121

22-
/**
23-
* {@inheritdoc}
24-
*/
25-
public function getDefaultLength(AbstractPlatform $platform)
26-
{
27-
return $platform->getVarcharDefaultLength();
28-
}
29-
3022
/**
3123
* {@inheritdoc}
3224
*/

lib/Doctrine/DBAL/Types/Type.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,6 @@ public function convertToPHPValue($value, AbstractPlatform $platform)
122122
return $value;
123123
}
124124

125-
/**
126-
* Gets the default length of this type.
127-
*
128-
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
129-
*
130-
* @return int|null
131-
*
132-
* @todo Needed?
133-
*/
134-
public function getDefaultLength(AbstractPlatform $platform)
135-
{
136-
return null;
137-
}
138-
139125
/**
140126
* Gets the SQL declaration snippet for a field of this type.
141127
*

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ public function testReturnsSqlDeclarationFromPlatformVarchar()
2828
self::assertEquals("DUMMYVARCHAR()", $this->_type->getSqlDeclaration(array(), $this->_platform));
2929
}
3030

31-
public function testReturnsDefaultLengthFromPlatformVarchar()
32-
{
33-
self::assertEquals(255, $this->_type->getDefaultLength($this->_platform));
34-
}
35-
3631
public function testConvertToPHPValue()
3732
{
3833
self::assertInternalType("string", $this->_type->convertToPHPValue("foo", $this->_platform));

0 commit comments

Comments
 (0)