Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/console/Helper/SymfonyQuestionHelper.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children | 129ea1e6d783 |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
27 */ | 27 */ |
28 class SymfonyQuestionHelper extends QuestionHelper | 28 class SymfonyQuestionHelper extends QuestionHelper |
29 { | 29 { |
30 /** | 30 /** |
31 * {@inheritdoc} | 31 * {@inheritdoc} |
32 * | |
33 * To be removed in 4.0 | |
32 */ | 34 */ |
33 public function ask(InputInterface $input, OutputInterface $output, Question $question) | 35 public function ask(InputInterface $input, OutputInterface $output, Question $question) |
34 { | 36 { |
35 $validator = $question->getValidator(); | 37 $validator = $question->getValidator(); |
36 $question->setValidator(function ($value) use ($validator) { | 38 $question->setValidator(function ($value) use ($validator) { |
37 if (null !== $validator) { | 39 if (null !== $validator) { |
38 $value = $validator($value); | 40 $value = $validator($value); |
39 } else { | 41 } else { |
40 // make required | 42 // make required |
41 if (!is_array($value) && !is_bool($value) && 0 === strlen($value)) { | 43 if (!is_array($value) && !is_bool($value) && 0 === strlen($value)) { |
44 @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); | |
45 | |
42 throw new LogicException('A value is required.'); | 46 throw new LogicException('A value is required.'); |
43 } | 47 } |
44 } | 48 } |
45 | 49 |
46 return $value; | 50 return $value; |