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:
@@ -37,6 +37,12 @@ class CurrencyRepository implements CurrencyRepositoryInterface
|
||||
{
|
||||
private User $user;
|
||||
|
||||
#[\Override]
|
||||
public function find(int $currencyId): ?TransactionCurrency
|
||||
{
|
||||
return TransactionCurrency::find($currencyId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find by currency code, return NULL if unfound.
|
||||
*/
|
||||
@@ -89,13 +95,13 @@ class CurrencyRepository implements CurrencyRepositoryInterface
|
||||
{
|
||||
return CurrencyExchangeRate::create(
|
||||
[
|
||||
'user_id' => $this->user->id,
|
||||
'user_group_id' => $this->user->user_group_id,
|
||||
'from_currency_id' => $fromCurrency->id,
|
||||
'to_currency_id' => $toCurrency->id,
|
||||
'date' => $date,
|
||||
'date_tz' => $date->format('e'),
|
||||
'rate' => $rate,
|
||||
'user_id' => $this->user->id,
|
||||
'user_group_id' => $this->user->user_group_id,
|
||||
'from_currency_id' => $fromCurrency->id,
|
||||
'to_currency_id' => $toCurrency->id,
|
||||
'date' => $date,
|
||||
'date_tz' => $date->format('e'),
|
||||
'rate' => $rate,
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -106,10 +112,4 @@ class CurrencyRepository implements CurrencyRepositoryInterface
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function find(int $currencyId): ?TransactionCurrency
|
||||
{
|
||||
return TransactionCurrency::find($currencyId);
|
||||
}
|
||||
}
|
||||
|
@@ -35,6 +35,8 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
interface CurrencyRepositoryInterface
|
||||
{
|
||||
public function find(int $currencyId): ?TransactionCurrency;
|
||||
|
||||
/**
|
||||
* Find by currency code, return NULL if unfound.
|
||||
*
|
||||
@@ -42,8 +44,6 @@ interface CurrencyRepositoryInterface
|
||||
*/
|
||||
public function findByCode(string $currencyCode): ?TransactionCurrency;
|
||||
|
||||
public function find(int $currencyId): ?TransactionCurrency;
|
||||
|
||||
/**
|
||||
* Returns the complete set of transactions but needs
|
||||
* no user object.
|
||||
|
Reference in New Issue
Block a user