forked from hechoendrupal/drupal-console
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleTrait.php
More file actions
34 lines (30 loc) · 817 Bytes
/
Copy pathModuleTrait.php
File metadata and controls
34 lines (30 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* @file
* Contains Drupal\AppConsole\Command\Helper\ModuleTrait.
*/
namespace Drupal\AppConsole\Command\Helper;
use Symfony\Component\Console\Helper\HelperInterface;
use Symfony\Component\Console\Output\OutputInterface;
trait ModuleTrait
{
/**
* @param OutputInterface $output
* @param HelperInterface $dialog
* @return mixed
*/
public function moduleQuestion(OutputInterface $output, HelperInterface $dialog)
{
$modules = $this->getModules();
return $dialog->askAndValidate(
$output,
$dialog->getQuestion($this->trans('commands.common.questions.module'), ''),
function ($module) {
return $this->validateModuleExist($module);
},
false,
'',
$modules
);
}
}