From 2d4ad4079930c67b384cfaa72ba42af1e9e904e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Alfaiate?= Date: Tue, 27 Aug 2024 22:08:31 +0700 Subject: [PATCH] Fix "Using ArrayAccess is deprecated" --- src/Mapping/Driver/AbstractAnnotationDriver.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Mapping/Driver/AbstractAnnotationDriver.php b/src/Mapping/Driver/AbstractAnnotationDriver.php index 43c92deae3..1eca100b1a 100644 --- a/src/Mapping/Driver/AbstractAnnotationDriver.php +++ b/src/Mapping/Driver/AbstractAnnotationDriver.php @@ -11,6 +11,7 @@ use Doctrine\Common\Annotations\Reader; use Doctrine\Deprecations\Deprecation; +use Doctrine\ORM\Mapping\FieldMapping; use Doctrine\Persistence\Mapping\ClassMetadata; use Doctrine\Persistence\Mapping\Driver\MappingDriver; @@ -131,7 +132,9 @@ protected function isValidField($meta, $field) { $mapping = $meta->getFieldMapping($field); - return $mapping && in_array($mapping['type'], $this->validTypes, true); + $type = $mapping instanceof FieldMapping ? $mapping->type : $mapping['type']; + + return in_array($type, $this->validTypes, true); } /**