Unverified Commit 83acc2ac authored by Michael Moravec's avatar Michael Moravec Committed by Sergei Morozov

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

parent 746e8e30
# 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}
*/ */
......
...@@ -159,18 +159,6 @@ abstract class Type ...@@ -159,18 +159,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.
* *
......
...@@ -31,15 +31,6 @@ class StringTest extends DbalTestCase ...@@ -31,15 +31,6 @@ class StringTest extends DbalTestCase
self::assertEquals('TEST_VARCHAR', $this->type->getSqlDeclaration([], $this->platform)); self::assertEquals('TEST_VARCHAR', $this->type->getSqlDeclaration([], $this->platform));
} }
public function testReturnsDefaultLengthFromPlatformVarchar() : void
{
$this->platform->expects($this->once())
->method('getVarcharDefaultLength')
->willReturn(255);
self::assertEquals(255, $this->type->getDefaultLength($this->platform));
}
public function testConvertToPHPValue() : void public function testConvertToPHPValue() : void
{ {
self::assertIsString($this->type->convertToPHPValue('foo', $this->platform)); self::assertIsString($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