Various code cleanup.

This commit is contained in:
James Cole
2021-04-06 08:51:27 +02:00
parent d32446b171
commit 5ceef2e9c3
47 changed files with 161 additions and 557 deletions

View File

@@ -214,14 +214,6 @@ class ApplyRules extends Command
$finalList = new Collection;
$accountList = explode(',', $accountString);
// @codeCoverageIgnoreStart
if (0 === count($accountList)) {
$this->error('Please use the --accounts option to indicate the accounts to apply rules to.');
return false;
}
// @codeCoverageIgnoreEnd
/** @var AccountRepositoryInterface $accountRepository */
$accountRepository = app(AccountRepositoryInterface::class);
$accountRepository->setUser($this->getUser());
@@ -255,12 +247,7 @@ class ApplyRules extends Command
return true;
}
$ruleGroupList = explode(',', $ruleGroupString);
// @codeCoverageIgnoreStart
if (0 === count($ruleGroupList)) {
// can be empty.
return true;
}
// @codeCoverageIgnoreEnd
foreach ($ruleGroupList as $ruleGroupId) {
$ruleGroup = $this->ruleGroupRepository->find((int)$ruleGroupId);
if ($ruleGroup->active) {
@@ -286,14 +273,6 @@ class ApplyRules extends Command
}
$ruleList = explode(',', $ruleString);
// @codeCoverageIgnoreStart
if (0 === count($ruleList)) {
// can be empty.
return true;
}
// @codeCoverageIgnoreEnd
foreach ($ruleList as $ruleId) {
$rule = $this->ruleRepository->find((int)$ruleId);
if (null !== $rule && $rule->active) {