mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Various code cleanup.
This commit is contained in:
@@ -220,7 +220,6 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
*/
|
||||
public function getAccountsById(array $accountIds): Collection
|
||||
{
|
||||
/** @var Collection $result */
|
||||
$query = $this->user->accounts();
|
||||
|
||||
if (0 !== count($accountIds)) {
|
||||
@@ -240,7 +239,6 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
*/
|
||||
public function getAccountsByType(array $types): Collection
|
||||
{
|
||||
/** @var Collection $result */
|
||||
$query = $this->user->accounts();
|
||||
if (0 !== count($types)) {
|
||||
$query->accountTypeIn($types);
|
||||
@@ -263,7 +261,6 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
*/
|
||||
public function getActiveAccountsByType(array $types): Collection
|
||||
{
|
||||
/** @var Collection $result */
|
||||
$query = $this->user->accounts()->with(
|
||||
['accountmeta' => function (HasMany $query) {
|
||||
$query->where('name', 'account_role');
|
||||
@@ -324,7 +321,6 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
*/
|
||||
public function getInactiveAccountsByType(array $types): Collection
|
||||
{
|
||||
/** @var Collection $result */
|
||||
$query = $this->user->accounts()->with(
|
||||
['accountmeta' => function (HasMany $query) {
|
||||
$query->where('name', 'account_role');
|
||||
|
@@ -29,6 +29,7 @@ use FireflyIII\Factory\BillFactory;
|
||||
use FireflyIII\Models\Attachment;
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\Rule;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
@@ -200,7 +201,6 @@ class BillRepository implements BillRepositoryInterface
|
||||
*/
|
||||
public function getBills(): Collection
|
||||
{
|
||||
/** @var Collection $set */
|
||||
return $this->user->bills()
|
||||
->orderBy('order', 'ASC')
|
||||
->orderBy('active', 'DESC')
|
||||
@@ -549,6 +549,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
->where('rule_actions.action_type', 'link_to_bill')
|
||||
->get(['rules.id', 'rules.title', 'rule_actions.action_value', 'rules.active']);
|
||||
$array = [];
|
||||
/** @var Rule $rule */
|
||||
foreach ($rules as $rule) {
|
||||
$array[$rule->action_value] = $array[$rule->action_value] ?? [];
|
||||
$array[$rule->action_value][] = ['id' => $rule->id, 'title' => $rule->title, 'active' => $rule->active];
|
||||
|
@@ -432,25 +432,6 @@ class CurrencyRepository implements CurrencyRepositoryInterface
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list of exchange rates with this currency.
|
||||
*
|
||||
* @param TransactionCurrency $currency
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getExchangeRates(TransactionCurrency $currency): Collection
|
||||
{
|
||||
/** @var CurrencyExchangeRate $rate */
|
||||
return $this->user->currencyExchangeRates()
|
||||
->where(
|
||||
function (Builder $query) use ($currency) {
|
||||
$query->where('from_currency_id', $currency->id);
|
||||
$query->orWhere('to_currency_id', $currency->id);
|
||||
}
|
||||
)->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
@@ -207,15 +207,6 @@ interface CurrencyRepositoryInterface
|
||||
*/
|
||||
public function getExchangeRate(TransactionCurrency $fromCurrency, TransactionCurrency $toCurrency, Carbon $date): ?CurrencyExchangeRate;
|
||||
|
||||
/**
|
||||
* Return a list of exchange rates with this currency.
|
||||
*
|
||||
* @param TransactionCurrency $currency
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getExchangeRates(TransactionCurrency $currency): Collection;
|
||||
|
||||
/**
|
||||
* @param TransactionCurrency $currency
|
||||
*
|
||||
|
@@ -97,7 +97,7 @@ class JournalAPIRepository implements JournalAPIRepositoryInterface
|
||||
*/
|
||||
public function getPiggyBankEvents(TransactionJournal $journal): Collection
|
||||
{
|
||||
/** @var Collection $set */
|
||||
/** @var Collection $events */
|
||||
$events = $journal->piggyBankEvents()->get();
|
||||
$events->each(
|
||||
function (PiggyBankEvent $event) {
|
||||
|
@@ -278,7 +278,7 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $transactionId
|
||||
* @param int $journalId
|
||||
*/
|
||||
public function reconcileById(int $journalId): void
|
||||
{
|
||||
|
@@ -169,7 +169,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface
|
||||
/**
|
||||
* Returns all the journal links (of a specific type).
|
||||
*
|
||||
* @param $linkType
|
||||
* @param LinkType|null $linkType
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
|
@@ -43,7 +43,6 @@ trait CreatesObjectGroups
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @param string $title
|
||||
*
|
||||
* @return ObjectGroup|null
|
||||
|
Reference in New Issue
Block a user