Skip to content

Firefly III: a personal finances manager

Fix PHP 8 related errors.

James Cole7530effcaaed
diff --git a/app/Http/Controllers/JavascriptController.php b/app/Http/Controllers/JavascriptController.php
index 58f68882f5..c73a82ddc6 100644
--- a/app/Http/Controllers/JavascriptController.php
+++ b/app/Http/Controllers/JavascriptController.php
@@ -54,7 +54,7 @@ class JavascriptController extends Controller
);
$preference = app('preferences')->get('currencyPreference', config('firefly.default_currency', 'EUR'));
/** @noinspection NullPointerExceptionInspection */
- $default = $currencyRepository->findByCodeNull($preference->data);
+ $default = $currencyRepository->findByCodeNull((string) $preference->data);
$data = ['accounts' => []];
diff --git a/app/Support/Http/Controllers/GetConfigurationData.php b/app/Support/Http/Controllers/GetConfigurationData.php
index 59ba461f4e..ae21096ea5 100644
--- a/app/Support/Http/Controllers/GetConfigurationData.php
+++ b/app/Support/Http/Controllers/GetConfigurationData.php
@@ -90,7 +90,7 @@ trait GetConfigurationData
*/
protected function getDateRangeConfig(): array // get configuration + get preferences.
{
- $viewRange = app('preferences')->get('viewRange', '1M')->data;
+ $viewRange = (string) app('preferences')->get('viewRange', '1M')->data;
/** @var Carbon $start */
$start = session('start');
/** @var Carbon $end */