original_string: public function rm(string $directory): bool {
      if (is_dir($directory)) {
        foreach (new DirectoryIterator(Path::replaceOSSeparator($directory)) as $fileInfo) {
          if (!$fileInfo->isDot()) {
            if ($fileInfo->isDir()) {
              $this->rm($fileInfo->getPathname());
              @rmdir($fileInfo->getPathname());
            } else if ($fileInfo->isFile()) {
              @unlink($fileInfo->getPathname());
            }
          }
        }
        @rmdir($directory);
      }
      return !file_exists($directory);
    }
code: public function rm(string $directory): bool {
      if (is_dir($directory)) {
        foreach (new DirectoryIterator(Path::replaceOSSeparator($directory)) as $fileInfo) {
          if (!$fileInfo->isDot()) {
            if ($fileInfo->isDir()) {
              $this->rm($fileInfo->getPathname());
              @rmdir($fileInfo->getPathname());
            } else if ($fileInfo->isFile()) {
              @unlink($fileInfo->getPathname());
            }
          }
        }
        @rmdir($directory);
      }
      return !file_exists($directory);
    }
code_tokens: public function rm ( string $ directory ) : bool { if ( is_dir ( $ directory ) ) { foreach ( new DirectoryIterator ( Path :: replaceOSSeparator ( $ directory ) ) as $ fileInfo ) { if ( ! $ fileInfo -> isDot ( ) ) { if ( $ fileInfo -> isDir ( ) ) { $ this -> rm ( $ fileInfo -> getPathname ( ) ) ; @ rmdir ( $ fileInfo -> getPathname ( ) ) ; } else if ( $ fileInfo -> isFile ( ) ) { @ unlink ( $ fileInfo -> getPathname ( ) ) ; } } } @ rmdir ( $ directory ) ; } return ! file_exists ( $ directory ) ; }
docstring: - Delete directory and sub directory recursive
  @param string $directory Path of directory
  @return bool Return if directory to be remove
docstring_tokens: - Delete directory and sub directory recursive