src/Collection/Mutable.php
public function build($decorator)
    {
        return $this->map(function ($element) use ($decorator) {
            if ($element instanceof Group) {
                $element->map(function ($e) use ($decorator) {
                    return $decorator->makeElement($e);
                });

                return $element;
            }

            return $decorator->makeElement($element);
        });
    }
public function build($decorator)
    {
        return $this->map(function ($element) use ($decorator) {
            if ($element instanceof Group) {
                $element->map(function ($e) use ($decorator) {
                    return $decorator->makeElement($e);
                });

                return $element;
            }

            return $decorator->makeElement($element);
        });
    }
public function build ( $ decorator ) { return $ this -> map ( function ( $ element ) use ( $ decorator ) { if ( $ element instanceof Group ) { $ element -> map ( function ( $ e ) use ( $ decorator ) { return $ decorator -> makeElement ( $ e ) ; } ) ; return $ element ; } return $ decorator -> makeElement ( $ element ) ; } ) ; }
Build a collection.

@param $decorator

@return static
Build a collection .