Skip to content

Commit

Permalink
Update core/Command/App/ListApps.php
Browse files Browse the repository at this point in the history
refactor: changed overcomplicated if statement into two shorter lines

Co-authored-by: Côme Chilliet <[email protected]>
Signed-off-by: Adam Blakey <[email protected]>
  • Loading branch information
adam-blakey and come-nc committed Mar 18, 2024
1 parent 8201a93 commit aa09af8
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions core/Command/App/ListApps.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$shippedFilter = null;
}

if ($input->getOption('enabled') && $input->getOption('disabled')) {
$showEnabledApps = true;
$showDisabledApps = true;
}
else if ($input->getOption('enabled')) {
$showEnabledApps = true;
$showDisabledApps = false;
}
else if ($input->getOption('disabled')) {
$showEnabledApps = false;
$showDisabledApps = true;
}
else {
$showEnabledApps = true;
$showDisabledApps = true;
}
$showEnabledApps = $input->getOption('enabled') || !$input->getOption('disabled');
$showDisabledApps = $input->getOption('disabled') || !$input->getOption('enabled');

$apps = \OC_App::getAllApps();
$enabledApps = $disabledApps = [];
Expand Down

0 comments on commit aa09af8

Please sign in to comment.