From 47d5e6b82c91a4f6093f70e6a01255e66d4cd172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 31 May 2017 12:58:03 +0200 Subject: [PATCH] [PropertyInfo][DoctrineBridge] The bigint Doctrine's type must be converted to string --- .../Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php | 5 +---- .../Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php | 2 ++ .../Doctrine/Tests/PropertyInfo/Fixtures/DoctrineDummy.php | 6 ++++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php b/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php index aba31792f9..e07c7b0bc2 100644 --- a/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php +++ b/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php @@ -174,13 +174,13 @@ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeE { switch ($doctrineType) { case DBALType::SMALLINT: - case DBALType::BIGINT: case DBALType::INTEGER: return Type::BUILTIN_TYPE_INT; case DBALType::FLOAT: return Type::BUILTIN_TYPE_FLOAT; + case DBALType::BIGINT: case DBALType::STRING: case DBALType::TEXT: case DBALType::GUID: @@ -196,9 +196,6 @@ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeE case DBALType::OBJECT: return Type::BUILTIN_TYPE_OBJECT; - - default: - return; } } } diff --git a/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php b/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php index 277922daef..48822d5888 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php @@ -55,6 +55,7 @@ class DoctrineExtractorTest extends TestCase 'bool', 'binary', 'customFoo', + 'bigint', 'foo', 'bar', 'indexedBar', @@ -76,6 +77,7 @@ class DoctrineExtractorTest extends TestCase return array( array('id', array(new Type(Type::BUILTIN_TYPE_INT))), array('guid', array(new Type(Type::BUILTIN_TYPE_STRING))), + array('bigint', array(new Type(Type::BUILTIN_TYPE_STRING))), array('float', array(new Type(Type::BUILTIN_TYPE_FLOAT))), array('decimal', array(new Type(Type::BUILTIN_TYPE_STRING))), array('bool', array(new Type(Type::BUILTIN_TYPE_BOOL))), diff --git a/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineDummy.php b/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineDummy.php index ad3b7b9227..9ceae5150c 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineDummy.php +++ b/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineDummy.php @@ -11,6 +11,7 @@ namespace Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures; +use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\Id; @@ -90,5 +91,10 @@ class DoctrineDummy */ private $customFoo; + /** + * @Column(type="bigint") + */ + private $bigint; + public $notMapped; }