Skip to content

Firefly III: a personal finances manager

Call dedicated method.

James Cole547b83b36e7d
diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.php
index b42a1402a1..6cbddee0a0 100644
--- a/app/Http/Controllers/DebugController.php
+++ b/app/Http/Controllers/DebugController.php
@@ -44,6 +44,7 @@ use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Artisan;
+use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Route;
@@ -108,7 +109,7 @@ final class DebugController extends Controller
Preferences::mark();
$request->session()->forget(['start', 'end', '_previous', 'viewRange', 'range', 'is_custom_range', 'temp-mfa-secret', 'temp-mfa-codes']);
- Artisan::call('cache:clear');
+ Cache::clear();
Artisan::call('config:clear');
Artisan::call('route:clear');
Artisan::call('view:clear');
diff --git a/app/Listeners/Model/CurrencyExchangeRate/ProcessesExchangeRates.php b/app/Listeners/Model/CurrencyExchangeRate/ProcessesExchangeRates.php
index c7835c7c28..f090b0fc64 100644
--- a/app/Listeners/Model/CurrencyExchangeRate/ProcessesExchangeRates.php
+++ b/app/Listeners/Model/CurrencyExchangeRate/ProcessesExchangeRates.php
@@ -24,13 +24,12 @@ namespace FireflyIII\Listeners\Model\CurrencyExchangeRate;
use FireflyIII\Events\Model\CurrencyExchangeRate\CreatedCurrencyExchangeRate;
use FireflyIII\Events\Model\CurrencyExchangeRate\DestroyedCurrencyExchangeRate;
use FireflyIII\Events\Model\CurrencyExchangeRate\UpdatedCurrencyExchangeRate;
-
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Models\UserGroup;
use FireflyIII\Services\Internal\Recalculate\PrimaryAmountRecalculationService;
use FireflyIII\Support\Facades\Amount;
use FireflyIII\Support\Facades\Preferences;
-use Illuminate\Support\Facades\Artisan;
+use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Log;
class ProcessesExchangeRates
@@ -38,7 +37,7 @@ class ProcessesExchangeRates
public function handle(CreatedCurrencyExchangeRate | UpdatedCurrencyExchangeRate | DestroyedCurrencyExchangeRate $event): void
{
Preferences::mark();
- Artisan::call('cache:clear');
+ Cache::clear();
if ($event instanceof DestroyedCurrencyExchangeRate) {
$this->handleCurrency($event->userGroup, $event->from);
$this->handleCurrency($event->userGroup, $event->to);
@@ -48,7 +47,8 @@ class ProcessesExchangeRates
$this->handleCurrency($event->rate->userGroup, $event->rate->toCurrency);
}
- private function handleCurrency(UserGroup $userGroup, TransactionCurrency $currency): void {
+ private function handleCurrency(UserGroup $userGroup, TransactionCurrency $currency): void
+ {
$calculator = new PrimaryAmountRecalculationService();
if (Amount::convertToPrimary()) {