src/CSDT/CollectionsBundle/CollectionHelper/HelperTrait/HelperArrayCasterTrait.php
public function arrayToCollection(array $source, $collectionClass)
    {
        $manager = $this->manager;
        if ($manager instanceof ArrayCasterManagerInterface) {
            return $manager->process($source, $collectionClass);
        }
        
        throw new \LogicException(
            "The manager must be set to cast array in collection"
        );
    }
public function arrayToCollection(array $source, $collectionClass)
    {
        $manager = $this->manager;
        if ($manager instanceof ArrayCasterManagerInterface) {
            return $manager->process($source, $collectionClass);
        }
        
        throw new \LogicException(
            "The manager must be set to cast array in collection"
        );
    }
Array to collection

This method inject an array into specific collection type.

@param array  $source          The array source to inject
@param string $collectionClass The collection class name

@throws \ParseError if the array cannot be cast
@return CollectionInterface