code: public function getParent()
      {
          if ($this->path === "/" || ($path = dirname($this->path)) === ".") {
              return null;
          }
  
          return new DirEntity($path);
      }
docs: Get the parent directory
  
  @return \sndsgd\fs\entity\DirEntity|null