original_string: private function rmdir($dir)
      {
          // remove all files
          $files = scandir($dir);
          foreach ($files as $file) {
              if ($file == '.' || $file == '..') {
                  continue;
              }
  
              $path = $dir . '/' . $file;
              if (is_dir($path)) {
                  $this->rmdir($path);
              } elseif (is_file($path)) {
                  unlink($path);
              }
          }
  
          rmdir($dir);
      }
code: private function rmdir($dir)
      {
          // remove all files
          $files = scandir($dir);
          foreach ($files as $file) {
              if ($file == '.' || $file == '..') {
                  continue;
              }
  
              $path = $dir . '/' . $file;
              if (is_dir($path)) {
                  $this->rmdir($path);
              } elseif (is_file($path)) {
                  unlink($path);
              }
          }
  
          rmdir($dir);
      }
code_tokens: private function rmdir ( $ dir ) { // remove all files $ files = scandir ( $ dir ) ; foreach ( $ files as $ file ) { if ( $ file == '.' || $ file == '..' ) { continue ; } $ path = $ dir . '/' . $ file ; if ( is_dir ( $ path ) ) { $ this -> rmdir ( $ path ) ; } elseif ( is_file ( $ path ) ) { unlink ( $ path ) ; } } rmdir ( $ dir ) ; }
docstring: Removes all files inside a directory recursively
  
  @param string $dir
docstring_tokens: Removes all files inside a directory recursively