Skip to content

Commit

Permalink
Change BigDecimal type to string
Browse files Browse the repository at this point in the history
  • Loading branch information
FVesely committed May 21, 2020
1 parent ad0c1ad commit 0a94c80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions src/Money/BigDecimalType.php
Expand Up @@ -5,19 +5,11 @@
use Brick\Math\BigDecimal;
use Doctrine\DBAL\Platforms\AbstractPlatform;

final class BigDecimalType extends \Doctrine\DBAL\Types\Type
final class BigDecimalType extends \Doctrine\DBAL\Types\StringType
{

public const NAME = 'big_decimal';

/**
* @param string[] $fieldDeclaration
*/
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform): string
{
return $platform->getDecimalTypeDeclarationSQL($fieldDeclaration);
}

/**
* @param mixed $value
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/DoctrineTypes/Money/BigDecimalTypeTest.phpt
Expand Up @@ -22,7 +22,7 @@ final class BigDecimalTypeTest extends \Tester\TestCase
{
$type = Type::getType(BigDecimalType::NAME);

Assert::same('NUMERIC(10, 0)', $type->getSQLDeclaration([], new Platform()));
Assert::same('VARCHAR(255)', $type->getSQLDeclaration([], new Platform()));
}

public function testConvertToPhpValue(): void
Expand Down

0 comments on commit 0a94c80

Please sign in to comment.