src/ServerRequest.php
private function getStream($stream)
    {
        if ($stream === 'php://input') {
            return new PhpInputStream();
        }

        if (! is_string($stream) && ! is_resource($stream) && ! $stream instanceof StreamInterface) {
            throw new InvalidArgumentException(
                'Stream must be a string stream resource identifier, '
                . 'an actual stream resource, '
                . 'or a Psr\Http\Message\StreamInterface implementation'
            );
        }

        if (! $stream instanceof StreamInterface) {
            return new Stream($stream, 'r');
        }

        return $stream;
    }
private function getStream($stream)
    {
        if ($stream === 'php://input') {
            return new PhpInputStream();
        }

        if (! is_string($stream) && ! is_resource($stream) && ! $stream instanceof StreamInterface) {
            throw new InvalidArgumentException(
                'Stream must be a string stream resource identifier, '
                . 'an actual stream resource, '
                . 'or a Psr\Http\Message\StreamInterface implementation'
            );
        }

        if (! $stream instanceof StreamInterface) {
            return new Stream($stream, 'r');
        }

        return $stream;
    }
private function getStream ( $ stream ) { if ( $ stream === 'php://input' ) { return new PhpInputStream ( ) ; } if ( ! is_string ( $ stream ) && ! is_resource ( $ stream ) && ! $ stream instanceof StreamInterface ) { throw new InvalidArgumentException ( 'Stream must be a string stream resource identifier, ' . 'an actual stream resource, ' . 'or a Psr\Http\Message\StreamInterface implementation' ) ; } if ( ! $ stream instanceof StreamInterface ) { return new Stream ( $ stream , 'r' ) ; } return $ stream ; }
Set the body stream

@param string|resource|StreamInterface $stream
@return void
Set the body stream