Improved if statements reducing indentation

This commit is contained in:
Alejandro Celaya 2017-07-06 17:38:16 +02:00
parent 23922f6c7b
commit c05aeabdee
3 changed files with 12 additions and 21 deletions

View file

@ -24,13 +24,10 @@ class ApplicationConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
{
$this->printTitle($output, 'APPLICATION');
if ($appConfig->hasApp()) {
$keepConfig = $this->questionHelper->ask($input, $output, new ConfirmationQuestion(
'<question>Do you want to keep imported application config? (Y/n):</question> '
));
if ($keepConfig) {
return;
}
if ($appConfig->hasApp() && $this->questionHelper->ask($input, $output, new ConfirmationQuestion(
'<question>Do you want to keep imported application config? (Y/n):</question> '
))) {
return;
}
$appConfig->setApp([

View file

@ -25,13 +25,10 @@ class LanguageConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
{
$this->printTitle($output, 'LANGUAGE');
if ($appConfig->hasLanguage()) {
$keepConfig = $this->questionHelper->ask($input, $output, new ConfirmationQuestion(
'<question>Do you want to keep imported language? (Y/n):</question> '
));
if ($keepConfig) {
return;
}
if ($appConfig->hasLanguage() && $this->questionHelper->ask($input, $output, new ConfirmationQuestion(
'<question>Do you want to keep imported language? (Y/n):</question> '
))) {
return;
}
$appConfig->setLanguage([

View file

@ -24,13 +24,10 @@ class UrlShortenerConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
{
$this->printTitle($output, 'URL SHORTENER');
if ($appConfig->hasUrlShortener()) {
$keepConfig = $this->questionHelper->ask($input, $output, new ConfirmationQuestion(
'<question>Do you want to keep imported URL shortener config? (Y/n):</question> '
));
if ($keepConfig) {
return;
}
if ($appConfig->hasUrlShortener() && $this->questionHelper->ask($input, $output, new ConfirmationQuestion(
'<question>Do you want to keep imported URL shortener config? (Y/n):</question> '
))) {
return;
}
// Ask for URL shortener params