Skip to content

Commit

Permalink
[DoctrineBridge][DoctrineExtractor] Fix wrong guessed type for "json"…
Browse files Browse the repository at this point in the history
… type
  • Loading branch information
fancyweb committed Mar 6, 2020
1 parent bd0bf52 commit f9f5f8d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Expand Up @@ -178,7 +178,6 @@ public function getTypes($class, $property, array $context = [])
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:
Expand Down Expand Up @@ -266,7 +265,6 @@ private function getPhpType($doctrineType)
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;
}

Expand Down
Expand Up @@ -182,7 +182,7 @@ public function typesProvider()
];

if (class_exists(Types::class)) {
$provider[] = ['json', [new Type(Type::BUILTIN_TYPE_ARRAY, true, null, true)]];
$provider[] = ['json', null];
}

return $provider;
Expand Down

0 comments on commit f9f5f8d

Please sign in to comment.