original_string: public function deleteDirectory(string $path, bool $withFiles = false)
      {
          if( $path == '*' )
              $this->abort('Can not delete "*", please specify folder or file.');
  
          $files = glob($path . '/*');
  
          foreach ( $files as $file ) {
              if( is_file($file) && ! $withFiles ) return;
              is_dir($file) ? $this->deleteDirectory($file, $withFiles) : unlink($file);
          }
          if( is_dir($path) )
              try {
                  rmdir($path);
                  $this->info('Deleting folder: ' . $path);
              } catch ( \Exception $e ) {
                  $this->comment('Can not delete ' . $path . ', it might contain hidden files, such as .gitignore');
              }
      }
code: public function deleteDirectory(string $path, bool $withFiles = false)
      {
          if( $path == '*' )
              $this->abort('Can not delete "*", please specify folder or file.');
  
          $files = glob($path . '/*');
  
          foreach ( $files as $file ) {
              if( is_file($file) && ! $withFiles ) return;
              is_dir($file) ? $this->deleteDirectory($file, $withFiles) : unlink($file);
          }
          if( is_dir($path) )
              try {
                  rmdir($path);
                  $this->info('Deleting folder: ' . $path);
              } catch ( \Exception $e ) {
                  $this->comment('Can not delete ' . $path . ', it might contain hidden files, such as .gitignore');
              }
      }
code_tokens: public function deleteDirectory ( string $ path , bool $ withFiles = false ) { if ( $ path == '*' ) $ this -> abort ( 'Can not delete "*", please specify folder or file.' ) ; $ files = glob ( $ path . '/*' ) ; foreach ( $ files as $ file ) { if ( is_file ( $ file ) && ! $ withFiles ) return ; is_dir ( $ file ) ? $ this -> deleteDirectory ( $ file , $ withFiles ) : unlink ( $ file ) ; } if ( is_dir ( $ path ) ) try { rmdir ( $ path ) ; $ this -> info ( 'Deleting folder: ' . $ path ) ; } catch ( \ Exception $ e ) { $ this -> comment ( 'Can not delete ' . $ path . ', it might contain hidden files, such as .gitignore' ) ; } }
docstring: Deleting existing folder
  
  @param string $path
  @param bool $withFiles
docstring_tokens: Deleting existing folder