original_string: public static function rmdir( $dirPath, $force = false )
      {
          $_path = rtrim( $dirPath ) . DIRECTORY_SEPARATOR;
  
          if ( !$force )
          {
              return rmdir( $_path );
          }
  
          if ( !is_dir( $_path ) )
          {
              throw new \InvalidArgumentException( '"' . $_path . '" is not a directory or bogus in some other way.' );
          }
  
          $_files = glob( $_path . '*', GLOB_MARK );
  
          foreach ( $_files as $_file )
          {
              if ( is_dir( $_file ) )
              {
                  static::rmdir( $_file, true );
              }
              else
              {
                  unlink( $_file );
              }
          }
  
          return rmdir( $_path );
      }
code: public static function rmdir( $dirPath, $force = false )
      {
          $_path = rtrim( $dirPath ) . DIRECTORY_SEPARATOR;
  
          if ( !$force )
          {
              return rmdir( $_path );
          }
  
          if ( !is_dir( $_path ) )
          {
              throw new \InvalidArgumentException( '"' . $_path . '" is not a directory or bogus in some other way.' );
          }
  
          $_files = glob( $_path . '*', GLOB_MARK );
  
          foreach ( $_files as $_file )
          {
              if ( is_dir( $_file ) )
              {
                  static::rmdir( $_file, true );
              }
              else
              {
                  unlink( $_file );
              }
          }
  
          return rmdir( $_path );
      }
code_tokens: public static function rmdir ( $ dirPath , $ force = false ) { $ _path = rtrim ( $ dirPath ) . DIRECTORY_SEPARATOR ; if ( ! $ force ) { return rmdir ( $ _path ) ; } if ( ! is_dir ( $ _path ) ) { throw new \ InvalidArgumentException ( '"' . $ _path . '" is not a directory or bogus in some other way.' ) ; } $ _files = glob ( $ _path . '*' , GLOB_MARK ) ; foreach ( $ _files as $ _file ) { if ( is_dir ( $ _file ) ) { static :: rmdir ( $ _file , true ) ; } else { unlink ( $ _file ) ; } } return rmdir ( $ _path ) ; }
docstring: rmdir function with force
  
  @param string $dirPath
  @param bool   $force If true, non-empty directories will be deleted
  
  @return bool
  @throws \InvalidArgumentException
docstring_tokens: rmdir function with force