From 84bdd47109427928b17ea9d2038275f97612e630 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 25 Mar 2020 19:25:50 +0100 Subject: [PATCH] update issue templates. --- .github/ISSUE_TEMPLATE/Bug_report.md | 2 +- .github/ISSUE_TEMPLATE/Custom.md | 2 +- app/Console/Commands/Export/ExportData.php | 3 ++- app/Exceptions/GracefulNotFoundHandler.php | 18 ++++++++++++++---- app/Factory/TransactionJournalFactory.php | 2 +- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index f8f985bebf..8ca171ab64 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -19,7 +19,7 @@ I am running Firefly III version x.x.x, and my problem is: - [ ] Nobody reported this bug before -- [ ] I have added a stack trace from my log files. +- [ ] I have added a stack trace from my log files - [ ] I have added a screenshot. - [ ] I was able to replicate it on the demo site https://demo.firefly-iii.org/ diff --git a/.github/ISSUE_TEMPLATE/Custom.md b/.github/ISSUE_TEMPLATE/Custom.md index 90cbcaf332..550e015f23 100644 --- a/.github/ISSUE_TEMPLATE/Custom.md +++ b/.github/ISSUE_TEMPLATE/Custom.md @@ -18,6 +18,6 @@ I am running Firefly III version x.x.x. - [ ] I have read the FAQ at https://bit.ly/FF3-FAQ - [ ] I added a screenshot -- [ ] I added log files (see https://bit.ly/FF3-get-logs) +- [ ] I added log files - [ ] I was able to replicate the issue on the demo site. diff --git a/app/Console/Commands/Export/ExportData.php b/app/Console/Commands/Export/ExportData.php index 89ac2abdb7..4ecf0cb1ee 100644 --- a/app/Console/Commands/Export/ExportData.php +++ b/app/Console/Commands/Export/ExportData.php @@ -238,11 +238,12 @@ class ExportData extends Command /** * @throws FireflyException + * * @return string */ private function getExportDirectory(): string { - $directory = $this->option('export_directory'); + $directory = (string) $this->option('export_directory'); if (null === $directory) { $directory = './'; } diff --git a/app/Exceptions/GracefulNotFoundHandler.php b/app/Exceptions/GracefulNotFoundHandler.php index 6c4ed1d45a..9169e2c67e 100644 --- a/app/Exceptions/GracefulNotFoundHandler.php +++ b/app/Exceptions/GracefulNotFoundHandler.php @@ -50,6 +50,7 @@ class GracefulNotFoundHandler extends ExceptionHandler * @param Request $request * @param Exception $exception * + * @throws Exception * @return mixed */ public function render($request, Exception $exception) @@ -137,9 +138,10 @@ class GracefulNotFoundHandler extends ExceptionHandler * @param Request $request * @param Exception $exception * - * @return \Illuminate\Http\Response|Response + * @throws Exception + * @return Redirector|Response */ - private function handleAccount($request, Exception $exception) + private function handleAccount(Request $request, Exception $exception) { Log::debug('404 page is probably a deleted account. Redirect to overview of account types.'); /** @var User $user */ @@ -160,6 +162,13 @@ class GracefulNotFoundHandler extends ExceptionHandler return redirect(route('accounts.index', [$shortType])); } + /** + * @param Request $request + * @param Exception $exception + * + * @throws Exception + * @return RedirectResponse|Redirector|Response + */ private function handleAttachment(Request $request, Exception $exception) { Log::debug('404 page is probably a deleted attachment. Redirect to parent object.'); @@ -199,12 +208,13 @@ class GracefulNotFoundHandler extends ExceptionHandler } /** - * @param $request + * @param Request $request * @param Exception $exception * + * @throws Exception * @return RedirectResponse|\Illuminate\Http\Response|Redirector|Response */ - private function handleGroup($request, Exception $exception) + private function handleGroup(Request $request, Exception $exception) { Log::debug('404 page is probably a deleted group. Redirect to overview of group types.'); /** @var User $user */ diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php index 6c8aca89f5..98034be969 100644 --- a/app/Factory/TransactionJournalFactory.php +++ b/app/Factory/TransactionJournalFactory.php @@ -470,7 +470,7 @@ class TransactionJournalFactory // return user's default: return app('amount')->getDefaultCurrencyByUser($this->user); } - $result = $preference ?? $currency; + $result = ($preference ?? $currency) ?? app('amount')->getSystemCurrency(); Log::debug(sprintf('Currency is now #%d (%s) because of account #%d (%s)', $result->id, $result->code, $account->id, $account->name)); return $result;