You are here

public function WebformCliService::drush_webform_tidy_validate in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Commands/WebformCliService.php \Drupal\webform\Commands\WebformCliService::drush_webform_tidy_validate()

Implements drush_hook_COMMAND_validate().

Overrides WebformCliServiceInterface::drush_webform_tidy_validate

File

src/Commands/WebformCliService.php, line 537

Class

WebformCliService
Drush version agnostic commands.

Namespace

Drupal\webform\Commands

Code

public function drush_webform_tidy_validate($target = NULL) {
  global $config_directories;
  $target = $target ?: 'webform';
  if (empty(Settings::get('config_' . $target . '_directory', FALSE)) && !(isset($config_directories) && isset($config_directories[$target])) && !(\Drupal::moduleHandler()
    ->moduleExists($target) && file_exists(drupal_get_path('module', $target) . '/config')) && !file_exists(realpath($target))) {
    $t_args = [
      '@target' => $target,
    ];
    return $this
      ->drush_set_error($this
      ->dt("Unable to find '@target' module (config/install), config directory (sync), or path (/some/path/).", $t_args));
  }
}