original_string: public static function delDir($dir) {
          $all = self::readDir($dir, self::ALL, true, NULL);
          if (isset($all['files'])) {
              foreach ($all['files'] as $file) {
                  if (is_array($file)) {
                      foreach ($file as $fil) {
                          if (!unlink($fil)) {
                              return false;
                          }
                      }
                  } else {
                      if (!unlink($file)) {
                          return false;
                      }
                  }
              }
          }
  
          if (isset($all['dirs'])) {
              foreach (array_reverse($all['dirs']) as $_dir) {
                  if (is_array($_dir)) {
                      foreach ($_dir as $_dr) {
                          if (!rmdir($_dr)) {
                              return false;
                          }
                      }
                  } else {
                      if (!rmdir($_dir)) {
                          return false;
                      }
                  }
              }
          }
  
          return rmdir($dir);
      }
code: public static function delDir($dir) {
          $all = self::readDir($dir, self::ALL, true, NULL);
          if (isset($all['files'])) {
              foreach ($all['files'] as $file) {
                  if (is_array($file)) {
                      foreach ($file as $fil) {
                          if (!unlink($fil)) {
                              return false;
                          }
                      }
                  } else {
                      if (!unlink($file)) {
                          return false;
                      }
                  }
              }
          }
  
          if (isset($all['dirs'])) {
              foreach (array_reverse($all['dirs']) as $_dir) {
                  if (is_array($_dir)) {
                      foreach ($_dir as $_dr) {
                          if (!rmdir($_dr)) {
                              return false;
                          }
                      }
                  } else {
                      if (!rmdir($_dir)) {
                          return false;
                      }
                  }
              }
          }
  
          return rmdir($dir);
      }
code_tokens: public static function delDir ( $ dir ) { $ all = self :: readDir ( $ dir , self :: ALL , true , NULL ) ; if ( isset ( $ all [ 'files' ] ) ) { foreach ( $ all [ 'files' ] as $ file ) { if ( is_array ( $ file ) ) { foreach ( $ file as $ fil ) { if ( ! unlink ( $ fil ) ) { return false ; } } } else { if ( ! unlink ( $ file ) ) { return false ; } } } } if ( isset ( $ all [ 'dirs' ] ) ) { foreach ( array_reverse ( $ all [ 'dirs' ] ) as $ _dir ) { if ( is_array ( $ _dir ) ) { foreach ( $ _dir as $ _dr ) { if ( ! rmdir ( $ _dr ) ) { return false ; } } } else { if ( ! rmdir ( $ _dir ) ) { return false ; } } } } return rmdir ( $ dir ) ; }
docstring: Deletes a directory and all contents including subdirectories and files
  
  @param string $file
  @return boolean
docstring_tokens: Deletes a directory and all contents including subdirectories and files