You are here

protected function UpdateTask::confirm in Lightning Core 8.2

Same name and namespace in other branches
  1. 8.5 src/UpdateTask.php \Drupal\lightning_core\UpdateTask::confirm()
  2. 8 src/UpdateTask.php \Drupal\lightning_core\UpdateTask::confirm()
  3. 8.3 src/UpdateTask.php \Drupal\lightning_core\UpdateTask::confirm()
  4. 8.4 src/UpdateTask.php \Drupal\lightning_core\UpdateTask::confirm()

Asks for confirmation before executing the task.

Parameters

\Symfony\Component\Console\Style\StyleInterface $io: The output style.

Return value

bool TRUE if the task is confirmed, FALSE otherwise.

1 call to UpdateTask::confirm()
UpdateTask::execute in src/UpdateTask.php
Prompts for confirmation and executes the task.

File

src/UpdateTask.php, line 56

Class

UpdateTask

Namespace

Drupal\lightning_core

Code

protected function confirm(StyleInterface $io) {
  if ($this->docBlock
    ->hasTag('ask')) {
    $tags = $this->docBlock
      ->getTagsByName('ask');
    return $io
      ->confirm(reset($tags)
      ->getDescription());
  }
  return TRUE;
}