Unverified Commit 2b33eeff authored by Michael Moravec's avatar Michael Moravec Committed by Sergei Morozov

Remove Doctrine\DBAL\Types\Type::getDefaultLength()

parent b7e82302
# Upgrade to 3.0 # 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 ## BC BREAK: `Doctrine\DBAL\Types\Type::__toString()` removed
Relying on string representation was discouraged and has been removed. Relying on string representation was discouraged and has been removed.
......
...@@ -17,14 +17,6 @@ class StringType extends Type ...@@ -17,14 +17,6 @@ class StringType extends Type
return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration); return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration);
} }
/**
* {@inheritdoc}
*/
public function getDefaultLength(AbstractPlatform $platform)
{
return $platform->getVarcharDefaultLength();
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
......
...@@ -114,18 +114,6 @@ abstract class Type ...@@ -114,18 +114,6 @@ abstract class Type
return $value; return $value;
} }
/**
* Gets the default length of this type.
*
* @deprecated Rely on information provided by the platform instead.
*
* @return int|null
*/
public function getDefaultLength(AbstractPlatform $platform)
{
return null;
}
/** /**
* Gets the SQL declaration snippet for a field of this type. * Gets the SQL declaration snippet for a field of this type.
* *
......
...@@ -25,11 +25,6 @@ class StringTest extends DbalTestCase ...@@ -25,11 +25,6 @@ class StringTest extends DbalTestCase
self::assertEquals('DUMMYVARCHAR()', $this->type->getSqlDeclaration([], $this->platform)); self::assertEquals('DUMMYVARCHAR()', $this->type->getSqlDeclaration([], $this->platform));
} }
public function testReturnsDefaultLengthFromPlatformVarchar()
{
self::assertEquals(255, $this->type->getDefaultLength($this->platform));
}
public function testConvertToPHPValue() public function testConvertToPHPValue()
{ {
self::assertInternalType('string', $this->type->convertToPHPValue('foo', $this->platform)); self::assertInternalType('string', $this->type->convertToPHPValue('foo', $this->platform));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment