public function setStream($stream)
    {
        if (!is_resource($stream) && !$stream instanceof \Closure) {
            throw new \InvalidArgumentException(sprintf('setStream() expects a stream or Closure, %s given.', gettype($stream)), 1416311979);
        }
        $this->stream = $stream;
    }
public function setStream($stream)
    {
        if (!is_resource($stream) && !$stream instanceof \Closure) {
            throw new \InvalidArgumentException(sprintf('setStream() expects a stream or Closure, %s given.', gettype($stream)), 1416311979);
        }
        $this->stream = $stream;
    }
public function setStream ( $ stream ) { if ( ! is_resource ( $ stream ) && ! $ stream instanceof \ Closure ) { throw new \ InvalidArgumentException ( sprintf ( 'setStream() expects a stream or Closure, %s given.' , gettype ( $ stream ) ) , 1416311979 ) ; } $ this -> stream = $ stream ; }
Sets the data stream which can deliver the content of this storage object

Instead of providing a stream (PHP resource), you can also pass a Closure which returns a stream when it is
evaluated.

@param resource|\Closure $stream The data stream, or a Closure which returns one
@return void
Sets the data stream which can deliver the content of this storage object