mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-08-27 05:37:20 -05:00
Fix code quality with rector [skip ci]
This commit is contained in:
@@ -80,7 +80,7 @@ class CreateController extends Controller
|
||||
*
|
||||
* @return Factory|View
|
||||
*/
|
||||
public function create(Request $request)
|
||||
public function create(Request $request): Factory|\Illuminate\Contracts\View\View
|
||||
{
|
||||
$budgets = app('expandedform')->makeSelectListWithEmpty($this->budgetRepos->getActiveBudgets());
|
||||
$bills = app('expandedform')->makeSelectListWithEmpty($this->billRepository->getActiveBills());
|
||||
@@ -115,16 +115,14 @@ class CreateController extends Controller
|
||||
|
||||
return view(
|
||||
'recurring.create',
|
||||
compact('tomorrow', 'oldRepetitionType', 'bills', 'weekendResponses', 'preFilled', 'repetitionEnds', 'budgets')
|
||||
['tomorrow' => $tomorrow, 'oldRepetitionType' => $oldRepetitionType, 'bills' => $bills, 'weekendResponses' => $weekendResponses, 'preFilled' => $preFilled, 'repetitionEnds' => $repetitionEnds, 'budgets' => $budgets]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Factory|\Illuminate\Contracts\View\View
|
||||
*
|
||||
* @SuppressWarnings("PHPMD.ExcessiveMethodLength")
|
||||
*/
|
||||
public function createFromJournal(Request $request, TransactionJournal $journal)
|
||||
public function createFromJournal(Request $request, TransactionJournal $journal): Factory|\Illuminate\Contracts\View\View
|
||||
{
|
||||
$budgets = app('expandedform')->makeSelectListWithEmpty($this->budgetRepos->getActiveBudgets());
|
||||
$bills = app('expandedform')->makeSelectListWithEmpty($this->billRepository->getActiveBills());
|
||||
@@ -162,7 +160,7 @@ class CreateController extends Controller
|
||||
$bill = null !== $journal->bill ? $journal->bill->id : 0;
|
||||
$hasOldInput = null !== $request->old('_token'); // flash some data
|
||||
$preFilled = [];
|
||||
if (true === $hasOldInput) {
|
||||
if ($hasOldInput) {
|
||||
$preFilled = [
|
||||
'title' => $request->old('title'),
|
||||
'transaction_description' => $request->old('description'),
|
||||
@@ -206,7 +204,7 @@ class CreateController extends Controller
|
||||
}
|
||||
$request->session()->flash('preFilled', $preFilled);
|
||||
|
||||
return view('recurring.create', compact('tomorrow', 'oldRepetitionType', 'bills', 'weekendResponses', 'preFilled', 'repetitionEnds', 'budgets'));
|
||||
return view('recurring.create', ['tomorrow' => $tomorrow, 'oldRepetitionType' => $oldRepetitionType, 'bills' => $bills, 'weekendResponses' => $weekendResponses, 'preFilled' => $preFilled, 'repetitionEnds' => $repetitionEnds, 'budgets' => $budgets]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -65,7 +65,7 @@ class DeleteController extends Controller
|
||||
*
|
||||
* @return Factory|View
|
||||
*/
|
||||
public function delete(Recurrence $recurrence)
|
||||
public function delete(Recurrence $recurrence): Factory|\Illuminate\Contracts\View\View
|
||||
{
|
||||
$subTitle = (string) trans('firefly.delete_recurring', ['title' => $recurrence->title]);
|
||||
// put previous url in session
|
||||
@@ -73,15 +73,13 @@ class DeleteController extends Controller
|
||||
|
||||
$journalsCreated = $this->repository->getTransactions($recurrence)->count();
|
||||
|
||||
return view('recurring.delete', compact('recurrence', 'subTitle', 'journalsCreated'));
|
||||
return view('recurring.delete', ['recurrence' => $recurrence, 'subTitle' => $subTitle, 'journalsCreated' => $journalsCreated]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy the recurring transaction.
|
||||
*
|
||||
* @return Redirector|RedirectResponse
|
||||
*/
|
||||
public function destroy(RecurringRepositoryInterface $repository, Request $request, Recurrence $recurrence)
|
||||
public function destroy(RecurringRepositoryInterface $repository, Request $request, Recurrence $recurrence): Redirector|RedirectResponse
|
||||
{
|
||||
$repository->destroy($recurrence);
|
||||
$request->session()->flash('success', (string) trans('firefly.recurrence_deleted', ['title' => $recurrence->title]));
|
||||
|
||||
@@ -86,7 +86,7 @@ class EditController extends Controller
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function edit(Request $request, Recurrence $recurrence)
|
||||
public function edit(Request $request, Recurrence $recurrence): Factory|\Illuminate\Contracts\View\View
|
||||
{
|
||||
// TODO this should be in the repository.
|
||||
$count = $recurrence->recurrenceTransactions()->count();
|
||||
@@ -160,17 +160,7 @@ class EditController extends Controller
|
||||
|
||||
return view(
|
||||
'recurring.edit',
|
||||
compact(
|
||||
'recurrence',
|
||||
'array',
|
||||
'bills',
|
||||
'weekendResponses',
|
||||
'budgets',
|
||||
'preFilled',
|
||||
'currentRepType',
|
||||
'repetitionEnd',
|
||||
'repetitionEnds'
|
||||
)
|
||||
['recurrence' => $recurrence, 'array' => $array, 'bills' => $bills, 'weekendResponses' => $weekendResponses, 'budgets' => $budgets, 'preFilled' => $preFilled, 'currentRepType' => $currentRepType, 'repetitionEnd' => $repetitionEnd, 'repetitionEnds' => $repetitionEnds]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ class IndexController extends Controller
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request): Factory|\Illuminate\Contracts\View\View
|
||||
{
|
||||
$page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page');
|
||||
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
|
||||
@@ -134,6 +134,6 @@ class IndexController extends Controller
|
||||
|
||||
$this->verifyRecurringCronJob();
|
||||
|
||||
return view('recurring.index', compact('paginator', 'today', 'page', 'pageSize', 'total'));
|
||||
return view('recurring.index', ['paginator' => $paginator, 'today' => $today, 'page' => $page, 'pageSize' => $pageSize, 'total' => $total]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ class ShowController extends Controller
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function show(Recurrence $recurrence)
|
||||
public function show(Recurrence $recurrence): Factory|\Illuminate\Contracts\View\View
|
||||
{
|
||||
$repos = app(AttachmentRepositoryInterface::class);
|
||||
|
||||
@@ -137,6 +137,6 @@ class ShowController extends Controller
|
||||
|
||||
$subTitle = (string) trans('firefly.overview_for_recurrence', ['title' => $recurrence->title]);
|
||||
|
||||
return view('recurring.show', compact('recurrence', 'subTitle', 'array', 'groups', 'today'));
|
||||
return view('recurring.show', ['recurrence' => $recurrence, 'subTitle' => $subTitle, 'array' => $array, 'groups' => $groups, 'today' => $today]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Recurring;
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Http\Requests\TriggerRecurrenceRequest;
|
||||
use FireflyIII\Jobs\CreateRecurringTransactions;
|
||||
@@ -70,7 +71,7 @@ class TriggerController extends Controller
|
||||
$backupDate = $recurrence->latest_date;
|
||||
|
||||
// fire the recurring cron job on the given date, then post-date the created transaction.
|
||||
app('log')->info(sprintf('Trigger: will now fire recurring cron job task for date "%s".', $date->format('Y-m-d H:i:s')));
|
||||
Log::info(sprintf('Trigger: will now fire recurring cron job task for date "%s".', $date->format('Y-m-d H:i:s')));
|
||||
|
||||
/** @var CreateRecurringTransactions $job */
|
||||
$job = app(CreateRecurringTransactions::class);
|
||||
@@ -78,7 +79,7 @@ class TriggerController extends Controller
|
||||
$job->setDate($date);
|
||||
$job->setForce(false);
|
||||
$job->handle();
|
||||
app('log')->debug('Done with recurrence.');
|
||||
Log::debug('Done with recurrence.');
|
||||
|
||||
$groups = $job->getGroups();
|
||||
$this->repository->markGroupsAsNow($groups);
|
||||
|
||||
Reference in New Issue
Block a user