Skip to content

Commit

Permalink
Remove Doctrine\DBAL\Types\Type::getDefaultLength()
Browse files Browse the repository at this point in the history
  • Loading branch information
Majkl578 authored and morozov committed Jan 20, 2019
1 parent 67a10cd commit 17daeea
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 25 deletions.
4 changes: 4 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 0 additions & 8 deletions lib/Doctrine/DBAL/Types/StringType.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $pla
return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration);
}

/**
* {@inheritdoc}
*/
public function getDefaultLength(AbstractPlatform $platform)
{
return $platform->getVarcharDefaultLength();
}

/**
* {@inheritdoc}
*/
Expand Down
12 changes: 0 additions & 12 deletions lib/Doctrine/DBAL/Types/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,6 @@ public function convertToPHPValue($value, AbstractPlatform $platform)
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.
*
Expand Down
5 changes: 0 additions & 5 deletions tests/Doctrine/Tests/DBAL/Types/StringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ public function testReturnsSqlDeclarationFromPlatformVarchar()
self::assertEquals('DUMMYVARCHAR()', $this->type->getSqlDeclaration([], $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));
Expand Down

0 comments on commit 17daeea

Please sign in to comment.