Mercurial > hg > isophonics-drupal-site
diff vendor/symfony/console/Helper/SymfonyQuestionHelper.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
line wrap: on
line diff
--- a/vendor/symfony/console/Helper/SymfonyQuestionHelper.php Tue Jul 10 15:07:59 2018 +0100 +++ b/vendor/symfony/console/Helper/SymfonyQuestionHelper.php Thu Feb 28 13:21:36 2019 +0000 @@ -12,13 +12,13 @@ namespace Symfony\Component\Console\Helper; use Symfony\Component\Console\Exception\LogicException; +use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ChoiceQuestion; use Symfony\Component\Console\Question\ConfirmationQuestion; use Symfony\Component\Console\Question\Question; use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\Console\Formatter\OutputFormatter; /** * Symfony Style Guide compliant question helper. @@ -40,7 +40,7 @@ $value = $validator($value); } else { // make required - if (!is_array($value) && !is_bool($value) && 0 === strlen($value)) { + if (!\is_array($value) && !\is_bool($value) && 0 === \strlen($value)) { @trigger_error('The default question validator is deprecated since Symfony 3.3 and will not be used anymore in version 4.0. Set a custom question validator if needed.', E_USER_DEPRECATED); throw new LogicException('A value is required.'); @@ -86,7 +86,7 @@ case $question instanceof ChoiceQuestion: $choices = $question->getChoices(); - $text = sprintf(' <info>%s</info> [<comment>%s</comment>]:', $text, OutputFormatter::escape($choices[$default])); + $text = sprintf(' <info>%s</info> [<comment>%s</comment>]:', $text, OutputFormatter::escape(isset($choices[$default]) ? $choices[$default] : $default)); break;