You are here

public function ApigeeEdgeCommands::validateCreateEdgeRole in Apigee Edge 8

Validate function for the createEdge method.

@hook validate apigee-edge:create-edge-role

File

src/Commands/ApigeeEdgeCommands.php, line 126

Class

ApigeeEdgeCommands
Drush 9 command file.

Namespace

Drupal\apigee_edge\Commands

Code

public function validateCreateEdgeRole(CommandData $commandData) {

  // If the user did not specify a password, then prompt for one.
  $password = $commandData
    ->input()
    ->getOption('password');
  $email = $commandData
    ->input()
    ->getArgument('email');
  if (empty($password)) {
    $password = $this
      ->io()
      ->askHidden(dt('Enter password for :email', [
      ':email' => $email,
    ]), function ($value) {
      return $value;
    });
    $commandData
      ->input()
      ->setOption('password', $password);
  }
}