mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
chore: code cleanup.
This commit is contained in:
@@ -71,6 +71,28 @@ class ExchangeRateSeeder extends Seeder
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @param TransactionCurrency $from
|
||||
* @param TransactionCurrency $to
|
||||
* @param string $date
|
||||
* @param float $rate
|
||||
* @return void
|
||||
*/
|
||||
private function addRate(User $user, TransactionCurrency $from, TransactionCurrency $to, string $date, float $rate): void
|
||||
{
|
||||
/** @var User $user */
|
||||
CurrencyExchangeRate::create(
|
||||
[
|
||||
'user_id' => $user->id,
|
||||
'from_currency_id' => $from->id,
|
||||
'to_currency_id' => $to->id,
|
||||
'date' => $date,
|
||||
'rate' => $rate,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $code
|
||||
* @return TransactionCurrency|null
|
||||
@@ -95,26 +117,4 @@ class ExchangeRateSeeder extends Seeder
|
||||
->where('date', $date)
|
||||
->count() > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @param TransactionCurrency $from
|
||||
* @param TransactionCurrency $to
|
||||
* @param string $date
|
||||
* @param float $rate
|
||||
* @return void
|
||||
*/
|
||||
private function addRate(User $user, TransactionCurrency $from, TransactionCurrency $to, string $date, float $rate): void
|
||||
{
|
||||
/** @var User $user */
|
||||
CurrencyExchangeRate::create(
|
||||
[
|
||||
'user_id' => $user->id,
|
||||
'from_currency_id' => $from->id,
|
||||
'to_currency_id' => $to->id,
|
||||
'date' => $date,
|
||||
'rate' => $rate,
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user