Skip to content

Commit e818172

Browse files
committed
[DoctrineBridge][DoctrineExtractor] Fix wrong guessed type for "json" type
1 parent 4f82aa0 commit e818172

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

PropertyInfo/DoctrineExtractor.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ public function getTypes($class, $property, array $context = [])
178178
switch ($typeOfField) {
179179
case self::$useDeprecatedConstants ? DBALType::TARRAY : 'array':
180180
case 'json_array':
181-
case self::$useDeprecatedConstants ? false : Types::JSON:
182181
return [new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true)];
183182

184183
case self::$useDeprecatedConstants ? DBALType::SIMPLE_ARRAY : Types::SIMPLE_ARRAY:
@@ -266,7 +265,6 @@ private function getPhpType($doctrineType)
266265
case self::$useDeprecatedConstants ? DBALType::TARRAY : 'array':
267266
case self::$useDeprecatedConstants ? DBALType::SIMPLE_ARRAY : Types::SIMPLE_ARRAY:
268267
case 'json_array':
269-
case self::$useDeprecatedConstants ? false : Types::JSON:
270268
return Type::BUILTIN_TYPE_ARRAY;
271269
}
272270

Tests/PropertyInfo/DoctrineExtractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function typesProvider()
182182
];
183183

184184
if (class_exists(Types::class)) {
185-
$provider[] = ['json', [new Type(Type::BUILTIN_TYPE_ARRAY, true, null, true)]];
185+
$provider[] = ['json', null];
186186
}
187187

188188
return $provider;

0 commit comments

Comments
 (0)