public function setStream(StreamInterface $stream): UploadedFile
    {
        if ($this->hasMoved()) {
            throw new \RuntimeException(sprintf('Uploaded file "%s" has already moved', $this->file));
        }

        $this->stream = $stream;

        return $this;
    }
public function setStream(StreamInterface $stream): UploadedFile
    {
        if ($this->hasMoved()) {
            throw new \RuntimeException(sprintf('Uploaded file "%s" has already moved', $this->file));
        }

        $this->stream = $stream;

        return $this;
    }
public function setStream ( StreamInterface $ stream ) : UploadedFile { if ( $ this -> hasMoved ( ) ) { throw new \ RuntimeException ( sprintf ( 'Uploaded file "%s" has already moved' , $ this -> file ) ) ; } $ this -> stream = $ stream ; return $ this ; }
Set stream of uploaded file.

@param \Psr\Http\Message\StreamInterface $stream

@return \Berlioz\Http\Message\UploadedFile
Set stream of uploaded file .