protected function attach($newStream)
    {
        if (is_resource($newStream) === false) {
            throw new InvalidArgumentException(__METHOD__ . ' argument must be a valid PHP resource');
        }

        if ($this->isAttached() === true) {
            $this->detach();
        }

        $this->stream = $newStream;
    }
protected function attach($newStream)
    {
        if (is_resource($newStream) === false) {
            throw new InvalidArgumentException(__METHOD__ . ' argument must be a valid PHP resource');
        }

        if ($this->isAttached() === true) {
            $this->detach();
        }

        $this->stream = $newStream;
    }
protected function attach ( $ newStream ) { if ( is_resource ( $ newStream ) === false ) { throw new InvalidArgumentException ( __METHOD__ . ' argument must be a valid PHP resource' ) ; } if ( $ this -> isAttached ( ) === true ) { $ this -> detach ( ) ; } $ this -> stream = $ newStream ; }
Attach new resource to this object.

Note: This method is not part of the PSR-7 standard.

@param resource $newStream A PHP resource handle.

@throws InvalidArgumentException If argument is not a valid PHP resource.
Attach new resource to this object .