Mercurial > hg > cmmr2012-drupal-site
comparison vendor/chi-teck/drupal-code-generator/src/Helper/InputHandler.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
children |
comparison
equal
deleted
inserted
replaced
4:a9cd425dd02b | 5:12f9dff5fda9 |
---|---|
22 * {@inheritdoc} | 22 * {@inheritdoc} |
23 */ | 23 */ |
24 public function getName() { | 24 public function getName() { |
25 return 'dcg_input_handler'; | 25 return 'dcg_input_handler'; |
26 } | 26 } |
27 | |
28 protected $askedQuestions = []; | |
27 | 29 |
28 /** | 30 /** |
29 * Interacts with the user and returns variables for templates. | 31 * Interacts with the user and returns variables for templates. |
30 * | 32 * |
31 * @param \Symfony\Component\Console\Input\InputInterface $input | 33 * @param \Symfony\Component\Console\Input\InputInterface $input |
57 /** @var \DrupalCodeGenerator\Command\GeneratorInterface $command */ | 59 /** @var \DrupalCodeGenerator\Command\GeneratorInterface $command */ |
58 $command = $this->getHelperSet()->getCommand(); | 60 $command = $this->getHelperSet()->getCommand(); |
59 $directory = $command->getDirectory(); | 61 $directory = $command->getDirectory(); |
60 | 62 |
61 foreach ($questions as $name => $question) { | 63 foreach ($questions as $name => $question) { |
64 | |
65 if (in_array($name, $this->askedQuestions)) { | |
66 continue; | |
67 } | |
68 $this->askedQuestions[] = $name; | |
69 | |
62 /** @var \Symfony\Component\Console\Question\Question $question */ | 70 /** @var \Symfony\Component\Console\Question\Question $question */ |
63 $default_value = $question->getDefault(); | 71 $default_value = $question->getDefault(); |
64 | 72 |
65 // Make some assumptions based on question name. | 73 // Make some assumptions based on question name. |
66 if ($default_value === NULL) { | 74 if ($default_value === NULL) { |