phpstreams\Stream::flatMap PHP Method

flatMap() public method

This method takes each element and unpacks it into a sequence of elements. All individual sequences are concatenated in the resulting stream.
public flatMap ( callable $unpacker = null ) : Stream
$unpacker callable [optional] An unpacker function that can unpack elements into something iterable. Default is to use the identity function.
return Stream
    public function flatMap(callable $unpacker = null)
    {
        if ($unpacker == null) {
            $unpacker = Functions::identity();
        }
        return new FlatMapOperation($this, $unpacker);
    }