src/precore/util/Iterators.php
public static function from(Traversable $traversable) : Iterator
    {
        Preconditions::checkArgument($traversable instanceof Iterator || $traversable instanceof IteratorAggregate);
        return $traversable instanceof Iterator
            ? $traversable
            : Iterators::from($traversable->getIterator());
    }
public static function from(Traversable $traversable) : Iterator
    {
        Preconditions::checkArgument($traversable instanceof Iterator || $traversable instanceof IteratorAggregate);
        return $traversable instanceof Iterator
            ? $traversable
            : Iterators::from($traversable->getIterator());
    }
Returns an iterator for the given traversable.

@param Traversable $traversable
@return Iterator