Skip to content

Commit c08f1e1

Browse files
fix(doctrine): test array type existence before using it (#6161)
1 parent a987469 commit c08f1e1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Doctrine/Orm/Filter/SearchFilter.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,12 @@ protected function createWrapCase(bool $caseSensitive): \Closure
369369
*/
370370
protected function getType(string $doctrineType): string
371371
{
372+
// Remove this test when doctrine/dbal:3 support is removed
373+
if (\defined(Types::class.'::ARRAY') && Types::ARRAY === $doctrineType) {
374+
return 'array';
375+
}
376+
372377
return match ($doctrineType) {
373-
Types::ARRAY => 'array',
374378
Types::BIGINT, Types::INTEGER, Types::SMALLINT => 'int',
375379
Types::BOOLEAN => 'bool',
376380
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)