Code reordering and reformatting. I should really start employing style CI.

This commit is contained in:
James Cole
2021-09-18 10:26:12 +02:00
parent 9b9d52e99f
commit 4003cea759
344 changed files with 2776 additions and 2605 deletions

View File

@@ -265,12 +265,12 @@ class CreateController extends Controller
// redirect to show bill.
if ('true' === $request->get('return_to_bill') && (int)$request->get('bill_id') > 0) {
return redirect(route('bills.show', [(int)$request->get('bill_id')]));
return redirect(route('bills.show', [(int)$request->get('bill_id')]));
}
// redirect to new bill creation.
if ((int)$request->get('bill_id') > 0) {
return redirect($this->getPreviousUri('bills.create.uri'));
return redirect($this->getPreviousUri('bills.create.uri'));
}
$redirect = redirect($this->getPreviousUri('rules.create.uri'));

View File

@@ -143,7 +143,7 @@ class EditController extends Controller
*/
private function parseFromOperators(array $submittedOperators): array
{
// See reference nr. 65
// See reference nr. 65
$operators = config('firefly.search.operators');
$renderedEntries = [];
$triggers = [];

View File

@@ -79,8 +79,8 @@ class IndexController extends Controller
}
/**
* @param Request $request
* @param Rule $rule
* @param Request $request
* @param Rule $rule
* @param RuleGroup $ruleGroup
*
* @return JsonResponse

View File

@@ -145,7 +145,7 @@ class SelectController extends Controller
// warn if nothing.
if (empty($textTriggers)) {
return response()->json(['html' => '', 'warning' => (string)trans('firefly.warning_no_valid_triggers')]);
return response()->json(['html' => '', 'warning' => (string)trans('firefly.warning_no_valid_triggers')]);
}
foreach ($textTriggers as $textTrigger) {
@@ -169,7 +169,7 @@ class SelectController extends Controller
// Warn the user if only a subset of transactions is returned
$warning = '';
if (empty($collection)) {
$warning = (string)trans('firefly.warning_no_matching_transactions');
$warning = (string)trans('firefly.warning_no_matching_transactions');
}
// Return json response
@@ -182,6 +182,7 @@ class SelectController extends Controller
Log::error($exception->getTraceAsString());
$view = sprintf('Could not render list.journals-tiny: %s', $exception->getMessage());
}
return response()->json(['html' => $view, 'warning' => $warning]);
}
@@ -199,7 +200,7 @@ class SelectController extends Controller
$triggers = $rule->ruleTriggers;
if (empty($triggers)) {
return response()->json(['html' => '', 'warning' => (string)trans('firefly.warning_no_valid_triggers')]);
return response()->json(['html' => '', 'warning' => (string)trans('firefly.warning_no_valid_triggers')]);
}
// create new rule engine:
$newRuleEngine = app(RuleEngineInterface::class);
@@ -211,7 +212,7 @@ class SelectController extends Controller
$warning = '';
if (empty($collection)) {
$warning = (string)trans('firefly.warning_no_matching_transactions');
$warning = (string)trans('firefly.warning_no_matching_transactions');
}
// Return json response
@@ -223,6 +224,7 @@ class SelectController extends Controller
Log::error(sprintf('Could not render view in testTriggersByRule(): %s', $exception->getMessage()));
Log::error($exception->getTraceAsString());
}
return response()->json(['html' => $view, 'warning' => $warning]);
}
}