From f930e0b032bef8e1461f60ebbc690dc491f47abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Alfaiate?= Date: Mon, 9 Sep 2024 16:24:05 +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); } /**