Skip to content

Commit

Permalink
Fix "Using ArrayAccess is deprecated"
Browse files Browse the repository at this point in the history
  • Loading branch information
Seb33300 committed Sep 9, 2024
1 parent ade7387 commit 2d4ad40
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Mapping/Driver/AbstractAnnotationDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 2d4ad40

Please sign in to comment.