| @@ 93-107 (lines=15) @@ | ||
| 90 | protected function interact(InputInterface $input, OutputInterface $output) |
|
| 91 | { |
|
| 92 | $default = $input->getOption('default'); |
|
| 93 | if (!$input->getArgument('subdomain') && !$default) { |
|
| 94 | $subdomain = $this->getHelper('dialog')->askAndValidate( |
|
| 95 | $output, |
|
| 96 | '<question>Please enter subdomain:</question>', |
|
| 97 | function ($subdomain) { |
|
| 98 | if (empty($subdomain)) { |
|
| 99 | throw new \RuntimeException('Subdomain can not be empty'); |
|
| 100 | } |
|
| 101 | ||
| 102 | return $subdomain; |
|
| 103 | } |
|
| 104 | ); |
|
| 105 | ||
| 106 | $input->setArgument('subdomain', $subdomain); |
|
| 107 | } |
|
| 108 | ||
| 109 | if (!$input->getArgument('name') && !$default) { |
|
| 110 | $name = $this->getHelper('dialog')->askAndValidate( |
|
| @@ 109-123 (lines=15) @@ | ||
| 106 | $input->setArgument('subdomain', $subdomain); |
|
| 107 | } |
|
| 108 | ||
| 109 | if (!$input->getArgument('name') && !$default) { |
|
| 110 | $name = $this->getHelper('dialog')->askAndValidate( |
|
| 111 | $output, |
|
| 112 | '<question>Please enter name:</question>', |
|
| 113 | function ($name) { |
|
| 114 | if (empty($name)) { |
|
| 115 | throw new \RuntimeException('Name can not be empty'); |
|
| 116 | } |
|
| 117 | ||
| 118 | return $name; |
|
| 119 | } |
|
| 120 | ); |
|
| 121 | ||
| 122 | $input->setArgument('name', $name); |
|
| 123 | } |
|
| 124 | } |
|
| 125 | ||
| 126 | /** |
|