Code cleanup

This commit is contained in:
James Cole
2018-04-02 15:10:40 +02:00
parent fa7ab45a40
commit a3c34e6b3c
151 changed files with 802 additions and 990 deletions

View File

@@ -94,7 +94,7 @@ class TransactionController extends Controller
}
if ($end < $start) {
list($start, $end) = [$end, $start];
[$start, $end] = [$end, $start];
}
$startStr = $start->formatLocalized($this->monthAndDayFormat);
$endStr = $end->formatLocalized($this->monthAndDayFormat);
@@ -240,9 +240,9 @@ class TransactionController extends Controller
*/
private function getPeriodOverview(string $what, Carbon $date): Collection
{
$range = Preferences::get('viewRange', '1M')->data;
$first = $this->repository->first();
$start = new Carbon;
$range = Preferences::get('viewRange', '1M')->data;
$first = $this->repository->firstNull();
$start = new Carbon;
$start->subYear();
$types = config('firefly.transactionTypesByWhat.' . $what);
$entries = new Collection;
@@ -250,7 +250,7 @@ class TransactionController extends Controller
$start = $first->date;
}
if ($date < $start) {
list($start, $date) = [$date, $start]; // @codeCoverageIgnore
[$start, $date] = [$date, $start]; // @codeCoverageIgnore
}
/** @var array $dates */