Skip to content

Commit 85f3e24

Browse files
committed
[PropertyInfo] Fix bigint extraction with type info
1 parent 2568d0a commit 85f3e24

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: PropertyInfo/DoctrineExtractor.php

+1-1
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;

Diff for: Tests/PropertyInfo/DoctrineExtractorTest.php

+1-1
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)