Code cleanup.

This commit is contained in:
James Cole
2023-12-20 19:35:52 +01:00
parent c4f6366642
commit 64ec0cf62e
997 changed files with 12908 additions and 28136 deletions

View File

@@ -48,7 +48,6 @@ class BudgetLimitCurrency extends Command
/**
* Execute the console command.
*
* @return int
* @throws ContainerExceptionInterface
* @throws FireflyException
* @throws NotFoundExceptionInterface
@@ -61,16 +60,16 @@ class BudgetLimitCurrency extends Command
return 0;
}
$count = 0;
$budgetLimits = BudgetLimit::get();
/** @var BudgetLimit $budgetLimit */
foreach ($budgetLimits as $budgetLimit) {
if (null === $budgetLimit->transaction_currency_id) {
/** @var Budget|null $budget */
/** @var null|Budget $budget */
$budget = $budgetLimit->budget;
if (null !== $budget) {
/** @var User|null $user */
/** @var null|User $user */
$user = $budget->user;
if (null !== $user) {
$currency = app('amount')->getDefaultCurrencyByUserGroup($user->userGroup);
@@ -79,7 +78,7 @@ class BudgetLimitCurrency extends Command
$this->friendlyInfo(
sprintf('Budget limit #%d (part of budget "%s") now has a currency setting (%s).', $budgetLimit->id, $budget->name, $currency->name)
);
$count++;
++$count;
}
}
}
@@ -93,7 +92,6 @@ class BudgetLimitCurrency extends Command
}
/**
* @return bool
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
@@ -107,9 +105,6 @@ class BudgetLimitCurrency extends Command
return false;
}
/**
*
*/
private function markAsExecuted(): void
{
app('fireflyconfig')->set(self::CONFIG_NAME, true);