mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-24 22:48:18 +00:00
Code cleanup that (hopefully) matches style CI
This commit is contained in:
@@ -31,9 +31,13 @@ use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\View\View;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
@@ -59,8 +63,8 @@ class HomeController extends Controller
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws Exception
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function dateRange(Request $request): JsonResponse
|
||||
{
|
||||
@@ -74,7 +78,7 @@ class HomeController extends Controller
|
||||
|
||||
// check if the label is "everything" or "Custom range" which will betray
|
||||
// a possible problem with the budgets.
|
||||
if ($label === (string)trans('firefly.everything') || $label === (string)trans('firefly.customRange')) {
|
||||
if ($label === (string) trans('firefly.everything') || $label === (string) trans('firefly.customRange')) {
|
||||
$isCustomRange = true;
|
||||
Log::debug('Range is now marked as "custom".');
|
||||
}
|
||||
@@ -82,7 +86,7 @@ class HomeController extends Controller
|
||||
$diff = $start->diffInDays($end);
|
||||
|
||||
if ($diff > 50) {
|
||||
$request->session()->flash('warning', (string)trans('firefly.warning_much_data', ['days' => $diff]));
|
||||
$request->session()->flash('warning', (string) trans('firefly.warning_much_data', ['days' => $diff]));
|
||||
}
|
||||
|
||||
$request->session()->put('is_custom_range', $isCustomRange);
|
||||
@@ -101,8 +105,8 @@ class HomeController extends Controller
|
||||
*
|
||||
* @param AccountRepositoryInterface $repository
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
|
||||
* @throws Exception
|
||||
* @return Factory|RedirectResponse|Redirector|View
|
||||
*/
|
||||
public function index(AccountRepositoryInterface $repository)
|
||||
{
|
||||
@@ -113,10 +117,11 @@ class HomeController extends Controller
|
||||
if (0 === $count) {
|
||||
return redirect(route('new-user.index'));
|
||||
}
|
||||
$subTitle = (string)trans('firefly.welcomeBack');
|
||||
$subTitle = (string) trans('firefly.welcomeBack');
|
||||
$transactions = [];
|
||||
$frontPage = app('preferences')->get(
|
||||
'frontPageAccounts', $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])->pluck('id')->toArray()
|
||||
'frontPageAccounts',
|
||||
$repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])->pluck('id')->toArray()
|
||||
);
|
||||
/** @var Carbon $start */
|
||||
$start = session('start', Carbon::now()->startOfMonth());
|
||||
@@ -145,5 +150,4 @@ class HomeController extends Controller
|
||||
|
||||
return view('index', compact('count', 'subTitle', 'transactions', 'billCount', 'start', 'end', 'today'));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user