original_string: protected function removeDir($dir){
          foreach (scandir($dir) as $item){
              if ($item == "." || $item == "..")
                  continue;
  
              if (is_dir($item)){
                  removeDir($item);
              } else {
                  unlink(join(DIRECTORY_SEPARATOR, array($dir, $item)));
              }
  
          }
          rmdir($dir);
      }
code: protected function removeDir($dir){
          foreach (scandir($dir) as $item){
              if ($item == "." || $item == "..")
                  continue;
  
              if (is_dir($item)){
                  removeDir($item);
              } else {
                  unlink(join(DIRECTORY_SEPARATOR, array($dir, $item)));
              }
  
          }
          rmdir($dir);
      }
code_tokens: protected function removeDir ( $ dir ) { foreach ( scandir ( $ dir ) as $ item ) { if ( $ item == "." || $ item == ".." ) continue ; if ( is_dir ( $ item ) ) { removeDir ( $ item ) ; } else { unlink ( join ( DIRECTORY_SEPARATOR , array ( $ dir , $ item ) ) ) ; } } rmdir ( $ dir ) ; }
docstring: Removes a directory and all files contained inside
  @param string $dir
docstring_tokens: Removes a directory and all files contained inside