Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
protected function interact(InputInterface $input, OutputInterface $output)
$dialog = $this->getDialogHelper();
$inputValue = $dialog->askAndValidate($output, 'Enter some input: ', array($this, 'validateInput'));
public function validateInput($value)
$validator = Validation::createValidator();
$errors = $validator->validateValue($value, new Assert\NotBlank());
if (count($errors)) {
throw new \InvalidArgumentException((string) $errors);
return $value;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.