Skip to content

Commit d45a3ee

Browse files
committed
Fixed type issues from dataProviderTestThatOneToManyAssociationMethodsWorksAsExpected method
1 parent 31485e5 commit d45a3ee

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/Integration/TestCase/EntityTestCase.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use DeviceDetector\DeviceDetector;
2121
use Doctrine\Common\Collections\ArrayCollection;
2222
use Doctrine\ORM\EntityManagerInterface;
23+
use Doctrine\ORM\Mapping\AssociationMapping;
2324
use Doctrine\ORM\Mapping\ClassMetadata;
2425
use PHPUnit\Framework\Attributes\DataProvider;
2526
use PHPUnit\Framework\Attributes\TestDox;
@@ -745,10 +746,10 @@ public static function dataProviderTestThatOneToManyAssociationMethodsWorksAsExp
745746
// Get entity class meta data
746747
$meta = $entityManager->getClassMetadata(static::$entityName);
747748

748-
$iterator = static fn (array $mapping): array => [
749+
$iterator = static fn (AssociationMapping $mapping): array => [
749750
[
750-
'get' . ucfirst((string)$mapping['fieldName']),
751-
$mapping['fieldName'],
751+
'get' . ucfirst($mapping->fieldName),
752+
$mapping->fieldName,
752753
$mapping,
753754
],
754755
];
@@ -759,15 +760,15 @@ public static function dataProviderTestThatOneToManyAssociationMethodsWorksAsExp
759760

760761
$items = array_filter(
761762
$meta->getAssociationMappings(),
762-
static fn (array $mapping): bool => $mapping['type'] === ClassMetadata::ONE_TO_MANY,
763+
static fn (AssociationMapping $mapping): bool => $mapping->type() === ClassMetadata::ONE_TO_MANY,
763764
);
764765

765766
if (empty($items)) {
766767
$output = [
767768
[null, null, []],
768769
];
769770
} else {
770-
$output = array_merge(...array_values(array_map($iterator, (array)$items)));
771+
$output = array_merge(...array_values(array_map($iterator, $items)));
771772
}
772773

773774
return $output;

0 commit comments

Comments
 (0)