diff --git a/src/FixtureFactory.php b/src/FixtureFactory.php index f3ccbab2..9c48194a 100644 --- a/src/FixtureFactory.php +++ b/src/FixtureFactory.php @@ -341,11 +341,11 @@ private function setField(object $entity, EntityDefinition $entityDefinition, st */ private static function createCollectionFrom($value = []): Common\Collections\ArrayCollection { - if (\is_array($value)) { - return new Common\Collections\ArrayCollection($value); + if (!\is_array($value)) { + return new Common\Collections\ArrayCollection(); } - return new Common\Collections\ArrayCollection(); + return new Common\Collections\ArrayCollection($value); } private function updateCollectionSideOfAssocation(