Skip to content

Commit 9f6ef08

Browse files
authored
fix(doctrine): test Doctrine Types:ARRAY existence before using it (#6333)
1 parent 63b35ef commit 9f6ef08

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Doctrine/Orm/Filter/SearchFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,11 @@ protected function createWrapCase(bool $caseSensitive): \Closure
367367
*/
368368
protected function getType(string $doctrineType): string
369369
{
370+
if (\defined(Types::class.'::ARRAY') && Types::ARRAY === $doctrineType) {
371+
return 'array';
372+
}
373+
370374
return match ($doctrineType) {
371-
Types::ARRAY => 'array',
372375
Types::BIGINT, Types::INTEGER, Types::SMALLINT => 'int',
373376
Types::BOOLEAN => 'bool',
374377
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,

0 commit comments

Comments
 (0)