comparison vendor/chi-teck/drupal-code-generator/src/Helper/InputHandler.php @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents c75dbcec494b
children 12f9dff5fda9
comparison
equal deleted inserted replaced
3:307d7a7fd348 4:a9cd425dd02b
91 $this->setQuestionDefault($question, $default_value); 91 $this->setQuestionDefault($question, $default_value);
92 92
93 if ($answers) { 93 if ($answers) {
94 if (array_key_exists($name, $answers)) { 94 if (array_key_exists($name, $answers)) {
95 $answer = $answers[$name]; 95 $answer = $answers[$name];
96 // Validate provided answer.
97 if ($validator = $question->getValidator()) {
98 $validator($answer);
99 }
96 // Turn 'yes/no' string into boolean. 100 // Turn 'yes/no' string into boolean.
97 if ($question instanceof ConfirmationQuestion && !is_bool($answer)) { 101 if ($question instanceof ConfirmationQuestion && !is_bool($answer)) {
98 $answer = strcasecmp($answer, 'yes') == 0; 102 $answer = strcasecmp($answer, 'yes') == 0;
99 } 103 }
100 } 104 }