diff --git a/UPGRADE.md b/UPGRADE.md index 337715ccd74..3429fb88b5a 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,9 @@ # Upgrade to 3.0 +## BC BREAK: `Doctrine\DBAL\Types\Type::getDefaultLength()` removed + +The `Doctrine\DBAL\Types\Type::getDefaultLength()` method has been removed as it served no purpose. + ## BC BREAK: `Doctrine\DBAL\Types\Type::__toString()` removed Relying on string representation was discouraged and has been removed. diff --git a/lib/Doctrine/DBAL/Types/StringType.php b/lib/Doctrine/DBAL/Types/StringType.php index e56569c4644..de74d634b21 100644 --- a/lib/Doctrine/DBAL/Types/StringType.php +++ b/lib/Doctrine/DBAL/Types/StringType.php @@ -19,14 +19,6 @@ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $pla return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration); } - /** - * {@inheritdoc} - */ - public function getDefaultLength(AbstractPlatform $platform) - { - return $platform->getVarcharDefaultLength(); - } - /** * {@inheritdoc} */ diff --git a/lib/Doctrine/DBAL/Types/Type.php b/lib/Doctrine/DBAL/Types/Type.php index f94f680333f..f73379ce700 100644 --- a/lib/Doctrine/DBAL/Types/Type.php +++ b/lib/Doctrine/DBAL/Types/Type.php @@ -122,20 +122,6 @@ public function convertToPHPValue($value, AbstractPlatform $platform) return $value; } - /** - * Gets the default length of this type. - * - * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform - * - * @return int|null - * - * @todo Needed? - */ - public function getDefaultLength(AbstractPlatform $platform) - { - return null; - } - /** * Gets the SQL declaration snippet for a field of this type. * diff --git a/tests/Doctrine/Tests/DBAL/Types/StringTest.php b/tests/Doctrine/Tests/DBAL/Types/StringTest.php index e968b9f0d99..28409fb83b1 100644 --- a/tests/Doctrine/Tests/DBAL/Types/StringTest.php +++ b/tests/Doctrine/Tests/DBAL/Types/StringTest.php @@ -28,11 +28,6 @@ public function testReturnsSqlDeclarationFromPlatformVarchar() self::assertEquals("DUMMYVARCHAR()", $this->_type->getSqlDeclaration(array(), $this->_platform)); } - public function testReturnsDefaultLengthFromPlatformVarchar() - { - self::assertEquals(255, $this->_type->getDefaultLength($this->_platform)); - } - public function testConvertToPHPValue() { self::assertInternalType("string", $this->_type->convertToPHPValue("foo", $this->_platform));