mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 22:21:42 +00:00
Code cleanup that (hopefully) matches style CI
This commit is contained in:
@@ -99,7 +99,7 @@ class NetWorth implements NetWorthInterface
|
||||
/** @var Account $account */
|
||||
foreach ($accounts as $account) {
|
||||
Log::debug(sprintf('Now at account #%d: "%s"', $account->id, $account->name));
|
||||
$currencyId = (int)$this->accountRepository->getMetaValue($account, 'currency_id');
|
||||
$currencyId = (int) $this->accountRepository->getMetaValue($account, 'currency_id');
|
||||
$currencyId = 0 === $currencyId ? $default->id : $currencyId;
|
||||
|
||||
Log::debug(sprintf('Currency ID is #%d', $currencyId));
|
||||
@@ -111,9 +111,9 @@ class NetWorth implements NetWorthInterface
|
||||
|
||||
// if the account is a credit card, subtract the virtual balance from the balance,
|
||||
// to better reflect that this is not money that is actually "yours".
|
||||
$role = (string)$this->accountRepository->getMetaValue($account, 'account_role');
|
||||
$virtualBalance = (string)$account->virtual_balance;
|
||||
if ('ccAsset' === $role && '' !== $virtualBalance && (float)$virtualBalance > 0) {
|
||||
$role = (string) $this->accountRepository->getMetaValue($account, 'account_role');
|
||||
$virtualBalance = (string) $account->virtual_balance;
|
||||
if ('ccAsset' === $role && '' !== $virtualBalance && (float) $virtualBalance > 0) {
|
||||
$balance = bcsub($balance, $virtualBalance);
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ class PopupReport implements PopupReportInterface
|
||||
if (null !== $currencyId) {
|
||||
/** @var CurrencyRepositoryInterface $repos */
|
||||
$repos = app(CurrencyRepositoryInterface::class);
|
||||
$currency = $repos->find((int)$currencyId);
|
||||
$currency = $repos->find((int) $currencyId);
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ class PopupReport implements PopupReportInterface
|
||||
if (null !== $currencyId) {
|
||||
/** @var CurrencyRepositoryInterface $repos */
|
||||
$repos = app(CurrencyRepositoryInterface::class);
|
||||
$currency = $repos->find((int)$currencyId);
|
||||
$currency = $repos->find((int) $currencyId);
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ class PopupReport implements PopupReportInterface
|
||||
* Collect journals by a category.
|
||||
*
|
||||
* @param Category|null $category
|
||||
* @param array $attributes
|
||||
* @param array $attributes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@@ -166,7 +166,7 @@ class PopupReport implements PopupReportInterface
|
||||
if (null !== $currencyId) {
|
||||
/** @var CurrencyRepositoryInterface $repos */
|
||||
$repos = app(CurrencyRepositoryInterface::class);
|
||||
$currency = $repos->find((int)$currencyId);
|
||||
$currency = $repos->find((int) $currencyId);
|
||||
}
|
||||
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
@@ -179,10 +179,10 @@ class PopupReport implements PopupReportInterface
|
||||
->withCategoryInformation()
|
||||
->setRange($attributes['startDate'], $attributes['endDate'])->withAccountInformation();
|
||||
|
||||
if(null!== $category) {
|
||||
if (null !== $category) {
|
||||
$collector->setCategory($category);
|
||||
}
|
||||
if(null === $category) {
|
||||
if (null === $category) {
|
||||
$collector->withoutCategory();
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ class PopupReport implements PopupReportInterface
|
||||
if (null !== $currencyId) {
|
||||
/** @var CurrencyRepositoryInterface $repos */
|
||||
$repos = app(CurrencyRepositoryInterface::class);
|
||||
$currency = $repos->find((int)$currencyId);
|
||||
$currency = $repos->find((int) $currencyId);
|
||||
}
|
||||
|
||||
/** @var JournalRepositoryInterface $repository */
|
||||
|
||||
@@ -25,7 +25,6 @@ namespace FireflyIII\Helpers\Report;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\Category;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Interface PopupReportInterface.
|
||||
@@ -68,7 +67,7 @@ interface PopupReportInterface
|
||||
* Group by category.
|
||||
*
|
||||
* @param Category|null $category
|
||||
* @param array $attributes
|
||||
* @param array $attributes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
||||
@@ -43,6 +43,7 @@ class ReportHelper implements ReportHelperInterface
|
||||
|
||||
/**
|
||||
* ReportHelper constructor.
|
||||
*
|
||||
* @param BudgetRepositoryInterface $budgetRepository
|
||||
*/
|
||||
public function __construct(BudgetRepositoryInterface $budgetRepository)
|
||||
@@ -62,8 +63,8 @@ class ReportHelper implements ReportHelperInterface
|
||||
*
|
||||
* Excludes bills which have not had a payment on the mentioned accounts.
|
||||
*
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param Collection $accounts
|
||||
*
|
||||
* @return array
|
||||
|
||||
@@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Helpers\Report;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Helpers\Collection\Bill as BillCollection;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user