original_string: public function wd($dir = null, $code = E_USER_WARNING){
  		if(null !== $dir && is_dir($dir)){
  			$this->wd = $dir;
  			if(chdir($dir) === false){
  			    throw new \Exception('Cannot change to directory '.$dir.' in '.__METHOD__, $code);
  				return $this;
  			}
  		}else{
  			$dir = $this->wd;
  		}
  		return $this;
  	}
code: public function wd($dir = null, $code = E_USER_WARNING){
  		if(null !== $dir && is_dir($dir)){
  			$this->wd = $dir;
  			if(chdir($dir) === false){
  			    throw new \Exception('Cannot change to directory '.$dir.' in '.__METHOD__, $code);
  				return $this;
  			}
  		}else{
  			$dir = $this->wd;
  		}
  		return $this;
  	}
code_tokens: public function wd ( $ dir = null , $ code = E_USER_WARNING ) { if ( null !== $ dir && is_dir ( $ dir ) ) { $ this -> wd = $ dir ; if ( chdir ( $ dir ) === false ) { throw new \ Exception ( 'Cannot change to directory ' . $ dir . ' in ' . __METHOD__ , $ code ) ; return $ this ; } } else { $ dir = $ this -> wd ; } return $ this ; }
docstring: set working directory
docstring_tokens: set working directory