[DoctrineBridge][DoctrineExtractor] Fix wrong guessed type for "json" type

This commit is contained in:
Thomas Calvet 2020-03-06 09:58:06 +01:00
parent bd0bf5240f
commit f9f5f8df3e
2 changed files with 1 additions and 3 deletions

View File

@ -178,7 +178,6 @@ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeE
switch ($typeOfField) {
case self::$useDeprecatedConstants ? DBALType::TARRAY : 'array':
case 'json_array':
case self::$useDeprecatedConstants ? false : Types::JSON:
return [new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true)];
case self::$useDeprecatedConstants ? DBALType::SIMPLE_ARRAY : Types::SIMPLE_ARRAY:
@ -266,7 +265,6 @@ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeE
case self::$useDeprecatedConstants ? DBALType::TARRAY : 'array':
case self::$useDeprecatedConstants ? DBALType::SIMPLE_ARRAY : Types::SIMPLE_ARRAY:
case 'json_array':
case self::$useDeprecatedConstants ? false : Types::JSON:
return Type::BUILTIN_TYPE_ARRAY;
}

View File

@ -182,7 +182,7 @@ class DoctrineExtractorTest extends TestCase
];
if (class_exists(Types::class)) {
$provider[] = ['json', [new Type(Type::BUILTIN_TYPE_ARRAY, true, null, true)]];
$provider[] = ['json', null];
}
return $provider;