You are here

public function CommandGcuSubscriber::onInteract in Update helper 2.x

Same name and namespace in other branches
  1. 8 modules/update_helper_checklist/src/Events/CommandGcuSubscriber.php \Drupal\update_helper_checklist\Events\CommandGcuSubscriber::onInteract()

Handle on interactive mode for getting command options.

Parameters

\Drupal\update_helper\Events\CommandInteractEvent $interact_event: Event.

File

modules/update_helper_checklist/src/Events/CommandGcuSubscriber.php, line 95

Class

CommandGcuSubscriber
Subscriber for "generate:configuration:update" command.

Namespace

Drupal\update_helper_checklist\Events

Code

public function onInteract(CommandInteractEvent $interact_event) {
  $update_versions = $this->updateChecklist
    ->getUpdateVersions($interact_event
    ->getVars()['module']);

  // Set internal pointer to end, to get last update version.
  end($update_versions);
  $questions[static::$updateVersionName] = new Question('Please enter a update version for checklist collection', empty($update_versions) ? '8.x-1.0' : current($update_versions));
  $questions[static::$updateDescription] = new Question('Please enter a detailed update description that will be used for checklist', 'This configuration update will update site configuration to newly provided configuration');
  $questions[static::$successMessageName] = new Question('Please enter a detailed update description that will be used for checklist', 'Configuration is successfully updated.');
  $questions[static::$failureMessageName] = new Question('Please enter a message that will be displayed in checklist entry when the update has failed', 'Update of configuration has failed.');
  $interact_event
    ->setQuestions($questions);
}