src/CSDT/CollectionsBundle/CollectionHelper/HelperTrait/HelperWalkerTrait.php
public function walkCollection(
        CollectionInterface $collection,
        \Closure $closure,
        array $args = null
    ) {
        $content = $collection->toArray();
        
        array_walk($content, $closure, $args);
    }
public function walkCollection(
        CollectionInterface $collection,
        \Closure $closure,
        array $args = null
    ) {
        $content = $collection->toArray();
        
        array_walk($content, $closure, $args);
    }
Walk collection

Apply a closure foreach elements of a collection.
It send to the closure the value as first argument
and the index as second one.

@param CollectionInterface $collection The collection to walk
@param \Closure            $closure    The closure to apply
@param array               $args       [optional] The array of argument to
send as third argument

@return void