src/Lazy/Enumerable.php
public function flatten()
    {
        return new Enumerator(
            function () {
                foreach ($this->each() as $k => $v) {
                    if (($v instanceof \Traversable) || is_array($v)) {
                        yield $k => Enumerator::from($v)->flatten();
                    } else {
                        yield $k => $v;
                    }
                }
            }
        );
    }
public function flatten()
    {
        return new Enumerator(
            function () {
                foreach ($this->each() as $k => $v) {
                    if (($v instanceof \Traversable) || is_array($v)) {
                        yield $k => Enumerator::from($v)->flatten();
                    } else {
                        yield $k => $v;
                    }
                }
            }
        );
    }
public function flatten ( ) { return new Enumerator ( function ( ) { foreach ( $ this -> each ( ) as $ k => $ v ) { if ( ( $ v instanceof \ Traversable ) || is_array ( $ v ) ) { yield $ k => Enumerator :: from ( $ v ) -> flatten ( ) ; } else { yield $ k => $ v ; } } } ) ; }
Return Enumerator which flatten values

@return \dooaki\Container\Lazy\Enumerator|\Generator
Return Enumerator which flatten values