mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 02:36:28 +00:00 
			
		
		
		
	Various code cleanup.
This commit is contained in:
		| @@ -145,7 +145,7 @@ class SelectController extends Controller | ||||
|  | ||||
|         // warn if nothing. | ||||
|         if (0 === count($textTriggers)) { | ||||
|             return response()->json(['html' => '', 'warning' => (string)trans('firefly.warning_no_valid_triggers')]); // @codeCoverageIgnore | ||||
|             return response()->json(['html' => '', 'warning' => (string)trans('firefly.warning_no_valid_triggers')]);  | ||||
|         } | ||||
|  | ||||
|         foreach ($textTriggers as $textTrigger) { | ||||
| @@ -168,21 +168,21 @@ class SelectController extends Controller | ||||
|         // Warn the user if only a subset of transactions is returned | ||||
|         $warning = ''; | ||||
|         if (0 === count($collection)) { | ||||
|             $warning = (string)trans('firefly.warning_no_matching_transactions'); // @codeCoverageIgnore | ||||
|             $warning = (string)trans('firefly.warning_no_matching_transactions');  | ||||
|         } | ||||
|  | ||||
|         // Return json response | ||||
|         $view = 'ERROR, see logs.'; | ||||
|         try { | ||||
|             $view = prefixView('list.journals-array-tiny', ['groups' => $collection])->render(); | ||||
|             // @codeCoverageIgnoreStart | ||||
|         } catch (Throwable $exception) { | ||||
|  | ||||
|         } catch (Throwable $exception) { // @phpstan-ignore-line | ||||
|             Log::error(sprintf('Could not render view in testTriggers(): %s', $exception->getMessage())); | ||||
|             Log::error($exception->getTraceAsString()); | ||||
|             $view = sprintf('Could not render list.journals-tiny: %s', $exception->getMessage()); | ||||
|         } | ||||
|  | ||||
|         // @codeCoverageIgnoreEnd | ||||
|  | ||||
|  | ||||
|         return response()->json(['html' => $view, 'warning' => $warning]); | ||||
|     } | ||||
| @@ -201,7 +201,7 @@ class SelectController extends Controller | ||||
|         $triggers = $rule->ruleTriggers; | ||||
|  | ||||
|         if (0 === count($triggers)) { | ||||
|             return response()->json(['html' => '', 'warning' => (string)trans('firefly.warning_no_valid_triggers')]); // @codeCoverageIgnore | ||||
|             return response()->json(['html' => '', 'warning' => (string)trans('firefly.warning_no_valid_triggers')]);  | ||||
|         } | ||||
|         // create new rule engine: | ||||
|         $newRuleEngine = app(RuleEngineInterface::class); | ||||
| @@ -213,20 +213,20 @@ class SelectController extends Controller | ||||
|  | ||||
|         $warning = ''; | ||||
|         if (0 === count($collection)) { | ||||
|             $warning = (string)trans('firefly.warning_no_matching_transactions'); // @codeCoverageIgnore | ||||
|             $warning = (string)trans('firefly.warning_no_matching_transactions');  | ||||
|         } | ||||
|  | ||||
|         // Return json response | ||||
|         $view = 'ERROR, see logs.'; | ||||
|         try { | ||||
|             $view = prefixView('list.journals-array-tiny', ['groups' => $collection])->render(); | ||||
|             // @codeCoverageIgnoreStart | ||||
|         } catch (Throwable $exception) { | ||||
|  | ||||
|         } catch (Throwable $exception) { // @phpstan-ignore-line | ||||
|             Log::error(sprintf('Could not render view in testTriggersByRule(): %s', $exception->getMessage())); | ||||
|             Log::error($exception->getTraceAsString()); | ||||
|         } | ||||
|  | ||||
|         // @codeCoverageIgnoreEnd | ||||
|  | ||||
|  | ||||
|         return response()->json(['html' => $view, 'warning' => $warning]); | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user