public function setStream($stream = null)
    {
        // String passed in? Try converting it to a stream
        if (is_string($stream)) {
            $stream = @fopen($stream, 'a');
        }

        // Make sure the stream is a resource
        if (!is_resource($stream)) {
            throw new \InvalidArgumentException('Invalid Stream');
        }

        // Store it
        $this->stream = $stream;

        // Afford chaining
        return $this;
    }
public function setStream($stream = null)
    {
        // String passed in? Try converting it to a stream
        if (is_string($stream)) {
            $stream = @fopen($stream, 'a');
        }

        // Make sure the stream is a resource
        if (!is_resource($stream)) {
            throw new \InvalidArgumentException('Invalid Stream');
        }

        // Store it
        $this->stream = $stream;

        // Afford chaining
        return $this;
    }
public function setStream ( $ stream = null ) { // String passed in? Try converting it to a stream if ( is_string ( $ stream ) ) { $ stream = @ fopen ( $ stream , 'a' ) ; } // Make sure the stream is a resource if ( ! is_resource ( $ stream ) ) { throw new \ InvalidArgumentException ( 'Invalid Stream' ) ; } // Store it $ this -> stream = $ stream ; // Afford chaining return $ this ; }
Set the stream to write to
@param mixed $stream Stream to write to
Set the stream to write to