Skip to content

Commit

Permalink
Fix JSON column type coming from DQL
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jan 5, 2024
1 parent a9d0aaf commit f9555a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Type/Doctrine/Query/QueryResultTypeWalker.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use PHPStan\Type\IntegerType;
use PHPStan\Type\IntersectionType;
use PHPStan\Type\MixedType;
use PHPStan\Type\NeverType;
use PHPStan\Type\NullType;
use PHPStan\Type\ObjectType;
use PHPStan\Type\StringType;
Expand Down Expand Up @@ -1326,6 +1327,9 @@ private function resolveDoctrineType(string $typeName, ?string $enumType = null,
$type = $this->descriptorRegistry
->get($typeName)
->getWritableToPropertyType();
if ($type instanceof NeverType) {
$type = new MixedType();
}
} catch (DescriptorNotRegisteredException $e) {
$type = new MixedType();
}
Expand Down

0 comments on commit f9555a2

Please sign in to comment.