Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / chi-teck / drupal-code-generator / src / Command / Drupal_8 / Service / TwigExtension.php
index b9121fdab85306cd03b8005c6e6b53bd6341f776..b08c8577f326e5ed1e80a3a1062038de37c4e9cf 100644 (file)
@@ -6,6 +6,7 @@ use DrupalCodeGenerator\Command\BaseGenerator;
 use DrupalCodeGenerator\Utils;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Question\ConfirmationQuestion;
 use Symfony\Component\Console\Question\Question;
 
 /**
@@ -23,9 +24,10 @@ class TwigExtension extends BaseGenerator {
   protected function interact(InputInterface $input, OutputInterface $output) {
     $questions = Utils::defaultQuestions();
     $default_class = function ($vars) {
-      return Utils::camelize($vars['name'] . 'TwigExtension');
+      return Utils::camelize($vars['name']) . 'TwigExtension';
     };
     $questions['class'] = new Question('Class', $default_class);
+    $questions['di'] = new ConfirmationQuestion('Would you like to inject dependencies?', FALSE);
 
     $this->collectVars($input, $output, $questions);