original_string: public function dir()
  	{
  		$dir = clone $this;
  		if ($this->lastPart === '') {
  			// already dir
  		} else if ($this->lastPart === '..' || $this->lastPart === '.') {
  			$dir->parts[] = '';
  		} else {
  			array_pop($dir->parts);
  			$dir->parts[] = '';
  		}
  		$dir->setParts($dir->parts);
  		return $dir;
  	}
code: public function dir()
  	{
  		$dir = clone $this;
  		if ($this->lastPart === '') {
  			// already dir
  		} else if ($this->lastPart === '..' || $this->lastPart === '.') {
  			$dir->parts[] = '';
  		} else {
  			array_pop($dir->parts);
  			$dir->parts[] = '';
  		}
  		$dir->setParts($dir->parts);
  		return $dir;
  	}
code_tokens: public function dir ( ) { $ dir = clone $ this ; if ( $ this -> lastPart === '' ) { // already dir } else if ( $ this -> lastPart === '..' || $ this -> lastPart === '.' ) { $ dir -> parts [ ] = '' ; } else { array_pop ( $ dir -> parts ) ; $ dir -> parts [ ] = '' ; } $ dir -> setParts ( $ dir -> parts ) ; return $ dir ; }
docstring: Returns a new path object that points to the dirname part.
  
  @return static a new Path object
docstring_tokens: Returns a new path object that points to the dirname part .