Code cleanup.

This commit is contained in:
James Cole
2018-04-02 14:42:07 +02:00
parent f96f38b172
commit 7d02d0f762
55 changed files with 200 additions and 281 deletions

View File

@@ -91,7 +91,7 @@ class BudgetReportHelper implements BudgetReportHelperInterface
'id' => $budget->id,
'name' => $budget->name,
'budgeted' => strval($budgetLimit->amount),
'budgeted' => (string)$budgetLimit->amount,
'spent' => $data['expenses'],
'left' => $data['left'],
'overspent' => $data['overspent'],

View File

@@ -75,9 +75,8 @@ class PopupReport implements PopupReportInterface
/** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class);
$collector->setAccounts(new Collection([$account]))->setRange($attributes['startDate'], $attributes['endDate'])->setBudget($budget);
$journals = $collector->getJournals();
return $journals;
return $collector->getJournals();
}
/**
@@ -118,9 +117,8 @@ class PopupReport implements PopupReportInterface
if (null !== $budget->id) {
$collector->setBudget($budget);
}
$journals = $collector->getJournals();
return $journals;
return $collector->getJournals();
}
/**
@@ -136,9 +134,8 @@ class PopupReport implements PopupReportInterface
$collector->setAccounts($attributes['accounts'])->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])
->setRange($attributes['startDate'], $attributes['endDate'])->withOpposingAccount()
->setCategory($category);
$journals = $collector->getJournals();
return $journals;
return $collector->getJournals();
}
/**

View File

@@ -90,8 +90,8 @@ class ReportHelper implements ReportHelperInterface
$billLine->setBill($bill);
$billLine->setPayDate($payDate);
$billLine->setEndOfPayDate($endOfPayPeriod);
$billLine->setMin(strval($bill->amount_min));
$billLine->setMax(strval($bill->amount_max));
$billLine->setMin((string)$bill->amount_min);
$billLine->setMax((string)$bill->amount_max);
$billLine->setHit(false);
$entry = $journals->filter(
function (Transaction $transaction) use ($bill) {
@@ -119,7 +119,6 @@ class ReportHelper implements ReportHelperInterface
* @param Carbon $date
*
* @return array
* @throws \InvalidArgumentException
*/
public function listOfMonths(Carbon $date): array
{