Created
October 9, 2015 19:14
-
-
Save JoshuaEstes/e3dec0df7cbafc3e97d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function interact(InputInterface $input, OutputInterface $output) | |
{ | |
$dialog = $this->getDialogHelper(); | |
$validator = Validation::createValidator(); | |
$inputValue = $dialog->ask($output, 'Enter some input: '); | |
$errors = $validator->validateValue($inputValue, new Assert\NotBlank()); | |
if (count($errors)) { | |
throw new \RuntimeException('Input cannot be blank'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment