8000 [PropertyInfo] Fix bigint extraction with type info · symfony/symfony@4ce5d8e · GitHub
[go: up one dir, main page]

Skip to content

Commit 4ce5d8e

Browse files
committed
[PropertyInfo] Fix bigint extraction with type info
1 parent 180f389 commit 4ce5d8e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function getType(string $class, string $property, array $context = []): ?
133133

134134
// DBAL 4 has a special fallback strategy for BINGINT (int -> string)
135135
if (Types::BIGINT === $typeOfField && !method_exists(BigIntType::class, 'getName')) {
136-
return Type::collection(Type::int(), Type::string());
136+
return $nullable ? Type::nullable(Type::union(Type::int(), Type::string())) : Type::union(Type::int(), Type::string());
137137
}
138138

139139
$enumType = null;

src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public static function typeProvider(): iterable
286286
{
287287
// DBAL 4 has a special fallback strategy for BINGINT (int -> string)
288288
if (!method_exists(BigIntType::class, 'getName')) {
289-
$expectedBigIntType = Type::collection(Type::int(), Type::string());
289+
$expectedBigIntType = Type::union(Type::int(), Type::string());
290290
} else {
291291
$expectedBigIntType = Type::string();
292292
}

0 commit comments

Comments
 (0)
0