Code cleanup

This commit is contained in:
James Cole
2024-12-22 08:43:12 +01:00
parent 5751f7e5a3
commit 565bd87959
574 changed files with 4600 additions and 4604 deletions

View File

@@ -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);
}
}

View File

@@ -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.