@@ -147,6 +147,8 @@ public function setSkeletonModuleDir($moduleDir)
147
147
148
148
/**
149
149
* @param string $moduleDir
150
+ *
151
+ * @return void
150
152
*/
151
153
public function setTargetModuleDir ($ moduleDir )
152
154
{
@@ -155,13 +157,16 @@ public function setTargetModuleDir($moduleDir)
155
157
156
158
/**
157
159
* @param array $tplEngines
160
+ *
161
+ * @return void
158
162
*/
159
163
public function setEnabledTemplatingEngines (array $ tplEngines )
160
164
{
161
165
$ this ->configEnabledTemplatingEngines = $ tplEngines ;
162
166
}
163
167
164
168
/**
169
+ * @return void
165
170
*/
166
171
protected function configure ()
167
172
{
@@ -320,8 +325,10 @@ protected function askQuestions(InputInterface $input, OutputInterface $output)
320
325
$ this ->chooseTemplatingEngine ($ input , $ output );
321
326
}
322
327
323
- if ($ this ->askForRouting ($ input , $ output )) {
324
- $ this ->chooseRouter ($ input , $ output );
328
+ if ($ this ->askForContoller ($ input , $ output )) {
329
+ if ($ this ->askForRouting ($ input , $ output )) {
330
+ return $ this ->chooseRouter ($ input , $ output );
331
+ }
325
332
}
326
333
}
327
334
@@ -416,7 +423,7 @@ private function askForTemplating(InputInterface $input, OutputInterface $output
416
423
private function askForRouting (InputInterface $ input , OutputInterface $ output )
417
424
{
418
425
$ questionHelper = $ this ->getHelper ('question ' );
419
- $ question = new ConfirmationQuestion ("Do you need routing ? (yes/no): \n" , false );
426
+ $ question = new ConfirmationQuestion ("Which router do you want ? (yes/no): \n" , false );
420
427
421
428
return $ questionHelper ->ask ($ input , $ output , $ question );
422
429
}
@@ -439,6 +446,12 @@ private function chooseTemplatingEngine($input, $output)
439
446
}
440
447
}
441
448
449
+ /**
450
+ * @param InputInterface $input
451
+ * @param OutputInterface $output
452
+ *
453
+ * @return void
454
+ */
442
455
private function chooseRouter (InputInterface $ input , OutputInterface $ output )
443
456
{
444
457
$ routingQuestion = new ChoiceQuestion ('Choose your routing engine: ' ,
@@ -460,13 +473,21 @@ private function chooseRouter(InputInterface $input, OutputInterface $output)
460
473
$ this ->routingEngine = $ chosenRouter ;
461
474
}
462
475
476
+ /**
477
+ * @param $tplEngine
478
+ *
479
+ * @return void
480
+ */
463
481
private function getTemplatingFilesFromEngine ($ tplEngine )
464
482
{
465
483
if (!isset ($ this ->tplEngineFilesMap [$ tplEngine ])) {
466
484
throw new \InvalidArgumentException ('Invalid templating engine specified for map files: ' . $ tplEngine );
467
485
}
468
486
}
469
487
488
+ /**
489
+ * @return void
490
+ */
470
491
private function processTemplatingFiles ()
471
492
{
472
493
$ tplFiles = $ this ->getTemplatingFilesFromEngine ($ this ->tplEngine );
@@ -495,6 +516,8 @@ private function processTemplatingFiles()
495
516
496
517
/**
497
518
* @throws \Exception
519
+ *
520
+ * @return void
498
521
*/
499
522
private function processRoutingFiles ($ tokenizedFiles , $ tokens )
500
523
{
@@ -543,6 +566,9 @@ private function processRoutingFiles($tokenizedFiles, $tokens)
543
566
}
544
567
}
545
568
569
+ /**
570
+ * @return array
571
+ */
546
572
protected function getTokenizedCoreFiles ()
547
573
{
548
574
$ files = [];
@@ -552,6 +578,11 @@ protected function getTokenizedCoreFiles()
552
578
return $ files ;
553
579
}
554
580
581
+ /**
582
+ * @param $routingEngine
583
+ * @return array
584
+ * @throws \Exception
585
+ */
555
586
private function getRoutingTokenMap ($ routingEngine ) {
556
587
557
588
// if(!isset($this->routingEngineTokenMap[$routingEngine])) {
0 commit comments