original_string: public function deleteTheme($theme)
      {
          if (!$theme) {
              return false;
          }
  
          if (is_string($theme)) {
              $theme = CmsTheme::load($theme);
          }
  
          if ($theme->isActiveTheme()) {
              throw new ApplicationException(trans('cms::lang.theme.delete_active_theme_failed'));
          }
  
          /*
           * Delete from file system
           */
          $themePath = $theme->getPath();
          if (File::isDirectory($themePath)) {
              File::deleteDirectory($themePath);
          }
  
          /*
           * Set uninstalled
           */
          if ($themeCode = $this->findByDirName($theme->getDirName())) {
              $this->setUninstalled($themeCode);
          }
      }
code: public function deleteTheme($theme)
      {
          if (!$theme) {
              return false;
          }
  
          if (is_string($theme)) {
              $theme = CmsTheme::load($theme);
          }
  
          if ($theme->isActiveTheme()) {
              throw new ApplicationException(trans('cms::lang.theme.delete_active_theme_failed'));
          }
  
          /*
           * Delete from file system
           */
          $themePath = $theme->getPath();
          if (File::isDirectory($themePath)) {
              File::deleteDirectory($themePath);
          }
  
          /*
           * Set uninstalled
           */
          if ($themeCode = $this->findByDirName($theme->getDirName())) {
              $this->setUninstalled($themeCode);
          }
      }
code_tokens: public function deleteTheme ( $ theme ) { if ( ! $ theme ) { return false ; } if ( is_string ( $ theme ) ) { $ theme = CmsTheme :: load ( $ theme ) ; } if ( $ theme -> isActiveTheme ( ) ) { throw new ApplicationException ( trans ( 'cms::lang.theme.delete_active_theme_failed' ) ) ; } /*
           * Delete from file system
           */ $ themePath = $ theme -> getPath ( ) ; if ( File :: isDirectory ( $ themePath ) ) { File :: deleteDirectory ( $ themePath ) ; } /*
           * Set uninstalled
           */ if ( $ themeCode = $ this -> findByDirName ( $ theme -> getDirName ( ) ) ) { $ this -> setUninstalled ( $ themeCode ) ; } }
docstring: Completely delete a theme from the system.
  @param string $theme Theme code/namespace
  @return void
docstring_tokens: Completely delete a theme from the system .