Skip to content

Commit

Permalink
fix(doctrine): test Doctrine Types:ARRAY existence before using it (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
fmata committed Apr 27, 2024
1 parent 63b35ef commit 9f6ef08
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Doctrine/Orm/Filter/SearchFilter.php
Expand Up @@ -367,8 +367,11 @@ protected function createWrapCase(bool $caseSensitive): \Closure
*/
protected function getType(string $doctrineType): string
{
if (\defined(Types::class.'::ARRAY') && Types::ARRAY === $doctrineType) {
return 'array';
}

return match ($doctrineType) {
Types::ARRAY => 'array',
Types::BIGINT, Types::INTEGER, Types::SMALLINT => 'int',
Types::BOOLEAN => 'bool',
Types::DATE_MUTABLE, Types::TIME_MUTABLE, Types::DATETIME_MUTABLE, Types::DATETIMETZ_MUTABLE, Types::DATE_IMMUTABLE, Types::TIME_IMMUTABLE, Types::DATETIME_IMMUTABLE, Types::DATETIMETZ_IMMUTABLE => \DateTimeInterface::class,
Expand Down

0 comments on commit 9f6ef08

Please sign in to comment.