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