Repository: EasyCorp/EasyAdminBundle (language: php)

Issue:
Using ArrayAccess on Doctrine\ORM\Mapping\JoinColumnMapping is deprecated
**Describe the bug**
We'll likely have a good while but I thought I'd open a ticket for it anyways:

It seems that array access on `JoinColumnMapping` has been deprecated and is now throwing warnings:

```
Using ArrayAccess on Doctrine\ORM\Mapping\JoinColumnMapping is deprecated and will not be possible in Doctrine ORM 4.0. Use the corresponding property instead. (ArrayAccessImplementation.php:18 called by CommonPreConfigurator.php:201, https://github.com/doctrine/orm/pull/11211, package doctrine/orm)

Using ArrayAccess on Doctrine\ORM\Mapping\JoinColumnMapping is deprecated and will not be possible in Doctrine ORM 4.0. Use the corresponding property instead. (ArrayAccessImplementation.php:18 called by EntityConfigurator.php:43, https://github.com/doctrine/orm/pull/11211, package doctrine/orm)

```

Probably easily fixable by checking if it's an array or `JoinColumnMapping `

**To Reproduce**
Use Easy Admin with ORM 3



Discussion / hints:

Fix patch:
diff --git a/src/Field/Configurator/CommonPreConfigurator.php b/src/Field/Configurator/CommonPreConfigurator.php
index 62d20c4a7b..e242c2a932 100644
--- a/src/Field/Configurator/CommonPreConfigurator.php
+++ b/src/Field/Configurator/CommonPreConfigurator.php
@@ -2,6 +2,7 @@
 
 namespace EasyCorp\Bundle\EasyAdminBundle\Field\Configurator;
 
+use Doctrine\ORM\Mapping\JoinColumnMapping;
 use EasyCorp\Bundle\EasyAdminBundle\Config\Action;
 use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
 use EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext;
@@ -198,11 +199,16 @@ private function buildRequiredOption(FieldDto $field, EntityDto $entityDto): boo
             $associatedEntityMetadata = $this->entityFactory->getEntityMetadata($doctrinePropertyMetadata->get('targetEntity'));
             foreach ($doctrinePropertyMetadata->get('joinColumns', []) as $joinColumn) {
                 if (true === $doctrinePropertyMetadata->get('isOwningSide', true)) {
-                    if (false === ($joinColumn['nullable'] ?? true)) {
+                    if ($joinColumn instanceof JoinColumnMapping) {
+                        $isNullable = $joinColumn->nullable ?? true;
+                    } else {
+                        $isNullable = $joinColumn['nullable'] ?? true;
+                    }
+                    if (false === $isNullable) {
                         return true;
                     }
                 } else {
-                    $propertyNameInAssociatedEntity = $joinColumn['referencedColumnName'];
+                    $propertyNameInAssociatedEntity = $joinColumn instanceof JoinColumnMapping ? $joinColumn->referencedColumnName : $joinColumn['referencedColumnName'];
                     $associatedPropertyMetadata = $associatedEntityMetadata->fieldMappings[$propertyNameInAssociatedEntity] ?? [];
                     $isNullable = $associatedPropertyMetadata['nullable'] ?? true;
 
diff --git a/src/Filter/Configurator/EntityConfigurator.php b/src/Filter/Configurator/EntityConfigurator.php
index 8dfc6ae168..d6d36a811d 100644
--- a/src/Filter/Configurator/EntityConfigurator.php
+++ b/src/Filter/Configurator/EntityConfigurator.php
@@ -40,7 +40,7 @@ public function configure(FilterDto $filterDto, ?FieldDto $fieldDto, EntityDto $
             $numberOfRequiredJoinColumns = \count(array_filter(
                 $doctrineMetadata->get('joinColumns'),
                 // Doctrine ORM 3.x changed the returned type from array to JoinColumnMapping
-                static fn (array|JoinColumnMapping $joinColumn): bool => false === ($joinColumn['nullable'] ?? false))
+                static fn (array|JoinColumnMapping $joinColumn): bool => false === (($joinColumn instanceof JoinColumnMapping ? $joinColumn->nullable ?? false : $joinColumn['nullable'] ?? false)))
             );
 
             $someJoinColumnsAreNullable = \count($doctrineMetadata->get('joinColumns')) !== $numberOfRequiredJoinColumns;


Test patch: