mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Code clean up.
This commit is contained in:
@@ -133,7 +133,6 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
}
|
||||
|
||||
return $chartData;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -342,7 +341,6 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
}
|
||||
|
||||
return $chartData;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -97,5 +97,4 @@ interface MetaPieChartInterface
|
||||
* @return MetaPieChartInterface
|
||||
*/
|
||||
public function setUser(User $user): MetaPieChartInterface;
|
||||
|
||||
}
|
||||
|
@@ -87,6 +87,4 @@ class Balance
|
||||
{
|
||||
$this->balanceLines = $balanceLines;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -89,6 +89,4 @@ class BalanceEntry
|
||||
{
|
||||
$this->spent = $spent;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -61,6 +61,4 @@ class BalanceHeader
|
||||
{
|
||||
return $this->accounts;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -36,7 +36,6 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
class BalanceLine
|
||||
{
|
||||
|
||||
const ROLE_DEFAULTROLE = 1;
|
||||
const ROLE_TAGROLE = 2;
|
||||
const ROLE_DIFFROLE = 3;
|
||||
@@ -57,7 +56,6 @@ class BalanceLine
|
||||
public function __construct()
|
||||
{
|
||||
$this->balanceEntries = new Collection;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Collection;
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
@@ -132,5 +131,4 @@ class Bill
|
||||
{
|
||||
$this->startDate = $startDate;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -177,6 +177,4 @@ class BillLine
|
||||
{
|
||||
$this->hit = $hit;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -26,7 +26,6 @@ namespace FireflyIII\Helpers\Collection;
|
||||
use FireflyIII\Models\Category as CategoryModel;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Class Category
|
||||
@@ -91,6 +90,4 @@ class Category
|
||||
{
|
||||
return $this->total;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Collector;
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use DB;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
@@ -265,8 +264,6 @@ class JournalCollector implements JournalCollectorInterface
|
||||
$transaction->opposing_account_name = app('steam')->tryDecrypt($transaction->opposing_account_name);
|
||||
$transaction->account_iban = app('steam')->tryDecrypt($transaction->account_iban);
|
||||
$transaction->opposing_account_iban = app('steam')->tryDecrypt($transaction->opposing_account_iban);
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
@@ -390,7 +387,6 @@ class JournalCollector implements JournalCollectorInterface
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -630,7 +626,6 @@ class JournalCollector implements JournalCollectorInterface
|
||||
->orderBy('transactions.amount', 'DESC');
|
||||
|
||||
$this->query = $query;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -648,7 +643,6 @@ class JournalCollector implements JournalCollectorInterface
|
||||
*/
|
||||
public function withCategoryInformation(): JournalCollectorInterface
|
||||
{
|
||||
|
||||
$this->joinCategoryTables();
|
||||
|
||||
return $this;
|
||||
@@ -760,7 +754,10 @@ class JournalCollector implements JournalCollectorInterface
|
||||
$this->joinedCategory = true;
|
||||
$this->query->leftJoin('category_transaction_journal', 'category_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id');
|
||||
$this->query->leftJoin(
|
||||
'categories as transaction_journal_categories', 'transaction_journal_categories.id', '=', 'category_transaction_journal.category_id'
|
||||
'categories as transaction_journal_categories',
|
||||
'transaction_journal_categories.id',
|
||||
'=',
|
||||
'category_transaction_journal.category_id'
|
||||
);
|
||||
|
||||
$this->query->leftJoin('category_transaction', 'category_transaction.transaction_id', '=', 'transactions.id');
|
||||
@@ -785,11 +782,12 @@ class JournalCollector implements JournalCollectorInterface
|
||||
Log::debug('joinedOpposing is false');
|
||||
// join opposing transaction (hard):
|
||||
$this->query->leftJoin(
|
||||
'transactions as opposing', function (JoinClause $join) {
|
||||
$join->on('opposing.transaction_journal_id', '=', 'transactions.transaction_journal_id')
|
||||
'transactions as opposing',
|
||||
function (JoinClause $join) {
|
||||
$join->on('opposing.transaction_journal_id', '=', 'transactions.transaction_journal_id')
|
||||
->where('opposing.identifier', '=', DB::raw('transactions.identifier'))
|
||||
->where('opposing.amount', '=', DB::raw('transactions.amount * -1'));
|
||||
}
|
||||
}
|
||||
);
|
||||
$this->query->leftJoin('accounts as opposing_accounts', 'opposing.account_id', '=', 'opposing_accounts.id');
|
||||
$this->query->leftJoin('account_types as opposing_account_types', 'opposing_accounts.account_type_id', '=', 'opposing_account_types.id');
|
||||
|
@@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Filter;
|
||||
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
interface FilterInterface
|
||||
@@ -34,5 +33,4 @@ interface FilterInterface
|
||||
* @return Collection
|
||||
*/
|
||||
public function filter(Collection $set): Collection;
|
||||
|
||||
}
|
||||
|
@@ -68,18 +68,18 @@ class InternalTransferFilter implements FilterInterface
|
||||
Log::debug(
|
||||
sprintf(
|
||||
'Transaction #%d has #%d and #%d in set, so removed',
|
||||
$transaction->id, $transaction->account_id, $transaction->opposing_account_id
|
||||
), $this->accounts
|
||||
$transaction->id,
|
||||
$transaction->account_id,
|
||||
$transaction->opposing_account_id
|
||||
),
|
||||
$this->accounts
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return $transaction;
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Filter;
|
||||
|
||||
|
||||
use FireflyIII\Models\Transaction;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
|
@@ -62,7 +62,6 @@ class Help implements HelpInterface
|
||||
*/
|
||||
public function getFromGithub(string $route, string $language): string
|
||||
{
|
||||
|
||||
$uri = sprintf('https://raw.githubusercontent.com/firefly-iii/help/master/%s/%s.md', $language, $route);
|
||||
Log::debug(sprintf('Trying to get %s...', $uri));
|
||||
$opt = ['useragent' => $this->userAgent];
|
||||
@@ -119,7 +118,6 @@ class Help implements HelpInterface
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -114,7 +114,10 @@ class BalanceReportHelper implements BalanceReportHelperInterface
|
||||
$balanceEntry = new BalanceEntry;
|
||||
$balanceEntry->setAccount($account);
|
||||
$spent = $this->budgetRepository->spentInPeriod(
|
||||
new Collection([$budgetLimit->budget]), new Collection([$account]), $budgetLimit->start_date, $budgetLimit->end_date
|
||||
new Collection([$budgetLimit->budget]),
|
||||
new Collection([$account]),
|
||||
$budgetLimit->start_date,
|
||||
$budgetLimit->end_date
|
||||
);
|
||||
$balanceEntry->setSpent($spent);
|
||||
$line->addBalanceEntry($balanceEntry);
|
||||
@@ -142,7 +145,6 @@ class BalanceReportHelper implements BalanceReportHelperInterface
|
||||
$budgetEntry->setAccount($account);
|
||||
$budgetEntry->setSpent($spent);
|
||||
$empty->addBalanceEntry($budgetEntry);
|
||||
|
||||
}
|
||||
|
||||
return $empty;
|
||||
@@ -176,7 +178,5 @@ class BalanceReportHelper implements BalanceReportHelperInterface
|
||||
$balance->setBalanceLines($newSet);
|
||||
|
||||
return $balance;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -27,7 +27,6 @@ use Carbon\Carbon;
|
||||
use FireflyIII\Helpers\Collection\Balance;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
|
||||
/**
|
||||
* Interface BalanceReportHelperInterface
|
||||
*
|
||||
|
@@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Report;
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\BudgetLimit;
|
||||
@@ -163,6 +162,5 @@ class BudgetReportHelper implements BudgetReportHelperInterface
|
||||
$array['expenses'] = $expenses;
|
||||
|
||||
return $array;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Report;
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
@@ -52,5 +51,4 @@ interface BudgetReportHelperInterface
|
||||
* @return Collection
|
||||
*/
|
||||
public function getBudgetsWithExpenses(Carbon $start, Carbon $end, Collection $accounts): Collection;
|
||||
|
||||
}
|
||||
|
@@ -153,5 +153,4 @@ class ReportHelper implements ReportHelperInterface
|
||||
|
||||
return $months;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -57,5 +57,4 @@ interface ReportHelperInterface
|
||||
* @return array
|
||||
*/
|
||||
public function listOfMonths(Carbon $date): array;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user