Skip to content

Commit

Permalink
Replace default value and update handling of Enter input from the user (
Browse files Browse the repository at this point in the history
  • Loading branch information
LOBsTerr authored and jmolivas committed Jan 23, 2018
1 parent c1c7deb commit b0a14a8
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/Command/Generate/PluginBlockCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ function ($class) {
$themeRegion = $this->getIo()->choiceNoList(
$this->trans('commands.generate.plugin.block.questions.theme-region'),
array_values($themeRegions),
null,
'',
true
);
$themeRegion = array_search($themeRegion, $themeRegions);
Expand Down
4 changes: 2 additions & 2 deletions src/Command/Migrate/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,11 @@ protected function interact(InputInterface $input, OutputInterface $output)
$exclude_id = $this->getIo()->choiceNoList(
$this->trans('commands.migrate.execute.questions.exclude-id'),
array_keys($migrations_list),
null,
'',
true
);

if (empty($exclude_id)) {
if (empty($exclude_id) || is_numeric($exclude_id)) {
break;
} else {
unset($migrations_list[$exclude_id]);
Expand Down
4 changes: 2 additions & 2 deletions src/Command/Role/DeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ protected function interact(InputInterface $input, OutputInterface $output)
$role = $this->getIo()->choiceNoList(
$this->trans('commands.common.questions.roles.name'),
$roles,
null,
'',
true
);
$role = trim($role);
if (empty($role)) {
if (empty($role) || is_numeric($role)) {
break;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Command/Shared/EventsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public function eventsQuestion()
$event = $this->getIo()->choiceNoList(
$this->trans('commands.common.questions.events.name'),
$events,
null,
'',
true
);

if (empty($event)) {
if (empty($event) || is_numeric($event)) {
break;
}

Expand Down
6 changes: 3 additions & 3 deletions src/Command/Shared/FormTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ public function formQuestion()
$input_type = $this->getIo()->choiceNoList(
$this->trans('commands.common.questions.inputs.type'),
$input_types,
null,
'',
true
);

if (empty($input_type)) {
if (empty($input_type) || is_numeric($input_type)) {
break;
}

Expand Down Expand Up @@ -78,7 +78,7 @@ public function formQuestion()
$inputFieldSet = $this->getIo()->choiceNoList(
$this->trans('commands.common.questions.inputs.fieldset'),
$fieldSets,
null,
'',
true
);

Expand Down
8 changes: 4 additions & 4 deletions src/Command/Shared/ProjectDownloadTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public function modulesQuestion()
$moduleName = $this->getIo()->choiceNoList(
$this->trans('commands.module.install.questions.module'),
$modules,
null,
'',
true
);

if (empty($moduleName)) {
if (empty($moduleName) && is_numeric($moduleName)) {
break;
}

Expand Down Expand Up @@ -65,11 +65,11 @@ public function modulesUninstallQuestion()
$moduleName = $this->getIo()->choiceNoList(
$this->trans('commands.module.uninstall.questions.module'),
$modules,
null,
'',
true
);

if (empty($moduleName)) {
if (empty($moduleName) || is_numeric($modules)) {
break;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Command/Theme/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ protected function interact(InputInterface $input, OutputInterface $output)
$theme_name = $this->getIo()->choiceNoList(
$this->trans('commands.theme.install.questions.theme'),
array_keys($theme_list),
null,
'',
true
);

if (empty($theme_name)) {
if (empty($theme_name) || is_numeric($theme_name)) {
break;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Command/Theme/UninstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ protected function interact(InputInterface $input, OutputInterface $output)
$theme_name = $this->getIo()->choiceNoList(
$this->trans('commands.theme.uninstall.questions.theme'),
array_keys($theme_list),
null,
'',
true
);

if (empty($theme_name)) {
if (empty($theme_name) || is_numeric($theme_name)) {
break;
}

Expand Down

0 comments on commit b0a14a8

Please sign in to comment.