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 Sep 29, 2018
1 parent 9f218b6 commit ed7ad19
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 27 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 @@ -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}
*/
Expand Down
14 changes: 0 additions & 14 deletions lib/Doctrine/DBAL/Types/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
* @deprecated Rely on information provided by the platform instead.
*/
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 ed7ad19

Please sign in to comment.