protected function iterate(IterableResult $iterator, callable $callback = null)
    {
        $iteration = 0;
        foreach ($iterator as $object) {
            /** @var Redirect $object */
            $object = current($object);
            yield $object;
            if ($callback !== null) {
                call_user_func($callback, $iteration, $object);
            }
            $iteration++;
        }
    }
protected function iterate(IterableResult $iterator, callable $callback = null)
    {
        $iteration = 0;
        foreach ($iterator as $object) {
            /** @var Redirect $object */
            $object = current($object);
            yield $object;
            if ($callback !== null) {
                call_user_func($callback, $iteration, $object);
            }
            $iteration++;
        }
    }
protected function iterate ( IterableResult $ iterator , callable $ callback = null ) { $ iteration = 0 ; foreach ( $ iterator as $ object ) { /** @var Redirect $object */ $ object = current ( $ object ) ; yield $ object ; if ( $ callback !== null ) { call_user_func ( $ callback , $ iteration , $ object ) ; } $ iteration ++ ; } }
Iterator over an IterableResult and return a Generator

@param IterableResult $iterator
@param callable $callback
@return \Generator<RedirectDto>
Iterator over an IterableResult and return a Generator