Slide 77
Slide 77 text
protected function interact($input, $output)
{
$isEmpty = function($value) {
if (empty($value)) {
throw new \InvalidArgumentException('Value cannot be empty.');
}
return $value;
};
$dialog = $this->getHelper('dialog');
$this->host = $dialog->askAndValidate($output, 'host: ', $isEmpty);
$this->user = $dialog->askAndValidate($output, 'username: ', $isEmpty);
$this->password = $dialog->askHiddenResponseAndValidate(
$output, 'password: ', $isEmpty
);
$this->dbnames = $dialog->askAndValidate(
$output, 'databases separate by space: ', $isEmpty
);
}
Daniel Gomes @danielcsgomes