mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Code cleanup.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user