Various code cleanup.

This commit is contained in:
James Cole
2017-12-22 18:32:43 +01:00
parent f13a93348f
commit 8bd76d1ff0
188 changed files with 383 additions and 396 deletions

View File

@@ -246,7 +246,6 @@ class BillController extends Controller
$transactions = $collector->getPaginatedJournals();
$transactions->setPath(route('bills.show', [$bill->id]));
$bill->paidDates = $repository->getPaidDatesInRange($bill, $date, $end);
$bill->payDates = $repository->getPayDatesInRange($bill, $date, $end);
$lastPaidDate = $this->lastPaidDate($repository->getPaidDatesInRange($bill, $date, $end), $date);
@@ -274,7 +273,6 @@ class BillController extends Controller
$request->session()->flash('success', strval(trans('firefly.stored_new_bill', ['name' => $bill->name])));
Preferences::mark();
/** @var array $files */
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
$this->attachments->saveAttachmentsForModel($bill, $files);
@@ -341,7 +339,7 @@ class BillController extends Controller
*/
private function lastPaidDate(Collection $dates, Carbon $default): Carbon
{
if ($dates->count() === 0) {
if (0 === $dates->count()) {
return $default; // @codeCoverageIgnore
}
$latest = $dates->first();
@@ -353,6 +351,5 @@ class BillController extends Controller
}
return $latest;
}
}