You are here

protected function AcquiaContentHubFiltersCommands::selectWebhook in Acquia Content Hub 8.2

Asks user to select webhook.

Parameters

array $webhooks: Webhooks list.

Return value

string Webhook chosen by user.

1 call to AcquiaContentHubFiltersCommands::selectWebhook()
AcquiaContentHubFiltersCommands::buildCloudFiltersList in src/Commands/AcquiaContentHubFiltersCommands.php
Builds cloud filters list.

File

src/Commands/AcquiaContentHubFiltersCommands.php, line 258

Class

AcquiaContentHubFiltersCommands
Drush command to interact with Acquia Content Hub filters.

Namespace

Drupal\acquia_contenthub\Commands

Code

protected function selectWebhook(array $webhooks) : string {
  $choices = [];
  foreach ($webhooks as $wh) {
    $choices[] = $wh
      ->getUrl();
  }
  $question = new ChoiceQuestion('Please select webhook:', $choices);
  $webhook = $this
    ->getDialog()
    ->ask($this->input, $this->output, $question);
  return $webhook;
}