From 5414a70abb5c6bcf64118bd3ab90f512656220c7 Mon Sep 17 00:00:00 2001 From: JC5 Date: Mon, 21 Apr 2025 05:23:29 +0200 Subject: [PATCH 01/87] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-04-21?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/firefly.php b/config/firefly.php index e16d645d92..f1bd4b849e 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -78,7 +78,7 @@ return [ 'running_balance_column' => env('USE_RUNNING_BALANCE', false), // see cer.php for exchange rates feature flag. ], - 'version' => '6.2.12', + 'version' => 'develop/2025-04-21', 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 25, From dca3ac92506380c876765def8a41f16b7dae4ca9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 04:07:28 +0000 Subject: [PATCH 02/87] Bump i18next from 24.2.3 to 25.0.1 Bumps [i18next](https://github.com/i18next/i18next) from 24.2.3 to 25.0.1. - [Release notes](https://github.com/i18next/i18next/releases) - [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/i18next/compare/v24.2.3...v25.0.1) --- updated-dependencies: - dependency-name: i18next dependency-version: 25.0.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- resources/assets/v2/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0e76a11c0d..1fff080996 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6979,9 +6979,9 @@ } }, "node_modules/i18next": { - "version": "24.2.3", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-24.2.3.tgz", - "integrity": "sha512-lfbf80OzkocvX7nmZtu7nSTNbrTYR52sLWxPtlXX1zAhVw8WEnFk4puUkCR4B1dNQwbSpEHHHemcZu//7EcB7A==", + "version": "25.0.1", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.0.1.tgz", + "integrity": "sha512-8S8PyZbrymJZn3DaN70/34JYWNhsqrU6yA4MuzcygJBv+41dgNMocEA8h+kV1P7MCc1ll03lOTOIXE7mpNCicw==", "funding": [ { "type": "individual", @@ -12337,7 +12337,7 @@ "chartjs-adapter-date-fns": "^3.0.0", "chartjs-chart-sankey": "^0.14.0", "date-fns": "^4.0.0", - "i18next": "^24.2.0", + "i18next": "^25.0.1", "i18next-chained-backend": "^4.6.2", "i18next-http-backend": "^3.0.1", "i18next-localstorage-backend": "^4.2.0", diff --git a/resources/assets/v2/package.json b/resources/assets/v2/package.json index b7eca8bc55..4475761b96 100644 --- a/resources/assets/v2/package.json +++ b/resources/assets/v2/package.json @@ -27,7 +27,7 @@ "chartjs-adapter-date-fns": "^3.0.0", "chartjs-chart-sankey": "^0.14.0", "date-fns": "^4.0.0", - "i18next": "^24.2.0", + "i18next": "^25.0.1", "i18next-chained-backend": "^4.6.2", "i18next-http-backend": "^3.0.1", "i18next-localstorage-backend": "^4.2.0", From c25adf0a56a000b147a425a38cb5a0fe53eb02fe Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 21 Apr 2025 08:03:32 +0200 Subject: [PATCH 03/87] Fix #10114 --- app/Http/Controllers/Budget/IndexController.php | 4 ++-- app/Http/Controllers/Budget/ShowController.php | 6 +++++- app/Http/Controllers/Chart/BudgetController.php | 13 +++++++------ .../Budget/OperationsRepository.php | 12 ++++++++---- app/Support/Http/Controllers/AugumentData.php | 17 ++++++++++++----- .../Report/Summarizer/TransactionSummarizer.php | 12 +++++++++++- resources/views/budgets/index.twig | 1 + resources/views/budgets/show.twig | 7 +++++-- 8 files changed, 51 insertions(+), 21 deletions(-) diff --git a/app/Http/Controllers/Budget/IndexController.php b/app/Http/Controllers/Budget/IndexController.php index 6e04f56134..c348e30a29 100644 --- a/app/Http/Controllers/Budget/IndexController.php +++ b/app/Http/Controllers/Budget/IndexController.php @@ -177,7 +177,7 @@ class IndexController extends Controller $array['end_date'] = $entry->end_date; // spent in period: - $spentArr = $this->opsRepository->sumExpenses($entry->start_date, $entry->end_date, null, null, $entry->transactionCurrency); + $spentArr = $this->opsRepository->sumExpenses($entry->start_date, $entry->end_date, null, null, $entry->transactionCurrency, false); $array['spent'] = $spentArr[$entry->transaction_currency_id]['sum'] ?? '0'; $array['native_spent'] = $this->convertToNative && $entry->transaction_currency_id !== $this->defaultCurrency->id ? $converter->convert($entry->transactionCurrency, $this->defaultCurrency, $entry->start_date, $array['spent']) : null; // budgeted in period: @@ -235,7 +235,7 @@ class IndexController extends Controller /** @var TransactionCurrency $currency */ foreach ($currencies as $currency) { - $spentArr = $this->opsRepository->sumExpenses($start, $end, null, new Collection([$current]), $currency); + $spentArr = $this->opsRepository->sumExpenses($start, $end, null, new Collection([$current]), $currency, false); if (array_key_exists($currency->id, $spentArr) && array_key_exists('sum', $spentArr[$currency->id])) { $array['spent'][$currency->id]['spent'] = $spentArr[$currency->id]['sum']; $array['spent'][$currency->id]['currency_id'] = $currency->id; diff --git a/app/Http/Controllers/Budget/ShowController.php b/app/Http/Controllers/Budget/ShowController.php index e59abc4437..0e29f9e425 100644 --- a/app/Http/Controllers/Budget/ShowController.php +++ b/app/Http/Controllers/Budget/ShowController.php @@ -175,6 +175,7 @@ class ShowController extends Controller throw new FireflyException('This budget limit is not part of this budget.'); } + $currencySymbol = $budgetLimit->transactionCurrency->symbol; $page = (int) $request->get('page'); $pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $subTitle = trans( @@ -186,6 +187,9 @@ class ShowController extends Controller 'currency' => $budgetLimit->transactionCurrency->name, ] ); + if($this->convertToNative) { + $currencySymbol = $this->defaultCurrency->symbol; + } // collector: /** @var GroupCollectorInterface $collector */ @@ -203,6 +207,6 @@ class ShowController extends Controller $attachments = $this->repository->getAttachments($budget); $limits = $this->getLimits($budget, $start, $end); - return view('budgets.show', compact('limits', 'attachments', 'budget', 'budgetLimit', 'groups', 'subTitle')); + return view('budgets.show', compact('limits', 'attachments', 'budget', 'budgetLimit', 'groups', 'subTitle', 'currencySymbol')); } } diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index ae56ea84f0..05061b59e0 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -164,7 +164,7 @@ class BudgetController extends Controller $cache->addProperty($budget->id); if ($cache->has()) { - return response()->json($cache->get()); + return response()->json($cache->get()); } $locale = app('steam')->getLocale(); $entries = []; @@ -172,13 +172,13 @@ class BudgetController extends Controller $budgetCollection = new Collection([$budget]); $currency = $budgetLimit->transactionCurrency; if ($this->convertToNative) { - $amount = $budgetLimit->native_amount ?? '0'; + $amount = $budgetLimit->native_amount ?? $amount; $currency = $this->defaultCurrency; } while ($start <= $end) { $current = clone $start; - $expenses = $this->opsRepository->sumExpenses($current, $current, null, $budgetCollection, $budgetLimit->transactionCurrency); + $expenses = $this->opsRepository->sumExpenses($current, $current, null, $budgetCollection, $budgetLimit->transactionCurrency, $this->convertToNative); $spent = $expenses[$currency->id]['sum'] ?? '0'; $amount = bcadd($amount, $spent); $format = $start->isoFormat((string) trans('config.month_and_day_js', [], $locale)); @@ -191,6 +191,7 @@ class BudgetController extends Controller $data['datasets'][0]['currency_symbol'] = $currency->symbol; $data['datasets'][0]['currency_code'] = $currency->code; $cache->store($data); + //var_dump($data);exit; return response()->json($data); } @@ -214,7 +215,7 @@ class BudgetController extends Controller if (null !== $budgetLimit) { $start = $budgetLimit->start_date; $end = $budgetLimit->end_date; - $collector->setRange($budgetLimit->start_date, $budgetLimit->end_date)->setCurrency($budgetLimit->transactionCurrency); + $collector->setRange($budgetLimit->start_date, $budgetLimit->end_date)->setNormalCurrency($budgetLimit->transactionCurrency); } $cache->addProperty($start); $cache->addProperty($end); @@ -296,7 +297,7 @@ class BudgetController extends Controller if (null !== $budgetLimit) { $start = $budgetLimit->start_date; $end = $budgetLimit->end_date; - $collector->setCurrency($budgetLimit->transactionCurrency); + $collector->setNormalCurrency($budgetLimit->transactionCurrency); } $cache->addProperty($start); $cache->addProperty($end); @@ -378,7 +379,7 @@ class BudgetController extends Controller if (null !== $budgetLimit) { $start = $budgetLimit->start_date; $end = $budgetLimit->end_date; - $collector->setRange($budgetLimit->start_date, $budgetLimit->end_date)->setCurrency($budgetLimit->transactionCurrency); + $collector->setRange($budgetLimit->start_date, $budgetLimit->end_date)->setNormalCurrency($budgetLimit->transactionCurrency); } $cache->addProperty($start); $cache->addProperty($end); diff --git a/app/Repositories/Budget/OperationsRepository.php b/app/Repositories/Budget/OperationsRepository.php index 18cf66c3d4..4c25f32ffa 100644 --- a/app/Repositories/Budget/OperationsRepository.php +++ b/app/Repositories/Budget/OperationsRepository.php @@ -31,6 +31,7 @@ use FireflyIII\Models\Account; use FireflyIII\Models\Budget; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Account\AccountRepositoryInterface; +use FireflyIII\Support\Facades\Amount; use FireflyIII\Support\Report\Summarizer\TransactionSummarizer; use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface; use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait; @@ -201,9 +202,10 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn Carbon $end, ?Collection $accounts = null, ?Collection $budgets = null, - ?TransactionCurrency $currency = null + ?TransactionCurrency $currency = null, + bool $convertToNative = false ): array { - Log::debug(sprintf('Start of %s.', __METHOD__)); + Log::debug(sprintf('Start of %s(date, date, array, array, "%s", "%s").', __METHOD__, $currency?->code, var_export($convertToNative, true))); // this collector excludes all transfers TO liabilities (which are also withdrawals) // because those expenses only become expenses once they move from the liability to the friend. // 2024-12-24 disable the exclusion for now. @@ -235,8 +237,8 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn $budgets = $this->getBudgets(); } if (null !== $currency) { - Log::debug(sprintf('Limit to currency %s', $currency->code)); - $collector->setCurrency($currency); + Log::debug(sprintf('Limit to normal currency %s', $currency->code)); + $collector->setNormalCurrency($currency); } $collector->setBudgets($budgets); $journals = $collector->getExtractedJournals(); @@ -246,6 +248,8 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn Log::debug('STOP looking for transactions in the foreign currency.'); } $summarizer = new TransactionSummarizer($this->user); + // 2025-04-21 overrule "convertToNative" because in this particular view, we never want to do this. + $summarizer->setConvertToNative($convertToNative); return $summarizer->groupByCurrencyId($journals, 'negative', false); } diff --git a/app/Support/Http/Controllers/AugumentData.php b/app/Support/Http/Controllers/AugumentData.php index dc47cd4711..a5b5b6ef25 100644 --- a/app/Support/Http/Controllers/AugumentData.php +++ b/app/Support/Http/Controllers/AugumentData.php @@ -38,6 +38,7 @@ use FireflyIII\Repositories\Budget\OperationsRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Support\CacheProperties; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Log; /** * Trait AugumentData @@ -167,6 +168,7 @@ trait AugumentData */ protected function getLimits(Budget $budget, Carbon $start, Carbon $end): Collection // get data + augment with info { + Log::debug('In getLimits'); /** @var OperationsRepositoryInterface $opsRepository */ $opsRepository = app(OperationsRepositoryInterface::class); @@ -183,7 +185,7 @@ trait AugumentData $cache->addProperty('get-limits'); if ($cache->has()) { - return $cache->get(); + return $cache->get(); } $set = $blRepository->getBudgetLimits($budget, $start, $end); @@ -192,13 +194,13 @@ trait AugumentData // merge sets based on a key, in case of convert to native $limits = new Collection(); - /** @var BudgetLimit $entry */ foreach ($set as $entry) { + Log::debug(sprintf('Now at budget limit #%d', $entry->id)); $currency = $entry->transactionCurrency; if ($this->convertToNative) { // the sumExpenses method already handles this. - $currency = $this->defaultCurrency; + $currency = $this->defaultCurrency; } // clone because these objects change each other. @@ -209,9 +211,14 @@ trait AugumentData $currentEnd = clone $currentStart; $currentEnd->addMonth(); } - - $expenses = $opsRepository->sumExpenses($currentStart, $currentEnd, null, $budgetCollection, $currency); + // native amount. + $expenses = $opsRepository->sumExpenses($currentStart, $currentEnd, null, $budgetCollection, $entry->transactionCurrency, $this->convertToNative); $spent = $expenses[$currency->id]['sum'] ?? '0'; + $entry->native_spent = $spent; + + // normal amount: + $expenses = $opsRepository->sumExpenses($currentStart, $currentEnd, null, $budgetCollection, $entry->transactionCurrency, false); + $spent = $expenses[$entry->transactionCurrency->id]['sum'] ?? '0'; $entry->spent = $spent; $limits->push($entry); diff --git a/app/Support/Report/Summarizer/TransactionSummarizer.php b/app/Support/Report/Summarizer/TransactionSummarizer.php index 27f5bc1cda..588e7952d9 100644 --- a/app/Support/Report/Summarizer/TransactionSummarizer.php +++ b/app/Support/Report/Summarizer/TransactionSummarizer.php @@ -51,7 +51,7 @@ class TransactionSummarizer public function groupByCurrencyId(array $journals, string $method = 'negative', bool $includeForeign = true): array { - Log::debug(sprintf('Now in groupByCurrencyId(array, "%s")', $method)); + Log::debug(sprintf('Now in groupByCurrencyId([%d journals], "%s")', count($journals), $method)); $array = []; foreach ($journals as $journal) { $field = 'amount'; @@ -71,6 +71,7 @@ class TransactionSummarizer $foreignCurrencyDecimalPlaces = null; if ($this->convertToNative) { + Log::debug('convertToNative is true.'); // if convert to native, use the native amount yes or no? $useNative = $this->default->id !== (int) $journal['currency_id']; $useForeign = $this->default->id === (int) $journal['foreign_currency_id']; @@ -94,6 +95,7 @@ class TransactionSummarizer } } if (!$this->convertToNative) { + Log::debug('convertToNative is false.'); // use foreign amount? $foreignCurrencyId = (int) $journal['foreign_currency_id']; if (0 !== $foreignCurrencyId) { @@ -224,4 +226,12 @@ class TransactionSummarizer return $array; } + + public function setConvertToNative(bool $convertToNative): void + { + Log::debug(sprintf('Overrule convertToNative to become %s', var_export($convertToNative, true))); + $this->convertToNative = $convertToNative; + } + + } diff --git a/resources/views/budgets/index.twig b/resources/views/budgets/index.twig index 3d1a958d6f..cdd4b359e1 100644 --- a/resources/views/budgets/index.twig +++ b/resources/views/budgets/index.twig @@ -314,6 +314,7 @@ {% endif %} + {% for spentInfo in budget.spent %} {{ formatAmountBySymbol(spentInfo.spent, spentInfo.currency_symbol, spentInfo.currency_decimal_places) }} {% if 0 == activeDaysPassed %} diff --git a/resources/views/budgets/show.twig b/resources/views/budgets/show.twig index d0ec49a61f..0bb756dbb7 100644 --- a/resources/views/budgets/show.twig +++ b/resources/views/budgets/show.twig @@ -167,7 +167,10 @@ {{ 'spent'|_ }} {% if convertToNative %} - {{ formatAmountBySymbol(limit.spent, defaultCurrency.symbol, defaultCurrency.decimal_places) }} + {{ formatAmountBySymbol(limit.spent, limit.transactionCurrency.symbol, limit.transactionCurrency.decimal_places) }} + {% if limit.native_spent %} + ({{ formatAmountBySymbol(limit.native_spent, defaultCurrency.symbol, defaultCurrency.decimal_places) }}) + {% endif %} {% else %} {{ formatAmountBySymbol(limit.spent, limit.transactionCurrency.symbol, limit.transactionCurrency.decimal_places) }} {% endif %} @@ -215,7 +218,7 @@ {% if budgetLimit.id %} budgetLimitID = {{ budgetLimit.id }}; var budgetChartUrl = '{{ route('chart.budget.budget-limit', [budget.id, budgetLimit.id] ) }}'; - var currencySymbol = '{{ budgetLimit.transactionCurrency.symbol }}'; + var currencySymbol = '{{ currencySymbol }}'; var expenseCategoryUrl = '{{ route('chart.budget.expense-category', [budget.id, budgetLimit.id]) }}'; var expenseAssetUrl = '{{ route('chart.budget.expense-asset', [budget.id, budgetLimit.id]) }}'; var expenseExpenseUrl = '{{ route('chart.budget.expense-expense', [budget.id, budgetLimit.id]) }}'; From 2efb2377b68e666adde0741159a9ac3de5465c52 Mon Sep 17 00:00:00 2001 From: Sander Dorigo Date: Tue, 22 Apr 2025 07:55:14 +0200 Subject: [PATCH 04/87] Fix nullpointer --- app/Handlers/Observer/PiggyBankEventObserver.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Handlers/Observer/PiggyBankEventObserver.php b/app/Handlers/Observer/PiggyBankEventObserver.php index 35d6ec3612..cec090bddc 100644 --- a/app/Handlers/Observer/PiggyBankEventObserver.php +++ b/app/Handlers/Observer/PiggyBankEventObserver.php @@ -45,7 +45,12 @@ class PiggyBankEventObserver private function updateNativeAmount(PiggyBankEvent $event): void { - if (!Amount::convertToNative($event->piggyBank->accounts()->first()->user)) { + $user = $event->piggyBank->accounts()->first()?->user; + if(null === $user) { + Log::warning('Piggy bank seems to have no accounts. Break.'); + return; + } + if (!Amount::convertToNative($user)) { return; } $userCurrency = app('amount')->getNativeCurrencyByUserGroup($event->piggyBank->accounts()->first()->user->userGroup); From 55a00aa6fe231129ddc47ca605685a56c2db3537 Mon Sep 17 00:00:00 2001 From: JC5 Date: Tue, 22 Apr 2025 07:59:58 +0200 Subject: [PATCH 05/87] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-04-22?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Observer/PiggyBankEventObserver.php | 5 +++-- .../Controllers/Budget/ShowController.php | 20 ++++++++--------- .../Controllers/Chart/BudgetController.php | 4 ++-- app/Support/Http/Controllers/AugumentData.php | 22 ++++++++++--------- .../Summarizer/TransactionSummarizer.php | 2 -- config/firefly.php | 2 +- package-lock.json | 20 ++++++++--------- 7 files changed, 38 insertions(+), 37 deletions(-) diff --git a/app/Handlers/Observer/PiggyBankEventObserver.php b/app/Handlers/Observer/PiggyBankEventObserver.php index cec090bddc..3238c827ce 100644 --- a/app/Handlers/Observer/PiggyBankEventObserver.php +++ b/app/Handlers/Observer/PiggyBankEventObserver.php @@ -45,9 +45,10 @@ class PiggyBankEventObserver private function updateNativeAmount(PiggyBankEvent $event): void { - $user = $event->piggyBank->accounts()->first()?->user; - if(null === $user) { + $user = $event->piggyBank->accounts()->first()?->user; + if (null === $user) { Log::warning('Piggy bank seems to have no accounts. Break.'); + return; } if (!Amount::convertToNative($user)) { diff --git a/app/Http/Controllers/Budget/ShowController.php b/app/Http/Controllers/Budget/ShowController.php index 0e29f9e425..2a0aad331a 100644 --- a/app/Http/Controllers/Budget/ShowController.php +++ b/app/Http/Controllers/Budget/ShowController.php @@ -176,9 +176,9 @@ class ShowController extends Controller } $currencySymbol = $budgetLimit->transactionCurrency->symbol; - $page = (int) $request->get('page'); - $pageSize = (int) app('preferences')->get('listPageSize', 50)->data; - $subTitle = trans( + $page = (int) $request->get('page'); + $pageSize = (int) app('preferences')->get('listPageSize', 50)->data; + $subTitle = trans( 'firefly.budget_in_period', [ 'name' => $budget->name, @@ -187,25 +187,25 @@ class ShowController extends Controller 'currency' => $budgetLimit->transactionCurrency->name, ] ); - if($this->convertToNative) { + if ($this->convertToNative) { $currencySymbol = $this->defaultCurrency->symbol; } // collector: /** @var GroupCollectorInterface $collector */ - $collector = app(GroupCollectorInterface::class); + $collector = app(GroupCollectorInterface::class); $collector->setRange($budgetLimit->start_date, $budgetLimit->end_date)->withAccountInformation() ->setBudget($budget)->setLimit($pageSize)->setPage($page)->withBudgetInformation()->withCategoryInformation() ; - $groups = $collector->getPaginatedGroups(); + $groups = $collector->getPaginatedGroups(); $groups->setPath(route('budgets.show.limit', [$budget->id, $budgetLimit->id])); /** @var Carbon $start */ - $start = session('first', today(config('app.timezone'))->startOfYear()); - $end = today(config('app.timezone')); - $attachments = $this->repository->getAttachments($budget); - $limits = $this->getLimits($budget, $start, $end); + $start = session('first', today(config('app.timezone'))->startOfYear()); + $end = today(config('app.timezone')); + $attachments = $this->repository->getAttachments($budget); + $limits = $this->getLimits($budget, $start, $end); return view('budgets.show', compact('limits', 'attachments', 'budget', 'budgetLimit', 'groups', 'subTitle', 'currencySymbol')); } diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index 05061b59e0..54492ade81 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -164,7 +164,7 @@ class BudgetController extends Controller $cache->addProperty($budget->id); if ($cache->has()) { - return response()->json($cache->get()); + return response()->json($cache->get()); } $locale = app('steam')->getLocale(); $entries = []; @@ -191,7 +191,7 @@ class BudgetController extends Controller $data['datasets'][0]['currency_symbol'] = $currency->symbol; $data['datasets'][0]['currency_code'] = $currency->code; $cache->store($data); - //var_dump($data);exit; + // var_dump($data);exit; return response()->json($data); } diff --git a/app/Support/Http/Controllers/AugumentData.php b/app/Support/Http/Controllers/AugumentData.php index a5b5b6ef25..301c4904c8 100644 --- a/app/Support/Http/Controllers/AugumentData.php +++ b/app/Support/Http/Controllers/AugumentData.php @@ -169,6 +169,7 @@ trait AugumentData protected function getLimits(Budget $budget, Carbon $start, Carbon $end): Collection // get data + augment with info { Log::debug('In getLimits'); + /** @var OperationsRepositoryInterface $opsRepository */ $opsRepository = app(OperationsRepositoryInterface::class); @@ -185,7 +186,7 @@ trait AugumentData $cache->addProperty('get-limits'); if ($cache->has()) { - return $cache->get(); + return $cache->get(); } $set = $blRepository->getBudgetLimits($budget, $start, $end); @@ -194,32 +195,33 @@ trait AugumentData // merge sets based on a key, in case of convert to native $limits = new Collection(); + /** @var BudgetLimit $entry */ foreach ($set as $entry) { Log::debug(sprintf('Now at budget limit #%d', $entry->id)); - $currency = $entry->transactionCurrency; + $currency = $entry->transactionCurrency; if ($this->convertToNative) { // the sumExpenses method already handles this. - $currency = $this->defaultCurrency; + $currency = $this->defaultCurrency; } // clone because these objects change each other. - $currentStart = clone $entry->start_date; - $currentEnd = null === $entry->end_date ? null : clone $entry->end_date; + $currentStart = clone $entry->start_date; + $currentEnd = null === $entry->end_date ? null : clone $entry->end_date; if (null === $currentEnd) { $currentEnd = clone $currentStart; $currentEnd->addMonth(); } // native amount. - $expenses = $opsRepository->sumExpenses($currentStart, $currentEnd, null, $budgetCollection, $entry->transactionCurrency, $this->convertToNative); - $spent = $expenses[$currency->id]['sum'] ?? '0'; + $expenses = $opsRepository->sumExpenses($currentStart, $currentEnd, null, $budgetCollection, $entry->transactionCurrency, $this->convertToNative); + $spent = $expenses[$currency->id]['sum'] ?? '0'; $entry->native_spent = $spent; // normal amount: - $expenses = $opsRepository->sumExpenses($currentStart, $currentEnd, null, $budgetCollection, $entry->transactionCurrency, false); - $spent = $expenses[$entry->transactionCurrency->id]['sum'] ?? '0'; - $entry->spent = $spent; + $expenses = $opsRepository->sumExpenses($currentStart, $currentEnd, null, $budgetCollection, $entry->transactionCurrency, false); + $spent = $expenses[$entry->transactionCurrency->id]['sum'] ?? '0'; + $entry->spent = $spent; $limits->push($entry); } diff --git a/app/Support/Report/Summarizer/TransactionSummarizer.php b/app/Support/Report/Summarizer/TransactionSummarizer.php index 588e7952d9..541740348c 100644 --- a/app/Support/Report/Summarizer/TransactionSummarizer.php +++ b/app/Support/Report/Summarizer/TransactionSummarizer.php @@ -232,6 +232,4 @@ class TransactionSummarizer Log::debug(sprintf('Overrule convertToNative to become %s', var_export($convertToNative, true))); $this->convertToNative = $convertToNative; } - - } diff --git a/config/firefly.php b/config/firefly.php index f1bd4b849e..73a5cf0681 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -78,7 +78,7 @@ return [ 'running_balance_column' => env('USE_RUNNING_BALANCE', false), // see cer.php for exchange rates feature flag. ], - 'version' => 'develop/2025-04-21', + 'version' => 'develop/2025-04-22', 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 25, diff --git a/package-lock.json b/package-lock.json index 1fff080996..db9556c30f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5635,9 +5635,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.139", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.139.tgz", - "integrity": "sha512-GGnRYOTdN5LYpwbIr0rwP/ZHOQSvAF6TG0LSzp28uCBb9JiXHJGmaaKw29qjNJc5bGnnp6kXJqRnGMQoELwi5w==", + "version": "1.5.140", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.140.tgz", + "integrity": "sha512-o82Rj+ONp4Ip7Cl1r7lrqx/pXhbp/lh9DpKcMNscFJdh8ebyRofnc7Sh01B4jx403RI0oqTBvlZ7OBIZLMr2+Q==", "dev": true, "license": "ISC" }, @@ -7489,14 +7489,14 @@ "license": "MIT" }, "node_modules/json-stable-stringify": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.2.1.tgz", - "integrity": "sha512-Lp6HbbBgosLmJbjx0pBLbgvx68FaFU1sdkmBuckmhhJ88kL13OA51CDtR2yJB50eCNMH9wRqtQNNiAqQH4YXnA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.3.0.tgz", + "integrity": "sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", - "call-bound": "^1.0.3", + "call-bound": "^1.0.4", "isarray": "^2.0.5", "jsonify": "^0.0.1", "object-keys": "^1.1.1" @@ -10083,9 +10083,9 @@ "license": "MIT" }, "node_modules/sass": { - "version": "1.86.3", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.86.3.tgz", - "integrity": "sha512-iGtg8kus4GrsGLRDLRBRHY9dNVA78ZaS7xr01cWnS7PEMQyFtTqBiyCrfpTYTZXRWM94akzckYjh8oADfFNTzw==", + "version": "1.87.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.87.0.tgz", + "integrity": "sha512-d0NoFH4v6SjEK7BoX810Jsrhj7IQSYHAHLi/iSpgqKc7LaIDshFRlSg5LOymf9FqQhxEHs2W5ZQXlvy0KD45Uw==", "dev": true, "license": "MIT", "dependencies": { From 576c5f242c35f111889df9e8a1c6af51970e73a2 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 22 Apr 2025 20:41:08 +0200 Subject: [PATCH 06/87] Fix #10180 --- .../Controllers/Summary/BasicController.php | 82 ++++++++++++++----- .../Budget/OperationsRepository.php | 51 ++++++------ public/v1/js/ff/index.js | 19 +++-- 3 files changed, 96 insertions(+), 56 deletions(-) diff --git a/app/Api/V1/Controllers/Summary/BasicController.php b/app/Api/V1/Controllers/Summary/BasicController.php index f5feb2fa2c..92e52cadb5 100644 --- a/app/Api/V1/Controllers/Summary/BasicController.php +++ b/app/Api/V1/Controllers/Summary/BasicController.php @@ -43,6 +43,7 @@ use FireflyIII\Support\Http\Api\ExchangeRateConverter; use FireflyIII\Support\Report\Summarizer\TransactionSummarizer; use FireflyIII\User; use Illuminate\Http\JsonResponse; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; /** @@ -104,10 +105,10 @@ class BasicController extends Controller $billData = $this->getSubscriptionInformation($start, $end); $spentData = $this->getLeftToSpendInfo($start, $end); $netWorthData = $this->getNetWorthInfo($end); - // $balanceData = []; - // $billData = []; +// $balanceData = []; +// $billData = []; // $spentData = []; - // $netWorthData = []; +// $netWorthData = []; $total = array_merge($balanceData, $billData, $spentData, $netWorthData); // give new keys @@ -539,26 +540,63 @@ class BasicController extends Controller ), ]; } + unset($leftToSpend); if (0 === count($return)) { - $currency = $this->nativeCurrency; - $return[$currency->id] = [ - 'key' => sprintf('left-to-spend-in-%s', $currency->code), - 'title' => trans('firefly.box_left_to_spend_in_currency', ['currency' => $currency->symbol]), - 'monetary_value' => '0', - 'no_available_budgets' => true, - 'currency_id' => (string) $currency->id, - 'currency_code' => $currency->code, - 'currency_symbol' => $currency->symbol, - 'currency_decimal_places' => $currency->decimal_places, - 'value_parsed' => app('amount')->formatFlat($currency->symbol, $currency->decimal_places, '0', false), - 'local_icon' => 'money', - 'sub_title' => app('amount')->formatFlat( - $currency->symbol, - $currency->decimal_places, - '0', - false - ), - ]; + // a small trick to get every expense in this period, regardless of budget. + $spent = $this->opsRepository->sumExpenses($start, $end, null, new Collection()); + foreach ($spent as $row) { + // either an amount was budgeted or 0 is available. + $currencyId = (int) $row['currency_id']; + $spentInCurrency = $row['sum']; + $perDay = '0'; + if (0 !== $days && -1 === bccomp($spentInCurrency, '0')) { + $perDay = bcdiv($spentInCurrency, (string) $days); + } + + Log::debug(sprintf('Spent %s %s', $row['currency_code'], $row['sum'])); + + $return[$currencyId] = [ + 'key' => sprintf('left-to-spend-in-%s', $row['currency_code']), + 'title' => trans('firefly.spent'), + 'no_available_budgets' => true, + 'monetary_value' => $spentInCurrency, + 'currency_id' => (string) $row['currency_id'], + 'currency_code' => $row['currency_code'], + 'currency_symbol' => $row['currency_symbol'], + 'currency_decimal_places' => $row['currency_decimal_places'], + 'value_parsed' => app('amount')->formatFlat($row['currency_symbol'], $row['currency_decimal_places'], $spentInCurrency, false), + 'local_icon' => 'money', + 'sub_title' => app('amount')->formatFlat( + $row['currency_symbol'], + $row['currency_decimal_places'], + $perDay, + false + ), + ]; + } + +// $amount = '0'; +// // $days +// // fill in by money spent, just count it. +// $currency = $this->nativeCurrency; +// $return[$currency->id] = [ +// 'key' => sprintf('left-to-spend-in-%s', $currency->code), +// 'title' => trans('firefly.box_left_to_spend_in_currency', ['currency' => $currency->symbol]), +// 'monetary_value' => '0', +// 'no_available_budgets' => true, +// 'currency_id' => (string) $currency->id, +// 'currency_code' => $currency->code, +// 'currency_symbol' => $currency->symbol, +// 'currency_decimal_places' => $currency->decimal_places, +// 'value_parsed' => app('amount')->formatFlat($currency->symbol, $currency->decimal_places, '0', false), +// 'local_icon' => 'money', +// 'sub_title' => app('amount')->formatFlat( +// $currency->symbol, +// $currency->decimal_places, +// '0', +// false +// ), +// ]; } return array_values($return); diff --git a/app/Repositories/Budget/OperationsRepository.php b/app/Repositories/Budget/OperationsRepository.php index 4c25f32ffa..f0dadd8c70 100644 --- a/app/Repositories/Budget/OperationsRepository.php +++ b/app/Repositories/Budget/OperationsRepository.php @@ -31,7 +31,6 @@ use FireflyIII\Models\Account; use FireflyIII\Models\Budget; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Account\AccountRepositoryInterface; -use FireflyIII\Support\Facades\Amount; use FireflyIII\Support\Report\Summarizer\TransactionSummarizer; use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface; use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait; @@ -63,7 +62,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn ++$count; app('log')->debug(sprintf('Found %d budget limits. Per day is %s, total is %s', $count, $perDay, $total)); } - $avg = $total; + $avg = $total; if ($count > 0) { $avg = bcdiv($total, (string) $count); } @@ -85,21 +84,21 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn // get all transactions: /** @var GroupCollectorInterface $collector */ - $collector = app(GroupCollectorInterface::class); + $collector = app(GroupCollectorInterface::class); $collector->setAccounts($accounts)->setRange($start, $end); $collector->setBudgets($budgets); - $journals = $collector->getExtractedJournals(); + $journals = $collector->getExtractedJournals(); // loop transactions: /** @var array $journal */ foreach ($journals as $journal) { // prep data array for currency: - $budgetId = (int) $journal['budget_id']; - $budgetName = $journal['budget_name']; - $currencyId = (int) $journal['currency_id']; - $key = sprintf('%d-%d', $budgetId, $currencyId); + $budgetId = (int) $journal['budget_id']; + $budgetName = $journal['budget_name']; + $currencyId = (int) $journal['currency_id']; + $key = sprintf('%d-%d', $budgetId, $currencyId); - $data[$key] ??= [ + $data[$key] ??= [ 'id' => $budgetId, 'name' => sprintf('%s (%s)', $budgetName, $journal['currency_name']), 'sum' => '0', @@ -137,13 +136,13 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn $collector->setBudgets($this->getBudgets()); } $collector->withBudgetInformation()->withAccountInformation()->withCategoryInformation(); - $journals = $collector->getExtractedJournals(); - $array = []; + $journals = $collector->getExtractedJournals(); + $array = []; foreach ($journals as $journal) { - $currencyId = (int) $journal['currency_id']; - $budgetId = (int) $journal['budget_id']; - $budgetName = (string) $journal['budget_name']; + $currencyId = (int) $journal['currency_id']; + $budgetId = (int) $journal['budget_id']; + $budgetName = (string) $journal['budget_name']; // catch "no category" entries. if (0 === $budgetId) { @@ -151,7 +150,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn } // info about the currency: - $array[$currencyId] ??= [ + $array[$currencyId] ??= [ 'budgets' => [], 'currency_id' => $currencyId, 'currency_name' => $journal['currency_name'], @@ -203,8 +202,9 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn ?Collection $accounts = null, ?Collection $budgets = null, ?TransactionCurrency $currency = null, - bool $convertToNative = false - ): array { + bool $convertToNative = false + ): array + { Log::debug(sprintf('Start of %s(date, date, array, array, "%s", "%s").', __METHOD__, $currency?->code, var_export($convertToNative, true))); // this collector excludes all transfers TO liabilities (which are also withdrawals) // because those expenses only become expenses once they move from the liability to the friend. @@ -212,8 +212,8 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn $repository = app(AccountRepositoryInterface::class); $repository->setUser($this->user); - $subset = $repository->getAccountsByType(config('firefly.valid_liabilities')); - $selection = new Collection(); + $subset = $repository->getAccountsByType(config('firefly.valid_liabilities')); + $selection = new Collection(); /** @var Account $account */ foreach ($subset as $account) { @@ -223,12 +223,11 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn } /** @var GroupCollectorInterface $collector */ - $collector = app(GroupCollectorInterface::class); + $collector = app(GroupCollectorInterface::class); $collector->setUser($this->user) - ->setRange($start, $end) + ->setRange($start, $end) // ->excludeDestinationAccounts($selection) - ->setTypes([TransactionTypeEnum::WITHDRAWAL->value]) - ; + ->setTypes([TransactionTypeEnum::WITHDRAWAL->value]); if (null !== $accounts) { $collector->setAccounts($accounts); @@ -240,8 +239,10 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn Log::debug(sprintf('Limit to normal currency %s', $currency->code)); $collector->setNormalCurrency($currency); } - $collector->setBudgets($budgets); - $journals = $collector->getExtractedJournals(); + if ($budgets->count() > 0) { + $collector->setBudgets($budgets); + } + $journals = $collector->getExtractedJournals(); // same but for transactions in the foreign currency: if (null !== $currency) { diff --git a/public/v1/js/ff/index.js b/public/v1/js/ff/index.js index 496eb93270..c7bfc189bb 100644 --- a/public/v1/js/ff/index.js +++ b/public/v1/js/ff/index.js @@ -62,6 +62,7 @@ function drawChart() { // net worth var net_worth = []; var keepGreen = false; + var makeBlue = false; for (key in data) { // balance @@ -80,17 +81,14 @@ function drawChart() { // left to spend if (key.substring(0, 17) === 'left-to-spend-in-') { + left_to_spend_top.push(data[key].value_parsed); + left_to_spend_bottom.push(data[key].sub_title); if(true === data[key].no_available_budgets) { - left_to_spend_top.push('---'); - left_to_spend_bottom.push('---'); - keepGreen = true; + makeBlue = true; + $('#box-left-to-spend-text').text(data[key].title); } - if(false === data[key].no_available_budgets) { - left_to_spend_top.push(data[key].value_parsed); - left_to_spend_bottom.push(data[key].sub_title); - if (parseFloat(data[key].monetary_value) > 0) { - keepGreen = true; - } + if(false === data[key].no_available_budgets && parseFloat(data[key].monetary_value) > 0) { + keepGreen = true; } } @@ -102,6 +100,9 @@ function drawChart() { if(!keepGreen) { $('#box-left-to-spend-box').removeClass('bg-green-gradient').addClass('bg-red-gradient') } + if(makeBlue) { + $('#box-left-to-spend-box').removeClass('bg-red-gradient').removeClass('bg-green-gradient').addClass('bg-blue-gradient') + } // balance $('#box-balance-sums').html(balance_top.join(', ')); From 478acdc84709fade8d2ea295b11a8f9bf94c9083 Mon Sep 17 00:00:00 2001 From: Denis Iskandarov Date: Fri, 25 Apr 2025 18:41:22 +0400 Subject: [PATCH 07/87] Fix Ukrainian language names Signed-off-by: Denis Iskandarov --- config/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/firefly.php b/config/firefly.php index 73a5cf0681..7971b9be7c 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -156,7 +156,7 @@ return [ 'sv_SE' => ['name_locale' => 'Svenska', 'name_english' => 'Swedish'], // // 'tlh_AA' => ['name_locale' => 'tlhIngan Hol', 'name_english' => 'Klingon'], 'tr_TR' => ['name_locale' => 'Türkçe', 'name_english' => 'Turkish'], - 'uk_UA' => ['name_locale' => 'Ukranian', 'name_english' => 'Ukranian'], + 'uk_UA' => ['name_locale' => 'Українська', 'name_english' => 'Ukrainian'], 'vi_VN' => ['name_locale' => 'Tiếng Việt', 'name_english' => 'Vietnamese'], 'zh_TW' => ['name_locale' => 'Chinese Traditional', 'name_english' => 'Chinese Traditional'], 'zh_CN' => ['name_locale' => 'Chinese Simplified', 'name_english' => 'Chinese Simplified'], From bd1232644f9e6946022de018f8ac52bd9ccd10bc Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 26 Apr 2025 14:20:00 +0200 Subject: [PATCH 08/87] Add running balance column. --- .../Extensions/CollectorProperties.php | 1 + app/Helpers/Collector/GroupCollector.php | 17 ++++++++++++++++- app/Http/Controllers/Account/ShowController.php | 1 + resources/lang/en_US/list.php | 1 + resources/views/list/groups.twig | 10 ++++++++++ 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/app/Helpers/Collector/Extensions/CollectorProperties.php b/app/Helpers/Collector/Extensions/CollectorProperties.php index 81aa7fca10..cfa3a5f78d 100644 --- a/app/Helpers/Collector/Extensions/CollectorProperties.php +++ b/app/Helpers/Collector/Extensions/CollectorProperties.php @@ -55,6 +55,7 @@ trait CollectorProperties private HasMany $query; private ?int $startRow; private array $stringFields; + private array $booleanFields; /* * This array is used to collect ALL tags the user may search for (using 'setTags'). * This way the user can call 'setTags' multiple times and get a joined result. diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index 7d090996a7..a9e9b31984 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -82,6 +82,7 @@ class GroupCollector implements GroupCollectorInterface $this->hasJoinedAttTables = false; $this->expandGroupSearch = false; $this->hasJoinedMetaTables = false; + $this->booleanFields = ['balance_dirty']; $this->integerFields = [ 'transaction_group_id', 'user_id', @@ -100,7 +101,7 @@ class GroupCollector implements GroupCollectorInterface 'category_id', 'budget_id', ]; - $this->stringFields = ['amount', 'foreign_amount', 'native_amount', 'native_foreign_amount']; + $this->stringFields = ['amount', 'foreign_amount', 'native_amount', 'native_foreign_amount','balance_after']; $this->total = 0; $this->fields = [ // group @@ -131,6 +132,8 @@ class GroupCollector implements GroupCollectorInterface // currency info: 'source.amount as amount', + 'source.balance_after as balance_after', + 'source.balance_dirty as balance_dirty', 'source.native_amount as native_amount', 'source.transaction_currency_id as currency_id', 'currency.code as currency_code', @@ -596,6 +599,9 @@ class GroupCollector implements GroupCollectorInterface // convert values to integers: $result = $this->convertToInteger($result); + // convert to boolean + $result = $this->convertToBoolean($result); + // convert back to strings because SQLite is dumb like that. $result = $this->convertToStrings($result); @@ -653,6 +659,15 @@ class GroupCollector implements GroupCollectorInterface return $array; } + private function convertToBoolean(array $array): array + { + foreach ($this->booleanFields as $field) { + $array[$field] = array_key_exists($field, $array) ? (bool) $array[$field] : null; + } + + return $array; + } + private function convertToStrings(array $array): array { foreach ($this->stringFields as $field) { diff --git a/app/Http/Controllers/Account/ShowController.php b/app/Http/Controllers/Account/ShowController.php index 8a602f59e4..7aec7bc667 100644 --- a/app/Http/Controllers/Account/ShowController.php +++ b/app/Http/Controllers/Account/ShowController.php @@ -145,6 +145,7 @@ class ShowController extends Controller $collector->setExpandGroupSearch(true); $groups = $collector->getPaginatedGroups(); + Log::debug('End collect transactions'); Timer::stop('collection'); diff --git a/resources/lang/en_US/list.php b/resources/lang/en_US/list.php index e367b63a4d..87462ea466 100644 --- a/resources/lang/en_US/list.php +++ b/resources/lang/en_US/list.php @@ -43,6 +43,7 @@ return [ 'recurring_transaction' => 'Recurring transaction', 'next_due' => 'Next due', 'transaction_type' => 'Type', + 'running_balance' => 'Running balance', 'lastActivity' => 'Last activity', 'balanceDiff' => 'Balance difference', 'other_meta_data' => 'Other meta data', diff --git a/resources/views/list/groups.twig b/resources/views/list/groups.twig index c3e4606881..bb228c71a9 100644 --- a/resources/views/list/groups.twig +++ b/resources/views/list/groups.twig @@ -33,6 +33,9 @@   {{ trans('list.description') }} {{ trans('list.amount') }} + {% if config('firefly.feature_flags.running_balance_column') %} + {{ trans('list.running_balance') }} + {% endif %} {{ trans('list.date') }} {{ trans('list.source_account') }} {{ trans('list.destination_account') }} @@ -250,6 +253,13 @@ {% endif %} {% endif %} + {% if config('firefly.feature_flags.running_balance_column') %} + + {% if null == transaction.balance_dirty or false == transaction.balance_dirty %} + {{ formatAmountBySymbol(transaction.balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }} + {% endif %} + + {% endif %} {{ transaction.date.isoFormat(monthAndDayFormat) }} From b50f8f8ecd4d0ffa5cbe4670dd0e7a08ce559e5d Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 26 Apr 2025 14:24:13 +0200 Subject: [PATCH 09/87] Fix #10197 --- app/Http/Controllers/Rule/EditController.php | 2 +- resources/lang/en_US/firefly.php | 2 +- routes/breadcrumbs.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Rule/EditController.php b/app/Http/Controllers/Rule/EditController.php index 9dbcf54ae9..8e4f5e5c5f 100644 --- a/app/Http/Controllers/Rule/EditController.php +++ b/app/Http/Controllers/Rule/EditController.php @@ -135,7 +135,7 @@ class EditController extends Controller // get rule trigger for update / store-journal: $primaryTrigger = $this->ruleRepos->getPrimaryTrigger($rule); - $subTitle = (string) trans('firefly.edit_rule', ['title' => $rule->title]); + $subTitle = (string) trans('firefly.edit_rule', ['nr' => $rule->order,'title' => $rule->title]); // put previous url in session if not redirect from store (not "return_to_edit"). if (true !== session('rules.edit.fromUpdate')) { diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index e7d4b8c1a4..2b09b63eaf 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -802,7 +802,7 @@ return [ 'action_value' => 'Action value', 'stop_executing_other_actions' => 'Stop executing other actions', 'add_rule_action' => 'Add new action', - 'edit_rule' => 'Edit rule ":title"', + 'edit_rule' => 'Edit rule #:nr ":title"', 'delete_rule' => 'Delete rule ":title"', 'update_rule' => 'Update rule', 'test_rule_triggers' => 'See matching transactions', diff --git a/routes/breadcrumbs.php b/routes/breadcrumbs.php index 19dc600b26..46682f8ba3 100644 --- a/routes/breadcrumbs.php +++ b/routes/breadcrumbs.php @@ -994,7 +994,7 @@ Breadcrumbs::for( 'rules.edit', static function (Generator $breadcrumbs, Rule $rule): void { $breadcrumbs->parent('rules.index'); - $breadcrumbs->push(trans('firefly.edit_rule', ['title' => $rule->title]), route('rules.edit', [$rule])); + $breadcrumbs->push(trans('firefly.edit_rule', ['nr' => $rule->order, 'title' => $rule->title]), route('rules.edit', [$rule])); } ); Breadcrumbs::for( From 1d997e7c8634ea48f90d79642ffa4ca36346b726 Mon Sep 17 00:00:00 2001 From: JC5 Date: Sat, 26 Apr 2025 14:29:53 +0200 Subject: [PATCH 10/87] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-04-26?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- THANKS.md | 1 + .../Controllers/Summary/BasicController.php | 52 +-- app/Helpers/Collector/GroupCollector.php | 6 +- app/Http/Controllers/Rule/EditController.php | 2 +- .../Budget/OperationsRepository.php | 44 +-- composer.lock | 64 ++-- config/firefly.php | 2 +- package-lock.json | 321 +++++++++--------- resources/assets/v1/src/locales/fr.json | 2 +- resources/assets/v1/src/locales/ru.json | 2 +- resources/assets/v1/src/locales/sl.json | 2 +- resources/lang/en_US/list.php | 2 +- 12 files changed, 251 insertions(+), 249 deletions(-) diff --git a/THANKS.md b/THANKS.md index e2bfa7bfe8..6c53dc2c9d 100755 --- a/THANKS.md +++ b/THANKS.md @@ -4,6 +4,7 @@ Over time, many people have contributed to Firefly III. Their efforts are not al Please find below all the people who contributed to the Firefly III code. Their names are mentioned in the year of their first contribution. ## 2025 +- Denis Iskandarov - = - Lompi - Jose Diaz-Gonzalez diff --git a/app/Api/V1/Controllers/Summary/BasicController.php b/app/Api/V1/Controllers/Summary/BasicController.php index 92e52cadb5..76c6029f8d 100644 --- a/app/Api/V1/Controllers/Summary/BasicController.php +++ b/app/Api/V1/Controllers/Summary/BasicController.php @@ -105,10 +105,10 @@ class BasicController extends Controller $billData = $this->getSubscriptionInformation($start, $end); $spentData = $this->getLeftToSpendInfo($start, $end); $netWorthData = $this->getNetWorthInfo($end); -// $balanceData = []; -// $billData = []; + // $balanceData = []; + // $billData = []; // $spentData = []; -// $netWorthData = []; + // $netWorthData = []; $total = array_merge($balanceData, $billData, $spentData, $netWorthData); // give new keys @@ -543,7 +543,7 @@ class BasicController extends Controller unset($leftToSpend); if (0 === count($return)) { // a small trick to get every expense in this period, regardless of budget. - $spent = $this->opsRepository->sumExpenses($start, $end, null, new Collection()); + $spent = $this->opsRepository->sumExpenses($start, $end, null, new Collection()); foreach ($spent as $row) { // either an amount was budgeted or 0 is available. $currencyId = (int) $row['currency_id']; @@ -575,28 +575,28 @@ class BasicController extends Controller ]; } -// $amount = '0'; -// // $days -// // fill in by money spent, just count it. -// $currency = $this->nativeCurrency; -// $return[$currency->id] = [ -// 'key' => sprintf('left-to-spend-in-%s', $currency->code), -// 'title' => trans('firefly.box_left_to_spend_in_currency', ['currency' => $currency->symbol]), -// 'monetary_value' => '0', -// 'no_available_budgets' => true, -// 'currency_id' => (string) $currency->id, -// 'currency_code' => $currency->code, -// 'currency_symbol' => $currency->symbol, -// 'currency_decimal_places' => $currency->decimal_places, -// 'value_parsed' => app('amount')->formatFlat($currency->symbol, $currency->decimal_places, '0', false), -// 'local_icon' => 'money', -// 'sub_title' => app('amount')->formatFlat( -// $currency->symbol, -// $currency->decimal_places, -// '0', -// false -// ), -// ]; + // $amount = '0'; + // // $days + // // fill in by money spent, just count it. + // $currency = $this->nativeCurrency; + // $return[$currency->id] = [ + // 'key' => sprintf('left-to-spend-in-%s', $currency->code), + // 'title' => trans('firefly.box_left_to_spend_in_currency', ['currency' => $currency->symbol]), + // 'monetary_value' => '0', + // 'no_available_budgets' => true, + // 'currency_id' => (string) $currency->id, + // 'currency_code' => $currency->code, + // 'currency_symbol' => $currency->symbol, + // 'currency_decimal_places' => $currency->decimal_places, + // 'value_parsed' => app('amount')->formatFlat($currency->symbol, $currency->decimal_places, '0', false), + // 'local_icon' => 'money', + // 'sub_title' => app('amount')->formatFlat( + // $currency->symbol, + // $currency->decimal_places, + // '0', + // false + // ), + // ]; } return array_values($return); diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index a9e9b31984..97387b0588 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -82,7 +82,7 @@ class GroupCollector implements GroupCollectorInterface $this->hasJoinedAttTables = false; $this->expandGroupSearch = false; $this->hasJoinedMetaTables = false; - $this->booleanFields = ['balance_dirty']; + $this->booleanFields = ['balance_dirty']; $this->integerFields = [ 'transaction_group_id', 'user_id', @@ -101,7 +101,7 @@ class GroupCollector implements GroupCollectorInterface 'category_id', 'budget_id', ]; - $this->stringFields = ['amount', 'foreign_amount', 'native_amount', 'native_foreign_amount','balance_after']; + $this->stringFields = ['amount', 'foreign_amount', 'native_amount', 'native_foreign_amount', 'balance_after']; $this->total = 0; $this->fields = [ // group @@ -600,7 +600,7 @@ class GroupCollector implements GroupCollectorInterface $result = $this->convertToInteger($result); // convert to boolean - $result = $this->convertToBoolean($result); + $result = $this->convertToBoolean($result); // convert back to strings because SQLite is dumb like that. $result = $this->convertToStrings($result); diff --git a/app/Http/Controllers/Rule/EditController.php b/app/Http/Controllers/Rule/EditController.php index 8e4f5e5c5f..c6f50d48ec 100644 --- a/app/Http/Controllers/Rule/EditController.php +++ b/app/Http/Controllers/Rule/EditController.php @@ -135,7 +135,7 @@ class EditController extends Controller // get rule trigger for update / store-journal: $primaryTrigger = $this->ruleRepos->getPrimaryTrigger($rule); - $subTitle = (string) trans('firefly.edit_rule', ['nr' => $rule->order,'title' => $rule->title]); + $subTitle = (string) trans('firefly.edit_rule', ['nr' => $rule->order, 'title' => $rule->title]); // put previous url in session if not redirect from store (not "return_to_edit"). if (true !== session('rules.edit.fromUpdate')) { diff --git a/app/Repositories/Budget/OperationsRepository.php b/app/Repositories/Budget/OperationsRepository.php index f0dadd8c70..db4d43834d 100644 --- a/app/Repositories/Budget/OperationsRepository.php +++ b/app/Repositories/Budget/OperationsRepository.php @@ -62,7 +62,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn ++$count; app('log')->debug(sprintf('Found %d budget limits. Per day is %s, total is %s', $count, $perDay, $total)); } - $avg = $total; + $avg = $total; if ($count > 0) { $avg = bcdiv($total, (string) $count); } @@ -84,21 +84,21 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn // get all transactions: /** @var GroupCollectorInterface $collector */ - $collector = app(GroupCollectorInterface::class); + $collector = app(GroupCollectorInterface::class); $collector->setAccounts($accounts)->setRange($start, $end); $collector->setBudgets($budgets); - $journals = $collector->getExtractedJournals(); + $journals = $collector->getExtractedJournals(); // loop transactions: /** @var array $journal */ foreach ($journals as $journal) { // prep data array for currency: - $budgetId = (int) $journal['budget_id']; - $budgetName = $journal['budget_name']; - $currencyId = (int) $journal['currency_id']; - $key = sprintf('%d-%d', $budgetId, $currencyId); + $budgetId = (int) $journal['budget_id']; + $budgetName = $journal['budget_name']; + $currencyId = (int) $journal['currency_id']; + $key = sprintf('%d-%d', $budgetId, $currencyId); - $data[$key] ??= [ + $data[$key] ??= [ 'id' => $budgetId, 'name' => sprintf('%s (%s)', $budgetName, $journal['currency_name']), 'sum' => '0', @@ -136,13 +136,13 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn $collector->setBudgets($this->getBudgets()); } $collector->withBudgetInformation()->withAccountInformation()->withCategoryInformation(); - $journals = $collector->getExtractedJournals(); - $array = []; + $journals = $collector->getExtractedJournals(); + $array = []; foreach ($journals as $journal) { - $currencyId = (int) $journal['currency_id']; - $budgetId = (int) $journal['budget_id']; - $budgetName = (string) $journal['budget_name']; + $currencyId = (int) $journal['currency_id']; + $budgetId = (int) $journal['budget_id']; + $budgetName = (string) $journal['budget_name']; // catch "no category" entries. if (0 === $budgetId) { @@ -150,7 +150,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn } // info about the currency: - $array[$currencyId] ??= [ + $array[$currencyId] ??= [ 'budgets' => [], 'currency_id' => $currencyId, 'currency_name' => $journal['currency_name'], @@ -203,8 +203,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn ?Collection $budgets = null, ?TransactionCurrency $currency = null, bool $convertToNative = false - ): array - { + ): array { Log::debug(sprintf('Start of %s(date, date, array, array, "%s", "%s").', __METHOD__, $currency?->code, var_export($convertToNative, true))); // this collector excludes all transfers TO liabilities (which are also withdrawals) // because those expenses only become expenses once they move from the liability to the friend. @@ -212,8 +211,8 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn $repository = app(AccountRepositoryInterface::class); $repository->setUser($this->user); - $subset = $repository->getAccountsByType(config('firefly.valid_liabilities')); - $selection = new Collection(); + $subset = $repository->getAccountsByType(config('firefly.valid_liabilities')); + $selection = new Collection(); /** @var Account $account */ foreach ($subset as $account) { @@ -223,11 +222,12 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn } /** @var GroupCollectorInterface $collector */ - $collector = app(GroupCollectorInterface::class); + $collector = app(GroupCollectorInterface::class); $collector->setUser($this->user) - ->setRange($start, $end) + ->setRange($start, $end) // ->excludeDestinationAccounts($selection) - ->setTypes([TransactionTypeEnum::WITHDRAWAL->value]); + ->setTypes([TransactionTypeEnum::WITHDRAWAL->value]) + ; if (null !== $accounts) { $collector->setAccounts($accounts); @@ -242,7 +242,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn if ($budgets->count() > 0) { $collector->setBudgets($budgets); } - $journals = $collector->getExtractedJournals(); + $journals = $collector->getExtractedJournals(); // same but for transactions in the foreign currency: if (null !== $currency) { diff --git a/composer.lock b/composer.lock index b431bdc56d..15e46f5b7b 100644 --- a/composer.lock +++ b/composer.lock @@ -1878,16 +1878,16 @@ }, { "name": "laravel/framework", - "version": "v11.44.2", + "version": "v11.44.7", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "f85216c82cbd38b66d67ebd20ea762cb3751a4b4" + "reference": "00bc6ac91a6d577bf051c18ddaa638c0d221e1c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/f85216c82cbd38b66d67ebd20ea762cb3751a4b4", - "reference": "f85216c82cbd38b66d67ebd20ea762cb3751a4b4", + "url": "https://api.github.com/repos/laravel/framework/zipball/00bc6ac91a6d577bf051c18ddaa638c0d221e1c7", + "reference": "00bc6ac91a6d577bf051c18ddaa638c0d221e1c7", "shasum": "" }, "require": { @@ -2089,7 +2089,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2025-03-12T14:34:30+00:00" + "time": "2025-04-25T12:40:47+00:00" }, { "name": "laravel/passport", @@ -2228,16 +2228,16 @@ }, { "name": "laravel/sanctum", - "version": "v4.0.8", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/laravel/sanctum.git", - "reference": "ec1dd9ddb2ab370f79dfe724a101856e0963f43c" + "reference": "4e4ced5023e9d8949214e0fb43d9f4bde79c7166" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/sanctum/zipball/ec1dd9ddb2ab370f79dfe724a101856e0963f43c", - "reference": "ec1dd9ddb2ab370f79dfe724a101856e0963f43c", + "url": "https://api.github.com/repos/laravel/sanctum/zipball/4e4ced5023e9d8949214e0fb43d9f4bde79c7166", + "reference": "4e4ced5023e9d8949214e0fb43d9f4bde79c7166", "shasum": "" }, "require": { @@ -2288,7 +2288,7 @@ "issues": "https://github.com/laravel/sanctum/issues", "source": "https://github.com/laravel/sanctum" }, - "time": "2025-01-26T19:34:36+00:00" + "time": "2025-04-22T13:53:47+00:00" }, { "name": "laravel/serializable-closure", @@ -10626,16 +10626,16 @@ }, { "name": "larastan/larastan", - "version": "v3.3.1", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/larastan/larastan.git", - "reference": "58bee8be51daf12d78ed0a909be3b205607d2f27" + "reference": "1042fa0c2ee490bb6da7381f3323f7292ad68222" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/larastan/larastan/zipball/58bee8be51daf12d78ed0a909be3b205607d2f27", - "reference": "58bee8be51daf12d78ed0a909be3b205607d2f27", + "url": "https://api.github.com/repos/larastan/larastan/zipball/1042fa0c2ee490bb6da7381f3323f7292ad68222", + "reference": "1042fa0c2ee490bb6da7381f3323f7292ad68222", "shasum": "" }, "require": { @@ -10652,7 +10652,7 @@ "phpstan/phpstan": "^2.1.11" }, "require-dev": { - "doctrine/coding-standard": "^12.0", + "doctrine/coding-standard": "^13", "laravel/framework": "^11.44.2 || ^12.7.2", "mockery/mockery": "^1.6.12", "nikic/php-parser": "^5.4", @@ -10688,13 +10688,9 @@ { "name": "Can Vural", "email": "can9119@gmail.com" - }, - { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" } ], - "description": "Larastan - Discover bugs in your code without running it. A phpstan/phpstan wrapper for Laravel", + "description": "Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel", "keywords": [ "PHPStan", "code analyse", @@ -10707,19 +10703,15 @@ ], "support": { "issues": "https://github.com/larastan/larastan/issues", - "source": "https://github.com/larastan/larastan/tree/v3.3.1" + "source": "https://github.com/larastan/larastan/tree/v3.4.0" }, "funding": [ { "url": "https://github.com/canvural", "type": "github" - }, - { - "url": "https://github.com/nunomaduro", - "type": "github" } ], - "time": "2025-04-03T20:08:04+00:00" + "time": "2025-04-22T09:44:59+00:00" }, { "name": "laravel-json-api/testing", @@ -11701,16 +11693,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.5.17", + "version": "11.5.18", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fd2e863a2995cdfd864fb514b5e0b28b09895b5c" + "reference": "fc3e887c7f3f9917e1bf61e523413d753db00a17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fd2e863a2995cdfd864fb514b5e0b28b09895b5c", - "reference": "fd2e863a2995cdfd864fb514b5e0b28b09895b5c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc3e887c7f3f9917e1bf61e523413d753db00a17", + "reference": "fc3e887c7f3f9917e1bf61e523413d753db00a17", "shasum": "" }, "require": { @@ -11782,7 +11774,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.17" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.18" }, "funding": [ { @@ -11793,12 +11785,20 @@ "url": "https://github.com/sebastianbergmann", "type": "github" }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, { "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", "type": "tidelift" } ], - "time": "2025-04-08T07:59:11+00:00" + "time": "2025-04-22T06:09:49+00:00" }, { "name": "sebastian/cli-parser", diff --git a/config/firefly.php b/config/firefly.php index 7971b9be7c..f1fc7fd5ec 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -78,7 +78,7 @@ return [ 'running_balance_column' => env('USE_RUNNING_BALANCE', false), // see cer.php for exchange rates feature flag. ], - 'version' => 'develop/2025-04-22', + 'version' => 'develop/2025-04-26', 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 25, diff --git a/package-lock.json b/package-lock.json index db9556c30f..9f76aba367 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1673,9 +1673,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.2.tgz", - "integrity": "sha512-wCIboOL2yXZym2cgm6mlA742s9QeJ8DjGVaL39dLN4rRwrOgOyYSnOaFPhKZGLb2ngj4EyfAFjsNJwPXZvseag==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.3.tgz", + "integrity": "sha512-W8bFfPA8DowP8l//sxjJLSLkD8iEjMc7cBVyP+u4cEv9sM7mdUCkgsj+t0n/BWPFtv7WWCN5Yzj0N6FJNUUqBQ==", "cpu": [ "ppc64" ], @@ -1690,9 +1690,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.2.tgz", - "integrity": "sha512-NQhH7jFstVY5x8CKbcfa166GoV0EFkaPkCKBQkdPJFvo5u+nGXLEH/ooniLb3QI8Fk58YAx7nsPLozUWfCBOJA==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.3.tgz", + "integrity": "sha512-PuwVXbnP87Tcff5I9ngV0lmiSu40xw1At6i3GsU77U7cjDDB4s0X2cyFuBiDa1SBk9DnvWwnGvVaGBqoFWPb7A==", "cpu": [ "arm" ], @@ -1707,9 +1707,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.2.tgz", - "integrity": "sha512-5ZAX5xOmTligeBaeNEPnPaeEuah53Id2tX4c2CVP3JaROTH+j4fnfHCkr1PjXMd78hMst+TlkfKcW/DlTq0i4w==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.3.tgz", + "integrity": "sha512-XelR6MzjlZuBM4f5z2IQHK6LkK34Cvv6Rj2EntER3lwCBFdg6h2lKbtRjpTTsdEjD/WSe1q8UyPBXP1x3i/wYQ==", "cpu": [ "arm64" ], @@ -1724,9 +1724,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.2.tgz", - "integrity": "sha512-Ffcx+nnma8Sge4jzddPHCZVRvIfQ0kMsUsCMcJRHkGJ1cDmhe4SsrYIjLUKn1xpHZybmOqCWwB0zQvsjdEHtkg==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.3.tgz", + "integrity": "sha512-ogtTpYHT/g1GWS/zKM0cc/tIebFjm1F9Aw1boQ2Y0eUQ+J89d0jFY//s9ei9jVIlkYi8AfOjiixcLJSGNSOAdQ==", "cpu": [ "x64" ], @@ -1741,9 +1741,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.2.tgz", - "integrity": "sha512-MpM6LUVTXAzOvN4KbjzU/q5smzryuoNjlriAIx+06RpecwCkL9JpenNzpKd2YMzLJFOdPqBpuub6eVRP5IgiSA==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.3.tgz", + "integrity": "sha512-eESK5yfPNTqpAmDfFWNsOhmIOaQA59tAcF/EfYvo5/QWQCzXn5iUSOnqt3ra3UdzBv073ykTtmeLJZGt3HhA+w==", "cpu": [ "arm64" ], @@ -1758,9 +1758,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.2.tgz", - "integrity": "sha512-5eRPrTX7wFyuWe8FqEFPG2cU0+butQQVNcT4sVipqjLYQjjh8a8+vUTfgBKM88ObB85ahsnTwF7PSIt6PG+QkA==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.3.tgz", + "integrity": "sha512-Kd8glo7sIZtwOLcPbW0yLpKmBNWMANZhrC1r6K++uDR2zyzb6AeOYtI6udbtabmQpFaxJ8uduXMAo1gs5ozz8A==", "cpu": [ "x64" ], @@ -1775,9 +1775,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.2.tgz", - "integrity": "sha512-mLwm4vXKiQ2UTSX4+ImyiPdiHjiZhIaE9QvC7sw0tZ6HoNMjYAqQpGyui5VRIi5sGd+uWq940gdCbY3VLvsO1w==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.3.tgz", + "integrity": "sha512-EJiyS70BYybOBpJth3M0KLOus0n+RRMKTYzhYhFeMwp7e/RaajXvP+BWlmEXNk6uk+KAu46j/kaQzr6au+JcIw==", "cpu": [ "arm64" ], @@ -1792,9 +1792,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.2.tgz", - "integrity": "sha512-6qyyn6TjayJSwGpm8J9QYYGQcRgc90nmfdUb0O7pp1s4lTY+9D0H9O02v5JqGApUyiHOtkz6+1hZNvNtEhbwRQ==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.3.tgz", + "integrity": "sha512-Q+wSjaLpGxYf7zC0kL0nDlhsfuFkoN+EXrx2KSB33RhinWzejOd6AvgmP5JbkgXKmjhmpfgKZq24pneodYqE8Q==", "cpu": [ "x64" ], @@ -1809,9 +1809,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.2.tgz", - "integrity": "sha512-UHBRgJcmjJv5oeQF8EpTRZs/1knq6loLxTsjc3nxO9eXAPDLcWW55flrMVc97qFPbmZP31ta1AZVUKQzKTzb0g==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.3.tgz", + "integrity": "sha512-dUOVmAUzuHy2ZOKIHIKHCm58HKzFqd+puLaS424h6I85GlSDRZIA5ycBixb3mFgM0Jdh+ZOSB6KptX30DD8YOQ==", "cpu": [ "arm" ], @@ -1826,9 +1826,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.2.tgz", - "integrity": "sha512-gq/sjLsOyMT19I8obBISvhoYiZIAaGF8JpeXu1u8yPv8BE5HlWYobmlsfijFIZ9hIVGYkbdFhEqC0NvM4kNO0g==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.3.tgz", + "integrity": "sha512-xCUgnNYhRD5bb1C1nqrDV1PfkwgbswTTBRbAd8aH5PhYzikdf/ddtsYyMXFfGSsb/6t6QaPSzxtbfAZr9uox4A==", "cpu": [ "arm64" ], @@ -1843,9 +1843,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.2.tgz", - "integrity": "sha512-bBYCv9obgW2cBP+2ZWfjYTU+f5cxRoGGQ5SeDbYdFCAZpYWrfjjfYwvUpP8MlKbP0nwZ5gyOU/0aUzZ5HWPuvQ==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.3.tgz", + "integrity": "sha512-yplPOpczHOO4jTYKmuYuANI3WhvIPSVANGcNUeMlxH4twz/TeXuzEP41tGKNGWJjuMhotpGabeFYGAOU2ummBw==", "cpu": [ "ia32" ], @@ -1860,9 +1860,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.2.tgz", - "integrity": "sha512-SHNGiKtvnU2dBlM5D8CXRFdd+6etgZ9dXfaPCeJtz+37PIUlixvlIhI23L5khKXs3DIzAn9V8v+qb1TRKrgT5w==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.3.tgz", + "integrity": "sha512-P4BLP5/fjyihmXCELRGrLd793q/lBtKMQl8ARGpDxgzgIKJDRJ/u4r1A/HgpBpKpKZelGct2PGI4T+axcedf6g==", "cpu": [ "loong64" ], @@ -1877,9 +1877,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.2.tgz", - "integrity": "sha512-hDDRlzE6rPeoj+5fsADqdUZl1OzqDYow4TB4Y/3PlKBD0ph1e6uPHzIQcv2Z65u2K0kpeByIyAjCmjn1hJgG0Q==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.3.tgz", + "integrity": "sha512-eRAOV2ODpu6P5divMEMa26RRqb2yUoYsuQQOuFUexUoQndm4MdpXXDBbUoKIc0iPa4aCO7gIhtnYomkn2x+bag==", "cpu": [ "mips64el" ], @@ -1894,9 +1894,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.2.tgz", - "integrity": "sha512-tsHu2RRSWzipmUi9UBDEzc0nLc4HtpZEI5Ba+Omms5456x5WaNuiG3u7xh5AO6sipnJ9r4cRWQB2tUjPyIkc6g==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.3.tgz", + "integrity": "sha512-ZC4jV2p7VbzTlnl8nZKLcBkfzIf4Yad1SJM4ZMKYnJqZFD4rTI+pBG65u8ev4jk3/MPwY9DvGn50wi3uhdaghg==", "cpu": [ "ppc64" ], @@ -1911,9 +1911,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.2.tgz", - "integrity": "sha512-k4LtpgV7NJQOml/10uPU0s4SAXGnowi5qBSjaLWMojNCUICNu7TshqHLAEbkBdAszL5TabfvQ48kK84hyFzjnw==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.3.tgz", + "integrity": "sha512-LDDODcFzNtECTrUUbVCs6j9/bDVqy7DDRsuIXJg6so+mFksgwG7ZVnTruYi5V+z3eE5y+BJZw7VvUadkbfg7QA==", "cpu": [ "riscv64" ], @@ -1928,9 +1928,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.2.tgz", - "integrity": "sha512-GRa4IshOdvKY7M/rDpRR3gkiTNp34M0eLTaC1a08gNrh4u488aPhuZOCpkF6+2wl3zAN7L7XIpOFBhnaE3/Q8Q==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.3.tgz", + "integrity": "sha512-s+w/NOY2k0yC2p9SLen+ymflgcpRkvwwa02fqmAwhBRI3SC12uiS10edHHXlVWwfAagYSY5UpmT/zISXPMW3tQ==", "cpu": [ "s390x" ], @@ -1945,9 +1945,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.2.tgz", - "integrity": "sha512-QInHERlqpTTZ4FRB0fROQWXcYRD64lAoiegezDunLpalZMjcUcld3YzZmVJ2H/Cp0wJRZ8Xtjtj0cEHhYc/uUg==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.3.tgz", + "integrity": "sha512-nQHDz4pXjSDC6UfOE1Fw9Q8d6GCAd9KdvMZpfVGWSJztYCarRgSDfOVBY5xwhQXseiyxapkiSJi/5/ja8mRFFA==", "cpu": [ "x64" ], @@ -1962,9 +1962,9 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.2.tgz", - "integrity": "sha512-talAIBoY5M8vHc6EeI2WW9d/CkiO9MQJ0IOWX8hrLhxGbro/vBXJvaQXefW2cP0z0nQVTdQ/eNyGFV1GSKrxfw==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.3.tgz", + "integrity": "sha512-1QaLtOWq0mzK6tzzp0jRN3eccmN3hezey7mhLnzC6oNlJoUJz4nym5ZD7mDnS/LZQgkrhEbEiTn515lPeLpgWA==", "cpu": [ "arm64" ], @@ -1979,9 +1979,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.2.tgz", - "integrity": "sha512-voZT9Z+tpOxrvfKFyfDYPc4DO4rk06qamv1a/fkuzHpiVBMOhpjK+vBmWM8J1eiB3OLSMFYNaOaBNLXGChf5tg==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.3.tgz", + "integrity": "sha512-i5Hm68HXHdgv8wkrt+10Bc50zM0/eonPb/a/OFVfB6Qvpiirco5gBA5bz7S2SHuU+Y4LWn/zehzNX14Sp4r27g==", "cpu": [ "x64" ], @@ -1996,9 +1996,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.2.tgz", - "integrity": "sha512-dcXYOC6NXOqcykeDlwId9kB6OkPUxOEqU+rkrYVqJbK2hagWOMrsTGsMr8+rW02M+d5Op5NNlgMmjzecaRf7Tg==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.3.tgz", + "integrity": "sha512-zGAVApJEYTbOC6H/3QBr2mq3upG/LBEXr85/pTtKiv2IXcgKV0RT0QA/hSXZqSvLEpXeIxah7LczB4lkiYhTAQ==", "cpu": [ "arm64" ], @@ -2013,9 +2013,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.2.tgz", - "integrity": "sha512-t/TkWwahkH0Tsgoq1Ju7QfgGhArkGLkF1uYz8nQS/PPFlXbP5YgRpqQR3ARRiC2iXoLTWFxc6DJMSK10dVXluw==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.3.tgz", + "integrity": "sha512-fpqctI45NnCIDKBH5AXQBsD0NDPbEFczK98hk/aa6HJxbl+UtLkJV2+Bvy5hLSLk3LHmqt0NTkKNso1A9y1a4w==", "cpu": [ "x64" ], @@ -2030,9 +2030,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.2.tgz", - "integrity": "sha512-cfZH1co2+imVdWCjd+D1gf9NjkchVhhdpgb1q5y6Hcv9TP6Zi9ZG/beI3ig8TvwT9lH9dlxLq5MQBBgwuj4xvA==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.3.tgz", + "integrity": "sha512-ROJhm7d8bk9dMCUZjkS8fgzsPAZEjtRJqCAmVgB0gMrvG7hfmPmz9k1rwO4jSiblFjYmNvbECL9uhaPzONMfgA==", "cpu": [ "x64" ], @@ -2047,9 +2047,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.2.tgz", - "integrity": "sha512-7Loyjh+D/Nx/sOTzV8vfbB3GJuHdOQyrOryFdZvPHLf42Tk9ivBU5Aedi7iyX+x6rbn2Mh68T4qq1SDqJBQO5Q==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.3.tgz", + "integrity": "sha512-YWcow8peiHpNBiIXHwaswPnAXLsLVygFwCB3A7Bh5jRkIBFWHGmNQ48AlX4xDvQNoMZlPYzjVOQDYEzWCqufMQ==", "cpu": [ "arm64" ], @@ -2064,9 +2064,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.2.tgz", - "integrity": "sha512-WRJgsz9un0nqZJ4MfhabxaD9Ft8KioqU3JMinOTvobbX6MOSUigSBlogP8QB3uxpJDsFS6yN+3FDBdqE5lg9kg==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.3.tgz", + "integrity": "sha512-qspTZOIGoXVS4DpNqUYUs9UxVb04khS1Degaw/MnfMe7goQ3lTfQ13Vw4qY/Nj0979BGvMRpAYbs/BAxEvU8ew==", "cpu": [ "ia32" ], @@ -2081,9 +2081,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.2.tgz", - "integrity": "sha512-kM3HKb16VIXZyIeVrM1ygYmZBKybX8N4p754bw390wGO3Tf2j4L2/WYL+4suWujpgf6GBYs3jv7TyUivdd05JA==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.3.tgz", + "integrity": "sha512-ICgUR+kPimx0vvRzf+N/7L7tVSQeE3BYY+NhHRHXS1kBuPO7z2+7ea2HbhDyZdTephgvNvKrlDDKUexuCVBVvg==", "cpu": [ "x64" ], @@ -3111,9 +3111,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.14.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.14.1.tgz", - "integrity": "sha512-u0HuPQwe/dHrItgHHpmw3N2fYCR6x4ivMNbPHRkBVP4CvN+kiRrKHWk3i8tXiO/joPwXLMYvF9TTF0eqgHIuOw==", + "version": "22.15.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.2.tgz", + "integrity": "sha512-uKXqKN9beGoMdBfcaTY1ecwz6ctxuJAcUlwE55938g0ZJ8lRxwAZqRz2AJ4pzpt5dHdTPMB863UZ0ESiFUcP7A==", "dev": true, "license": "MIT", "dependencies": { @@ -3782,9 +3782,9 @@ } }, "node_modules/asn1.js/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", "dev": true, "license": "MIT" }, @@ -3872,9 +3872,9 @@ } }, "node_modules/axios": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz", - "integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.9.0.tgz", + "integrity": "sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg==", "dev": true, "license": "MIT", "dependencies": { @@ -4021,9 +4021,9 @@ "license": "MIT" }, "node_modules/bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.2.tgz", + "integrity": "sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw==", "dev": true, "license": "MIT" }, @@ -4136,9 +4136,9 @@ "license": "MIT" }, "node_modules/bootstrap5-tags": { - "version": "1.7.10", - "resolved": "https://registry.npmjs.org/bootstrap5-tags/-/bootstrap5-tags-1.7.10.tgz", - "integrity": "sha512-affAvDcyny6/YU/oZD4U61m9KKIP3pE33041lLrH7oDEKRZN7oWi2TeA0QwWzIyPH0AgsBWET0+ILb04CKyqNw==", + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/bootstrap5-tags/-/bootstrap5-tags-1.7.11.tgz", + "integrity": "sha512-2pEAFRFTW7IRkL1f/TAkMSK9zmZVbYV2+0aFxoThP8hJFvTyHC3dzYa2yJeDygWw2F2dO2a+VDl8VPNrWnaVHA==", "license": "MIT" }, "node_modules/brace-expansion": { @@ -4923,9 +4923,9 @@ } }, "node_modules/create-ecdh/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", "dev": true, "license": "MIT" }, @@ -5440,9 +5440,9 @@ } }, "node_modules/diffie-hellman/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", "dev": true, "license": "MIT" }, @@ -5635,9 +5635,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.140", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.140.tgz", - "integrity": "sha512-o82Rj+ONp4Ip7Cl1r7lrqx/pXhbp/lh9DpKcMNscFJdh8ebyRofnc7Sh01B4jx403RI0oqTBvlZ7OBIZLMr2+Q==", + "version": "1.5.142", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.142.tgz", + "integrity": "sha512-Ah2HgkTu/9RhTDNThBtzu2Wirdy4DC9b0sMT1pUhbkZQ5U/iwmE+PHZX1MpjD5IkJCc2wSghgGG/B04szAx07w==", "dev": true, "license": "ISC" }, @@ -5658,9 +5658,9 @@ } }, "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", "dev": true, "license": "MIT" }, @@ -5762,9 +5762,9 @@ } }, "node_modules/es-module-lexer": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz", - "integrity": "sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", "dev": true, "license": "MIT" }, @@ -5798,9 +5798,9 @@ } }, "node_modules/esbuild": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.2.tgz", - "integrity": "sha512-16854zccKPnC+toMywC+uKNeYSv+/eXkevRAfwRD/G9Cleq66m8XFIrigkbvauLLlCfDL45Q2cWegSg53gGBnQ==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.3.tgz", + "integrity": "sha512-qKA6Pvai73+M2FtftpNKRxJ78GIjmFXFxd/1DVBqGo/qNhLSfv+G12n9pNoWdytJC8U00TrViOwpjT0zgqQS8Q==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -5811,31 +5811,31 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.2", - "@esbuild/android-arm": "0.25.2", - "@esbuild/android-arm64": "0.25.2", - "@esbuild/android-x64": "0.25.2", - "@esbuild/darwin-arm64": "0.25.2", - "@esbuild/darwin-x64": "0.25.2", - "@esbuild/freebsd-arm64": "0.25.2", - "@esbuild/freebsd-x64": "0.25.2", - "@esbuild/linux-arm": "0.25.2", - "@esbuild/linux-arm64": "0.25.2", - "@esbuild/linux-ia32": "0.25.2", - "@esbuild/linux-loong64": "0.25.2", - "@esbuild/linux-mips64el": "0.25.2", - "@esbuild/linux-ppc64": "0.25.2", - "@esbuild/linux-riscv64": "0.25.2", - "@esbuild/linux-s390x": "0.25.2", - "@esbuild/linux-x64": "0.25.2", - "@esbuild/netbsd-arm64": "0.25.2", - "@esbuild/netbsd-x64": "0.25.2", - "@esbuild/openbsd-arm64": "0.25.2", - "@esbuild/openbsd-x64": "0.25.2", - "@esbuild/sunos-x64": "0.25.2", - "@esbuild/win32-arm64": "0.25.2", - "@esbuild/win32-ia32": "0.25.2", - "@esbuild/win32-x64": "0.25.2" + "@esbuild/aix-ppc64": "0.25.3", + "@esbuild/android-arm": "0.25.3", + "@esbuild/android-arm64": "0.25.3", + "@esbuild/android-x64": "0.25.3", + "@esbuild/darwin-arm64": "0.25.3", + "@esbuild/darwin-x64": "0.25.3", + "@esbuild/freebsd-arm64": "0.25.3", + "@esbuild/freebsd-x64": "0.25.3", + "@esbuild/linux-arm": "0.25.3", + "@esbuild/linux-arm64": "0.25.3", + "@esbuild/linux-ia32": "0.25.3", + "@esbuild/linux-loong64": "0.25.3", + "@esbuild/linux-mips64el": "0.25.3", + "@esbuild/linux-ppc64": "0.25.3", + "@esbuild/linux-riscv64": "0.25.3", + "@esbuild/linux-s390x": "0.25.3", + "@esbuild/linux-x64": "0.25.3", + "@esbuild/netbsd-arm64": "0.25.3", + "@esbuild/netbsd-x64": "0.25.3", + "@esbuild/openbsd-arm64": "0.25.3", + "@esbuild/openbsd-x64": "0.25.3", + "@esbuild/sunos-x64": "0.25.3", + "@esbuild/win32-arm64": "0.25.3", + "@esbuild/win32-ia32": "0.25.3", + "@esbuild/win32-x64": "0.25.3" } }, "node_modules/escalade": { @@ -8031,9 +8031,9 @@ } }, "node_modules/miller-rabin/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", "dev": true, "license": "MIT" }, @@ -9592,9 +9592,9 @@ } }, "node_modules/public-encrypt/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", "dev": true, "license": "MIT" }, @@ -10968,9 +10968,9 @@ "license": "MIT" }, "node_modules/terser-webpack-plugin/node_modules/schema-utils": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz", - "integrity": "sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.2.tgz", + "integrity": "sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==", "dev": true, "license": "MIT", "dependencies": { @@ -11349,18 +11349,18 @@ } }, "node_modules/vite": { - "version": "6.3.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.2.tgz", - "integrity": "sha512-ZSvGOXKGceizRQIZSz7TGJ0pS3QLlVY/9hwxVh17W3re67je1RKYzFHivZ/t0tubU78Vkyb9WnHPENSBCzbckg==", + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.3.tgz", + "integrity": "sha512-5nXH+QsELbFKhsEfWLkHrvgRpTdGJzqOZ+utSdmPTvwHmvU6ITTm3xx+mRusihkcI8GeC7lCDyn3kDtiki9scw==", "dev": true, "license": "MIT", "dependencies": { "esbuild": "^0.25.0", - "fdir": "^6.4.3", + "fdir": "^6.4.4", "picomatch": "^4.0.2", "postcss": "^8.5.3", "rollup": "^4.34.9", - "tinyglobby": "^0.2.12" + "tinyglobby": "^0.2.13" }, "bin": { "vite": "bin/vite.js" @@ -11669,14 +11669,15 @@ "license": "BSD-2-Clause" }, "node_modules/webpack": { - "version": "5.99.6", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.99.6.tgz", - "integrity": "sha512-TJOLrJ6oeccsGWPl7ujCYuc0pIq2cNsuD6GZDma8i5o5Npvcco/z+NKvZSFsP0/x6SShVb0+X2JK/JHUjKY9dQ==", + "version": "5.99.7", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.99.7.tgz", + "integrity": "sha512-CNqKBRMQjwcmKR0idID5va1qlhrqVUKpovi+Ec79ksW8ux7iS1+A6VqzfZXgVYCFRKl7XL5ap3ZoMpwBJxcg0w==", "dev": true, "license": "MIT", "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "@webassemblyjs/ast": "^1.14.1", "@webassemblyjs/wasm-edit": "^1.14.1", "@webassemblyjs/wasm-parser": "^1.14.1", @@ -11693,7 +11694,7 @@ "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^4.3.0", + "schema-utils": "^4.3.2", "tapable": "^2.1.1", "terser-webpack-plugin": "^5.3.11", "watchpack": "^2.4.1", @@ -11825,9 +11826,9 @@ "license": "MIT" }, "node_modules/webpack-dev-middleware/node_modules/schema-utils": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz", - "integrity": "sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.2.tgz", + "integrity": "sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==", "dev": true, "license": "MIT", "dependencies": { @@ -11977,9 +11978,9 @@ } }, "node_modules/webpack-dev-server/node_modules/schema-utils": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz", - "integrity": "sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.2.tgz", + "integrity": "sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==", "dev": true, "license": "MIT", "dependencies": { @@ -12079,9 +12080,9 @@ "license": "MIT" }, "node_modules/webpack/node_modules/schema-utils": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz", - "integrity": "sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.2.tgz", + "integrity": "sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==", "dev": true, "license": "MIT", "dependencies": { diff --git a/resources/assets/v1/src/locales/fr.json b/resources/assets/v1/src/locales/fr.json index 721bb64876..4e60e54d3a 100644 --- a/resources/assets/v1/src/locales/fr.json +++ b/resources/assets/v1/src/locales/fr.json @@ -2,7 +2,7 @@ "firefly": { "administrations_page_title": "Administrations financi\u00e8res", "administrations_index_menu": "Administrations financi\u00e8res", - "expires_at": "Expires at", + "expires_at": "Expire le", "temp_administrations_introduction": "Firefly III aura bient\u00f4t la possibilit\u00e9 de g\u00e9rer plusieurs administrations financi\u00e8res. Pour le moment, vous n'en avez qu'une. Vous pouvez d\u00e9finir le titre de cette administration et de sa devise locale. Cela remplace le param\u00e8tre pr\u00e9c\u00e9dent o\u00f9 vous d\u00e9finissiez votre \"devise par d\u00e9faut\". Ce param\u00e8tre est d\u00e9sormais li\u00e9 \u00e0 l'administration financi\u00e8re et peut \u00eatre diff\u00e9rent par administration.", "administration_currency_form_help": "La page peut mettre longtemps \u00e0 charger si vous modifiez la devise locale, car des op\u00e9rations peuvent n\u00e9cessiter une conversion vers votre (nouvelle) devise locale.", "administrations_page_edit_sub_title_js": "Modifier l'administration financi\u00e8re \"{title}\"", diff --git a/resources/assets/v1/src/locales/ru.json b/resources/assets/v1/src/locales/ru.json index 9f0cc390f3..dd66e40bed 100644 --- a/resources/assets/v1/src/locales/ru.json +++ b/resources/assets/v1/src/locales/ru.json @@ -2,7 +2,7 @@ "firefly": { "administrations_page_title": "\u0424\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0435 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u044b", "administrations_index_menu": "\u0424\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0435 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u044b", - "expires_at": "Expires at", + "expires_at": "\u0418\u0441\u0442\u0435\u043a\u0430\u0435\u0442", "temp_administrations_introduction": "Firefly III \u0432\u0441\u043a\u043e\u0440\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u043c\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438. \u0421\u0435\u0439\u0447\u0430\u0441 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438 \u0435\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0432\u0430\u043b\u044e\u0442\u0443. \u042d\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \"\u0432\u0430\u043b\u044e\u0442\u0443 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\". \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u044d\u0442\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u043e\u0439 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430.", "administration_currency_form_help": "\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0432\u0430\u043b\u044e\u0442\u0443, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 \u043d\u043e\u0432\u0443\u044e \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0432\u0430\u043b\u044e\u0442\u0443.", "administrations_page_edit_sub_title_js": "\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0438\u043d\u0430\u043d\u0441\u0430\u043c\u0438 \"{title}\"", diff --git a/resources/assets/v1/src/locales/sl.json b/resources/assets/v1/src/locales/sl.json index f5f051fa10..0554a1d6eb 100644 --- a/resources/assets/v1/src/locales/sl.json +++ b/resources/assets/v1/src/locales/sl.json @@ -2,7 +2,7 @@ "firefly": { "administrations_page_title": "Finan\u010dne administracije", "administrations_index_menu": "Finan\u010dne administracije", - "expires_at": "Expires at", + "expires_at": "Pote\u010de ob", "temp_administrations_introduction": "Firefly III bo kmalu dobil mo\u017enost upravljanja ve\u010d finan\u010dnih administracij. Trenutno imate samo eno. Nastavite lahko naziv te administracije in njeno doma\u010do valuto. To nadome\u0161\u010da prej\u0161njo nastavitev, kjer bi nastavili svojo \"privzeto valuto\". Ta nastavitev je zdaj vezana na finan\u010dno administracijo in se lahko razlikuje glede na administracijo.", "administration_currency_form_help": "\u010ce spremenite doma\u010do valuto, lahko traja dolgo \u010dasa, da se stran nalo\u017ei, ker bo transakcijo morda treba pretvoriti v va\u0161o (novo) doma\u010do valuto.", "administrations_page_edit_sub_title_js": "Uredi finan\u010dno administracijo \"{title}\"", diff --git a/resources/lang/en_US/list.php b/resources/lang/en_US/list.php index 87462ea466..9d13e5d58f 100644 --- a/resources/lang/en_US/list.php +++ b/resources/lang/en_US/list.php @@ -43,7 +43,7 @@ return [ 'recurring_transaction' => 'Recurring transaction', 'next_due' => 'Next due', 'transaction_type' => 'Type', - 'running_balance' => 'Running balance', + 'running_balance' => 'Running balance', 'lastActivity' => 'Last activity', 'balanceDiff' => 'Balance difference', 'other_meta_data' => 'Other meta data', From 76e893f86ee9c308122cb190889f12d48d1d625e Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 26 Apr 2025 15:24:14 +0200 Subject: [PATCH 11/87] Fix running balance --- app/Helpers/Collector/GroupCollector.php | 5 +++-- resources/views/list/groups.twig | 14 +++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index 97387b0588..250face3da 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -101,7 +101,7 @@ class GroupCollector implements GroupCollectorInterface 'category_id', 'budget_id', ]; - $this->stringFields = ['amount', 'foreign_amount', 'native_amount', 'native_foreign_amount', 'balance_after']; + $this->stringFields = ['amount', 'foreign_amount', 'native_amount', 'native_foreign_amount','source_balance_after','destination_balance_after']; $this->total = 0; $this->fields = [ // group @@ -132,7 +132,7 @@ class GroupCollector implements GroupCollectorInterface // currency info: 'source.amount as amount', - 'source.balance_after as balance_after', + 'source.balance_after as source_balance_after', 'source.balance_dirty as balance_dirty', 'source.native_amount as native_amount', 'source.transaction_currency_id as currency_id', @@ -152,6 +152,7 @@ class GroupCollector implements GroupCollectorInterface // destination account info (always present) 'destination.account_id as destination_account_id', + 'destination.balance_after as destination_balance_after', ]; } diff --git a/resources/views/list/groups.twig b/resources/views/list/groups.twig index bb228c71a9..0bd2df088e 100644 --- a/resources/views/list/groups.twig +++ b/resources/views/list/groups.twig @@ -256,7 +256,19 @@ {% if config('firefly.feature_flags.running_balance_column') %} {% if null == transaction.balance_dirty or false == transaction.balance_dirty %} - {{ formatAmountBySymbol(transaction.balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }} + {% if transaction.transaction_type_type == 'Deposit' %} + {{ formatAmountBySymbol(transaction.destination_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }} + {% elseif transaction.transaction_type_type == 'Withdrawal' %} + {{ formatAmountBySymbol(transaction.source_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }} + {% elseif transaction.transaction_type_type == 'Opening balance' %} + {% if transaction.source_account_type == 'Initial balance account' %} + {{ formatAmountBySymbol(transaction.destination_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }} + {% else %} + {{ formatAmountBySymbol(transaction.source_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }} + {% endif %} + {% else %} +   + {% endif %} {% endif %} {% endif %} From 41e74cd816668bfd2ddf69f75d60981cef3784ca Mon Sep 17 00:00:00 2001 From: JC5 Date: Sat, 26 Apr 2025 15:28:31 +0200 Subject: [PATCH 12/87] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-04-26?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Helpers/Collector/GroupCollector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index 250face3da..81eddda840 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -101,7 +101,7 @@ class GroupCollector implements GroupCollectorInterface 'category_id', 'budget_id', ]; - $this->stringFields = ['amount', 'foreign_amount', 'native_amount', 'native_foreign_amount','source_balance_after','destination_balance_after']; + $this->stringFields = ['amount', 'foreign_amount', 'native_amount', 'native_foreign_amount', 'source_balance_after', 'destination_balance_after']; $this->total = 0; $this->fields = [ // group From 50803a2c2415ca55a92a84976e16174223b012b9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 26 Apr 2025 17:29:10 +0200 Subject: [PATCH 13/87] Add transfer type --- .../System/RecalculatesRunningBalance.php | 65 +++++++++++++++++++ .../Models/AccountBalanceCalculator.php | 1 + resources/views/list/groups.twig | 6 ++ 3 files changed, 72 insertions(+) create mode 100644 app/Console/Commands/System/RecalculatesRunningBalance.php diff --git a/app/Console/Commands/System/RecalculatesRunningBalance.php b/app/Console/Commands/System/RecalculatesRunningBalance.php new file mode 100644 index 0000000000..c571dda59d --- /dev/null +++ b/app/Console/Commands/System/RecalculatesRunningBalance.php @@ -0,0 +1,65 @@ +friendlyInfo('Will recalculate account balances. This may take a LONG time. Please be patient.'); + $this->correctBalanceAmounts($this->option('force')); + $this->friendlyInfo('Done recalculating account balances.'); + + return 0; + } + $this->friendlyWarning('This command has been disabled.'); + } + + private function correctBalanceAmounts(bool $forced): void + { + AccountBalanceCalculator::recalculateAll($forced); + } +} diff --git a/app/Support/Models/AccountBalanceCalculator.php b/app/Support/Models/AccountBalanceCalculator.php index 554936da51..b51af3d7f7 100644 --- a/app/Support/Models/AccountBalanceCalculator.php +++ b/app/Support/Models/AccountBalanceCalculator.php @@ -89,6 +89,7 @@ class AccountBalanceCalculator } $set = $query->get(['transactions.id', 'transactions.balance_dirty', 'transactions.transaction_currency_id', 'transaction_journals.date', 'transactions.account_id', 'transactions.amount']); + Log::debug(sprintf('Counted %d transaction(s)', $set->count())); // the balance value is an array. // first entry is the balance, second is the date. diff --git a/resources/views/list/groups.twig b/resources/views/list/groups.twig index 0bd2df088e..dbe736414d 100644 --- a/resources/views/list/groups.twig +++ b/resources/views/list/groups.twig @@ -266,6 +266,12 @@ {% else %} {{ formatAmountBySymbol(transaction.source_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }} {% endif %} + {% elseif transaction.transaction_type_type == 'Transfer' %} + {% if account.id == transaction.source_account_id %} + {{ formatAmountBySymbol(transaction.source_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }} + {% else %} + {{ formatAmountBySymbol(transaction.destination_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }} + {% endif %} {% else %}   {% endif %} From 945ad79c03bd52bd0778e15777de7268d9e85f3e Mon Sep 17 00:00:00 2001 From: JC5 Date: Sat, 26 Apr 2025 17:33:49 +0200 Subject: [PATCH 14/87] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-04-26?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/System/RecalculatesRunningBalance.php | 4 +++- package-lock.json | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Console/Commands/System/RecalculatesRunningBalance.php b/app/Console/Commands/System/RecalculatesRunningBalance.php index c571dda59d..cd0c3874b4 100644 --- a/app/Console/Commands/System/RecalculatesRunningBalance.php +++ b/app/Console/Commands/System/RecalculatesRunningBalance.php @@ -1,4 +1,6 @@ Date: Sun, 27 Apr 2025 10:32:21 +0200 Subject: [PATCH 15/87] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-04-27?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/firefly.php b/config/firefly.php index f1fc7fd5ec..226d38a8c4 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -78,7 +78,7 @@ return [ 'running_balance_column' => env('USE_RUNNING_BALANCE', false), // see cer.php for exchange rates feature flag. ], - 'version' => 'develop/2025-04-26', + 'version' => 'develop/2025-04-27', 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 25, From 5fc764e72be1ebc247505bdd538375a15ef569f9 Mon Sep 17 00:00:00 2001 From: JC5 Date: Mon, 28 Apr 2025 05:23:53 +0200 Subject: [PATCH 16/87] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-04-28?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.lock | 24 ++++++++++++------------ config/firefly.php | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/composer.lock b/composer.lock index 15e46f5b7b..ddea61e47f 100644 --- a/composer.lock +++ b/composer.lock @@ -11217,16 +11217,16 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.12", + "version": "2.1.13", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "96dde49e967c0c22812bcfa7bda4ff82c09f3b0c" + "reference": "e55e03e6d4ac49cd1240907e5b08e5cd378572a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/96dde49e967c0c22812bcfa7bda4ff82c09f3b0c", - "reference": "96dde49e967c0c22812bcfa7bda4ff82c09f3b0c", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e55e03e6d4ac49cd1240907e5b08e5cd378572a9", + "reference": "e55e03e6d4ac49cd1240907e5b08e5cd378572a9", "shasum": "" }, "require": { @@ -11271,25 +11271,25 @@ "type": "github" } ], - "time": "2025-04-16T13:19:18+00:00" + "time": "2025-04-27T12:28:25+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", - "reference": "1cc1259cb91ee4cfbb5c39bca9f635f067c910b4" + "reference": "9d8e7d4e32711715ad78a1fb6ec368df9af01fdf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/1cc1259cb91ee4cfbb5c39bca9f635f067c910b4", - "reference": "1cc1259cb91ee4cfbb5c39bca9f635f067c910b4", + "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/9d8e7d4e32711715ad78a1fb6ec368df9af01fdf", + "reference": "9d8e7d4e32711715ad78a1fb6ec368df9af01fdf", "shasum": "" }, "require": { "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^2.0" + "phpstan/phpstan": "^2.1.13" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", @@ -11316,9 +11316,9 @@ "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", "support": { "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", - "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/2.0.1" + "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/2.0.2" }, - "time": "2024-11-28T21:56:36+00:00" + "time": "2025-04-26T19:59:57+00:00" }, { "name": "phpstan/phpstan-strict-rules", diff --git a/config/firefly.php b/config/firefly.php index 226d38a8c4..c087c8a4d2 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -78,7 +78,7 @@ return [ 'running_balance_column' => env('USE_RUNNING_BALANCE', false), // see cer.php for exchange rates feature flag. ], - 'version' => 'develop/2025-04-27', + 'version' => 'develop/2025-04-28', 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 25, From 2967f4d4c71ec310f799b527fd47803081c50aa5 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 2 May 2025 05:46:35 +0200 Subject: [PATCH 17/87] Update PR template --- .github/pull_request_template.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f3c1785261..c80a508636 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -21,5 +21,3 @@ Changes in this pull request: - - - - -@JC5 From 3924781797cbe8007964d77ffcef3d536b3e85de Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 2 May 2025 06:45:34 +0200 Subject: [PATCH 18/87] Make sure running balance also updates when transactions are removed. --- .../Events/DestroyedGroupEventHandler.php | 20 +++++- .../Events/UpdatedGroupEventHandler.php | 65 +++++++++++-------- app/Providers/EventServiceProvider.php | 2 +- .../Internal/Update/GroupUpdateService.php | 45 ++++++------- .../Models/AccountBalanceCalculator.php | 52 +++++++-------- 5 files changed, 105 insertions(+), 79 deletions(-) diff --git a/app/Handlers/Events/DestroyedGroupEventHandler.php b/app/Handlers/Events/DestroyedGroupEventHandler.php index 0b28a7fb10..5b55bcd66b 100644 --- a/app/Handlers/Events/DestroyedGroupEventHandler.php +++ b/app/Handlers/Events/DestroyedGroupEventHandler.php @@ -27,15 +27,24 @@ namespace FireflyIII\Handlers\Events; use FireflyIII\Enums\WebhookTrigger; use FireflyIII\Events\DestroyedTransactionGroup; use FireflyIII\Events\RequestedSendWebhookMessages; +use FireflyIII\Events\UpdatedTransactionGroup; use FireflyIII\Generator\Webhook\MessageGeneratorInterface; +use FireflyIII\Support\Models\AccountBalanceCalculator; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Log; /** * Class DestroyedGroupEventHandler */ class DestroyedGroupEventHandler { - public function triggerWebhooks(DestroyedTransactionGroup $destroyedGroupEvent): void + public function runAllHandlers(DestroyedTransactionGroup $event): void + { + $this->triggerWebhooks($event); + $this->updateRunningBalance($event); + } + + private function triggerWebhooks(DestroyedTransactionGroup $destroyedGroupEvent): void { app('log')->debug('DestroyedTransactionGroup:triggerWebhooks'); $group = $destroyedGroupEvent->transactionGroup; @@ -50,4 +59,13 @@ class DestroyedGroupEventHandler event(new RequestedSendWebhookMessages()); } + + private function updateRunningBalance(DestroyedTransactionGroup $event): void + { + Log::debug(__METHOD__); + $group = $event->transactionGroup; + foreach ($group->transactionJournals as $journal) { + AccountBalanceCalculator::recalculateForJournal($journal); + } + } } diff --git a/app/Handlers/Events/UpdatedGroupEventHandler.php b/app/Handlers/Events/UpdatedGroupEventHandler.php index 723cb9743a..88198aa520 100644 --- a/app/Handlers/Events/UpdatedGroupEventHandler.php +++ b/app/Handlers/Events/UpdatedGroupEventHandler.php @@ -33,8 +33,10 @@ use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface; use FireflyIII\Services\Internal\Support\CreditRecalculateService; +use FireflyIII\Support\Models\AccountBalanceCalculator; use FireflyIII\TransactionRules\Engine\RuleEngineInterface; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Log; /** * Class UpdatedGroupEventHandler @@ -47,6 +49,7 @@ class UpdatedGroupEventHandler $this->processRules($event); $this->recalculateCredit($event); $this->triggerWebhooks($event); + $this->updateRunningBalance($event); } @@ -56,29 +59,29 @@ class UpdatedGroupEventHandler private function processRules(UpdatedTransactionGroup $updatedGroupEvent): void { if (false === $updatedGroupEvent->applyRules) { - app('log')->info(sprintf('Will not run rules on group #%d', $updatedGroupEvent->transactionGroup->id)); + Log::info(sprintf('Will not run rules on group #%d', $updatedGroupEvent->transactionGroup->id)); return; } - $journals = $updatedGroupEvent->transactionGroup->transactionJournals; - $array = []; + $journals = $updatedGroupEvent->transactionGroup->transactionJournals; + $array = []; /** @var TransactionJournal $journal */ foreach ($journals as $journal) { $array[] = $journal->id; } - $journalIds = implode(',', $array); - app('log')->debug(sprintf('Add local operator for journal(s): %s', $journalIds)); + $journalIds = implode(',', $array); + Log::debug(sprintf('Add local operator for journal(s): %s', $journalIds)); // collect rules: $ruleGroupRepository = app(RuleGroupRepositoryInterface::class); $ruleGroupRepository->setUser($updatedGroupEvent->transactionGroup->user); - $groups = $ruleGroupRepository->getRuleGroupsWithRules('update-journal'); + $groups = $ruleGroupRepository->getRuleGroupsWithRules('update-journal'); // file rule engine. - $newRuleEngine = app(RuleEngineInterface::class); + $newRuleEngine = app(RuleEngineInterface::class); $newRuleEngine->setUser($updatedGroupEvent->transactionGroup->user); $newRuleEngine->addOperator(['type' => 'journal_id', 'value' => $journalIds]); $newRuleEngine->setRuleGroups($groups); @@ -87,7 +90,7 @@ class UpdatedGroupEventHandler private function recalculateCredit(UpdatedTransactionGroup $event): void { - $group = $event->transactionGroup; + $group = $event->transactionGroup; /** @var CreditRecalculateService $object */ $object = app(CreditRecalculateService::class); @@ -97,14 +100,14 @@ class UpdatedGroupEventHandler private function triggerWebhooks(UpdatedTransactionGroup $updatedGroupEvent): void { - app('log')->debug(__METHOD__); - $group = $updatedGroupEvent->transactionGroup; + Log::debug(__METHOD__); + $group = $updatedGroupEvent->transactionGroup; if (false === $updatedGroupEvent->fireWebhooks) { - app('log')->info(sprintf('Will not fire webhooks for transaction group #%d', $group->id)); + Log::info(sprintf('Will not fire webhooks for transaction group #%d', $group->id)); return; } - $user = $group->user; + $user = $group->user; /** @var MessageGeneratorInterface $engine */ $engine = app(MessageGeneratorInterface::class); @@ -121,47 +124,53 @@ class UpdatedGroupEventHandler */ public function unifyAccounts(UpdatedTransactionGroup $updatedGroupEvent): void { - $group = $updatedGroupEvent->transactionGroup; + $group = $updatedGroupEvent->transactionGroup; if (1 === $group->transactionJournals->count()) { return; } // first journal: /** @var null|TransactionJournal $first */ - $first = $group->transactionJournals() - ->orderBy('transaction_journals.date', 'DESC') - ->orderBy('transaction_journals.order', 'ASC') - ->orderBy('transaction_journals.id', 'DESC') - ->orderBy('transaction_journals.description', 'DESC') - ->first() - ; + $first = $group->transactionJournals() + ->orderBy('transaction_journals.date', 'DESC') + ->orderBy('transaction_journals.order', 'ASC') + ->orderBy('transaction_journals.id', 'DESC') + ->orderBy('transaction_journals.description', 'DESC') + ->first(); if (null === $first) { - app('log')->warning(sprintf('Group #%d has no transaction journals.', $group->id)); + Log::warning(sprintf('Group #%d has no transaction journals.', $group->id)); return; } - $all = $group->transactionJournals()->get()->pluck('id')->toArray(); + $all = $group->transactionJournals()->get()->pluck('id')->toArray(); /** @var Account $sourceAccount */ $sourceAccount = $first->transactions()->where('amount', '<', '0')->first()->account; /** @var Account $destAccount */ - $destAccount = $first->transactions()->where('amount', '>', '0')->first()->account; + $destAccount = $first->transactions()->where('amount', '>', '0')->first()->account; - $type = $first->transactionType->type; + $type = $first->transactionType->type; if (TransactionTypeEnum::TRANSFER->value === $type || TransactionTypeEnum::WITHDRAWAL->value === $type) { // set all source transactions to source account: Transaction::whereIn('transaction_journal_id', $all) - ->where('amount', '<', 0)->update(['account_id' => $sourceAccount->id]) - ; + ->where('amount', '<', 0)->update(['account_id' => $sourceAccount->id]); } if (TransactionTypeEnum::TRANSFER->value === $type || TransactionTypeEnum::DEPOSIT->value === $type) { // set all destination transactions to destination account: Transaction::whereIn('transaction_journal_id', $all) - ->where('amount', '>', 0)->update(['account_id' => $destAccount->id]) - ; + ->where('amount', '>', 0)->update(['account_id' => $destAccount->id]); + } + } + + private function updateRunningBalance(UpdatedTransactionGroup $event): void + { + Log::debug(__METHOD__); + $group = $event->transactionGroup; + foreach ($group->transactionJournals as $journal) { + AccountBalanceCalculator::recalculateForJournal($journal); } } } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 1e9d655b0d..fe465411ea 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -176,7 +176,7 @@ class EventServiceProvider extends ServiceProvider 'FireflyIII\Handlers\Events\UpdatedGroupEventHandler@runAllHandlers', ], DestroyedTransactionGroup::class => [ - 'FireflyIII\Handlers\Events\DestroyedGroupEventHandler@triggerWebhooks', + 'FireflyIII\Handlers\Events\DestroyedGroupEventHandler@runAllHandlers', ], // API related events: AccessTokenCreated::class => [ diff --git a/app/Services/Internal/Update/GroupUpdateService.php b/app/Services/Internal/Update/GroupUpdateService.php index 2d30599e54..45bcf06d82 100644 --- a/app/Services/Internal/Update/GroupUpdateService.php +++ b/app/Services/Internal/Update/GroupUpdateService.php @@ -31,6 +31,7 @@ use FireflyIII\Factory\TransactionJournalFactory; use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; use FireflyIII\Services\Internal\Destroy\JournalDestroyService; +use Illuminate\Support\Facades\Log; /** * Class GroupUpdateService @@ -45,14 +46,14 @@ class GroupUpdateService */ public function update(TransactionGroup $transactionGroup, array $data): TransactionGroup { - app('log')->debug(sprintf('Now in %s', __METHOD__)); - app('log')->debug('Now in group update service', $data); + Log::debug(sprintf('Now in %s', __METHOD__)); + Log::debug('Now in group update service', $data); /** @var array $transactions */ $transactions = $data['transactions'] ?? []; // update group name. if (array_key_exists('group_title', $data)) { - app('log')->debug(sprintf('Update transaction group #%d title.', $transactionGroup->id)); + Log::debug(sprintf('Update transaction group #%d title.', $transactionGroup->id)); $oldTitle = $transactionGroup->title; $transactionGroup->title = $data['group_title']; $transactionGroup->save(); @@ -68,7 +69,7 @@ class GroupUpdateService } if (0 === count($transactions)) { - app('log')->debug('No transactions submitted, do nothing.'); + Log::debug('No transactions submitted, do nothing.'); return $transactionGroup; } @@ -76,7 +77,7 @@ class GroupUpdateService if (1 === count($transactions) && 1 === $transactionGroup->transactionJournals()->count()) { /** @var TransactionJournal $first */ $first = $transactionGroup->transactionJournals()->first(); - app('log')->debug( + Log::debug( sprintf('Will now update journal #%d (only journal in group #%d)', $first->id, $transactionGroup->id) ); $this->updateTransactionJournal($transactionGroup, $first, reset($transactions)); @@ -87,14 +88,14 @@ class GroupUpdateService return $transactionGroup; } - app('log')->debug('Going to update split group.'); + Log::debug('Going to update split group.'); $existing = $transactionGroup->transactionJournals->pluck('id')->toArray(); $updated = $this->updateTransactions($transactionGroup, $transactions); - app('log')->debug('Array of updated IDs: ', $updated); + Log::debug('Array of updated IDs: ', $updated); if (0 === count($updated)) { - app('log')->error('There were no transactions updated or created. Will not delete anything.'); + Log::error('There were no transactions updated or created. Will not delete anything.'); $transactionGroup->touch(); $transactionGroup->refresh(); app('preferences')->mark(); @@ -103,7 +104,7 @@ class GroupUpdateService } $result = array_diff($existing, $updated); - app('log')->debug('Result of DIFF: ', $result); + Log::debug('Result of DIFF: ', $result); if (count($result) > 0) { /** @var string $deletedId */ foreach ($result as $deletedId) { @@ -131,7 +132,7 @@ class GroupUpdateService TransactionJournal $journal, array $data ): void { - app('log')->debug(sprintf('Now in %s', __METHOD__)); + Log::debug(sprintf('Now in %s', __METHOD__)); if (0 === count($data)) { return; } @@ -153,7 +154,7 @@ class GroupUpdateService */ private function updateTransactions(TransactionGroup $transactionGroup, array $transactions): array { - app('log')->debug(sprintf('Now in %s', __METHOD__)); + Log::debug(sprintf('Now in %s', __METHOD__)); // updated or created transaction journals: $updated = []; @@ -162,17 +163,17 @@ class GroupUpdateService * @var array $transaction */ foreach ($transactions as $index => $transaction) { - app('log')->debug(sprintf('Now at #%d of %d', $index + 1, count($transactions)), $transaction); + Log::debug(sprintf('Now at #%d of %d', $index + 1, count($transactions)), $transaction); $journalId = (int) ($transaction['transaction_journal_id'] ?? 0); /** @var null|TransactionJournal $journal */ $journal = $transactionGroup->transactionJournals()->find($journalId); if (null === $journal) { - app('log')->debug('This entry has no existing journal: make a new split.'); + Log::debug('This entry has no existing journal: make a new split.'); // force the transaction type on the transaction data. // by plucking it from another journal in the group: if (!array_key_exists('type', $transaction)) { - app('log')->debug('No transaction type is indicated.'); + Log::debug('No transaction type is indicated.'); /** @var null|TransactionJournal $randomJournal */ $randomJournal = $transactionGroup->transactionJournals()->inRandomOrder()->with( @@ -180,24 +181,24 @@ class GroupUpdateService )->first(); if (null !== $randomJournal) { $transaction['type'] = $randomJournal->transactionType->type; - app('log')->debug(sprintf('Transaction type set to %s.', $transaction['type'])); + Log::debug(sprintf('Transaction type set to %s.', $transaction['type'])); } } - app('log')->debug('Call createTransactionJournal'); + Log::debug('Call createTransactionJournal'); $newJournal = $this->createTransactionJournal($transactionGroup, $transaction); - app('log')->debug('Done calling createTransactionJournal'); + Log::debug('Done calling createTransactionJournal'); if (null !== $newJournal) { $updated[] = $newJournal->id; } if (null === $newJournal) { - app('log')->error('createTransactionJournal returned NULL, indicating something went wrong.'); + Log::error('createTransactionJournal returned NULL, indicating something went wrong.'); } } if (null !== $journal) { - app('log')->debug('Call updateTransactionJournal'); + Log::debug('Call updateTransactionJournal'); $this->updateTransactionJournal($transactionGroup, $journal, $transaction); $updated[] = $journal->id; - app('log')->debug('Done calling updateTransactionJournal'); + Log::debug('Done calling updateTransactionJournal'); } } @@ -223,8 +224,8 @@ class GroupUpdateService try { $collection = $factory->create($submission); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); throw new FireflyException( sprintf('Could not create new transaction journal: %s', $e->getMessage()), diff --git a/app/Support/Models/AccountBalanceCalculator.php b/app/Support/Models/AccountBalanceCalculator.php index b51af3d7f7..11ee28f04b 100644 --- a/app/Support/Models/AccountBalanceCalculator.php +++ b/app/Support/Models/AccountBalanceCalculator.php @@ -71,15 +71,14 @@ class AccountBalanceCalculator $balances = []; $count = 0; $query = Transaction::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') - ->whereNull('transactions.deleted_at') - ->whereNull('transaction_journals.deleted_at') + ->whereNull('transactions.deleted_at') + ->whereNull('transaction_journals.deleted_at') // this order is the same as GroupCollector, but in the exact reverse. - ->orderBy('transaction_journals.date', 'asc') - ->orderBy('transaction_journals.order', 'desc') - ->orderBy('transaction_journals.id', 'asc') - ->orderBy('transaction_journals.description', 'asc') - ->orderBy('transactions.amount', 'asc') - ; + ->orderBy('transaction_journals.date', 'asc') + ->orderBy('transaction_journals.order', 'desc') + ->orderBy('transaction_journals.id', 'asc') + ->orderBy('transaction_journals.description', 'asc') + ->orderBy('transactions.amount', 'asc'); if ($accounts->count() > 0) { $query->whereIn('transactions.account_id', $accounts->pluck('id')->toArray()); } @@ -88,7 +87,7 @@ class AccountBalanceCalculator $query->where('transaction_journals.date', '>=', $notBefore); } - $set = $query->get(['transactions.id', 'transactions.balance_dirty', 'transactions.transaction_currency_id', 'transaction_journals.date', 'transactions.account_id', 'transactions.amount']); + $set = $query->get(['transactions.id', 'transactions.balance_dirty', 'transactions.transaction_currency_id', 'transaction_journals.date', 'transactions.account_id', 'transactions.amount']); Log::debug(sprintf('Counted %d transaction(s)', $set->count())); // the balance value is an array. @@ -101,8 +100,8 @@ class AccountBalanceCalculator $balances[$entry->account_id][$entry->transaction_currency_id] ??= [$this->getLatestBalance($entry->account_id, $entry->transaction_currency_id, $notBefore), null]; // before and after are easy: - $before = $balances[$entry->account_id][$entry->transaction_currency_id][0]; - $after = bcadd($before, $entry->amount); + $before = $balances[$entry->account_id][$entry->transaction_currency_id][0]; + $after = bcadd($before, $entry->amount); if (true === $entry->balance_dirty || $accounts->count() > 0) { // update the transaction: $entry->balance_before = $before; @@ -128,18 +127,17 @@ class AccountBalanceCalculator return '0'; } Log::debug(sprintf('getLatestBalance: notBefore date is "%s", calculating', $notBefore->format('Y-m-d'))); - $query = Transaction::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') - ->whereNull('transactions.deleted_at') - ->where('transaction_journals.transaction_currency_id', $currencyId) - ->whereNull('transaction_journals.deleted_at') + $query = Transaction::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->whereNull('transactions.deleted_at') + ->where('transaction_journals.transaction_currency_id', $currencyId) + ->whereNull('transaction_journals.deleted_at') // this order is the same as GroupCollector - ->orderBy('transaction_journals.date', 'DESC') - ->orderBy('transaction_journals.order', 'ASC') - ->orderBy('transaction_journals.id', 'DESC') - ->orderBy('transaction_journals.description', 'DESC') - ->orderBy('transactions.amount', 'DESC') - ->where('transactions.account_id', $accountId) - ; + ->orderBy('transaction_journals.date', 'DESC') + ->orderBy('transaction_journals.order', 'ASC') + ->orderBy('transaction_journals.id', 'DESC') + ->orderBy('transaction_journals.description', 'DESC') + ->orderBy('transactions.amount', 'DESC') + ->where('transactions.account_id', $accountId); $notBefore->startOfDay(); $query->where('transaction_journals.date', '<', $notBefore); @@ -171,7 +169,7 @@ class AccountBalanceCalculator */ foreach ($currencies as $currencyId => $balance) { /** @var null|TransactionCurrency $currency */ - $currency = TransactionCurrency::find($currencyId); + $currency = TransactionCurrency::find($currencyId); if (null === $currency) { Log::error(sprintf('Could not find currency #%d, will not save account balance.', $currencyId)); @@ -199,13 +197,13 @@ class AccountBalanceCalculator public static function recalculateForJournal(TransactionJournal $transactionJournal): void { Log::debug(__METHOD__); - $object = new self(); + $object = new self(); - // recalculate the involved accounts: - $accounts = new Collection(); + $set = []; foreach ($transactionJournal->transactions as $transaction) { - $accounts->push($transaction->account); + $set[$transaction->account_id] = $transaction->account; } + $accounts = new Collection($set); $object->optimizedCalculation($accounts, $transactionJournal->date); } } From ba43d8c3f55cc7c29b4d5ded3183eaa131be4b20 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 May 2025 06:15:49 +0200 Subject: [PATCH 19/87] Fix type error. --- app/Http/Controllers/Chart/AccountController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index 80c803cc68..f8e2a847ed 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -511,7 +511,7 @@ class AccountController extends Controller foreach ($return as $key => $info) { if ('balance' !== $key && 'native_balance' !== $key) { // assume it's a currency: - $setCurrency = $this->currencyRepository->findByCode($key); + $setCurrency = $this->currencyRepository->findByCode((string) $key); $info['currency_symbol'] = $setCurrency->symbol; $info['currency_code'] = $setCurrency->code; $info['label'] = sprintf('%s (%s)', $account->name, $setCurrency->symbol); From 446e855b7403365086d7f5efe9463c837c524300 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 May 2025 12:11:25 +0200 Subject: [PATCH 20/87] Replace methods with safe variants. Let's see how this works out. --- .../Data/Export/ExportController.php | 1 + .../Requests/Data/Bulk/TransactionRequest.php | 2 +- app/Console/Commands/Export/ExportsData.php | 4 +- .../Commands/System/ForcesDecimalSize.php | 10 +- .../Commands/System/OutputsInstructions.php | 4 +- .../Commands/System/ScansAttachments.php | 8 +- .../Commands/System/VerifySecurityAlerts.php | 2 +- .../Upgrade/RemovesDatabaseDecryption.php | 2 +- .../Commands/Upgrade/UpgradesDatabase.php | 2 +- .../Upgrade/UpgradesRecurrenceMetaData.php | 2 +- .../Commands/Upgrade/UpgradesToGroups.php | 4 +- app/Exceptions/Handler.php | 8 +- app/Factory/PiggyBankFactory.php | 2 +- app/Factory/TransactionJournalFactory.php | 4 +- .../Events/VersionCheckEventHandler.php | 4 +- app/Helpers/Attachments/AttachmentHelper.php | 16 +- .../Collector/Extensions/MetaCollection.php | 56 +- app/Helpers/Collector/GroupCollector.php | 2 +- .../Webhook/Sha3SignatureGenerator.php | 2 +- .../Auth/ForgotPasswordController.php | 2 +- .../Controllers/Chart/AccountController.php | 6 +- app/Http/Controllers/Controller.php | 6 +- app/Http/Controllers/DebugController.php | 14 +- .../Controllers/Export/IndexController.php | 2 +- .../Controllers/Json/RecurrenceController.php | 2 +- .../Controllers/PreferencesController.php | 8 +- .../Controllers/System/InstallController.php | 4 +- .../Transaction/CreateController.php | 2 +- .../Transaction/EditController.php | 2 +- app/Http/Middleware/AcceptHeaders.php | 2 +- app/Http/Requests/ReportFormRequest.php | 4 +- app/Jobs/DownloadExchangeRates.php | 2 +- app/Jobs/MailError.php | 8 +- app/Mail/InvitationMail.php | 2 +- app/Models/AccountMeta.php | 4 +- app/Models/Configuration.php | 4 +- app/Models/TransactionJournalMeta.php | 4 +- app/Providers/AppServiceProvider.php | 2 +- .../Account/AccountRepository.php | 2 +- .../Currency/CurrencyRepository.php | 6 +- .../Recurring/RecurringRepository.php | 14 +- .../TransactionGroupRepository.php | 4 +- app/Repositories/User/UserRepository.php | 4 +- .../UserGroups/Account/AccountRepository.php | 2 +- .../Currency/CurrencyRepository.php | 6 +- app/Rules/IsValidBulkClause.php | 2 +- app/Rules/IsValidPositiveAmount.php | 2 +- app/Rules/UniqueAccountNumber.php | 2 +- .../FireflyIIIOrg/Update/UpdateRequest.php | 2 +- .../Internal/Support/JournalServiceTrait.php | 2 +- .../Support/RecurringTransactionTrait.php | 4 +- .../Webhook/StandardWebhookSender.php | 2 +- .../Authentication/RemoteUserGuard.php | 4 +- app/Support/CacheProperties.php | 2 +- app/Support/Cronjobs/UpdateCheckCronjob.php | 2 +- app/Support/Http/Controllers/CreateStuff.php | 4 +- .../Http/Controllers/RequestInformation.php | 2 +- app/Support/ParseDateString.php | 16 +- app/Support/Request/ConvertsDataTypes.php | 2 +- app/Support/Search/AccountSearch.php | 4 +- .../Search/QueryParser/GdbotsQueryParser.php | 2 +- app/Support/Steam.php | 8 +- app/Support/System/OAuthKeys.php | 8 +- app/Support/Twig/General.php | 6 +- app/Support/Twig/TransactionGroupTwig.php | 4 +- app/Transformers/RecurrenceTransformer.php | 2 +- .../WebhookMessageTransformer.php | 2 +- .../Bulk/ValidatesBulkTransactionQuery.php | 2 +- app/Validation/FireflyValidator.php | 6 +- composer.json | 6 +- composer.lock | 482 +++++++++++------- 71 files changed, 480 insertions(+), 353 deletions(-) diff --git a/app/Api/V1/Controllers/Data/Export/ExportController.php b/app/Api/V1/Controllers/Data/Export/ExportController.php index b4decbf49f..ad578e6f42 100644 --- a/app/Api/V1/Controllers/Data/Export/ExportController.php +++ b/app/Api/V1/Controllers/Data/Export/ExportController.php @@ -29,6 +29,7 @@ use FireflyIII\Api\V1\Requests\Data\Export\ExportRequest; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Support\Export\ExportDataGenerator; use Illuminate\Http\Response as LaravelResponse; +use function Safe\date; /** * Class ExportController diff --git a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php index fb8f302f76..9bee14442d 100644 --- a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php +++ b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php @@ -48,7 +48,7 @@ class TransactionRequest extends FormRequest try { $data = [ - 'query' => json_decode($this->get('query'), true, 8, JSON_THROW_ON_ERROR), + 'query' => \Safe\json_decode($this->get('query'), true, 8, JSON_THROW_ON_ERROR), ]; } catch (\JsonException $e) { // dont really care. the validation should catch invalid json. diff --git a/app/Console/Commands/Export/ExportsData.php b/app/Console/Commands/Export/ExportsData.php index a4cc991d89..83fd906dc6 100644 --- a/app/Console/Commands/Export/ExportsData.php +++ b/app/Console/Commands/Export/ExportsData.php @@ -273,7 +273,7 @@ class ExportsData extends Command */ private function exportData(array $options, array $data): void { - $date = date('Y_m_d'); + $date = \Safe\date('Y_m_d'); foreach ($data as $key => $content) { $file = sprintf('%s%s_%s.csv', $options['directory'], $date, $key); if (false === $options['force'] && file_exists($file)) { @@ -283,7 +283,7 @@ class ExportsData extends Command $this->friendlyWarning(sprintf('File "%s" exists already but will be replaced.', $file)); } // continue to write to file. - file_put_contents($file, $content); + \Safe\file_put_contents($file, $content); $this->friendlyPositive(sprintf('Wrote %s-export to file "%s".', $key, $file)); } } diff --git a/app/Console/Commands/System/ForcesDecimalSize.php b/app/Console/Commands/System/ForcesDecimalSize.php index 66340b4c6c..eaec52cdfb 100644 --- a/app/Console/Commands/System/ForcesDecimalSize.php +++ b/app/Console/Commands/System/ForcesDecimalSize.php @@ -130,7 +130,7 @@ class ForcesDecimalSize extends Command // if sqlite, add function? if ('sqlite' === (string) config('database.default')) { DB::connection()->getPdo()->sqliteCreateFunction('REGEXP', static function ($pattern, $value) { - mb_regex_encoding('UTF-8'); + \Safe\mb_regex_encoding('UTF-8'); $pattern = trim($pattern, '"'); return (false !== mb_ereg($pattern, (string) $value)) ? 1 : 0; @@ -234,7 +234,7 @@ class ForcesDecimalSize extends Command /** @var Builder $query */ $query = Account::leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id') ->where('account_meta.name', 'currency_id') - ->where('account_meta.data', json_encode((string) $currency->id)) + ->where('account_meta.data', \Safe\json_encode((string) $currency->id)) ; $query->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void { foreach ($fields as $field) { @@ -338,7 +338,7 @@ class ForcesDecimalSize extends Command ->leftJoin('accounts', 'piggy_banks.account_id', '=', 'accounts.id') ->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id') ->where('account_meta.name', 'currency_id') - ->where('account_meta.data', json_encode((string) $currency->id)) + ->where('account_meta.data', \Safe\json_encode((string) $currency->id)) ->where(static function (Builder $q) use ($fields, $currency, $cast, $operator, $regularExpression): void { foreach ($fields as $field) { $q->orWhere( @@ -394,7 +394,7 @@ class ForcesDecimalSize extends Command ->leftJoin('accounts', 'piggy_banks.account_id', '=', 'accounts.id') ->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id') ->where('account_meta.name', 'currency_id') - ->where('account_meta.data', json_encode((string) $currency->id)) + ->where('account_meta.data', \Safe\json_encode((string) $currency->id)) ->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void { foreach ($fields as $field) { $q->orWhere( @@ -448,7 +448,7 @@ class ForcesDecimalSize extends Command $query = PiggyBank::leftJoin('accounts', 'piggy_banks.account_id', '=', 'accounts.id') ->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id') ->where('account_meta.name', 'currency_id') - ->where('account_meta.data', json_encode((string) $currency->id)) + ->where('account_meta.data', \Safe\json_encode((string) $currency->id)) ->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void { foreach ($fields as $field) { $q->orWhere( diff --git a/app/Console/Commands/System/OutputsInstructions.php b/app/Console/Commands/System/OutputsInstructions.php index 7842cf1ad6..e9cd25e5be 100644 --- a/app/Console/Commands/System/OutputsInstructions.php +++ b/app/Console/Commands/System/OutputsInstructions.php @@ -111,8 +111,8 @@ class OutputsInstructions extends Command */ private function showLogo(): void { - $today = date('m-d'); - $month = date('m'); + $today = \Safe\date('m-d'); + $month = \Safe\date('m'); // variation in colors and effects just because I can! // default is Ukraine flag: $colors = ['blue', 'blue', 'blue', 'yellow', 'yellow', 'yellow', 'default', 'default']; diff --git a/app/Console/Commands/System/ScansAttachments.php b/app/Console/Commands/System/ScansAttachments.php index b5fad33afa..001f2ec80c 100644 --- a/app/Console/Commands/System/ScansAttachments.php +++ b/app/Console/Commands/System/ScansAttachments.php @@ -63,15 +63,15 @@ class ScansAttachments extends Command app('log')->error(sprintf('Could not decrypt data of attachment #%d: %s', $attachment->id, $e->getMessage())); $decryptedContent = $encryptedContent; } - $tempFileName = tempnam(sys_get_temp_dir(), 'FireflyIII'); + $tempFileName = \Safe\tempnam(sys_get_temp_dir(), 'FireflyIII'); if (false === $tempFileName) { app('log')->error(sprintf('Could not create temporary file for attachment #%d', $attachment->id)); exit(1); } - file_put_contents($tempFileName, $decryptedContent); - $attachment->md5 = (string) md5_file($tempFileName); - $attachment->mime = (string) mime_content_type($tempFileName); + \Safe\file_put_contents($tempFileName, $decryptedContent); + $attachment->md5 = (string) \Safe\md5_file($tempFileName); + $attachment->mime = (string) \Safe\mime_content_type($tempFileName); $attachment->save(); $this->friendlyInfo(sprintf('Fixed attachment #%d', $attachment->id)); } diff --git a/app/Console/Commands/System/VerifySecurityAlerts.php b/app/Console/Commands/System/VerifySecurityAlerts.php index 894c73daa2..0cad167ccb 100644 --- a/app/Console/Commands/System/VerifySecurityAlerts.php +++ b/app/Console/Commands/System/VerifySecurityAlerts.php @@ -57,7 +57,7 @@ class VerifySecurityAlerts extends Command return 0; } $content = $disk->get('alerts.json'); - $json = json_decode($content, true, 10); + $json = \Safe\json_decode($content, true, 10); /** @var array $array */ foreach ($json as $array) { diff --git a/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php b/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php index 89a961925c..9bc4477888 100644 --- a/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php +++ b/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php @@ -167,7 +167,7 @@ class RemovesDatabaseDecryption extends Command { // try to json_decrypt the value. try { - $newValue = json_decode($value, true, 512, JSON_THROW_ON_ERROR) ?? $value; + $newValue = \Safe\json_decode($value, true, 512, JSON_THROW_ON_ERROR) ?? $value; } catch (\JsonException $e) { $message = sprintf('Could not JSON decode preference row #%d: %s. This does not have to be a problem.', $id, $e->getMessage()); $this->friendlyError($message); diff --git a/app/Console/Commands/Upgrade/UpgradesDatabase.php b/app/Console/Commands/Upgrade/UpgradesDatabase.php index b09c15f657..d30b32662a 100644 --- a/app/Console/Commands/Upgrade/UpgradesDatabase.php +++ b/app/Console/Commands/Upgrade/UpgradesDatabase.php @@ -24,7 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Upgrade; -set_time_limit(0); +\Safe\set_time_limit(0); use FireflyIII\Console\Commands\ShowsFriendlyMessages; use Illuminate\Console\Command; diff --git a/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php b/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php index d20f763945..39a715ced9 100644 --- a/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php +++ b/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php @@ -100,7 +100,7 @@ class UpgradesRecurrenceMetaData extends Command if ('tags' === $meta->name) { $array = explode(',', $meta->value); - $value = json_encode($array, JSON_THROW_ON_ERROR); + $value = \Safe\json_encode($array, JSON_THROW_ON_ERROR); } RecurrenceTransactionMeta::create( diff --git a/app/Console/Commands/Upgrade/UpgradesToGroups.php b/app/Console/Commands/Upgrade/UpgradesToGroups.php index d1c0625efe..f294db33a8 100644 --- a/app/Console/Commands/Upgrade/UpgradesToGroups.php +++ b/app/Console/Commands/Upgrade/UpgradesToGroups.php @@ -368,8 +368,8 @@ class UpgradesToGroups extends Command { $groupId = DB::table('transaction_groups')->insertGetId( [ - 'created_at' => date('Y-m-d H:i:s'), - 'updated_at' => date('Y-m-d H:i:s'), + 'created_at' => \Safe\date('Y-m-d H:i:s'), + 'updated_at' => \Safe\date('Y-m-d H:i:s'), 'title' => null, 'user_id' => $array['user_id'], ] diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 13fa54bc88..021d3513b9 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -224,7 +224,7 @@ class Handler extends ExceptionHandler $data = [ 'class' => get_class($e), 'errorMessage' => $e->getMessage(), - 'time' => date('r'), + 'time' => \Safe\date('r'), 'stackTrace' => $e->getTraceAsString(), 'file' => $e->getFile(), 'line' => $e->getLine(), @@ -235,7 +235,7 @@ class Handler extends ExceptionHandler 'json' => request()->acceptsJson(), 'method' => request()->method(), 'headers' => $headers, - 'post' => 'POST' === request()->method() ? json_encode(request()->all()) : '', + 'post' => 'POST' === request()->method() ? \Safe\json_encode(request()->all()) : '', ]; // create job that will mail. @@ -283,8 +283,8 @@ class Handler extends ExceptionHandler } $safe = route('index'); $previous = $exception->redirectTo; - $previousHost = parse_url($previous, PHP_URL_HOST); - $safeHost = parse_url($safe, PHP_URL_HOST); + $previousHost = \Safe\parse_url($previous, PHP_URL_HOST); + $safeHost = \Safe\parse_url($safe, PHP_URL_HOST); return null !== $previousHost && $previousHost === $safeHost ? $previous : $safe; } diff --git a/app/Factory/PiggyBankFactory.php b/app/Factory/PiggyBankFactory.php index 5c308c1d08..a6707e8b40 100644 --- a/app/Factory/PiggyBankFactory.php +++ b/app/Factory/PiggyBankFactory.php @@ -284,7 +284,7 @@ class PiggyBankFactory Log::debug(sprintf('Will link account #%d with info: ', $account->id), $toBeLinked[$account->id]); } } - Log::debug(sprintf('Link information: %s', json_encode($toBeLinked))); + Log::debug(sprintf('Link information: %s', \Safe\json_encode($toBeLinked))); if (0 !== count($toBeLinked)) { $piggyBank->accounts()->sync($toBeLinked); } diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php index 67428dbc50..f2d716bbc4 100644 --- a/app/Factory/TransactionJournalFactory.php +++ b/app/Factory/TransactionJournalFactory.php @@ -315,7 +315,7 @@ class TransactionJournalFactory unset($dataRow['import_hash_v2'], $dataRow['original_source']); try { - $json = json_encode($dataRow, JSON_THROW_ON_ERROR); + $json = \Safe\json_encode($dataRow, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { app('log')->error(sprintf('Could not encode dataRow: %s', $e->getMessage())); $json = microtime(); @@ -344,7 +344,7 @@ class TransactionJournalFactory ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'journal_meta.transaction_journal_id') ->whereNotNull('transaction_journals.id') ->where('transaction_journals.user_id', $this->user->id) - ->where('data', json_encode($hash, JSON_THROW_ON_ERROR)) + ->where('data', \Safe\json_encode($hash, JSON_THROW_ON_ERROR)) ->with(['transactionJournal', 'transactionJournal.transactionGroup']) ->first(['journal_meta.*']) ; diff --git a/app/Handlers/Events/VersionCheckEventHandler.php b/app/Handlers/Events/VersionCheckEventHandler.php index 75e313a313..3624250767 100644 --- a/app/Handlers/Events/VersionCheckEventHandler.php +++ b/app/Handlers/Events/VersionCheckEventHandler.php @@ -73,7 +73,7 @@ class VersionCheckEventHandler $diff = $now - $lastCheckTime->data; Log::debug(sprintf('Last check time is %d, current time is %d, difference is %d', $lastCheckTime->data, $now, $diff)); if ($diff < 604800) { - Log::debug(sprintf('Checked for updates less than a week ago (on %s).', date('Y-m-d H:i:s', $lastCheckTime->data))); + Log::debug(sprintf('Checked for updates less than a week ago (on %s).', \Safe\date('Y-m-d H:i:s', $lastCheckTime->data))); return; } @@ -105,7 +105,7 @@ class VersionCheckEventHandler $diff = $now - $lastCheckTime->data; Log::debug(sprintf('Last warning time is %d, current time is %d, difference is %d', $lastCheckTime->data, $now, $diff)); if ($diff < 604800 * 4) { - Log::debug(sprintf('Warned about updates less than four weeks ago (on %s).', date('Y-m-d H:i:s', $lastCheckTime->data))); + Log::debug(sprintf('Warned about updates less than four weeks ago (on %s).', \Safe\date('Y-m-d H:i:s', $lastCheckTime->data))); return; } diff --git a/app/Helpers/Attachments/AttachmentHelper.php b/app/Helpers/Attachments/AttachmentHelper.php index a4cbc352ba..42f7034bd3 100644 --- a/app/Helpers/Attachments/AttachmentHelper.php +++ b/app/Helpers/Attachments/AttachmentHelper.php @@ -118,7 +118,7 @@ class AttachmentHelper implements AttachmentHelperInterface public function saveAttachmentFromApi(Attachment $attachment, string $content): bool { Log::debug(sprintf('Now in %s', __METHOD__)); - $resource = tmpfile(); + $resource = \Safe\tmpfile(); if (false === $resource) { Log::error('Cannot create temp-file for file upload.'); @@ -133,17 +133,17 @@ class AttachmentHelper implements AttachmentHelperInterface $path = stream_get_meta_data($resource)['uri']; Log::debug(sprintf('Path is %s', $path)); - $result = fwrite($resource, $content); + $result = \Safe\fwrite($resource, $content); if (false === $result) { Log::error('Could not write temp file.'); return false; } Log::debug(sprintf('Wrote %d bytes to temp file.', $result)); - $finfo = finfo_open(FILEINFO_MIME_TYPE); + $finfo = \Safe\finfo_open(FILEINFO_MIME_TYPE); if (false === $finfo) { Log::error('Could not open finfo.'); - fclose($resource); + \Safe\fclose($resource); return false; } @@ -151,7 +151,7 @@ class AttachmentHelper implements AttachmentHelperInterface $allowedMime = config('firefly.allowedMimes'); if (!in_array($mime, $allowedMime, true)) { Log::error(sprintf('Mime type %s is not allowed for API file upload.', $mime)); - fclose($resource); + \Safe\fclose($resource); return false; } @@ -163,7 +163,7 @@ class AttachmentHelper implements AttachmentHelperInterface $this->uploadDisk->put($file, $content); // update attachment. - $attachment->md5 = (string) md5_file($path); + $attachment->md5 = (string) \Safe\md5_file($path); $attachment->mime = $mime; $attachment->size = strlen($content); $attachment->uploaded = true; @@ -225,7 +225,7 @@ class AttachmentHelper implements AttachmentHelperInterface $attachment = new Attachment(); // create Attachment object. $attachment->user()->associate($user); $attachment->attachable()->associate($model); - $attachment->md5 = (string) md5_file($file->getRealPath()); + $attachment->md5 = (string) \Safe\md5_file($file->getRealPath()); $attachment->filename = $file->getClientOriginalName(); $attachment->mime = $file->getMimeType(); $attachment->size = $file->getSize(); @@ -333,7 +333,7 @@ class AttachmentHelper implements AttachmentHelperInterface */ protected function hasFile(UploadedFile $file, Model $model): bool { - $md5 = md5_file($file->getRealPath()); + $md5 = \Safe\md5_file($file->getRealPath()); $name = $file->getClientOriginalName(); $class = get_class($model); $count = 0; diff --git a/app/Helpers/Collector/Extensions/MetaCollection.php b/app/Helpers/Collector/Extensions/MetaCollection.php index 1ce417a77d..f1cad62f17 100644 --- a/app/Helpers/Collector/Extensions/MetaCollection.php +++ b/app/Helpers/Collector/Extensions/MetaCollection.php @@ -166,7 +166,7 @@ trait MetaCollection { $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'external_id'); - $this->query->where('journal_meta.data', '!=', sprintf('%s', json_encode($externalId))); + $this->query->where('journal_meta.data', '!=', sprintf('%s', \Safe\json_encode($externalId))); $this->query->whereNull('journal_meta.deleted_at'); return $this; @@ -189,14 +189,14 @@ trait MetaCollection { $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'external_url'); - $this->query->where('journal_meta.data', '!=', json_encode($url)); + $this->query->where('journal_meta.data', '!=', \Safe\json_encode($url)); return $this; } public function excludeInternalReference(string $internalReference): GroupCollectorInterface { - $internalReference = (string) json_encode($internalReference); + $internalReference = (string) \Safe\json_encode($internalReference); $internalReference = str_replace('\\', '\\\\', trim($internalReference, '"')); $this->joinMetaDataTables(); @@ -210,14 +210,14 @@ trait MetaCollection { $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'recurrence_id'); - $this->query->where('journal_meta.data', '!=', sprintf('%s', json_encode($recurringId))); + $this->query->where('journal_meta.data', '!=', sprintf('%s', \Safe\json_encode($recurringId))); return $this; } public function externalIdContains(string $externalId): GroupCollectorInterface { - $externalId = (string) json_encode($externalId); + $externalId = (string) \Safe\json_encode($externalId); $externalId = str_replace('\\', '\\\\', trim($externalId, '"')); $this->joinMetaDataTables(); @@ -229,7 +229,7 @@ trait MetaCollection public function externalIdDoesNotContain(string $externalId): GroupCollectorInterface { - $externalId = (string) json_encode($externalId); + $externalId = (string) \Safe\json_encode($externalId); $externalId = str_replace('\\', '\\\\', trim($externalId, '"')); $this->joinMetaDataTables(); @@ -241,7 +241,7 @@ trait MetaCollection public function externalIdDoesNotEnd(string $externalId): GroupCollectorInterface { - $externalId = (string) json_encode($externalId); + $externalId = (string) \Safe\json_encode($externalId); $externalId = str_replace('\\', '\\\\', trim($externalId, '"')); $this->joinMetaDataTables(); @@ -253,7 +253,7 @@ trait MetaCollection public function externalIdDoesNotStart(string $externalId): GroupCollectorInterface { - $externalId = (string) json_encode($externalId); + $externalId = (string) \Safe\json_encode($externalId); $externalId = str_replace('\\', '\\\\', trim($externalId, '"')); $this->joinMetaDataTables(); @@ -265,7 +265,7 @@ trait MetaCollection public function externalIdEnds(string $externalId): GroupCollectorInterface { - $externalId = (string) json_encode($externalId); + $externalId = (string) \Safe\json_encode($externalId); $externalId = str_replace('\\', '\\\\', trim($externalId, '"')); $this->joinMetaDataTables(); @@ -277,7 +277,7 @@ trait MetaCollection public function externalIdStarts(string $externalId): GroupCollectorInterface { - $externalId = (string) json_encode($externalId); + $externalId = (string) \Safe\json_encode($externalId); $externalId = str_replace('\\', '\\\\', trim($externalId, '"')); $this->joinMetaDataTables(); @@ -290,7 +290,7 @@ trait MetaCollection public function externalUrlContains(string $url): GroupCollectorInterface { $this->joinMetaDataTables(); - $url = (string) json_encode($url); + $url = (string) \Safe\json_encode($url); $url = str_replace('\\', '\\\\', trim($url, '"')); $this->query->where('journal_meta.name', '=', 'external_url'); $this->query->whereLike('journal_meta.data', sprintf('%%%s%%', $url)); @@ -301,7 +301,7 @@ trait MetaCollection public function externalUrlDoesNotContain(string $url): GroupCollectorInterface { $this->joinMetaDataTables(); - $url = (string) json_encode($url); + $url = (string) \Safe\json_encode($url); $url = str_replace('\\', '\\\\', trim($url, '"')); $this->query->where('journal_meta.name', '=', 'external_url'); $this->query->whereNotLike('journal_meta.data', sprintf('%%%s%%', $url)); @@ -312,7 +312,7 @@ trait MetaCollection public function externalUrlDoesNotEnd(string $url): GroupCollectorInterface { $this->joinMetaDataTables(); - $url = (string) json_encode($url); + $url = (string) \Safe\json_encode($url); $url = str_replace('\\', '\\\\', ltrim($url, '"')); $this->query->where('journal_meta.name', '=', 'external_url'); $this->query->whereNotLike('journal_meta.data', sprintf('%%%s', $url)); @@ -323,7 +323,7 @@ trait MetaCollection public function externalUrlDoesNotStart(string $url): GroupCollectorInterface { $this->joinMetaDataTables(); - $url = (string) json_encode($url); + $url = (string) \Safe\json_encode($url); $url = str_replace('\\', '\\\\', rtrim($url, '"')); // var_dump($url); @@ -336,7 +336,7 @@ trait MetaCollection public function externalUrlEnds(string $url): GroupCollectorInterface { $this->joinMetaDataTables(); - $url = (string) json_encode($url); + $url = (string) \Safe\json_encode($url); $url = str_replace('\\', '\\\\', ltrim($url, '"')); $this->query->where('journal_meta.name', '=', 'external_url'); $this->query->whereLike('journal_meta.data', sprintf('%%%s', $url)); @@ -347,7 +347,7 @@ trait MetaCollection public function externalUrlStarts(string $url): GroupCollectorInterface { $this->joinMetaDataTables(); - $url = (string) json_encode($url); + $url = (string) \Safe\json_encode($url); $url = str_replace('\\', '\\\\', rtrim($url, '"')); // var_dump($url); @@ -398,7 +398,7 @@ trait MetaCollection public function internalReferenceContains(string $internalReference): GroupCollectorInterface { - $internalReference = (string) json_encode($internalReference); + $internalReference = (string) \Safe\json_encode($internalReference); $internalReference = str_replace('\\', '\\\\', trim($internalReference, '"')); // var_dump($internalReference); // exit; @@ -413,7 +413,7 @@ trait MetaCollection public function internalReferenceDoesNotContain(string $internalReference): GroupCollectorInterface { - $internalReference = (string) json_encode($internalReference); + $internalReference = (string) \Safe\json_encode($internalReference); $internalReference = str_replace('\\', '\\\\', trim($internalReference, '"')); $this->joinMetaDataTables(); @@ -426,7 +426,7 @@ trait MetaCollection public function internalReferenceDoesNotEnd(string $internalReference): GroupCollectorInterface { - $internalReference = (string) json_encode($internalReference); + $internalReference = (string) \Safe\json_encode($internalReference); $internalReference = str_replace('\\', '\\\\', trim($internalReference, '"')); $this->joinMetaDataTables(); @@ -439,7 +439,7 @@ trait MetaCollection public function internalReferenceDoesNotStart(string $internalReference): GroupCollectorInterface { - $internalReference = (string) json_encode($internalReference); + $internalReference = (string) \Safe\json_encode($internalReference); $internalReference = str_replace('\\', '\\\\', trim($internalReference, '"')); $this->joinMetaDataTables(); @@ -452,7 +452,7 @@ trait MetaCollection public function internalReferenceEnds(string $internalReference): GroupCollectorInterface { - $internalReference = (string) json_encode($internalReference); + $internalReference = (string) \Safe\json_encode($internalReference); $internalReference = str_replace('\\', '\\\\', trim($internalReference, '"')); $this->joinMetaDataTables(); @@ -465,7 +465,7 @@ trait MetaCollection public function internalReferenceStarts(string $internalReference): GroupCollectorInterface { - $internalReference = (string) json_encode($internalReference); + $internalReference = (string) \Safe\json_encode($internalReference); $internalReference = str_replace('\\', '\\\\', trim($internalReference, '"')); $this->joinMetaDataTables(); @@ -703,7 +703,7 @@ trait MetaCollection { $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'external_id'); - $this->query->where('journal_meta.data', '=', sprintf('%s', json_encode($externalId))); + $this->query->where('journal_meta.data', '=', sprintf('%s', \Safe\json_encode($externalId))); $this->query->whereNull('journal_meta.deleted_at'); return $this; @@ -713,7 +713,7 @@ trait MetaCollection { $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'external_url'); - $this->query->where('journal_meta.data', '=', json_encode($url)); + $this->query->where('journal_meta.data', '=', \Safe\json_encode($url)); $this->query->whereNull('journal_meta.deleted_at'); return $this; @@ -721,12 +721,12 @@ trait MetaCollection public function setInternalReference(string $internalReference): GroupCollectorInterface { - $internalReference = (string) json_encode($internalReference); + $internalReference = (string) \Safe\json_encode($internalReference); $internalReference = str_replace('\\', '\\\\', trim($internalReference, '"')); $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'internal_reference'); - $this->query->where('journal_meta.data', '=', sprintf('%s', json_encode($internalReference))); + $this->query->where('journal_meta.data', '=', sprintf('%s', \Safe\json_encode($internalReference))); $this->query->whereNull('journal_meta.deleted_at'); return $this; @@ -736,7 +736,7 @@ trait MetaCollection { $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'recurrence_id'); - $this->query->where('journal_meta.data', '=', sprintf('%s', json_encode($recurringId))); + $this->query->where('journal_meta.data', '=', sprintf('%s', \Safe\json_encode($recurringId))); $this->query->whereNull('journal_meta.deleted_at'); return $this; @@ -746,7 +746,7 @@ trait MetaCollection { $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'sepa_ct_id'); - $this->query->where('journal_meta.data', '=', sprintf('%s', json_encode($sepaCT))); + $this->query->where('journal_meta.data', '=', sprintf('%s', \Safe\json_encode($sepaCT))); $this->query->whereNull('journal_meta.deleted_at'); return $this; diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index 81eddda840..828da5f3a3 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -593,7 +593,7 @@ class GroupCollector implements GroupCollectorInterface if (array_key_exists('meta_name', $result) && in_array($result['meta_name'], $dates, true)) { $name = $result['meta_name']; if (array_key_exists('meta_data', $result) && '' !== (string) $result['meta_data']) { - $result[$name] = Carbon::createFromFormat('!Y-m-d', substr(json_decode($result['meta_data']), 0, 10)); + $result[$name] = Carbon::createFromFormat('!Y-m-d', substr(\Safe\json_decode($result['meta_data']), 0, 10)); } } diff --git a/app/Helpers/Webhook/Sha3SignatureGenerator.php b/app/Helpers/Webhook/Sha3SignatureGenerator.php index 4e13fac540..25aee00464 100644 --- a/app/Helpers/Webhook/Sha3SignatureGenerator.php +++ b/app/Helpers/Webhook/Sha3SignatureGenerator.php @@ -46,7 +46,7 @@ class Sha3SignatureGenerator implements SignatureGeneratorInterface $json = ''; try { - $json = json_encode($message->message, JSON_THROW_ON_ERROR); + $json = \Safe\json_encode($message->message, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { app('log')->error('Could not generate hash.'); app('log')->error(sprintf('JSON value: %s', $json)); diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index de924f295b..56388c6d46 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -101,7 +101,7 @@ class ForgotPasswordController extends Controller */ private function validateHost(): void { - $configuredHost = parse_url((string) config('app.url'), PHP_URL_HOST); + $configuredHost = \Safe\parse_url((string) config('app.url'), PHP_URL_HOST); if (false === $configuredHost || null === $configuredHost) { throw new FireflyException('Please set a valid and correct Firefly III URL in the APP_URL environment variable.'); } diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index f8e2a847ed..dc4810aaed 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -469,14 +469,14 @@ class AccountController extends Controller Log::debug('Balances exist at:'); foreach ($range as $key => $value) { $newRange[] = ['date' => $key, 'info' => $value]; - Log::debug(sprintf('%d - %s (%s)', count($newRange) - 1, $key, json_encode($value))); + Log::debug(sprintf('%d - %s (%s)', count($newRange) - 1, $key, \Safe\json_encode($value))); } $carbon = Carbon::createFromFormat('Y-m-d', $newRange[0]['date'])->endOfDay(); Log::debug(sprintf('Start of loop, $carbon is %s', $carbon->format('Y-m-d H:i:s'))); while ($end->gte($current)) { $momentBalance = $previous; // $theDate = $current->format('Y-m-d'); - Log::debug(sprintf('Now at %s, with momentBalance %s', $current->format('Y-m-d H:i:s'), json_encode($momentBalance))); + Log::debug(sprintf('Now at %s, with momentBalance %s', $current->format('Y-m-d H:i:s'), \Safe\json_encode($momentBalance))); // loop over the array with balances, find one that is earlier or on the same day. while ($carbon->lte($current) && array_key_exists($expectedIndex, $newRange)) { @@ -491,7 +491,7 @@ class AccountController extends Controller $carbon = Carbon::createFromFormat('Y-m-d', $newRange[$expectedIndex]['date'])->endOfDay(); } } - Log::debug(sprintf('momentBalance is now %s', json_encode($momentBalance))); + Log::debug(sprintf('momentBalance is now %s', \Safe\json_encode($momentBalance))); $return = $this->updateChartKeys($return, $momentBalance); $previous = $momentBalance; diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index e64530ebcf..ca4b5728be 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -81,15 +81,15 @@ abstract class Controller extends BaseController // overrule v2 layout back to v1. if ('true' === request()->get('force_default_layout') && 'v2' === config('view.layout')) { - View::getFinder()->setPaths([realpath(base_path('resources/views'))]); // @phpstan-ignore-line + View::getFinder()->setPaths([\Safe\realpath(base_path('resources/views'))]); // @phpstan-ignore-line } View::share('authGuard', $authGuard); View::share('logoutUrl', $logoutUrl); // upload size - $maxFileSize = Steam::phpBytes((string) ini_get('upload_max_filesize')); - $maxPostSize = Steam::phpBytes((string) ini_get('post_max_size')); + $maxFileSize = Steam::phpBytes((string) \Safe\ini_get('upload_max_filesize')); + $maxPostSize = Steam::phpBytes((string) \Safe\ini_get('post_max_size')); $uploadSize = min($maxFileSize, $maxPostSize); View::share('uploadSize', $uploadSize); diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.php index a4d93201c0..62ba16aa7f 100644 --- a/app/Http/Controllers/DebugController.php +++ b/app/Http/Controllers/DebugController.php @@ -242,7 +242,7 @@ class DebugController extends Controller if ($handler instanceof RotatingFileHandler) { $logFile = $handler->getUrl(); if (null !== $logFile && file_exists($logFile)) { - $logContent = file_get_contents($logFile); + $logContent = \Safe\file_get_contents($logFile); } } } @@ -267,8 +267,8 @@ class DebugController extends Controller private function getSystemInformation(): array { - $maxFileSize = Steam::phpBytes((string) ini_get('upload_max_filesize')); - $maxPostSize = Steam::phpBytes((string) ini_get('post_max_size')); + $maxFileSize = Steam::phpBytes((string) \Safe\ini_get('upload_max_filesize')); + $maxPostSize = Steam::phpBytes((string) \Safe\ini_get('post_max_size')); $drivers = DB::availableDrivers(); $currentDriver = DB::getDriverName(); @@ -280,8 +280,8 @@ class DebugController extends Controller 'interface' => \PHP_SAPI, 'bits' => \PHP_INT_SIZE * 8, 'bcscale' => bcscale(), - 'display_errors' => ini_get('display_errors'), - 'error_reporting' => $this->errorReporting((int) ini_get('error_reporting')), + 'display_errors' => \Safe\ini_get('display_errors'), + 'error_reporting' => $this->errorReporting((int) \Safe\ini_get('error_reporting')), 'upload_size' => min($maxFileSize, $maxPostSize), 'all_drivers' => $drivers, 'current_driver' => $currentDriver, @@ -300,7 +300,7 @@ class DebugController extends Controller try { if (file_exists('/var/www/counter-main.txt')) { - $return['build'] = trim((string) file_get_contents('/var/www/counter-main.txt')); + $return['build'] = trim((string) \Safe\file_get_contents('/var/www/counter-main.txt')); app('log')->debug(sprintf('build is now "%s"', $return['build'])); } } catch (\Exception $e) { @@ -310,7 +310,7 @@ class DebugController extends Controller try { if (file_exists('/var/www/build-date-main.txt')) { - $return['build_date'] = trim((string) file_get_contents('/var/www/build-date-main.txt')); + $return['build_date'] = trim((string) \Safe\file_get_contents('/var/www/build-date-main.txt')); } } catch (\Exception $e) { app('log')->debug('Could not check build date, but thats ok.'); diff --git a/app/Http/Controllers/Export/IndexController.php b/app/Http/Controllers/Export/IndexController.php index 8ab072fb12..8fbadde074 100644 --- a/app/Http/Controllers/Export/IndexController.php +++ b/app/Http/Controllers/Export/IndexController.php @@ -91,7 +91,7 @@ class IndexController extends Controller $generator->setStart($firstDate); $result = $generator->export(); - $name = sprintf('%s_transaction_export.csv', date('Y_m_d')); + $name = sprintf('%s_transaction_export.csv', \Safe\date('Y_m_d')); $quoted = sprintf('"%s"', addcslashes($name, '"\\')); // headers for CSV file. diff --git a/app/Http/Controllers/Json/RecurrenceController.php b/app/Http/Controllers/Json/RecurrenceController.php index 10fdb61b67..d4685e5a30 100644 --- a/app/Http/Controllers/Json/RecurrenceController.php +++ b/app/Http/Controllers/Json/RecurrenceController.php @@ -153,7 +153,7 @@ class RecurrenceController extends Controller */ public function suggest(Request $request): JsonResponse { - $string = '' === (string) $request->get('date') ? date('Y-m-d') : (string) $request->get('date'); + $string = '' === (string) $request->get('date') ? \Safe\date('Y-m-d') : (string) $request->get('date'); $today = today(config('app.timezone'))->startOfDay(); try { diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index bf8b12af22..e5561ccb10 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -110,7 +110,7 @@ class PreferencesController extends Controller if (is_array($fiscalYearStartStr)) { $fiscalYearStartStr = '01-01'; } - $fiscalYearStart = sprintf('%s-%s', date('Y'), (string) $fiscalYearStartStr); + $fiscalYearStart = sprintf('%s-%s', \Safe\date('Y'), (string) $fiscalYearStartStr); $tjOptionalFields = Preferences::get('transaction_journal_optional_fields', [])->data; $availableDarkModes = config('firefly.available_dark_modes'); @@ -149,7 +149,7 @@ class PreferencesController extends Controller // list of locales also has "equal" which makes it equal to whatever the language is. try { - $locales = json_decode((string) file_get_contents(resource_path(sprintf('locales/%s/locales.json', $language))), true, 512, JSON_THROW_ON_ERROR); + $locales = \Safe\json_decode((string) \Safe\file_get_contents(resource_path(sprintf('locales/%s/locales.json', $language))), true, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { app('log')->error($e->getMessage()); $locales = []; @@ -271,9 +271,9 @@ class PreferencesController extends Controller // custom fiscal year $customFiscalYear = 1 === (int) $request->get('customFiscalYear'); - $string = strtotime((string) $request->get('fiscalYearStart')); + $string = \Safe\strtotime((string) $request->get('fiscalYearStart')); if (false !== $string) { - $fiscalYearStart = date('m-d', $string); + $fiscalYearStart = \Safe\date('m-d', $string); Preferences::set('customFiscalYear', $customFiscalYear); Preferences::set('fiscalYearStart', $fiscalYearStart); } diff --git a/app/Http/Controllers/System/InstallController.php b/app/Http/Controllers/System/InstallController.php index df765dc6fb..6a851d43a1 100644 --- a/app/Http/Controllers/System/InstallController.php +++ b/app/Http/Controllers/System/InstallController.php @@ -169,7 +169,7 @@ class InstallController extends Controller return; } - file_put_contents($publicKey, (string) $key->getPublicKey()); - file_put_contents($privateKey, $key->toString('PKCS1')); + \Safe\file_put_contents($publicKey, (string) $key->getPublicKey()); + \Safe\file_put_contents($privateKey, $key->toString('PKCS1')); } } diff --git a/app/Http/Controllers/Transaction/CreateController.php b/app/Http/Controllers/Transaction/CreateController.php index fad87c640a..d306b18c78 100644 --- a/app/Http/Controllers/Transaction/CreateController.php +++ b/app/Http/Controllers/Transaction/CreateController.php @@ -116,7 +116,7 @@ class CreateController extends Controller $accountToTypes = config('firefly.account_to_transaction'); $defaultCurrency = $this->defaultCurrency; $previousUrl = $this->rememberPreviousUrl('transactions.create.url'); - $parts = parse_url($previousUrl); + $parts = \Safe\parse_url($previousUrl); $search = sprintf('?%s', $parts['query'] ?? ''); $previousUrl = str_replace($search, '', $previousUrl); if (!is_array($optionalFields)) { diff --git a/app/Http/Controllers/Transaction/EditController.php b/app/Http/Controllers/Transaction/EditController.php index c638deb7c8..1bf0ef9c9f 100644 --- a/app/Http/Controllers/Transaction/EditController.php +++ b/app/Http/Controllers/Transaction/EditController.php @@ -85,7 +85,7 @@ class EditController extends Controller $defaultCurrency = $this->defaultCurrency; $cash = $repository->getCashAccount(); $previousUrl = $this->rememberPreviousUrl('transactions.edit.url'); - $parts = parse_url($previousUrl); + $parts = \Safe\parse_url($previousUrl); $search = sprintf('?%s', $parts['query'] ?? ''); $previousUrl = str_replace($search, '', $previousUrl); diff --git a/app/Http/Middleware/AcceptHeaders.php b/app/Http/Middleware/AcceptHeaders.php index 54c9d1f643..cb3745b904 100644 --- a/app/Http/Middleware/AcceptHeaders.php +++ b/app/Http/Middleware/AcceptHeaders.php @@ -71,7 +71,7 @@ class AcceptHeaders // throw bad request if trace id is not a UUID $uuid = $request->header('X-Trace-Id'); - if (is_string($uuid) && '' !== trim($uuid) && (1 !== preg_match('/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', trim($uuid)))) { + if (is_string($uuid) && '' !== trim($uuid) && (1 !== \Safe\preg_match('/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', trim($uuid)))) { throw new BadRequestHttpException('Bad X-Trace-Id header.'); } diff --git a/app/Http/Requests/ReportFormRequest.php b/app/Http/Requests/ReportFormRequest.php index da6c5e4417..250d520122 100644 --- a/app/Http/Requests/ReportFormRequest.php +++ b/app/Http/Requests/ReportFormRequest.php @@ -143,7 +143,7 @@ class ReportFormRequest extends FormRequest // validate as date // if regex for YYYY-MM-DD: $pattern = '/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][\d]|3[01])$/'; - $result = preg_match($pattern, $string); + $result = \Safe\preg_match($pattern, $string); if (false !== $result && 0 !== $result) { try { $date = new Carbon($parts[1]); @@ -181,7 +181,7 @@ class ReportFormRequest extends FormRequest // validate as date // if regex for YYYY-MM-DD: $pattern = '/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][\d]|3[01])$/'; - $result = preg_match($pattern, $string); + $result = \Safe\preg_match($pattern, $string); if (false !== $result && 0 !== $result) { try { $date = new Carbon($parts[0]); diff --git a/app/Jobs/DownloadExchangeRates.php b/app/Jobs/DownloadExchangeRates.php index 5ba8d7f998..bc17d08316 100644 --- a/app/Jobs/DownloadExchangeRates.php +++ b/app/Jobs/DownloadExchangeRates.php @@ -113,7 +113,7 @@ class DownloadExchangeRates implements ShouldQueue return; } $body = (string) $res->getBody(); - $json = json_decode($body, true); + $json = \Safe\json_decode($body, true); if (false === $json || null === $json) { app('log')->warning(sprintf('Trying to grab "%s" resulted in bad JSON.', $url)); diff --git a/app/Jobs/MailError.php b/app/Jobs/MailError.php index 72e45fa30e..21984409af 100644 --- a/app/Jobs/MailError.php +++ b/app/Jobs/MailError.php @@ -55,7 +55,7 @@ class MailError extends Job implements ShouldQueue $debug = $exceptionData; unset($debug['stackTrace'], $debug['headers']); - app('log')->error(sprintf('Exception is: %s', json_encode($debug))); + app('log')->error(sprintf('Exception is: %s', \Safe\json_encode($debug))); } /** @@ -126,11 +126,11 @@ class MailError extends Job implements ShouldQueue if (!file_exists($file)) { Log::debug(sprintf('Wrote new file in "%s"', $file)); - file_put_contents($file, json_encode($limits, JSON_PRETTY_PRINT)); + \Safe\file_put_contents($file, \Safe\json_encode($limits, JSON_PRETTY_PRINT)); } if (file_exists($file)) { Log::debug(sprintf('Read file in "%s"', $file)); - $limits = json_decode((string) file_get_contents($file), true); + $limits = \Safe\json_decode((string) \Safe\file_get_contents($file), true); } // limit reached? foreach ($types as $type => $info) { @@ -158,7 +158,7 @@ class MailError extends Job implements ShouldQueue } ++$limits[$type]['sent']; } - file_put_contents($file, json_encode($limits, JSON_PRETTY_PRINT)); + \Safe\file_put_contents($file, \Safe\json_encode($limits, JSON_PRETTY_PRINT)); Log::debug('No limits reached, return FALSE.'); return false; diff --git a/app/Mail/InvitationMail.php b/app/Mail/InvitationMail.php index 36bae2e7bb..8a368d9a25 100644 --- a/app/Mail/InvitationMail.php +++ b/app/Mail/InvitationMail.php @@ -49,7 +49,7 @@ class InvitationMail extends Mailable $this->invitee = $invitee; $this->admin = $admin; $this->url = $url; - $this->host = (string) parse_url($url, PHP_URL_HOST); + $this->host = (string) \Safe\parse_url($url, PHP_URL_HOST); } /** diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php index fa3b58a5b6..baefb2f9b7 100644 --- a/app/Models/AccountMeta.php +++ b/app/Models/AccountMeta.php @@ -47,11 +47,11 @@ class AccountMeta extends Model public function getDataAttribute(mixed $value): string { - return (string) json_decode($value, true); + return (string) \Safe\json_decode($value, true); } public function setDataAttribute(mixed $value): void { - $this->attributes['data'] = json_encode($value); + $this->attributes['data'] = \Safe\json_encode($value); } } diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index a6a137e975..93abb2cfc1 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -50,7 +50,7 @@ class Configuration extends Model */ public function getDataAttribute($value) { - return json_decode($value); + return \Safe\json_decode($value); } /** @@ -58,6 +58,6 @@ class Configuration extends Model */ public function setDataAttribute($value): void { - $this->attributes['data'] = json_encode($value); + $this->attributes['data'] = \Safe\json_encode($value); } } diff --git a/app/Models/TransactionJournalMeta.php b/app/Models/TransactionJournalMeta.php index 09ac979206..00e2aae961 100644 --- a/app/Models/TransactionJournalMeta.php +++ b/app/Models/TransactionJournalMeta.php @@ -52,7 +52,7 @@ class TransactionJournalMeta extends Model */ public function getDataAttribute($value) { - return json_decode($value, false); + return \Safe\json_decode($value, false); } /** @@ -60,7 +60,7 @@ class TransactionJournalMeta extends Model */ public function setDataAttribute($value): void { - $data = json_encode($value); + $data = \Safe\json_encode($value); $this->attributes['data'] = $data; $this->attributes['hash'] = hash('sha256', (string) $data); } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ca3b82710a..32d30664a8 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -46,7 +46,7 @@ class AppServiceProvider extends ServiceProvider 'Cache-Control' => 'no-store', ]; $uuid = (string) request()->header('X-Trace-Id'); - if ('' !== trim($uuid) && (1 === preg_match('/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', trim($uuid)))) { + if ('' !== trim($uuid) && (1 === \Safe\preg_match('/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', trim($uuid)))) { $headers['X-Trace-Id'] = $uuid; } diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index 3f97289ee6..ae6b6f3a1f 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -108,7 +108,7 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac ->where('accounts.active', true) ->where( static function (EloquentBuilder $q1) use ($number): void { - $json = json_encode($number); + $json = \Safe\json_encode($number); $q1->where('account_meta.name', '=', 'account_number'); $q1->where('account_meta.data', '=', $json); } diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index 3100f2d809..f6c00d39a4 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -81,7 +81,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf } // is being used in accounts: - $meta = AccountMeta::where('name', 'currency_id')->where('data', json_encode((string) $currency->id))->count(); + $meta = AccountMeta::where('name', 'currency_id')->where('data', \Safe\json_encode((string) $currency->id))->count(); if ($meta > 0) { app('log')->info(sprintf('Used in %d accounts as currency_id, return true. ', $meta)); @@ -89,7 +89,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf } // second search using integer check. - $meta = AccountMeta::where('name', 'currency_id')->where('data', json_encode((int) $currency->id))->count(); + $meta = AccountMeta::where('name', 'currency_id')->where('data', \Safe\json_encode((int) $currency->id))->count(); if ($meta > 0) { app('log')->info(sprintf('Used in %d accounts as currency_id, return true. ', $meta)); @@ -117,7 +117,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf // is being used in accounts (as integer) $meta = AccountMeta::leftJoin('accounts', 'accounts.id', '=', 'account_meta.account_id') ->whereNull('accounts.deleted_at') - ->where('account_meta.name', 'currency_id')->where('account_meta.data', json_encode($currency->id))->count() + ->where('account_meta.name', 'currency_id')->where('account_meta.data', \Safe\json_encode($currency->id))->count() ; if ($meta > 0) { app('log')->info(sprintf('Used in %d accounts as currency_id, return true. ', $meta)); diff --git a/app/Repositories/Recurring/RecurringRepository.php b/app/Repositories/Recurring/RecurringRepository.php index bbbac73933..689e1ace72 100644 --- a/app/Repositories/Recurring/RecurringRepository.php +++ b/app/Repositories/Recurring/RecurringRepository.php @@ -68,16 +68,16 @@ class RecurringRepository implements RecurringRepositoryInterface, UserGroupInte $set = TransactionJournalMeta::where(static function (Builder $q1) use ($recurrence): void { $q1->where('name', 'recurrence_id'); - $q1->where('data', json_encode((string) $recurrence->id)); + $q1->where('data', \Safe\json_encode((string) $recurrence->id)); })->get(['journal_meta.transaction_journal_id']); // there are X journals made for this recurrence. Any of them meant for today? foreach ($set as $journalMeta) { $count = TransactionJournalMeta::where(static function (Builder $q2) use ($date): void { $string = (string) $date; - app('log')->debug(sprintf('Search for date: %s', json_encode($string))); + app('log')->debug(sprintf('Search for date: %s', \Safe\json_encode($string))); $q2->where('name', 'recurrence_date'); - $q2->where('data', json_encode($string)); + $q2->where('data', \Safe\json_encode($string)); }) ->where('transaction_journal_id', $journalMeta->transaction_journal_id) ->count() @@ -232,7 +232,7 @@ class RecurringRepository implements RecurringRepositoryInterface, UserGroupInte return TransactionJournalMeta::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'journal_meta.transaction_journal_id') ->where('transaction_journals.user_id', $this->user->id) ->where('journal_meta.name', '=', 'recurrence_id') - ->where('journal_meta.data', '=', json_encode((string) $recurrence->id)) + ->where('journal_meta.data', '=', \Safe\json_encode((string) $recurrence->id)) ->get(['journal_meta.transaction_journal_id'])->pluck('transaction_journal_id')->toArray() ; } @@ -272,7 +272,7 @@ class RecurringRepository implements RecurringRepositoryInterface, UserGroupInte /** @var RecurrenceMeta $meta */ foreach ($transaction->recurrenceTransactionMeta as $meta) { if ('tags' === $meta->name && '' !== $meta->value) { - $tags = json_decode($meta->value, true, 512, JSON_THROW_ON_ERROR); + $tags = \Safe\json_decode($meta->value, true, 512, JSON_THROW_ON_ERROR); } } @@ -285,7 +285,7 @@ class RecurringRepository implements RecurringRepositoryInterface, UserGroupInte ->whereNull('transaction_journals.deleted_at') ->where('transaction_journals.user_id', $this->user->id) ->where('name', 'recurrence_id') - ->where('data', json_encode((string) $recurrence->id)) + ->where('data', \Safe\json_encode((string) $recurrence->id)) ->get()->pluck('transaction_journal_id')->toArray() ; $search = []; @@ -311,7 +311,7 @@ class RecurringRepository implements RecurringRepositoryInterface, UserGroupInte ->whereNull('transaction_journals.deleted_at') ->where('transaction_journals.user_id', $this->user->id) ->where('name', 'recurrence_id') - ->where('data', json_encode((string) $recurrence->id)) + ->where('data', \Safe\json_encode((string) $recurrence->id)) ->get()->pluck('transaction_journal_id')->toArray() ; $search = []; diff --git a/app/Repositories/TransactionGroup/TransactionGroupRepository.php b/app/Repositories/TransactionGroup/TransactionGroupRepository.php index 97a5b7f48c..50eddb7fd6 100644 --- a/app/Repositories/TransactionGroup/TransactionGroupRepository.php +++ b/app/Repositories/TransactionGroup/TransactionGroupRepository.php @@ -304,7 +304,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface, $return = []; foreach ($query as $row) { - $return[$row->name] = new Carbon(json_decode($row->data, true, 512, JSON_THROW_ON_ERROR)); + $return[$row->name] = new Carbon(\Safe\json_decode($row->data, true, 512, JSON_THROW_ON_ERROR)); } return new NullArrayObject($return); @@ -324,7 +324,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface, $return = []; foreach ($query as $row) { - $return[$row->name] = json_decode($row->data); + $return[$row->name] = \Safe\json_decode($row->data); } return new NullArrayObject($return); diff --git a/app/Repositories/User/UserRepository.php b/app/Repositories/User/UserRepository.php index 9abc8554a3..5de94de9bd 100644 --- a/app/Repositories/User/UserRepository.php +++ b/app/Repositories/User/UserRepository.php @@ -54,7 +54,7 @@ class UserRepository implements UserRepositoryInterface // save old email as pref app('preferences')->setForUser($user, 'previous_email_latest', $oldEmail); - app('preferences')->setForUser($user, 'previous_email_'.date('Y-m-d-H-i-s'), $oldEmail); + app('preferences')->setForUser($user, 'previous_email_'.\Safe\date('Y-m-d-H-i-s'), $oldEmail); // set undo and confirm token: app('preferences')->setForUser($user, 'email_change_undo_token', bin2hex(random_bytes(16))); @@ -389,7 +389,7 @@ class UserRepository implements UserRepositoryInterface // save old email as pref app('preferences')->setForUser($user, 'admin_previous_email_latest', $oldEmail); - app('preferences')->setForUser($user, 'admin_previous_email_'.date('Y-m-d-H-i-s'), $oldEmail); + app('preferences')->setForUser($user, 'admin_previous_email_'.\Safe\date('Y-m-d-H-i-s'), $oldEmail); $user->email = $newEmail; $user->save(); diff --git a/app/Repositories/UserGroups/Account/AccountRepository.php b/app/Repositories/UserGroups/Account/AccountRepository.php index 97877aeb3e..37b0c24859 100644 --- a/app/Repositories/UserGroups/Account/AccountRepository.php +++ b/app/Repositories/UserGroups/Account/AccountRepository.php @@ -66,7 +66,7 @@ class AccountRepository implements AccountRepositoryInterface ->where('accounts.active', true) ->where( static function (EloquentBuilder $q1) use ($number): void { - $json = json_encode($number); + $json = \Safe\json_encode($number); $q1->where('account_meta.name', '=', 'account_number'); $q1->where('account_meta.data', '=', $json); } diff --git a/app/Repositories/UserGroups/Currency/CurrencyRepository.php b/app/Repositories/UserGroups/Currency/CurrencyRepository.php index 73bce5a06b..d935fe6502 100644 --- a/app/Repositories/UserGroups/Currency/CurrencyRepository.php +++ b/app/Repositories/UserGroups/Currency/CurrencyRepository.php @@ -81,7 +81,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface } // is being used in accounts: - $meta = AccountMeta::where('name', 'currency_id')->where('data', json_encode((string) $currency->id))->count(); + $meta = AccountMeta::where('name', 'currency_id')->where('data', \Safe\json_encode((string) $currency->id))->count(); if ($meta > 0) { app('log')->info(sprintf('Used in %d accounts as currency_id, return true. ', $meta)); @@ -89,7 +89,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface } // second search using integer check. - $meta = AccountMeta::where('name', 'currency_id')->where('data', json_encode((int) $currency->id))->count(); + $meta = AccountMeta::where('name', 'currency_id')->where('data', \Safe\json_encode((int) $currency->id))->count(); if ($meta > 0) { app('log')->info(sprintf('Used in %d accounts as currency_id, return true. ', $meta)); @@ -117,7 +117,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface // is being used in accounts (as integer) $meta = AccountMeta::leftJoin('accounts', 'accounts.id', '=', 'account_meta.account_id') ->whereNull('accounts.deleted_at') - ->where('account_meta.name', 'currency_id')->where('account_meta.data', json_encode($currency->id))->count() + ->where('account_meta.name', 'currency_id')->where('account_meta.data', \Safe\json_encode($currency->id))->count() ; if ($meta > 0) { app('log')->info(sprintf('Used in %d accounts as currency_id, return true. ', $meta)); diff --git a/app/Rules/IsValidBulkClause.php b/app/Rules/IsValidBulkClause.php index 30d108edd1..7487a8ba41 100644 --- a/app/Rules/IsValidBulkClause.php +++ b/app/Rules/IsValidBulkClause.php @@ -63,7 +63,7 @@ class IsValidBulkClause implements ValidationRule private function basicValidation(string $value): bool { try { - $array = json_decode($value, true, 8, JSON_THROW_ON_ERROR); + $array = \Safe\json_decode($value, true, 8, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { $this->error = (string) trans('validation.json'); diff --git a/app/Rules/IsValidPositiveAmount.php b/app/Rules/IsValidPositiveAmount.php index 89d7ada4a6..5f3cc94f66 100644 --- a/app/Rules/IsValidPositiveAmount.php +++ b/app/Rules/IsValidPositiveAmount.php @@ -40,7 +40,7 @@ class IsValidPositiveAmount implements ValidationRule { if (is_array($value)) { $fail('validation.numeric')->translate(); - $message = sprintf('IsValidPositiveAmount: "%s" is not a number.', json_encode($value)); + $message = sprintf('IsValidPositiveAmount: "%s" is not a number.', \Safe\json_encode($value)); Log::debug($message); Log::channel('audit')->info($message); diff --git a/app/Rules/UniqueAccountNumber.php b/app/Rules/UniqueAccountNumber.php index 7e2bc5d24c..921f78ae33 100644 --- a/app/Rules/UniqueAccountNumber.php +++ b/app/Rules/UniqueAccountNumber.php @@ -138,7 +138,7 @@ class UniqueAccountNumber implements ValidationRule ->where('accounts.user_id', auth()->user()->id) ->where('account_types.type', $type) ->where('account_meta.name', '=', 'account_number') - ->where('account_meta.data', json_encode($accountNumber)) + ->where('account_meta.data', \Safe\json_encode($accountNumber)) ; if (null !== $this->account) { diff --git a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php index b6321dd852..a72e1f35cb 100644 --- a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php +++ b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php @@ -99,7 +99,7 @@ class UpdateRequest implements UpdateRequestInterface $body = (string) $res->getBody(); try { - $json = json_decode($body, true, 512, JSON_THROW_ON_ERROR); + $json = \Safe\json_decode($body, true, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { Log::error('Body is not valid JSON'); Log::error($body); diff --git a/app/Services/Internal/Support/JournalServiceTrait.php b/app/Services/Internal/Support/JournalServiceTrait.php index 9a87b5aa75..f4e27a24de 100644 --- a/app/Services/Internal/Support/JournalServiceTrait.php +++ b/app/Services/Internal/Support/JournalServiceTrait.php @@ -260,7 +260,7 @@ trait JournalServiceTrait if (null === $account) { // final attempt, create it. if (AccountTypeEnum::ASSET->value === $preferredType) { - throw new FireflyException(sprintf('TransactionFactory: Cannot create asset account with these values: %s', json_encode($data))); + throw new FireflyException(sprintf('TransactionFactory: Cannot create asset account with these values: %s', \Safe\json_encode($data))); } // fix name of account if only IBAN is given: if ('' === (string) $data['name'] && '' !== (string) $data['iban']) { diff --git a/app/Services/Internal/Support/RecurringTransactionTrait.php b/app/Services/Internal/Support/RecurringTransactionTrait.php index 9df6075d19..95b5520599 100644 --- a/app/Services/Internal/Support/RecurringTransactionTrait.php +++ b/app/Services/Internal/Support/RecurringTransactionTrait.php @@ -307,9 +307,9 @@ trait RecurringTransactionTrait /** @var null|RecurrenceMeta $entry */ $entry = $transaction->recurrenceTransactionMeta()->where('name', 'tags')->first(); if (null === $entry) { - $entry = RecurrenceTransactionMeta::create(['rt_id' => $transaction->id, 'name' => 'tags', 'value' => json_encode($tags)]); + $entry = RecurrenceTransactionMeta::create(['rt_id' => $transaction->id, 'name' => 'tags', 'value' => \Safe\json_encode($tags)]); } - $entry->value = json_encode($tags); + $entry->value = \Safe\json_encode($tags); $entry->save(); } if (0 === count($tags)) { diff --git a/app/Services/Webhook/StandardWebhookSender.php b/app/Services/Webhook/StandardWebhookSender.php index 911fde75d9..264e754bc8 100644 --- a/app/Services/Webhook/StandardWebhookSender.php +++ b/app/Services/Webhook/StandardWebhookSender.php @@ -80,7 +80,7 @@ class StandardWebhookSender implements WebhookSenderInterface app('log')->debug(sprintf('Trying to send webhook message #%d', $this->message->id)); try { - $json = json_encode($this->message->message, JSON_THROW_ON_ERROR); + $json = \Safe\json_encode($this->message->message, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { app('log')->error('Did not send message because of a JSON error.'); app('log')->error($e->getMessage()); diff --git a/app/Support/Authentication/RemoteUserGuard.php b/app/Support/Authentication/RemoteUserGuard.php index 93c418ce69..c73cd0da42 100644 --- a/app/Support/Authentication/RemoteUserGuard.php +++ b/app/Support/Authentication/RemoteUserGuard.php @@ -69,7 +69,7 @@ class RemoteUserGuard implements Guard if (function_exists('apache_request_headers')) { Log::debug('Use apache_request_headers to find user ID.'); - $userID = request()->server($header) ?? apache_request_headers()[$header] ?? null; + $userID = request()->server($header) ?? \Safe\apache_request_headers()[$header] ?? null; } if (null === $userID || '' === $userID) { @@ -87,7 +87,7 @@ class RemoteUserGuard implements Guard $header = config('auth.guard_email'); if (null !== $header) { - $emailAddress = (string) (request()->server($header) ?? apache_request_headers()[$header] ?? null); + $emailAddress = (string) (request()->server($header) ?? \Safe\apache_request_headers()[$header] ?? null); $preference = app('preferences')->getForUser($retrievedUser, 'remote_guard_alt_email'); if ('' !== $emailAddress && null === $preference && $emailAddress !== $userID) { diff --git a/app/Support/CacheProperties.php b/app/Support/CacheProperties.php index 8a8ba020b7..ed52fa17d9 100644 --- a/app/Support/CacheProperties.php +++ b/app/Support/CacheProperties.php @@ -78,7 +78,7 @@ class CacheProperties $content = ''; foreach ($this->properties as $property) { try { - $content .= json_encode($property, JSON_THROW_ON_ERROR); + $content .= \Safe\json_encode($property, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { // @ignoreException $content .= hash('sha256', (string) time()); diff --git a/app/Support/Cronjobs/UpdateCheckCronjob.php b/app/Support/Cronjobs/UpdateCheckCronjob.php index 0cfb0a0967..980973e099 100644 --- a/app/Support/Cronjobs/UpdateCheckCronjob.php +++ b/app/Support/Cronjobs/UpdateCheckCronjob.php @@ -63,7 +63,7 @@ class UpdateCheckCronjob extends AbstractCronjob $this->jobFired = false; $this->jobErrored = false; $this->jobSucceeded = true; - $this->message = sprintf('Checked for updates less than a week ago (on %s).', date('Y-m-d H:i:s', $lastCheckTime->data)); + $this->message = sprintf('Checked for updates less than a week ago (on %s).', \Safe\date('Y-m-d H:i:s', $lastCheckTime->data)); return; } diff --git a/app/Support/Http/Controllers/CreateStuff.php b/app/Support/Http/Controllers/CreateStuff.php index 59fe677edd..6fb55a9d22 100644 --- a/app/Support/Http/Controllers/CreateStuff.php +++ b/app/Support/Http/Controllers/CreateStuff.php @@ -106,8 +106,8 @@ trait CreateStuff Log::alert('NO OAuth keys were found. They have been created.'); - file_put_contents($publicKey, (string) $key->getPublicKey()); - file_put_contents($privateKey, $key->toString('PKCS1')); + \Safe\file_put_contents($publicKey, (string) $key->getPublicKey()); + \Safe\file_put_contents($privateKey, $key->toString('PKCS1')); } /** diff --git a/app/Support/Http/Controllers/RequestInformation.php b/app/Support/Http/Controllers/RequestInformation.php index 7307496f2e..7f18f6fe3c 100644 --- a/app/Support/Http/Controllers/RequestInformation.php +++ b/app/Support/Http/Controllers/RequestInformation.php @@ -46,7 +46,7 @@ trait RequestInformation final protected function getDomain(): string // get request info { $url = url()->to('/'); - $parts = parse_url($url); + $parts = \Safe\parse_url($url); return $parts['host'] ?? ''; } diff --git a/app/Support/ParseDateString.php b/app/Support/ParseDateString.php index 6ddde18a15..4d61dc35d5 100644 --- a/app/Support/ParseDateString.php +++ b/app/Support/ParseDateString.php @@ -85,7 +85,7 @@ class ParseDateString // if regex for YYYY-MM-DD: $pattern = '/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12]\d|3[01])$/'; - $result = preg_match($pattern, $date); + $result = \Safe\preg_match($pattern, $date); if (false !== $result && 0 !== $result) { return $this->parseDefaultDate($date); } @@ -182,7 +182,7 @@ class ParseDateString // verify if correct $pattern = '/[+-]\d+[wqmdy]/'; - $result = preg_match($pattern, $part); + $result = \Safe\preg_match($pattern, $part); if (0 === $result || false === $result) { app('log')->error(sprintf('Part "%s" does not match regular expression. Will be skipped.', $part)); @@ -256,7 +256,7 @@ class ParseDateString protected function isDayRange(string $date): bool { $pattern = '/^xxxx-xx-(0[1-9]|[12]\d|3[01])$/'; - $result = preg_match($pattern, $date); + $result = \Safe\preg_match($pattern, $date); if (false !== $result && 0 !== $result) { app('log')->debug(sprintf('"%s" is a day range.', $date)); @@ -283,7 +283,7 @@ class ParseDateString { // if regex for xxxx-MM-xx: $pattern = '/^xxxx-(0[1-9]|1[012])-xx$/'; - $result = preg_match($pattern, $date); + $result = \Safe\preg_match($pattern, $date); if (false !== $result && 0 !== $result) { app('log')->debug(sprintf('"%s" is a month range.', $date)); @@ -311,7 +311,7 @@ class ParseDateString { // if regex for YYYY-xx-xx: $pattern = '/^(19|20)\d\d-xx-xx$/'; - $result = preg_match($pattern, $date); + $result = \Safe\preg_match($pattern, $date); if (false !== $result && 0 !== $result) { app('log')->debug(sprintf('"%s" is a year range.', $date)); @@ -339,7 +339,7 @@ class ParseDateString { // if regex for xxxx-MM-DD: $pattern = '/^xxxx-(0[1-9]|1[012])-(0[1-9]|[12]\d|3[01])$/'; - $result = preg_match($pattern, $date); + $result = \Safe\preg_match($pattern, $date); if (false !== $result && 0 !== $result) { app('log')->debug(sprintf('"%s" is a month/day range.', $date)); @@ -368,7 +368,7 @@ class ParseDateString { // if regex for YYYY-xx-DD: $pattern = '/^(19|20)\d\d-xx-(0[1-9]|[12]\d|3[01])$/'; - $result = preg_match($pattern, $date); + $result = \Safe\preg_match($pattern, $date); if (false !== $result && 0 !== $result) { app('log')->debug(sprintf('"%s" is a day/year range.', $date)); @@ -397,7 +397,7 @@ class ParseDateString { // if regex for YYYY-MM-xx: $pattern = '/^(19|20)\d\d-(0[1-9]|1[012])-xx$/'; - $result = preg_match($pattern, $date); + $result = \Safe\preg_match($pattern, $date); if (false !== $result && 0 !== $result) { app('log')->debug(sprintf('"%s" is a month/year range.', $date)); diff --git a/app/Support/Request/ConvertsDataTypes.php b/app/Support/Request/ConvertsDataTypes.php index fd776c1e60..d8792fdc79 100644 --- a/app/Support/Request/ConvertsDataTypes.php +++ b/app/Support/Request/ConvertsDataTypes.php @@ -125,7 +125,7 @@ trait ConvertsDataTypes $string = str_replace($this->characters, "\x20", $string); // clear zalgo text (TODO also in API v2) - $string = preg_replace('/(\pM{2})\pM+/u', '\1', $string); + $string = \Safe\preg_replace('/(\pM{2})\pM+/u', '\1', $string); return trim((string) $string); } diff --git a/app/Support/Search/AccountSearch.php b/app/Support/Search/AccountSearch.php index ec5ef15e58..a40c407e3f 100644 --- a/app/Support/Search/AccountSearch.php +++ b/app/Support/Search/AccountSearch.php @@ -81,7 +81,7 @@ class AccountSearch implements GenericSearchInterface // meta data: $searchQuery->orWhere( static function (Builder $q) use ($originalQuery): void { - $json = json_encode($originalQuery, JSON_THROW_ON_ERROR); + $json = \Safe\json_encode($originalQuery, JSON_THROW_ON_ERROR); $q->where('account_meta.name', '=', 'account_number'); $q->whereLike('account_meta.data', $json); } @@ -108,7 +108,7 @@ class AccountSearch implements GenericSearchInterface // meta data: $searchQuery->Where( static function (Builder $q) use ($originalQuery): void { - $json = json_encode($originalQuery, JSON_THROW_ON_ERROR); + $json = \Safe\json_encode($originalQuery, JSON_THROW_ON_ERROR); $q->where('account_meta.name', 'account_number'); $q->where('account_meta.data', $json); } diff --git a/app/Support/Search/QueryParser/GdbotsQueryParser.php b/app/Support/Search/QueryParser/GdbotsQueryParser.php index 3685e8c281..56dde78b20 100644 --- a/app/Support/Search/QueryParser/GdbotsQueryParser.php +++ b/app/Support/Search/QueryParser/GdbotsQueryParser.php @@ -54,7 +54,7 @@ class GdbotsQueryParser implements QueryParserInterface return new NodeGroup($nodes); } catch (\LogicException|\TypeError $e) { - fwrite(STDERR, "Setting up GdbotsQueryParserTest\n"); + \Safe\fwrite(STDERR, "Setting up GdbotsQueryParserTest\n"); app('log')->error($e->getMessage()); app('log')->error(sprintf('Could not parse search: "%s".', $query)); diff --git a/app/Support/Steam.php b/app/Support/Steam.php index 5d53d36515..7e14c580c9 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -270,8 +270,8 @@ class Steam ]; // clear zalgo text - $string = preg_replace('/(\pM{2})\pM+/u', '\1', $string); - $string = preg_replace('/\s+/', '', $string); + $string = \Safe\preg_replace('/(\pM{2})\pM+/u', '\1', $string); + $string = \Safe\preg_replace('/\s+/', '', $string); return str_replace($search, '', $string); } @@ -549,8 +549,8 @@ class Steam { // Log::debug(sprintf('getSafeUrl(%s, %s)', $unknownUrl, $safeUrl)); $returnUrl = $safeUrl; - $unknownHost = parse_url($unknownUrl, PHP_URL_HOST); - $safeHost = parse_url($safeUrl, PHP_URL_HOST); + $unknownHost = \Safe\parse_url($unknownUrl, PHP_URL_HOST); + $safeHost = \Safe\parse_url($safeUrl, PHP_URL_HOST); if (null !== $unknownHost && $unknownHost === $safeHost) { $returnUrl = $unknownUrl; diff --git a/app/Support/System/OAuthKeys.php b/app/Support/System/OAuthKeys.php index cda0721846..e0c0fa0b7a 100644 --- a/app/Support/System/OAuthKeys.php +++ b/app/Support/System/OAuthKeys.php @@ -96,8 +96,8 @@ class OAuthKeys { $private = storage_path('oauth-private.key'); $public = storage_path('oauth-public.key'); - app('fireflyconfig')->set(self::PRIVATE_KEY, Crypt::encrypt(file_get_contents($private))); - app('fireflyconfig')->set(self::PUBLIC_KEY, Crypt::encrypt(file_get_contents($public))); + app('fireflyconfig')->set(self::PRIVATE_KEY, Crypt::encrypt(\Safe\file_get_contents($private))); + app('fireflyconfig')->set(self::PUBLIC_KEY, Crypt::encrypt(\Safe\file_get_contents($public))); } /** @@ -123,8 +123,8 @@ class OAuthKeys } $private = storage_path('oauth-private.key'); $public = storage_path('oauth-public.key'); - file_put_contents($private, $privateContent); - file_put_contents($public, $publicContent); + \Safe\file_put_contents($private, $privateContent); + \Safe\file_put_contents($public, $publicContent); return true; } diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index 80383ec78f..e0e4a8fdf3 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -240,8 +240,8 @@ class General extends AbstractExtension return new TwigFilter( 'phphost', static function (string $string): string { - $proto = (string) parse_url($string, PHP_URL_SCHEME); - $host = (string) parse_url($string, PHP_URL_HOST); + $proto = (string) \Safe\parse_url($string, PHP_URL_SCHEME); + $host = (string) \Safe\parse_url($string, PHP_URL_HOST); return e(sprintf('%s://%s', $proto, $host)); } @@ -272,7 +272,7 @@ class General extends AbstractExtension return new TwigFunction( 'phpdate', static function (string $str): string { - return date($str); + return \Safe\date($str); } ); } diff --git a/app/Support/Twig/TransactionGroupTwig.php b/app/Support/Twig/TransactionGroupTwig.php index 73d1542a26..b3df2e485a 100644 --- a/app/Support/Twig/TransactionGroupTwig.php +++ b/app/Support/Twig/TransactionGroupTwig.php @@ -254,7 +254,7 @@ class TransactionGroupTwig extends AbstractExtension return today(config('app.timezone')); } - return new Carbon(json_decode($entry->data, false)); + return new Carbon(\Safe\json_decode($entry->data, false)); } ); } @@ -275,7 +275,7 @@ class TransactionGroupTwig extends AbstractExtension return ''; } - return json_decode($entry->data, true); + return \Safe\json_decode($entry->data, true); } ); } diff --git a/app/Transformers/RecurrenceTransformer.php b/app/Transformers/RecurrenceTransformer.php index 8eecfbcf3e..2bf862a7aa 100644 --- a/app/Transformers/RecurrenceTransformer.php +++ b/app/Transformers/RecurrenceTransformer.php @@ -264,7 +264,7 @@ class RecurrenceTransformer extends AbstractTransformer break; case 'tags': - $array['tags'] = json_decode($transactionMeta->value); + $array['tags'] = \Safe\json_decode($transactionMeta->value); break; diff --git a/app/Transformers/WebhookMessageTransformer.php b/app/Transformers/WebhookMessageTransformer.php index f0fd5c056d..5271582bbb 100644 --- a/app/Transformers/WebhookMessageTransformer.php +++ b/app/Transformers/WebhookMessageTransformer.php @@ -39,7 +39,7 @@ class WebhookMessageTransformer extends AbstractTransformer $json = '{}'; try { - $json = json_encode($message->message, JSON_THROW_ON_ERROR); + $json = \Safe\json_encode($message->message, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { app('log')->error(sprintf('Could not encode webhook message #%d: %s', $message->id, $e->getMessage())); } diff --git a/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php b/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php index 876d4269be..c5651941d4 100644 --- a/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php +++ b/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php @@ -34,7 +34,7 @@ trait ValidatesBulkTransactionQuery $data = $validator->getData(); // assumption is all validation has already taken place and the query key exists. $query = $data['query'] ?? '[]'; - $json = json_decode($query, true, 8, JSON_THROW_ON_ERROR); + $json = \Safe\json_decode($query, true, 8, JSON_THROW_ON_ERROR); if ( array_key_exists('where', $json) diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index 213bfab7a6..7faa885731 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -110,7 +110,7 @@ class FireflyValidator extends Validator return false; } $regex = '/^[a-z]{6}[0-9a-z]{2}([0-9a-z]{3})?\z/i'; - $result = preg_match($regex, $value); + $result = \Safe\preg_match($regex, $value); if (false === $result || 0 === $result) { return false; } @@ -200,7 +200,7 @@ class FireflyValidator extends Validator $value = strtoupper($value); // replace characters outside of ASCI range. - $value = (string) iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $value); + $value = (string) \Safe\iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $value); $search = [' ', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; $replace = ['', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35']; @@ -634,7 +634,7 @@ class FireflyValidator extends Validator ->whereNull('accounts.deleted_at') ->where('accounts.user_id', auth()->user()->id) ->where('account_meta.name', 'account_number') - ->where('account_meta.data', json_encode($value)) + ->where('account_meta.data', \Safe\json_encode($value)) ; if ($accountId > 0) { diff --git a/composer.json b/composer.json index b2b00813bc..eca5b62ed0 100644 --- a/composer.json +++ b/composer.json @@ -81,7 +81,7 @@ "ext-tokenizer": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "bacon/bacon-qr-code": "^2", + "bacon/bacon-qr-code": "^3.0", "diglactic/laravel-breadcrumbs": "^10", "gdbots/query-parser": "^3.0", "guzzlehttp/guzzle": "^7.9", @@ -123,7 +123,9 @@ "phpstan/phpstan": "^2", "phpstan/phpstan-deprecation-rules": "^2", "phpstan/phpstan-strict-rules": "^2", - "phpunit/phpunit": "^11" + "phpunit/phpunit": "^11", + "rector/rector": "^2.0", + "thecodingmachine/phpstan-safe-rule": "^1.4" }, "suggest": {}, "autoload": { diff --git a/composer.lock b/composer.lock index ddea61e47f..186d66d610 100644 --- a/composer.lock +++ b/composer.lock @@ -4,32 +4,32 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3c350a535ca785e45a43f67c3a41154b", + "content-hash": "ce140fe154a7c5c4f9326b67873620d3", "packages": [ { "name": "bacon/bacon-qr-code", - "version": "2.0.8", + "version": "v3.0.1", "source": { "type": "git", "url": "https://github.com/Bacon/BaconQrCode.git", - "reference": "8674e51bb65af933a5ffaf1c308a660387c35c22" + "reference": "f9cc1f52b5a463062251d666761178dbdb6b544f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/8674e51bb65af933a5ffaf1c308a660387c35c22", - "reference": "8674e51bb65af933a5ffaf1c308a660387c35c22", + "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/f9cc1f52b5a463062251d666761178dbdb6b544f", + "reference": "f9cc1f52b5a463062251d666761178dbdb6b544f", "shasum": "" }, "require": { "dasprid/enum": "^1.0.3", "ext-iconv": "*", - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "phly/keep-a-changelog": "^2.1", - "phpunit/phpunit": "^7 | ^8 | ^9", - "spatie/phpunit-snapshot-assertions": "^4.2.9", - "squizlabs/php_codesniffer": "^3.4" + "phly/keep-a-changelog": "^2.12", + "phpunit/phpunit": "^10.5.11 || 11.0.4", + "spatie/phpunit-snapshot-assertions": "^5.1.5", + "squizlabs/php_codesniffer": "^3.9" }, "suggest": { "ext-imagick": "to generate QR code images" @@ -56,9 +56,9 @@ "homepage": "https://github.com/Bacon/BaconQrCode", "support": { "issues": "https://github.com/Bacon/BaconQrCode/issues", - "source": "https://github.com/Bacon/BaconQrCode/tree/2.0.8" + "source": "https://github.com/Bacon/BaconQrCode/tree/v3.0.1" }, - "time": "2022-12-07T17:46:57+00:00" + "time": "2024-10-01T13:55:55+00:00" }, { "name": "beberlei/assert", @@ -1656,22 +1656,22 @@ }, { "name": "jc5/google2fa-laravel", - "version": "v2.0.8", + "version": "2.0.9", "source": { "type": "git", "url": "https://github.com/JC5/google2fa-laravel.git", - "reference": "0205b0e58b90ee41e6d108d4c26ad9d0f7997baa" + "reference": "af390d117e92963c75fa36868b754e6321b3710f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JC5/google2fa-laravel/zipball/0205b0e58b90ee41e6d108d4c26ad9d0f7997baa", - "reference": "0205b0e58b90ee41e6d108d4c26ad9d0f7997baa", + "url": "https://api.github.com/repos/JC5/google2fa-laravel/zipball/af390d117e92963c75fa36868b754e6321b3710f", + "reference": "af390d117e92963c75fa36868b754e6321b3710f", "shasum": "" }, "require": { "laravel/framework": ">=5.4.36", "php": ">=8", - "pragmarx/google2fa-qrcode": "^1.0" + "pragmarx/google2fa-qrcode": ">1.0" }, "require-dev": { "orchestra/testbench": "3.4.*|3.5.*|3.6.*|3.7.*|4.*|5.*|6.*", @@ -1718,7 +1718,7 @@ }, { "name": "James Cole", - "email": "thegrumpydictator@gmail.com", + "email": "james@firefly-iii.org", "role": "Developer" } ], @@ -1731,9 +1731,9 @@ ], "support": { "issues": "https://github.com/JC5/google2fa-laravel/issues", - "source": "https://github.com/JC5/google2fa-laravel/tree/v2.0.8" + "source": "https://github.com/JC5/google2fa-laravel/tree/2.0.9" }, - "time": "2022-03-30T16:00:00+00:00" + "time": "2023-09-16T02:59:44+00:00" }, { "name": "jc5/recovery", @@ -2228,16 +2228,16 @@ }, { "name": "laravel/sanctum", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/laravel/sanctum.git", - "reference": "4e4ced5023e9d8949214e0fb43d9f4bde79c7166" + "reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/sanctum/zipball/4e4ced5023e9d8949214e0fb43d9f4bde79c7166", - "reference": "4e4ced5023e9d8949214e0fb43d9f4bde79c7166", + "url": "https://api.github.com/repos/laravel/sanctum/zipball/a360a6a1fd2400ead4eb9b6a9c1bb272939194f5", + "reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5", "shasum": "" }, "require": { @@ -2288,7 +2288,7 @@ "issues": "https://github.com/laravel/sanctum/issues", "source": "https://github.com/laravel/sanctum" }, - "time": "2025-04-22T13:53:47+00:00" + "time": "2025-04-23T13:03:38+00:00" }, { "name": "laravel/serializable-closure", @@ -3711,16 +3711,16 @@ }, { "name": "nesbot/carbon", - "version": "3.9.0", + "version": "3.9.1", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon.git", - "reference": "6d16a8a015166fe54e22c042e0805c5363aef50d" + "reference": "ced71f79398ece168e24f7f7710462f462310d4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/6d16a8a015166fe54e22c042e0805c5363aef50d", - "reference": "6d16a8a015166fe54e22c042e0805c5363aef50d", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/ced71f79398ece168e24f7f7710462f462310d4d", + "reference": "ced71f79398ece168e24f7f7710462f462310d4d", "shasum": "" }, "require": { @@ -3813,7 +3813,7 @@ "type": "tidelift" } ], - "time": "2025-03-27T12:57:33+00:00" + "time": "2025-05-01T19:51:51+00:00" }, { "name": "nette/schema", @@ -4968,26 +4968,31 @@ }, { "name": "pragmarx/google2fa-qrcode", - "version": "v1.0.3", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/antonioribeiro/google2fa-qrcode.git", - "reference": "fd5ff0531a48b193a659309cc5fb882c14dbd03f" + "reference": "ce4d8a729b6c93741c607cfb2217acfffb5bf76b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antonioribeiro/google2fa-qrcode/zipball/fd5ff0531a48b193a659309cc5fb882c14dbd03f", - "reference": "fd5ff0531a48b193a659309cc5fb882c14dbd03f", + "url": "https://api.github.com/repos/antonioribeiro/google2fa-qrcode/zipball/ce4d8a729b6c93741c607cfb2217acfffb5bf76b", + "reference": "ce4d8a729b6c93741c607cfb2217acfffb5bf76b", "shasum": "" }, "require": { - "bacon/bacon-qr-code": "~1.0|~2.0", - "php": ">=5.4", + "php": ">=7.1", "pragmarx/google2fa": ">=4.0" }, "require-dev": { + "bacon/bacon-qr-code": "^2.0", + "chillerlan/php-qrcode": "^1.0|^2.0|^3.0|^4.0", "khanamiryan/qrcode-detector-decoder": "^1.0", - "phpunit/phpunit": "~4|~5|~6|~7" + "phpunit/phpunit": "~4|~5|~6|~7|~8|~9" + }, + "suggest": { + "bacon/bacon-qr-code": "For QR Code generation, requires imagick", + "chillerlan/php-qrcode": "For QR Code generation" }, "type": "library", "extra": { @@ -5024,9 +5029,9 @@ ], "support": { "issues": "https://github.com/antonioribeiro/google2fa-qrcode/issues", - "source": "https://github.com/antonioribeiro/google2fa-qrcode/tree/master" + "source": "https://github.com/antonioribeiro/google2fa-qrcode/tree/v3.0.0" }, - "time": "2019-03-20T16:42:58+00:00" + "time": "2021-08-15T12:53:48+00:00" }, { "name": "pragmarx/random", @@ -5097,16 +5102,16 @@ }, { "name": "predis/predis", - "version": "v2.3.0", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/predis/predis.git", - "reference": "bac46bfdb78cd6e9c7926c697012aae740cb9ec9" + "reference": "f49e13ee3a2a825631562aa0223ac922ec5d058b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/predis/predis/zipball/bac46bfdb78cd6e9c7926c697012aae740cb9ec9", - "reference": "bac46bfdb78cd6e9c7926c697012aae740cb9ec9", + "url": "https://api.github.com/repos/predis/predis/zipball/f49e13ee3a2a825631562aa0223ac922ec5d058b", + "reference": "f49e13ee3a2a825631562aa0223ac922ec5d058b", "shasum": "" }, "require": { @@ -5115,6 +5120,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^3.3", "phpstan/phpstan": "^1.9", + "phpunit/phpcov": "^6.0 || ^8.0", "phpunit/phpunit": "^8.0 || ^9.4" }, "suggest": { @@ -5137,7 +5143,7 @@ "role": "Maintainer" } ], - "description": "A flexible and feature-complete Redis client for PHP.", + "description": "A flexible and feature-complete Redis/Valkey client for PHP.", "homepage": "http://github.com/predis/predis", "keywords": [ "nosql", @@ -5146,7 +5152,7 @@ ], "support": { "issues": "https://github.com/predis/predis/issues", - "source": "https://github.com/predis/predis/tree/v2.3.0" + "source": "https://github.com/predis/predis/tree/v2.4.0" }, "funding": [ { @@ -5154,7 +5160,7 @@ "type": "github" } ], - "time": "2024-11-21T20:00:02+00:00" + "time": "2025-04-30T15:16:02+00:00" }, { "name": "psr/cache", @@ -5903,16 +5909,16 @@ }, { "name": "spatie/backtrace", - "version": "1.7.1", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/spatie/backtrace.git", - "reference": "0f2477c520e3729de58e061b8192f161c99f770b" + "reference": "9807de6b8fecfaa5b3d10650985f0348b02862b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/backtrace/zipball/0f2477c520e3729de58e061b8192f161c99f770b", - "reference": "0f2477c520e3729de58e061b8192f161c99f770b", + "url": "https://api.github.com/repos/spatie/backtrace/zipball/9807de6b8fecfaa5b3d10650985f0348b02862b2", + "reference": "9807de6b8fecfaa5b3d10650985f0348b02862b2", "shasum": "" }, "require": { @@ -5950,7 +5956,7 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/backtrace/tree/1.7.1" + "source": "https://github.com/spatie/backtrace/tree/1.7.2" }, "funding": [ { @@ -5962,7 +5968,7 @@ "type": "other" } ], - "time": "2024-12-02T13:28:15+00:00" + "time": "2025-04-28T14:55:53+00:00" }, { "name": "spatie/error-solutions", @@ -6476,16 +6482,16 @@ }, { "name": "symfony/cache", - "version": "v7.2.5", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "9131e3018872d2ebb6fe8a9a4d6631273513d42c" + "reference": "8b49dde3f5a5e9867595a3a269977f78418d75ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/9131e3018872d2ebb6fe8a9a4d6631273513d42c", - "reference": "9131e3018872d2ebb6fe8a9a4d6631273513d42c", + "url": "https://api.github.com/repos/symfony/cache/zipball/8b49dde3f5a5e9867595a3a269977f78418d75ee", + "reference": "8b49dde3f5a5e9867595a3a269977f78418d75ee", "shasum": "" }, "require": { @@ -6554,7 +6560,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v7.2.5" + "source": "https://github.com/symfony/cache/tree/v7.2.6" }, "funding": [ { @@ -6570,7 +6576,7 @@ "type": "tidelift" } ], - "time": "2025-03-25T15:54:33+00:00" + "time": "2025-04-08T09:06:23+00:00" }, { "name": "symfony/cache-contracts", @@ -6724,16 +6730,16 @@ }, { "name": "symfony/console", - "version": "v7.2.5", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "e51498ea18570c062e7df29d05a7003585b19b88" + "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/e51498ea18570c062e7df29d05a7003585b19b88", - "reference": "e51498ea18570c062e7df29d05a7003585b19b88", + "url": "https://api.github.com/repos/symfony/console/zipball/0e2e3f38c192e93e622e41ec37f4ca70cfedf218", + "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218", "shasum": "" }, "require": { @@ -6797,7 +6803,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.2.5" + "source": "https://github.com/symfony/console/tree/v7.2.6" }, "funding": [ { @@ -6813,7 +6819,7 @@ "type": "tidelift" } ], - "time": "2025-03-12T08:11:12+00:00" + "time": "2025-04-07T19:09:28+00:00" }, { "name": "symfony/css-selector", @@ -7481,16 +7487,16 @@ }, { "name": "symfony/http-foundation", - "version": "v7.2.5", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "371272aeb6286f8135e028ca535f8e4d6f114126" + "reference": "6023ec7607254c87c5e69fb3558255aca440d72b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/371272aeb6286f8135e028ca535f8e4d6f114126", - "reference": "371272aeb6286f8135e028ca535f8e4d6f114126", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/6023ec7607254c87c5e69fb3558255aca440d72b", + "reference": "6023ec7607254c87c5e69fb3558255aca440d72b", "shasum": "" }, "require": { @@ -7539,7 +7545,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v7.2.5" + "source": "https://github.com/symfony/http-foundation/tree/v7.2.6" }, "funding": [ { @@ -7555,20 +7561,20 @@ "type": "tidelift" } ], - "time": "2025-03-25T15:54:33+00:00" + "time": "2025-04-09T08:14:01+00:00" }, { "name": "symfony/http-kernel", - "version": "v7.2.5", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "b1fe91bc1fa454a806d3f98db4ba826eb9941a54" + "reference": "f9dec01e6094a063e738f8945ef69c0cfcf792ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/b1fe91bc1fa454a806d3f98db4ba826eb9941a54", - "reference": "b1fe91bc1fa454a806d3f98db4ba826eb9941a54", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f9dec01e6094a063e738f8945ef69c0cfcf792ec", + "reference": "f9dec01e6094a063e738f8945ef69c0cfcf792ec", "shasum": "" }, "require": { @@ -7653,7 +7659,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v7.2.5" + "source": "https://github.com/symfony/http-kernel/tree/v7.2.6" }, "funding": [ { @@ -7669,20 +7675,20 @@ "type": "tidelift" } ], - "time": "2025-03-28T13:32:50+00:00" + "time": "2025-05-02T09:04:03+00:00" }, { "name": "symfony/mailer", - "version": "v7.2.3", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/mailer.git", - "reference": "f3871b182c44997cf039f3b462af4a48fb85f9d3" + "reference": "998692469d6e698c6eadc7ef37a6530a9eabb356" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/f3871b182c44997cf039f3b462af4a48fb85f9d3", - "reference": "f3871b182c44997cf039f3b462af4a48fb85f9d3", + "url": "https://api.github.com/repos/symfony/mailer/zipball/998692469d6e698c6eadc7ef37a6530a9eabb356", + "reference": "998692469d6e698c6eadc7ef37a6530a9eabb356", "shasum": "" }, "require": { @@ -7733,7 +7739,7 @@ "description": "Helps sending emails", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailer/tree/v7.2.3" + "source": "https://github.com/symfony/mailer/tree/v7.2.6" }, "funding": [ { @@ -7749,7 +7755,7 @@ "type": "tidelift" } ], - "time": "2025-01-27T11:08:17+00:00" + "time": "2025-04-04T09:50:51+00:00" }, { "name": "symfony/mailgun-mailer", @@ -7822,16 +7828,16 @@ }, { "name": "symfony/mime", - "version": "v7.2.4", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "87ca22046b78c3feaff04b337f33b38510fd686b" + "reference": "706e65c72d402539a072d0d6ad105fff6c161ef1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/87ca22046b78c3feaff04b337f33b38510fd686b", - "reference": "87ca22046b78c3feaff04b337f33b38510fd686b", + "url": "https://api.github.com/repos/symfony/mime/zipball/706e65c72d402539a072d0d6ad105fff6c161ef1", + "reference": "706e65c72d402539a072d0d6ad105fff6c161ef1", "shasum": "" }, "require": { @@ -7886,7 +7892,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v7.2.4" + "source": "https://github.com/symfony/mime/tree/v7.2.6" }, "funding": [ { @@ -7902,7 +7908,7 @@ "type": "tidelift" } ], - "time": "2025-02-19T08:51:20+00:00" + "time": "2025-04-27T13:34:41+00:00" }, { "name": "symfony/options-resolver", @@ -7973,7 +7979,7 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -8032,7 +8038,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" }, "funding": [ { @@ -8052,7 +8058,7 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", @@ -8110,7 +8116,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0" }, "funding": [ { @@ -8130,16 +8136,16 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773" + "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c36586dcf89a12315939e00ec9b4474adcb1d773", - "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/9614ac4d8061dc257ecc64cba1b140873dce8ad3", + "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3", "shasum": "" }, "require": { @@ -8193,7 +8199,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.32.0" }, "funding": [ { @@ -8209,11 +8215,11 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-09-10T14:38:51+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -8274,7 +8280,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" }, "funding": [ { @@ -8294,19 +8300,20 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", "shasum": "" }, "require": { + "ext-iconv": "*", "php": ">=7.2" }, "provide": { @@ -8354,7 +8361,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" }, "funding": [ { @@ -8370,20 +8377,20 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-12-23T08:48:59+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", "shasum": "" }, "require": { @@ -8434,7 +8441,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0" }, "funding": [ { @@ -8450,11 +8457,11 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2025-01-02T08:10:11+00:00" }, { "name": "symfony/polyfill-php83", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php83.git", @@ -8510,7 +8517,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php83/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php83/tree/v1.32.0" }, "funding": [ { @@ -8530,7 +8537,7 @@ }, { "name": "symfony/polyfill-uuid", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-uuid.git", @@ -8589,7 +8596,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/polyfill-uuid/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.32.0" }, "funding": [ { @@ -8917,16 +8924,16 @@ }, { "name": "symfony/string", - "version": "v7.2.0", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" + "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", - "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", + "url": "https://api.github.com/repos/symfony/string/zipball/a214fe7d62bd4df2a76447c67c6b26e1d5e74931", + "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931", "shasum": "" }, "require": { @@ -8984,7 +8991,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.2.0" + "source": "https://github.com/symfony/string/tree/v7.2.6" }, "funding": [ { @@ -9000,20 +9007,20 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:31:26+00:00" + "time": "2025-04-20T20:18:16+00:00" }, { "name": "symfony/translation", - "version": "v7.2.4", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "283856e6981286cc0d800b53bd5703e8e363f05a" + "reference": "e7fd8e2a4239b79a0fd9fb1fef3e0e7f969c6dc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/283856e6981286cc0d800b53bd5703e8e363f05a", - "reference": "283856e6981286cc0d800b53bd5703e8e363f05a", + "url": "https://api.github.com/repos/symfony/translation/zipball/e7fd8e2a4239b79a0fd9fb1fef3e0e7f969c6dc6", + "reference": "e7fd8e2a4239b79a0fd9fb1fef3e0e7f969c6dc6", "shasum": "" }, "require": { @@ -9079,7 +9086,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v7.2.4" + "source": "https://github.com/symfony/translation/tree/v7.2.6" }, "funding": [ { @@ -9095,7 +9102,7 @@ "type": "tidelift" } ], - "time": "2025-02-13T10:27:23+00:00" + "time": "2025-04-07T19:09:28+00:00" }, { "name": "symfony/translation-contracts", @@ -9251,16 +9258,16 @@ }, { "name": "symfony/var-dumper", - "version": "v7.2.3", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "82b478c69745d8878eb60f9a049a4d584996f73a" + "reference": "9c46038cd4ed68952166cf7001b54eb539184ccb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/82b478c69745d8878eb60f9a049a4d584996f73a", - "reference": "82b478c69745d8878eb60f9a049a4d584996f73a", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/9c46038cd4ed68952166cf7001b54eb539184ccb", + "reference": "9c46038cd4ed68952166cf7001b54eb539184ccb", "shasum": "" }, "require": { @@ -9314,7 +9321,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v7.2.3" + "source": "https://github.com/symfony/var-dumper/tree/v7.2.6" }, "funding": [ { @@ -9330,20 +9337,20 @@ "type": "tidelift" } ], - "time": "2025-01-17T11:39:41+00:00" + "time": "2025-04-09T08:14:01+00:00" }, { "name": "symfony/var-exporter", - "version": "v7.2.5", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "c37b301818bd7288715d40de634f05781b686ace" + "reference": "422b8de94c738830a1e071f59ad14d67417d7007" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/c37b301818bd7288715d40de634f05781b686ace", - "reference": "c37b301818bd7288715d40de634f05781b686ace", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/422b8de94c738830a1e071f59ad14d67417d7007", + "reference": "422b8de94c738830a1e071f59ad14d67417d7007", "shasum": "" }, "require": { @@ -9390,7 +9397,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v7.2.5" + "source": "https://github.com/symfony/var-exporter/tree/v7.2.6" }, "funding": [ { @@ -9406,7 +9413,7 @@ "type": "tidelift" } ], - "time": "2025-03-13T12:21:46+00:00" + "time": "2025-05-02T08:36:00+00:00" }, { "name": "thecodingmachine/safe", @@ -9604,16 +9611,16 @@ }, { "name": "twig/twig", - "version": "v3.20.0", + "version": "v3.21.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "3468920399451a384bef53cf7996965f7cd40183" + "reference": "285123877d4dd97dd7c11842ac5fb7e86e60d81d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/3468920399451a384bef53cf7996965f7cd40183", - "reference": "3468920399451a384bef53cf7996965f7cd40183", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/285123877d4dd97dd7c11842ac5fb7e86e60d81d", + "reference": "285123877d4dd97dd7c11842ac5fb7e86e60d81d", "shasum": "" }, "require": { @@ -9667,7 +9674,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.20.0" + "source": "https://github.com/twigphp/Twig/tree/v3.21.1" }, "funding": [ { @@ -9679,7 +9686,7 @@ "type": "tidelift" } ], - "time": "2025-02-13T08:34:43+00:00" + "time": "2025-05-03T07:21:55+00:00" }, { "name": "verifiedjoseph/ntfy-php-library", @@ -9737,16 +9744,16 @@ }, { "name": "vlucas/phpdotenv", - "version": "v5.6.1", + "version": "v5.6.2", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2" + "reference": "24ac4c74f91ee2c193fa1aaa5c249cb0822809af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/a59a13791077fe3d44f90e7133eb68e7d22eaff2", - "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/24ac4c74f91ee2c193fa1aaa5c249cb0822809af", + "reference": "24ac4c74f91ee2c193fa1aaa5c249cb0822809af", "shasum": "" }, "require": { @@ -9805,7 +9812,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.1" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.2" }, "funding": [ { @@ -9817,7 +9824,7 @@ "type": "tidelift" } ], - "time": "2024-07-20T21:52:34+00:00" + "time": "2025-04-30T23:37:27+00:00" }, { "name": "voku/portable-ascii", @@ -10534,20 +10541,20 @@ }, { "name": "hamcrest/hamcrest-php", - "version": "v2.0.1", + "version": "v2.1.1", "source": { "type": "git", "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" + "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", - "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487", + "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487", "shasum": "" }, "require": { - "php": "^5.3|^7.0|^8.0" + "php": "^7.4|^8.0" }, "replace": { "cordoval/hamcrest-php": "*", @@ -10555,8 +10562,8 @@ "kodova/hamcrest-php": "*" }, "require-dev": { - "phpunit/php-file-iterator": "^1.4 || ^2.0", - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" + "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" }, "type": "library", "extra": { @@ -10579,9 +10586,9 @@ ], "support": { "issues": "https://github.com/hamcrest/hamcrest-php/issues", - "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" + "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.1.1" }, - "time": "2020-07-09T08:09:16+00:00" + "time": "2025-04-30T06:54:44+00:00" }, { "name": "iamcal/sql-parser", @@ -10863,16 +10870,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.13.0", + "version": "1.13.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414" + "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c", + "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c", "shasum": "" }, "require": { @@ -10911,7 +10918,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.1" }, "funding": [ { @@ -10919,7 +10926,7 @@ "type": "tidelift" } ], - "time": "2025-02-12T12:17:51+00:00" + "time": "2025-04-29T12:36:36+00:00" }, { "name": "nikic/php-parser", @@ -11217,16 +11224,16 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.13", + "version": "2.1.14", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e55e03e6d4ac49cd1240907e5b08e5cd378572a9" + "reference": "8f2e03099cac24ff3b379864d171c5acbfc6b9a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e55e03e6d4ac49cd1240907e5b08e5cd378572a9", - "reference": "e55e03e6d4ac49cd1240907e5b08e5cd378572a9", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/8f2e03099cac24ff3b379864d171c5acbfc6b9a2", + "reference": "8f2e03099cac24ff3b379864d171c5acbfc6b9a2", "shasum": "" }, "require": { @@ -11271,7 +11278,7 @@ "type": "github" } ], - "time": "2025-04-27T12:28:25+00:00" + "time": "2025-05-02T15:32:28+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -11693,16 +11700,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.5.18", + "version": "11.5.19", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fc3e887c7f3f9917e1bf61e523413d753db00a17" + "reference": "0da1ebcdbc4d5bd2d189cfe02846a89936d8dda5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc3e887c7f3f9917e1bf61e523413d753db00a17", - "reference": "fc3e887c7f3f9917e1bf61e523413d753db00a17", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0da1ebcdbc4d5bd2d189cfe02846a89936d8dda5", + "reference": "0da1ebcdbc4d5bd2d189cfe02846a89936d8dda5", "shasum": "" }, "require": { @@ -11712,7 +11719,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.13.0", + "myclabs/deep-copy": "^1.13.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=8.2", @@ -11774,7 +11781,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.18" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.19" }, "funding": [ { @@ -11798,7 +11805,66 @@ "type": "tidelift" } ], - "time": "2025-04-22T06:09:49+00:00" + "time": "2025-05-02T06:56:52+00:00" + }, + { + "name": "rector/rector", + "version": "2.0.14", + "source": { + "type": "git", + "url": "https://github.com/rectorphp/rector.git", + "reference": "63923bc9383c1212476c41d8cebf58a425e6f98d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/63923bc9383c1212476c41d8cebf58a425e6f98d", + "reference": "63923bc9383c1212476c41d8cebf58a425e6f98d", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0", + "phpstan/phpstan": "^2.1.12" + }, + "conflict": { + "rector/rector-doctrine": "*", + "rector/rector-downgrade-php": "*", + "rector/rector-phpunit": "*", + "rector/rector-symfony": "*" + }, + "suggest": { + "ext-dom": "To manipulate phpunit.xml via the custom-rule command" + }, + "bin": [ + "bin/rector" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "keywords": [ + "automation", + "dev", + "migration", + "refactoring" + ], + "support": { + "issues": "https://github.com/rectorphp/rector/issues", + "source": "https://github.com/rectorphp/rector/tree/2.0.14" + }, + "funding": [ + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2025-04-28T00:03:14+00:00" }, { "name": "sebastian/cli-parser", @@ -12778,6 +12844,64 @@ ], "time": "2024-10-20T05:08:20+00:00" }, + { + "name": "thecodingmachine/phpstan-safe-rule", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/thecodingmachine/phpstan-safe-rule.git", + "reference": "33dcbc3228c55ea4c364ecf74a3661cf7b7f168d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thecodingmachine/phpstan-safe-rule/zipball/33dcbc3228c55ea4c364ecf74a3661cf7b7f168d", + "reference": "33dcbc3228c55ea4c364ecf74a3661cf7b7f168d", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5", + "php": "^8.1", + "phpstan/phpstan": "^2.0", + "thecodingmachine/safe": "^1.2 || ^2.0 || ^3.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^10.4", + "squizlabs/php_codesniffer": "^3.4" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "phpstan-safe-rule.neon" + ] + }, + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "TheCodingMachine\\Safe\\PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "David Négrier", + "email": "d.negrier@thecodingmachine.com" + } + ], + "description": "A PHPStan rule to detect safety issues. Must be used in conjunction with thecodingmachine/safe", + "support": { + "issues": "https://github.com/thecodingmachine/phpstan-safe-rule/issues", + "source": "https://github.com/thecodingmachine/phpstan-safe-rule/tree/v1.4.0" + }, + "time": "2025-02-11T12:41:29+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.3", From d5240f7afd661e2ab5113ce7d7b8f8ff8f57015e Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 May 2025 12:20:54 +0200 Subject: [PATCH 21/87] Replace string operators. --- .../Commands/System/OutputsInstructions.php | 5 +---- app/Http/Controllers/Json/IntroController.php | 18 +++++++++--------- .../Controllers/Recurring/EditController.php | 2 +- .../Internal/Update/GroupCloneService.php | 5 +---- app/Support/CacheProperties.php | 13 +++++++------ 5 files changed, 19 insertions(+), 24 deletions(-) diff --git a/app/Console/Commands/System/OutputsInstructions.php b/app/Console/Commands/System/OutputsInstructions.php index e9cd25e5be..ae703f8399 100644 --- a/app/Console/Commands/System/OutputsInstructions.php +++ b/app/Console/Commands/System/OutputsInstructions.php @@ -147,10 +147,7 @@ class OutputsInstructions extends Command */ private function showLine(): void { - $line = '+'; - $line .= str_repeat('-', 78); - $line .= '+'; - $this->line($line); + $this->line(sprintf('+%s+', str_repeat('-', 78))); } /** diff --git a/app/Http/Controllers/Json/IntroController.php b/app/Http/Controllers/Json/IntroController.php index 6ea2ca32d2..620660c5ba 100644 --- a/app/Http/Controllers/Json/IntroController.php +++ b/app/Http/Controllers/Json/IntroController.php @@ -41,7 +41,7 @@ class IntroController extends Controller public function getIntroSteps(string $route, ?string $specificPage = null): JsonResponse { app('log')->debug(sprintf('getIntroSteps for route "%s" and page "%s"', $route, $specificPage)); - $specificPage ??= ''; + $specificPage ??= ''; $steps = $this->getBasicSteps($route); $specificSteps = $this->getSpecificSteps($route, $specificPage); if (0 === count($specificSteps)) { @@ -55,8 +55,8 @@ class IntroController extends Controller // remove last step: array_pop($steps); // merge arrays and add last step again - $steps = array_merge($steps, $specificSteps); - $steps[] = $lastStep; + $steps = array_merge($steps, $specificSteps); + $steps[] = $lastStep; } if (!$this->hasOutroStep($route)) { $steps = array_merge($steps, $specificSteps); @@ -77,7 +77,7 @@ class IntroController extends Controller return false; } - $hasStep = array_key_exists('outro', $elements); + $hasStep = array_key_exists('outro', $elements); app('log')->debug('Elements is array', $elements); app('log')->debug('Keys is', array_keys($elements)); @@ -94,10 +94,10 @@ class IntroController extends Controller public function postEnable(string $route, ?string $specialPage = null): JsonResponse { $specialPage ??= ''; - $route = str_replace('.', '_', $route); - $key = 'shown_demo_'.$route; + $route = str_replace('.', '_', $route); + $key = sprintf('shown_demo_%s', $route); if ('' !== $specialPage) { - $key .= '_'.$specialPage; + $key = sprintf('%s_%s', $key, $specialPage); } app('log')->debug(sprintf('Going to mark the following route as NOT done: %s with special "%s" (%s)', $route, $specialPage, $key)); app('preferences')->set($key, false); @@ -114,9 +114,9 @@ class IntroController extends Controller public function postFinished(string $route, ?string $specialPage = null): JsonResponse { $specialPage ??= ''; - $key = 'shown_demo_'.$route; + $key = sprintf('shown_demo_%s', $route); if ('' !== $specialPage) { - $key .= '_'.$specialPage; + $key = sprintf('%s_%s', $key, $specialPage); } app('log')->debug(sprintf('Going to mark the following route as done: %s with special "%s" (%s)', $route, $specialPage, $key)); app('preferences')->set($key, true); diff --git a/app/Http/Controllers/Recurring/EditController.php b/app/Http/Controllers/Recurring/EditController.php index b48e5f7b85..0a2cae44a1 100644 --- a/app/Http/Controllers/Recurring/EditController.php +++ b/app/Http/Controllers/Recurring/EditController.php @@ -104,7 +104,7 @@ class EditController extends Controller $repetition = $recurrence->recurrenceRepetitions()->first(); $currentRepType = $repetition->repetition_type; if ('' !== $repetition->repetition_moment) { - $currentRepType .= ','.$repetition->repetition_moment; + $currentRepType = sprintf('%s,%s', $currentRepType,$repetition->repetition_moment); } // put previous url in session if not redirect from store (not "return_to_edit"). diff --git a/app/Services/Internal/Update/GroupCloneService.php b/app/Services/Internal/Update/GroupCloneService.php index 53cfb14c44..4bb92e31d0 100644 --- a/app/Services/Internal/Update/GroupCloneService.php +++ b/app/Services/Internal/Update/GroupCloneService.php @@ -117,10 +117,7 @@ class GroupCloneService private function cloneNote(Note $note, TransactionJournal $newJournal, int $oldGroupId): void { $newNote = $note->replicate(); - $newNote->text .= sprintf( - "\n\n%s", - trans('firefly.clones_journal_x', ['description' => $newJournal->description, 'id' => $oldGroupId]) - ); + $newNote->text = sprintf("%s\n\n%s",$newNote->text, trans('firefly.clones_journal_x', ['description' => $newJournal->description, 'id' => $oldGroupId])); $newNote->noteable_id = $newJournal->id; $newNote->save(); } diff --git a/app/Support/CacheProperties.php b/app/Support/CacheProperties.php index ed52fa17d9..5f783af1c1 100644 --- a/app/Support/CacheProperties.php +++ b/app/Support/CacheProperties.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Support; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Cache; /** * Class CacheProperties. @@ -55,7 +56,7 @@ class CacheProperties */ public function get() { - return \Cache::get($this->hash); + return Cache::get($this->hash); } public function getHash(): string @@ -70,18 +71,18 @@ class CacheProperties } $this->hash(); - return \Cache::has($this->hash); + return Cache::has($this->hash); } private function hash(): void { - $content = ''; + $content = ''; foreach ($this->properties as $property) { try { - $content .= \Safe\json_encode($property, JSON_THROW_ON_ERROR); + $content = sprintf('%s%s', $content, \Safe\json_encode($property, JSON_THROW_ON_ERROR)); } catch (\JsonException $e) { // @ignoreException - $content .= hash('sha256', (string) time()); + $content = sprintf('%s%s', $content, hash('sha256', (string) time())); } } $this->hash = substr(hash('sha256', $content), 0, 16); @@ -92,6 +93,6 @@ class CacheProperties */ public function store($data): void { - \Cache::forever($this->hash, $data); + Cache::forever($this->hash, $data); } } From abd92601931332ef2b6cdae969634d5332c8f6f2 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 May 2025 12:57:14 +0200 Subject: [PATCH 22/87] Update code to use php 8.4 code, using Nestor. --- .../Autocomplete/BillController.php | 12 +++++------- .../Autocomplete/BudgetController.php | 10 ++++------ .../Autocomplete/CategoryController.php | 10 ++++------ .../Controllers/Chart/CategoryController.php | 4 +--- .../TransactionCurrency/ListController.php | 4 +--- app/Api/V1/Requests/Chart/ChartRequest.php | 2 +- .../Data/Bulk/MoveTransactionsRequest.php | 2 +- .../Requests/Data/Bulk/TransactionRequest.php | 2 +- .../Requests/Models/Account/UpdateRequest.php | 2 +- .../Models/Attachment/StoreRequest.php | 4 +--- .../Models/Attachment/UpdateRequest.php | 4 +--- .../Models/AvailableBudget/Request.php | 2 +- .../V1/Requests/Models/Bill/StoreRequest.php | 2 +- .../V1/Requests/Models/Bill/UpdateRequest.php | 2 +- .../V1/Requests/Models/Budget/StoreRequest.php | 2 +- .../Requests/Models/Budget/UpdateRequest.php | 2 +- .../Models/BudgetLimit/UpdateRequest.php | 2 +- .../Requests/Models/PiggyBank/StoreRequest.php | 2 +- .../Models/Recurrence/StoreRequest.php | 2 +- .../Models/Recurrence/UpdateRequest.php | 2 +- .../V1/Requests/Models/Rule/StoreRequest.php | 2 +- .../V1/Requests/Models/Rule/UpdateRequest.php | 2 +- .../Models/Transaction/StoreRequest.php | 2 +- .../Models/Transaction/UpdateRequest.php | 2 +- .../Models/TransactionLink/StoreRequest.php | 2 +- .../Models/TransactionLink/UpdateRequest.php | 2 +- .../V1/Requests/System/UserUpdateRequest.php | 2 +- .../Autocomplete/CategoryController.php | 12 +++++------- .../Controllers/Autocomplete/TagController.php | 16 +++++++--------- .../Controllers/Chart/CategoryController.php | 4 +--- .../V2/Request/Chart/BalanceChartRequest.php | 2 +- app/Api/V2/Request/Chart/ChartRequest.php | 2 +- .../V2/Request/Chart/DashboardChartRequest.php | 2 +- .../Request/Model/Transaction/StoreRequest.php | 2 +- .../Model/Transaction/UpdateRequest.php | 5 ++++- .../Commands/Correction/CorrectsAmounts.php | 2 +- .../Commands/Correction/CorrectsCurrencies.php | 4 +--- .../Correction/CorrectsNativeAmounts.php | 4 +--- .../Correction/CorrectsTransactionTypes.php | 8 ++------ .../Commands/Upgrade/UpgradesToGroups.php | 4 +--- .../Upgrade/UpgradesTransferCurrencies.php | 12 ++++++------ app/Console/Kernel.php | 2 ++ app/Events/Admin/InvitationCreated.php | 5 +---- app/Events/DestroyedTransactionGroup.php | 5 +---- app/Events/DestroyedTransactionLink.php | 7 ++----- app/Events/DetectedNewIPAddress.php | 5 +---- app/Events/Model/Account/Updated.php | 5 +---- app/Events/Model/BudgetLimit/Created.php | 5 +---- app/Events/Model/BudgetLimit/Deleted.php | 5 +---- app/Events/Model/BudgetLimit/Updated.php | 5 +---- app/Events/Model/PiggyBank/ChangedAmount.php | 6 +----- .../Model/Rule/RuleActionFailedOnArray.php | 9 +-------- .../Model/Rule/RuleActionFailedOnObject.php | 9 +-------- app/Events/NewVersionAvailable.php | 5 +---- .../UserGroupChangedDefaultCurrency.php | 5 +---- app/Events/RegisteredUser.php | 7 +------ app/Events/RequestedReportOnJournals.php | 7 +------ app/Events/RequestedVersionCheckStatus.php | 5 +---- app/Events/Security/MFABackupFewLeft.php | 5 +---- app/Events/Security/MFAManyFailedAttempts.php | 5 +---- .../Security/UnknownUserAttemptedLogin.php | 5 +---- app/Events/StoredAccount.php | 5 +---- app/Events/StoredTransactionGroup.php | 9 +-------- .../Test/OwnerTestNotificationChannel.php | 4 +--- .../Test/UserTestNotificationChannel.php | 4 +--- app/Events/TriggeredAuditLog.php | 13 +------------ app/Events/UpdatedAccount.php | 5 +---- app/Events/UpdatedTransactionGroup.php | 9 +-------- app/Events/UserChangedEmail.php | 9 +-------- app/Events/WarnUserAboutBill.php | 9 +-------- app/Exceptions/GracefulNotFoundHandler.php | 1 + app/Exceptions/Handler.php | 18 ++++++++++-------- app/Factory/TransactionFactory.php | 2 +- app/Factory/TransactionGroupFactory.php | 2 +- .../Account/MultiYearReportGenerator.php | 1 + .../Report/Account/YearReportGenerator.php | 1 + .../Webhook/StandardMessageGenerator.php | 2 +- app/Handlers/Events/WebhookEventHandler.php | 4 +--- config/ide-helper.php | 4 ++-- 79 files changed, 120 insertions(+), 261 deletions(-) diff --git a/app/Api/V1/Controllers/Autocomplete/BillController.php b/app/Api/V1/Controllers/Autocomplete/BillController.php index 224a899076..2c158c6ea5 100644 --- a/app/Api/V1/Controllers/Autocomplete/BillController.php +++ b/app/Api/V1/Controllers/Autocomplete/BillController.php @@ -65,13 +65,11 @@ class BillController extends Controller $data = $request->getData(); $result = $this->repository->searchBill($data['query'], $this->parameters->get('limit')); $filtered = $result->map( - static function (Bill $item) { - return [ - 'id' => (string) $item->id, - 'name' => $item->name, - 'active' => $item->active, - ]; - } + static fn(Bill $item) => [ + 'id' => (string) $item->id, + 'name' => $item->name, + 'active' => $item->active, + ] ); return response()->api($filtered->toArray()); diff --git a/app/Api/V1/Controllers/Autocomplete/BudgetController.php b/app/Api/V1/Controllers/Autocomplete/BudgetController.php index 97fa37418a..5f9aea4988 100644 --- a/app/Api/V1/Controllers/Autocomplete/BudgetController.php +++ b/app/Api/V1/Controllers/Autocomplete/BudgetController.php @@ -65,12 +65,10 @@ class BudgetController extends Controller $data = $request->getData(); $result = $this->repository->searchBudget($data['query'], $this->parameters->get('limit')); $filtered = $result->map( - static function (Budget $item) { - return [ - 'id' => (string) $item->id, - 'name' => $item->name, - ]; - } + static fn(Budget $item) => [ + 'id' => (string) $item->id, + 'name' => $item->name, + ] ); return response()->api($filtered->toArray()); diff --git a/app/Api/V1/Controllers/Autocomplete/CategoryController.php b/app/Api/V1/Controllers/Autocomplete/CategoryController.php index 39085c1f06..09dfd0797a 100644 --- a/app/Api/V1/Controllers/Autocomplete/CategoryController.php +++ b/app/Api/V1/Controllers/Autocomplete/CategoryController.php @@ -65,12 +65,10 @@ class CategoryController extends Controller $data = $request->getData(); $result = $this->repository->searchCategory($data['query'], $this->parameters->get('limit')); $filtered = $result->map( - static function (Category $item) { - return [ - 'id' => (string) $item->id, - 'name' => $item->name, - ]; - } + static fn(Category $item) => [ + 'id' => (string) $item->id, + 'name' => $item->name, + ] ); return response()->api($filtered->toArray()); diff --git a/app/Api/V1/Controllers/Chart/CategoryController.php b/app/Api/V1/Controllers/Chart/CategoryController.php index dd2c277c5e..8053d5c122 100644 --- a/app/Api/V1/Controllers/Chart/CategoryController.php +++ b/app/Api/V1/Controllers/Chart/CategoryController.php @@ -119,9 +119,7 @@ class CategoryController extends Controller $return = array_values($return); // order by amount - usort($return, static function (array $a, array $b) { - return (float) $a['amount'] < (float) $b['amount'] ? 1 : -1; - }); + usort($return, static fn(array $a, array $b) => (float) $a['amount'] < (float) $b['amount'] ? 1 : -1); return response()->json($this->clean($return)); } diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php index acac15728d..0c9883e1e6 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php @@ -177,9 +177,7 @@ class ListController extends Controller // filter and paginate list: $collection = $unfiltered->filter( - static function (Bill $bill) use ($currency) { - return $bill->transaction_currency_id === $currency->id; - } + static fn(Bill $bill) => $bill->transaction_currency_id === $currency->id ); $count = $collection->count(); $bills = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize); diff --git a/app/Api/V1/Requests/Chart/ChartRequest.php b/app/Api/V1/Requests/Chart/ChartRequest.php index a52c2e8245..7d3f0e4a94 100644 --- a/app/Api/V1/Requests/Chart/ChartRequest.php +++ b/app/Api/V1/Requests/Chart/ChartRequest.php @@ -85,7 +85,7 @@ class ChartRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V1/Requests/Data/Bulk/MoveTransactionsRequest.php b/app/Api/V1/Requests/Data/Bulk/MoveTransactionsRequest.php index f3dacae241..3ada80f591 100644 --- a/app/Api/V1/Requests/Data/Bulk/MoveTransactionsRequest.php +++ b/app/Api/V1/Requests/Data/Bulk/MoveTransactionsRequest.php @@ -74,7 +74,7 @@ class MoveTransactionsRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } diff --git a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php index 9bee14442d..544d65b1f6 100644 --- a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php +++ b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php @@ -74,7 +74,7 @@ class TransactionRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V1/Requests/Models/Account/UpdateRequest.php b/app/Api/V1/Requests/Models/Account/UpdateRequest.php index 4d718460e7..dbe30eab1b 100644 --- a/app/Api/V1/Requests/Models/Account/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Account/UpdateRequest.php @@ -144,7 +144,7 @@ class UpdateRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V1/Requests/Models/Attachment/StoreRequest.php b/app/Api/V1/Requests/Models/Attachment/StoreRequest.php index 68fa02319f..b50b77c141 100644 --- a/app/Api/V1/Requests/Models/Attachment/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Attachment/StoreRequest.php @@ -58,9 +58,7 @@ class StoreRequest extends FormRequest { $models = config('firefly.valid_attachment_models'); $models = array_map( - static function (string $className) { - return str_replace('FireflyIII\Models\\', '', $className); - }, + static fn(string $className) => str_replace('FireflyIII\Models\\', '', $className), $models ); $models = implode(',', $models); diff --git a/app/Api/V1/Requests/Models/Attachment/UpdateRequest.php b/app/Api/V1/Requests/Models/Attachment/UpdateRequest.php index fd0eee86b8..be3e13aad9 100644 --- a/app/Api/V1/Requests/Models/Attachment/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Attachment/UpdateRequest.php @@ -60,9 +60,7 @@ class UpdateRequest extends FormRequest { $models = config('firefly.valid_attachment_models'); $models = array_map( - static function (string $className) { - return str_replace('FireflyIII\Models\\', '', $className); - }, + static fn(string $className) => str_replace('FireflyIII\Models\\', '', $className), $models ); $models = implode(',', $models); diff --git a/app/Api/V1/Requests/Models/AvailableBudget/Request.php b/app/Api/V1/Requests/Models/AvailableBudget/Request.php index 5b0adb3b52..ccf7e4d030 100644 --- a/app/Api/V1/Requests/Models/AvailableBudget/Request.php +++ b/app/Api/V1/Requests/Models/AvailableBudget/Request.php @@ -90,7 +90,7 @@ class Request extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V1/Requests/Models/Bill/StoreRequest.php b/app/Api/V1/Requests/Models/Bill/StoreRequest.php index 9925b66a1c..40194a33f4 100644 --- a/app/Api/V1/Requests/Models/Bill/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Bill/StoreRequest.php @@ -129,7 +129,7 @@ class StoreRequest extends FormRequest $failed = false; } if ($failed) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V1/Requests/Models/Bill/UpdateRequest.php b/app/Api/V1/Requests/Models/Bill/UpdateRequest.php index be00edb215..5931fc7bd2 100644 --- a/app/Api/V1/Requests/Models/Bill/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Bill/UpdateRequest.php @@ -110,7 +110,7 @@ class UpdateRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V1/Requests/Models/Budget/StoreRequest.php b/app/Api/V1/Requests/Models/Budget/StoreRequest.php index c650674c78..f6a96a6941 100644 --- a/app/Api/V1/Requests/Models/Budget/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Budget/StoreRequest.php @@ -94,7 +94,7 @@ class StoreRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V1/Requests/Models/Budget/UpdateRequest.php b/app/Api/V1/Requests/Models/Budget/UpdateRequest.php index 01d9099ea7..1319df36e6 100644 --- a/app/Api/V1/Requests/Models/Budget/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Budget/UpdateRequest.php @@ -106,7 +106,7 @@ class UpdateRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php b/app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php index 34a191c2a7..1fb3d53ca9 100644 --- a/app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php @@ -96,7 +96,7 @@ class UpdateRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php b/app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php index 6ee29d70d9..e7ae890499 100644 --- a/app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php +++ b/app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php @@ -126,7 +126,7 @@ class StoreRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } diff --git a/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php b/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php index dd2aa5fb82..f8f5091ed0 100644 --- a/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php @@ -193,7 +193,7 @@ class StoreRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php b/app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php index f81fca7b8c..5449a5edda 100644 --- a/app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php @@ -208,7 +208,7 @@ class UpdateRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V1/Requests/Models/Rule/StoreRequest.php b/app/Api/V1/Requests/Models/Rule/StoreRequest.php index fb5b511f4b..dd65d648a0 100644 --- a/app/Api/V1/Requests/Models/Rule/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Rule/StoreRequest.php @@ -148,7 +148,7 @@ class StoreRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } diff --git a/app/Api/V1/Requests/Models/Rule/UpdateRequest.php b/app/Api/V1/Requests/Models/Rule/UpdateRequest.php index d9fecdc314..13a8a97676 100644 --- a/app/Api/V1/Requests/Models/Rule/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Rule/UpdateRequest.php @@ -168,7 +168,7 @@ class UpdateRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } diff --git a/app/Api/V1/Requests/Models/Transaction/StoreRequest.php b/app/Api/V1/Requests/Models/Transaction/StoreRequest.php index 4e07711c9d..e651e5a1d6 100644 --- a/app/Api/V1/Requests/Models/Transaction/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Transaction/StoreRequest.php @@ -300,7 +300,7 @@ class StoreRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php b/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php index 2d18b028e3..f53b5ba6df 100644 --- a/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php @@ -359,7 +359,7 @@ class UpdateRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V1/Requests/Models/TransactionLink/StoreRequest.php b/app/Api/V1/Requests/Models/TransactionLink/StoreRequest.php index d395da5fd8..638bda8306 100644 --- a/app/Api/V1/Requests/Models/TransactionLink/StoreRequest.php +++ b/app/Api/V1/Requests/Models/TransactionLink/StoreRequest.php @@ -80,7 +80,7 @@ class StoreRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } diff --git a/app/Api/V1/Requests/Models/TransactionLink/UpdateRequest.php b/app/Api/V1/Requests/Models/TransactionLink/UpdateRequest.php index 5aaeb892cb..0ab51bccd0 100644 --- a/app/Api/V1/Requests/Models/TransactionLink/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/TransactionLink/UpdateRequest.php @@ -80,7 +80,7 @@ class UpdateRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } diff --git a/app/Api/V1/Requests/System/UserUpdateRequest.php b/app/Api/V1/Requests/System/UserUpdateRequest.php index 1fc0df7bb3..553f8e54e4 100644 --- a/app/Api/V1/Requests/System/UserUpdateRequest.php +++ b/app/Api/V1/Requests/System/UserUpdateRequest.php @@ -99,7 +99,7 @@ class UserUpdateRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V2/Controllers/Autocomplete/CategoryController.php b/app/Api/V2/Controllers/Autocomplete/CategoryController.php index de0d566888..1c0abe3db9 100644 --- a/app/Api/V2/Controllers/Autocomplete/CategoryController.php +++ b/app/Api/V2/Controllers/Autocomplete/CategoryController.php @@ -61,13 +61,11 @@ class CategoryController extends Controller $queryParameters = $request->getParameters(); $result = $this->repository->searchCategory($queryParameters['query'], $queryParameters['size']); $filtered = $result->map( - static function (Category $item) { - return [ - 'id' => (string) $item->id, - 'title' => $item->name, - 'meta' => [], - ]; - } + static fn(Category $item) => [ + 'id' => (string) $item->id, + 'title' => $item->name, + 'meta' => [], + ] ); return response()->json($filtered); diff --git a/app/Api/V2/Controllers/Autocomplete/TagController.php b/app/Api/V2/Controllers/Autocomplete/TagController.php index de80a16b92..dc296da528 100644 --- a/app/Api/V2/Controllers/Autocomplete/TagController.php +++ b/app/Api/V2/Controllers/Autocomplete/TagController.php @@ -61,15 +61,13 @@ class TagController extends Controller $queryParameters = $request->getParameters(); $result = $this->repository->searchTag($queryParameters['query']); $filtered = $result->map( - static function (Tag $item) { - return [ - 'id' => (string) $item->id, - 'title' => $item->tag, - 'value' => (string) $item->id, - 'label' => $item->tag, - 'meta' => [], - ]; - } + static fn(Tag $item) => [ + 'id' => (string) $item->id, + 'title' => $item->tag, + 'value' => (string) $item->id, + 'label' => $item->tag, + 'meta' => [], + ] ); return response()->json($filtered); diff --git a/app/Api/V2/Controllers/Chart/CategoryController.php b/app/Api/V2/Controllers/Chart/CategoryController.php index 0a0639a94c..7d66f5080b 100644 --- a/app/Api/V2/Controllers/Chart/CategoryController.php +++ b/app/Api/V2/Controllers/Chart/CategoryController.php @@ -134,9 +134,7 @@ class CategoryController extends Controller $return = array_values($return); // order by native amount - usort($return, static function (array $a, array $b) { - return (float) $a['native_amount'] < (float) $b['native_amount'] ? 1 : -1; - }); + usort($return, static fn(array $a, array $b) => (float) $a['native_amount'] < (float) $b['native_amount'] ? 1 : -1); $converter->summarize(); return response()->json($this->clean($return)); diff --git a/app/Api/V2/Request/Chart/BalanceChartRequest.php b/app/Api/V2/Request/Chart/BalanceChartRequest.php index 3f60442a89..bdbb141b65 100644 --- a/app/Api/V2/Request/Chart/BalanceChartRequest.php +++ b/app/Api/V2/Request/Chart/BalanceChartRequest.php @@ -84,7 +84,7 @@ class BalanceChartRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V2/Request/Chart/ChartRequest.php b/app/Api/V2/Request/Chart/ChartRequest.php index 4221166e8c..6ca32ea6e8 100644 --- a/app/Api/V2/Request/Chart/ChartRequest.php +++ b/app/Api/V2/Request/Chart/ChartRequest.php @@ -86,7 +86,7 @@ class ChartRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V2/Request/Chart/DashboardChartRequest.php b/app/Api/V2/Request/Chart/DashboardChartRequest.php index e3673eb2da..96f66e1095 100644 --- a/app/Api/V2/Request/Chart/DashboardChartRequest.php +++ b/app/Api/V2/Request/Chart/DashboardChartRequest.php @@ -83,7 +83,7 @@ class DashboardChartRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V2/Request/Model/Transaction/StoreRequest.php b/app/Api/V2/Request/Model/Transaction/StoreRequest.php index 542fc71f8b..4e95b69e9f 100644 --- a/app/Api/V2/Request/Model/Transaction/StoreRequest.php +++ b/app/Api/V2/Request/Model/Transaction/StoreRequest.php @@ -311,7 +311,7 @@ class StoreRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Api/V2/Request/Model/Transaction/UpdateRequest.php b/app/Api/V2/Request/Model/Transaction/UpdateRequest.php index ce5d6a95d3..c4d8140c79 100644 --- a/app/Api/V2/Request/Model/Transaction/UpdateRequest.php +++ b/app/Api/V2/Request/Model/Transaction/UpdateRequest.php @@ -64,6 +64,7 @@ class UpdateRequest extends Request * * @throws FireflyException */ + #[\Override] public function getAll(): array { app('log')->debug(sprintf('Now in %s', __METHOD__)); @@ -247,6 +248,7 @@ class UpdateRequest extends Request /** * The rules that the incoming request must be matched against. */ + #[\Override] public function rules(): array { app('log')->debug(sprintf('Now in %s', __METHOD__)); @@ -330,6 +332,7 @@ class UpdateRequest extends Request /** * Configure the validator instance. */ + #[\Override] public function withValidator(Validator $validator): void { app('log')->debug('Now in withValidator'); @@ -361,7 +364,7 @@ class UpdateRequest extends Request } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Console/Commands/Correction/CorrectsAmounts.php b/app/Console/Commands/Correction/CorrectsAmounts.php index e1b8520e76..3dc797dbb7 100644 --- a/app/Console/Commands/Correction/CorrectsAmounts.php +++ b/app/Console/Commands/Correction/CorrectsAmounts.php @@ -175,7 +175,7 @@ class CorrectsAmounts extends Command { try { $check = bccomp((string) $item->trigger_value, '0'); - } catch (\ValueError $e) { + } catch (\ValueError) { $this->friendlyError(sprintf('Rule #%d contained invalid %s-trigger "%s". The trigger has been removed, and the rule is disabled.', $item->rule_id, $item->trigger_type, $item->trigger_value)); $item->rule->active = false; $item->rule->save(); diff --git a/app/Console/Commands/Correction/CorrectsCurrencies.php b/app/Console/Commands/Correction/CorrectsCurrencies.php index 0f621fe5be..8d7623ea18 100644 --- a/app/Console/Commands/Correction/CorrectsCurrencies.php +++ b/app/Console/Commands/Correction/CorrectsCurrencies.php @@ -115,9 +115,7 @@ class CorrectsCurrencies extends Command $found = array_values( array_filter( $found, - static function (int $currencyId) { - return 0 !== $currencyId; - } + static fn(int $currencyId) => 0 !== $currencyId ) ); diff --git a/app/Console/Commands/Correction/CorrectsNativeAmounts.php b/app/Console/Commands/Correction/CorrectsNativeAmounts.php index abf952000f..5bfce8187e 100644 --- a/app/Console/Commands/Correction/CorrectsNativeAmounts.php +++ b/app/Console/Commands/Correction/CorrectsNativeAmounts.php @@ -128,9 +128,7 @@ class CorrectsNativeAmounts extends Command $repository->setUserGroup($userGroup); $set = $repository->getPiggyBanks(); $set = $set->filter( - static function (PiggyBank $piggyBank) use ($currency) { - return $currency->id !== $piggyBank->transaction_currency_id; - } + static fn(PiggyBank $piggyBank) => $currency->id !== $piggyBank->transaction_currency_id ); foreach ($set as $piggyBank) { $piggyBank->encrypted = false; diff --git a/app/Console/Commands/Correction/CorrectsTransactionTypes.php b/app/Console/Commands/Correction/CorrectsTransactionTypes.php index bb185d5d87..e88c0f7db8 100644 --- a/app/Console/Commands/Correction/CorrectsTransactionTypes.php +++ b/app/Console/Commands/Correction/CorrectsTransactionTypes.php @@ -115,9 +115,7 @@ class CorrectsTransactionTypes extends Command private function getSourceAccount(TransactionJournal $journal): Account { $collection = $journal->transactions->filter( - static function (Transaction $transaction) { - return $transaction->amount < 0; - } + static fn(Transaction $transaction) => $transaction->amount < 0 ); if (0 === $collection->count()) { throw new FireflyException(sprintf('300001: Journal #%d has no source transaction.', $journal->id)); @@ -144,9 +142,7 @@ class CorrectsTransactionTypes extends Command private function getDestinationAccount(TransactionJournal $journal): Account { $collection = $journal->transactions->filter( - static function (Transaction $transaction) { - return $transaction->amount > 0; - } + static fn(Transaction $transaction) => $transaction->amount > 0 ); if (0 === $collection->count()) { throw new FireflyException(sprintf('300004: Journal #%d has no destination transaction.', $journal->id)); diff --git a/app/Console/Commands/Upgrade/UpgradesToGroups.php b/app/Console/Commands/Upgrade/UpgradesToGroups.php index f294db33a8..07b92e00a4 100644 --- a/app/Console/Commands/Upgrade/UpgradesToGroups.php +++ b/app/Console/Commands/Upgrade/UpgradesToGroups.php @@ -179,9 +179,7 @@ class UpgradesToGroups extends Command private function getDestinationTransactions(TransactionJournal $journal): Collection { return $journal->transactions->filter( - static function (Transaction $transaction) { - return $transaction->amount > 0; - } + static fn(Transaction $transaction) => $transaction->amount > 0 ); } diff --git a/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php b/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php index eec9c08e44..a06b63a69e 100644 --- a/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php +++ b/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php @@ -46,12 +46,12 @@ class UpgradesTransferCurrencies extends Command private JournalCLIRepositoryInterface $cliRepos; private int $count; - private ?Account $destinationAccount; - private ?TransactionCurrency $destinationCurrency; - private ?Transaction $destinationTransaction; - private ?Account $sourceAccount; - private ?TransactionCurrency $sourceCurrency; - private ?Transaction $sourceTransaction; + private ?Account $destinationAccount = null; + private ?TransactionCurrency $destinationCurrency = null; + private ?Transaction $destinationTransaction = null; + private ?Account $sourceAccount = null; + private ?TransactionCurrency $sourceCurrency = null; + private ?Transaction $sourceTransaction = null; /** * Execute the console command. diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 8e2776a54e..e29ec31305 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -35,6 +35,7 @@ class Kernel extends ConsoleKernel /** * Register the commands for the application. */ + #[\Override] protected function commands(): void { $this->load(__DIR__.'/Commands'); @@ -45,6 +46,7 @@ class Kernel extends ConsoleKernel /** * Define the application's command schedule. */ + #[\Override] protected function schedule(Schedule $schedule): void { $schedule->call( diff --git a/app/Events/Admin/InvitationCreated.php b/app/Events/Admin/InvitationCreated.php index c057b35b06..7d6ae6af9c 100644 --- a/app/Events/Admin/InvitationCreated.php +++ b/app/Events/Admin/InvitationCreated.php @@ -36,15 +36,12 @@ class InvitationCreated extends Event { use SerializesModels; - public InvitedUser $invitee; - public TransactionGroup $transactionGroup; /** * Create a new event instance. */ - public function __construct(InvitedUser $invitee) + public function __construct(public InvitedUser $invitee) { - $this->invitee = $invitee; } } diff --git a/app/Events/DestroyedTransactionGroup.php b/app/Events/DestroyedTransactionGroup.php index 9911864c1e..f6692981f9 100644 --- a/app/Events/DestroyedTransactionGroup.php +++ b/app/Events/DestroyedTransactionGroup.php @@ -34,14 +34,11 @@ class DestroyedTransactionGroup extends Event { use SerializesModels; - public TransactionGroup $transactionGroup; - /** * Create a new event instance. */ - public function __construct(TransactionGroup $transactionGroup) + public function __construct(public TransactionGroup $transactionGroup) { app('log')->debug(sprintf('Now in %s', __METHOD__)); - $this->transactionGroup = $transactionGroup; } } diff --git a/app/Events/DestroyedTransactionLink.php b/app/Events/DestroyedTransactionLink.php index b32c677ddd..374f870465 100644 --- a/app/Events/DestroyedTransactionLink.php +++ b/app/Events/DestroyedTransactionLink.php @@ -32,15 +32,12 @@ use Illuminate\Queue\SerializesModels; */ class DestroyedTransactionLink extends Event { - use SerializesModels; - - private TransactionJournalLink $link; // @phpstan-ignore-line + use SerializesModels; // @phpstan-ignore-line /** * DestroyedTransactionLink constructor. */ - public function __construct(TransactionJournalLink $link) + public function __construct(private TransactionJournalLink $link) { - $this->link = $link; } } diff --git a/app/Events/DetectedNewIPAddress.php b/app/Events/DetectedNewIPAddress.php index a04d65cb7c..189c8a379d 100644 --- a/app/Events/DetectedNewIPAddress.php +++ b/app/Events/DetectedNewIPAddress.php @@ -34,13 +34,10 @@ class DetectedNewIPAddress extends Event { use SerializesModels; - public User $user; - /** * Create a new event instance. This event is triggered when a new user registers. */ - public function __construct(User $user) + public function __construct(public User $user) { - $this->user = $user; } } diff --git a/app/Events/Model/Account/Updated.php b/app/Events/Model/Account/Updated.php index 8f86723bd3..5edbde05d0 100644 --- a/app/Events/Model/Account/Updated.php +++ b/app/Events/Model/Account/Updated.php @@ -31,10 +31,7 @@ class Updated { use SerializesModels; - public Account $account; - - public function __construct(Account $account) + public function __construct(public Account $account) { - $this->account = $account; } } diff --git a/app/Events/Model/BudgetLimit/Created.php b/app/Events/Model/BudgetLimit/Created.php index 2600c41632..96158fe3f3 100644 --- a/app/Events/Model/BudgetLimit/Created.php +++ b/app/Events/Model/BudgetLimit/Created.php @@ -35,10 +35,7 @@ class Created extends Event { use SerializesModels; - public BudgetLimit $budgetLimit; - - public function __construct(BudgetLimit $budgetLimit) + public function __construct(public BudgetLimit $budgetLimit) { - $this->budgetLimit = $budgetLimit; } } diff --git a/app/Events/Model/BudgetLimit/Deleted.php b/app/Events/Model/BudgetLimit/Deleted.php index 06aab6e0ca..dd3f4c44e1 100644 --- a/app/Events/Model/BudgetLimit/Deleted.php +++ b/app/Events/Model/BudgetLimit/Deleted.php @@ -35,10 +35,7 @@ class Deleted extends Event { use SerializesModels; - public BudgetLimit $budgetLimit; - - public function __construct(BudgetLimit $budgetLimit) + public function __construct(public BudgetLimit $budgetLimit) { - $this->budgetLimit = $budgetLimit; } } diff --git a/app/Events/Model/BudgetLimit/Updated.php b/app/Events/Model/BudgetLimit/Updated.php index 6429635ea0..c043387013 100644 --- a/app/Events/Model/BudgetLimit/Updated.php +++ b/app/Events/Model/BudgetLimit/Updated.php @@ -35,10 +35,7 @@ class Updated extends Event { use SerializesModels; - public BudgetLimit $budgetLimit; - - public function __construct(BudgetLimit $budgetLimit) + public function __construct(public BudgetLimit $budgetLimit) { - $this->budgetLimit = $budgetLimit; } } diff --git a/app/Events/Model/PiggyBank/ChangedAmount.php b/app/Events/Model/PiggyBank/ChangedAmount.php index 9521641ab3..24bb9b36e9 100644 --- a/app/Events/Model/PiggyBank/ChangedAmount.php +++ b/app/Events/Model/PiggyBank/ChangedAmount.php @@ -39,18 +39,14 @@ class ChangedAmount extends Event public string $amount; public PiggyBank $piggyBank; - public ?TransactionGroup $transactionGroup; - public ?TransactionJournal $transactionJournal; /** * Create a new event instance. */ - public function __construct(PiggyBank $piggyBank, string $amount, ?TransactionJournal $transactionJournal, ?TransactionGroup $transactionGroup) + public function __construct(PiggyBank $piggyBank, string $amount, public ?TransactionJournal $transactionJournal, public ?TransactionGroup $transactionGroup) { app('log')->debug(sprintf('Created piggy bank event for piggy bank #%d with amount %s', $piggyBank->id, $amount)); $this->piggyBank = $piggyBank; - $this->transactionJournal = $transactionJournal; - $this->transactionGroup = $transactionGroup; $this->amount = $amount; } } diff --git a/app/Events/Model/Rule/RuleActionFailedOnArray.php b/app/Events/Model/Rule/RuleActionFailedOnArray.php index 8c6ca6aa9d..fc537cb430 100644 --- a/app/Events/Model/Rule/RuleActionFailedOnArray.php +++ b/app/Events/Model/Rule/RuleActionFailedOnArray.php @@ -34,15 +34,8 @@ class RuleActionFailedOnArray { use SerializesModels; - public string $error; - public array $journal; - public RuleAction $ruleAction; - - public function __construct(RuleAction $ruleAction, array $journal, string $error) + public function __construct(public RuleAction $ruleAction, public array $journal, public string $error) { app('log')->debug('Created new RuleActionFailedOnArray'); - $this->ruleAction = $ruleAction; - $this->journal = $journal; - $this->error = $error; } } diff --git a/app/Events/Model/Rule/RuleActionFailedOnObject.php b/app/Events/Model/Rule/RuleActionFailedOnObject.php index bfc14bd78d..bde5cacdec 100644 --- a/app/Events/Model/Rule/RuleActionFailedOnObject.php +++ b/app/Events/Model/Rule/RuleActionFailedOnObject.php @@ -35,15 +35,8 @@ class RuleActionFailedOnObject { use SerializesModels; - public string $error; - public TransactionJournal $journal; - public RuleAction $ruleAction; - - public function __construct(RuleAction $ruleAction, TransactionJournal $journal, string $error) + public function __construct(public RuleAction $ruleAction, public TransactionJournal $journal, public string $error) { app('log')->debug('Created new RuleActionFailedOnObject'); - $this->ruleAction = $ruleAction; - $this->journal = $journal; - $this->error = $error; } } diff --git a/app/Events/NewVersionAvailable.php b/app/Events/NewVersionAvailable.php index 5d08de0d71..64c93f01f4 100644 --- a/app/Events/NewVersionAvailable.php +++ b/app/Events/NewVersionAvailable.php @@ -34,14 +34,11 @@ class NewVersionAvailable extends Event { use SerializesModels; - public string $message; - /** * Create a new event instance. This event is triggered when a new version is available. */ - public function __construct(string $message) + public function __construct(public string $message) { Log::debug(__METHOD__); - $this->message = $message; } } diff --git a/app/Events/Preferences/UserGroupChangedDefaultCurrency.php b/app/Events/Preferences/UserGroupChangedDefaultCurrency.php index baa392f605..5eb709b3e2 100644 --- a/app/Events/Preferences/UserGroupChangedDefaultCurrency.php +++ b/app/Events/Preferences/UserGroupChangedDefaultCurrency.php @@ -33,11 +33,8 @@ class UserGroupChangedDefaultCurrency extends Event { use SerializesModels; - public UserGroup $userGroup; - - public function __construct(UserGroup $userGroup) + public function __construct(public UserGroup $userGroup) { Log::debug('User group changed default currency.'); - $this->userGroup = $userGroup; } } diff --git a/app/Events/RegisteredUser.php b/app/Events/RegisteredUser.php index 51539a856a..4dd01adc72 100644 --- a/app/Events/RegisteredUser.php +++ b/app/Events/RegisteredUser.php @@ -35,15 +35,10 @@ class RegisteredUser extends Event { use SerializesModels; - public OwnerNotifiable $owner; - public User $user; - /** * Create a new event instance. This event is triggered when a new user registers. */ - public function __construct(OwnerNotifiable $owner, User $user) + public function __construct(public OwnerNotifiable $owner, public User $user) { - $this->user = $user; - $this->owner = $owner; } } diff --git a/app/Events/RequestedReportOnJournals.php b/app/Events/RequestedReportOnJournals.php index 01ed141159..8805776832 100644 --- a/app/Events/RequestedReportOnJournals.php +++ b/app/Events/RequestedReportOnJournals.php @@ -39,17 +39,12 @@ class RequestedReportOnJournals use InteractsWithSockets; use SerializesModels; - public Collection $groups; - public int $userId; - /** * Create a new event instance. */ - public function __construct(int $userId, Collection $groups) + public function __construct(public int $userId, public Collection $groups) { app('log')->debug('In event RequestedReportOnJournals.'); - $this->userId = $userId; - $this->groups = $groups; } /** diff --git a/app/Events/RequestedVersionCheckStatus.php b/app/Events/RequestedVersionCheckStatus.php index 63b9f4f898..27e6bf24eb 100644 --- a/app/Events/RequestedVersionCheckStatus.php +++ b/app/Events/RequestedVersionCheckStatus.php @@ -34,14 +34,11 @@ class RequestedVersionCheckStatus extends Event { use SerializesModels; - public User $user; - /** * Create a new event instance. This event is triggered when Firefly III wants to know * what the deal is with the version checker. */ - public function __construct(User $user) + public function __construct(public User $user) { - $this->user = $user; } } diff --git a/app/Events/Security/MFABackupFewLeft.php b/app/Events/Security/MFABackupFewLeft.php index dd1129c7d3..141c6f1e69 100644 --- a/app/Events/Security/MFABackupFewLeft.php +++ b/app/Events/Security/MFABackupFewLeft.php @@ -32,15 +32,12 @@ use Illuminate\Queue\SerializesModels; class MFABackupFewLeft extends Event { use SerializesModels; - - public int $count; public User $user; - public function __construct(null|Authenticatable|User $user, int $count) + public function __construct(null|Authenticatable|User $user, public int $count) { if ($user instanceof User) { $this->user = $user; } - $this->count = $count; } } diff --git a/app/Events/Security/MFAManyFailedAttempts.php b/app/Events/Security/MFAManyFailedAttempts.php index 6363dc3a3d..0bbaf6ea08 100644 --- a/app/Events/Security/MFAManyFailedAttempts.php +++ b/app/Events/Security/MFAManyFailedAttempts.php @@ -32,15 +32,12 @@ use Illuminate\Queue\SerializesModels; class MFAManyFailedAttempts extends Event { use SerializesModels; - - public int $count; public User $user; - public function __construct(null|Authenticatable|User $user, int $count) + public function __construct(null|Authenticatable|User $user, public int $count) { if ($user instanceof User) { $this->user = $user; } - $this->count = $count; } } diff --git a/app/Events/Security/UnknownUserAttemptedLogin.php b/app/Events/Security/UnknownUserAttemptedLogin.php index 871b0b7316..641e26e06d 100644 --- a/app/Events/Security/UnknownUserAttemptedLogin.php +++ b/app/Events/Security/UnknownUserAttemptedLogin.php @@ -30,10 +30,7 @@ class UnknownUserAttemptedLogin { use SerializesModels; - public string $address; - - public function __construct(string $address) + public function __construct(public string $address) { - $this->address = $address; } } diff --git a/app/Events/StoredAccount.php b/app/Events/StoredAccount.php index 441afed64a..2c6e783660 100644 --- a/app/Events/StoredAccount.php +++ b/app/Events/StoredAccount.php @@ -34,13 +34,10 @@ class StoredAccount extends Event { use SerializesModels; - public Account $account; - /** * Create a new event instance. */ - public function __construct(Account $account) + public function __construct(public Account $account) { - $this->account = $account; } } diff --git a/app/Events/StoredTransactionGroup.php b/app/Events/StoredTransactionGroup.php index 268525635f..d7559d3741 100644 --- a/app/Events/StoredTransactionGroup.php +++ b/app/Events/StoredTransactionGroup.php @@ -34,17 +34,10 @@ class StoredTransactionGroup extends Event { use SerializesModels; - public bool $applyRules; - public bool $fireWebhooks; - public TransactionGroup $transactionGroup; - /** * Create a new event instance. */ - public function __construct(TransactionGroup $transactionGroup, bool $applyRules, bool $fireWebhooks) + public function __construct(public TransactionGroup $transactionGroup, public bool $applyRules, public bool $fireWebhooks) { - $this->transactionGroup = $transactionGroup; - $this->fireWebhooks = $fireWebhooks; - $this->applyRules = $applyRules; } } diff --git a/app/Events/Test/OwnerTestNotificationChannel.php b/app/Events/Test/OwnerTestNotificationChannel.php index c246520c2d..904076aac2 100644 --- a/app/Events/Test/OwnerTestNotificationChannel.php +++ b/app/Events/Test/OwnerTestNotificationChannel.php @@ -32,15 +32,13 @@ class OwnerTestNotificationChannel use SerializesModels; public string $channel; - public OwnerNotifiable $owner; /** * Create a new event instance. */ - public function __construct(string $channel, OwnerNotifiable $owner) + public function __construct(string $channel, public OwnerNotifiable $owner) { app('log')->debug(sprintf('Triggered OwnerTestNotificationChannel("%s")', $channel)); - $this->owner = $owner; $this->channel = $channel; } } diff --git a/app/Events/Test/UserTestNotificationChannel.php b/app/Events/Test/UserTestNotificationChannel.php index aff68cc409..4d028459d1 100644 --- a/app/Events/Test/UserTestNotificationChannel.php +++ b/app/Events/Test/UserTestNotificationChannel.php @@ -32,15 +32,13 @@ class UserTestNotificationChannel use SerializesModels; public string $channel; - public User $user; /** * Create a new event instance. */ - public function __construct(string $channel, User $user) + public function __construct(string $channel, public User $user) { app('log')->debug(sprintf('Triggered UserTestNotificationChannel("%s")', $channel)); - $this->user = $user; $this->channel = $channel; } } diff --git a/app/Events/TriggeredAuditLog.php b/app/Events/TriggeredAuditLog.php index 11febd18ff..eb758cd594 100644 --- a/app/Events/TriggeredAuditLog.php +++ b/app/Events/TriggeredAuditLog.php @@ -34,23 +34,12 @@ class TriggeredAuditLog extends Event { use SerializesModels; - public mixed $after; - public Model $auditable; - public mixed $before; - public Model $changer; - public string $field; - /** * Create a new event instance. * * @SuppressWarnings("PHPMD.ExcessiveParameterList") */ - public function __construct(Model $changer, Model $auditable, string $field, mixed $before, mixed $after) + public function __construct(public Model $changer, public Model $auditable, public string $field, public mixed $before, public mixed $after) { - $this->changer = $changer; - $this->auditable = $auditable; - $this->field = $field; - $this->before = $before; - $this->after = $after; } } diff --git a/app/Events/UpdatedAccount.php b/app/Events/UpdatedAccount.php index 3deceba692..c4a317c4a7 100644 --- a/app/Events/UpdatedAccount.php +++ b/app/Events/UpdatedAccount.php @@ -34,13 +34,10 @@ class UpdatedAccount extends Event { use SerializesModels; - public Account $account; - /** * Create a new event instance. */ - public function __construct(Account $account) + public function __construct(public Account $account) { - $this->account = $account; } } diff --git a/app/Events/UpdatedTransactionGroup.php b/app/Events/UpdatedTransactionGroup.php index 9827d81d06..c5d41e7860 100644 --- a/app/Events/UpdatedTransactionGroup.php +++ b/app/Events/UpdatedTransactionGroup.php @@ -34,17 +34,10 @@ class UpdatedTransactionGroup extends Event { use SerializesModels; - public bool $applyRules; - public bool $fireWebhooks; - public TransactionGroup $transactionGroup; - /** * Create a new event instance. */ - public function __construct(TransactionGroup $transactionGroup, bool $applyRules, bool $fireWebhooks) + public function __construct(public TransactionGroup $transactionGroup, public bool $applyRules, public bool $fireWebhooks) { - $this->transactionGroup = $transactionGroup; - $this->fireWebhooks = $fireWebhooks; - $this->applyRules = $applyRules; } } diff --git a/app/Events/UserChangedEmail.php b/app/Events/UserChangedEmail.php index 1d2e11fcf7..f69c5ed238 100644 --- a/app/Events/UserChangedEmail.php +++ b/app/Events/UserChangedEmail.php @@ -34,17 +34,10 @@ class UserChangedEmail extends Event { use SerializesModels; - public string $newEmail; - public string $oldEmail; - public User $user; - /** * UserChangedEmail constructor. */ - public function __construct(User $user, string $newEmail, string $oldEmail) + public function __construct(public User $user, public string $newEmail, public string $oldEmail) { - $this->user = $user; - $this->oldEmail = $oldEmail; - $this->newEmail = $newEmail; } } diff --git a/app/Events/WarnUserAboutBill.php b/app/Events/WarnUserAboutBill.php index 98b7d5c449..968d2f95d9 100644 --- a/app/Events/WarnUserAboutBill.php +++ b/app/Events/WarnUserAboutBill.php @@ -34,14 +34,7 @@ class WarnUserAboutBill extends Event { use SerializesModels; - public Bill $bill; - public int $diff; - public string $field; - - public function __construct(Bill $bill, string $field, int $diff) + public function __construct(public Bill $bill, public string $field, public int $diff) { - $this->bill = $bill; - $this->field = $field; - $this->diff = $diff; } } diff --git a/app/Exceptions/GracefulNotFoundHandler.php b/app/Exceptions/GracefulNotFoundHandler.php index 371add870f..46bef0b640 100644 --- a/app/Exceptions/GracefulNotFoundHandler.php +++ b/app/Exceptions/GracefulNotFoundHandler.php @@ -49,6 +49,7 @@ class GracefulNotFoundHandler extends ExceptionHandler * * @SuppressWarnings("PHPMD.CyclomaticComplexity") */ + #[\Override] public function render($request, \Throwable $e): Response { $route = $request->route(); diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 021d3513b9..b2cd742b2f 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -69,6 +69,7 @@ class Handler extends ExceptionHandler /** * Register the exception handling callbacks for the application. */ + #[\Override] public function register(): void {} /** @@ -82,6 +83,7 @@ class Handler extends ExceptionHandler * @SuppressWarnings("PHPMD.NPathComplexity") * @SuppressWarnings("PHPMD.CyclomaticComplexity") */ + #[\Override] public function render($request, \Throwable $e): Response { $expectsJson = $request->expectsJson(); @@ -149,12 +151,12 @@ class Handler extends ExceptionHandler $isDebug = (bool) config('app.debug', false); if ($isDebug) { - app('log')->debug(sprintf('Return JSON %s with debug.', get_class($e))); + app('log')->debug(sprintf('Return JSON %s with debug.', $e::class)); return response()->json( [ 'message' => $e->getMessage(), - 'exception' => get_class($e), + 'exception' => $e::class, 'line' => $e->getLine(), 'file' => $e->getFile(), 'trace' => $e->getTrace(), @@ -162,7 +164,7 @@ class Handler extends ExceptionHandler $errorCode ); } - app('log')->debug(sprintf('Return JSON %s.', get_class($e))); + app('log')->debug(sprintf('Return JSON %s.', $e::class)); return response()->json( ['message' => sprintf('Internal Firefly III Exception: %s', $e->getMessage()), 'exception' => 'UndisclosedException'], @@ -192,7 +194,7 @@ class Handler extends ExceptionHandler return response()->view('errors.FireflyException', ['exception' => $e, 'debug' => $isDebug], 500); } - app('log')->debug(sprintf('Error "%s" has no Firefly III treatment, parent will handle.', get_class($e))); + app('log')->debug(sprintf('Error "%s" has no Firefly III treatment, parent will handle.', $e::class)); return parent::render($request, $e); } @@ -202,6 +204,7 @@ class Handler extends ExceptionHandler * * @throws \Throwable */ + #[\Override] public function report(\Throwable $e): void { $doMailError = (bool) config('firefly.send_error_message'); @@ -222,7 +225,7 @@ class Handler extends ExceptionHandler $headers = request()->headers->all(); $data = [ - 'class' => get_class($e), + 'class' => $e::class, 'errorMessage' => $e->getMessage(), 'time' => \Safe\date('r'), 'stackTrace' => $e->getTraceAsString(), @@ -250,9 +253,7 @@ class Handler extends ExceptionHandler { return null !== Arr::first( $this->dontReport, - static function ($type) use ($e) { - return $e instanceof $type; - } + static fn($type) => $e instanceof $type ); } @@ -261,6 +262,7 @@ class Handler extends ExceptionHandler * * @param Request $request */ + #[\Override] protected function invalid($request, LaravelValidationException $exception): \Illuminate\Http\Response|JsonResponse|RedirectResponse { // protect against open redirect when submitting invalid forms. diff --git a/app/Factory/TransactionFactory.php b/app/Factory/TransactionFactory.php index 6fe9dbb539..83294e2045 100644 --- a/app/Factory/TransactionFactory.php +++ b/app/Factory/TransactionFactory.php @@ -41,7 +41,7 @@ class TransactionFactory private Account $account; private array $accountInformation; private TransactionCurrency $currency; - private ?TransactionCurrency $foreignCurrency; + private ?TransactionCurrency $foreignCurrency = null; private TransactionJournal $journal; private bool $reconciled; diff --git a/app/Factory/TransactionGroupFactory.php b/app/Factory/TransactionGroupFactory.php index 38eb4e095a..f28153f4e6 100644 --- a/app/Factory/TransactionGroupFactory.php +++ b/app/Factory/TransactionGroupFactory.php @@ -35,7 +35,7 @@ use FireflyIII\User; */ class TransactionGroupFactory { - private TransactionJournalFactory $journalFactory; + private readonly TransactionJournalFactory $journalFactory; private User $user; private UserGroup $userGroup; diff --git a/app/Generator/Report/Account/MultiYearReportGenerator.php b/app/Generator/Report/Account/MultiYearReportGenerator.php index 06619ce900..ff59598046 100644 --- a/app/Generator/Report/Account/MultiYearReportGenerator.php +++ b/app/Generator/Report/Account/MultiYearReportGenerator.php @@ -31,6 +31,7 @@ class MultiYearReportGenerator extends MonthReportGenerator /** * Returns the preferred period. */ + #[\Override] protected function preferredPeriod(): string { return 'year'; diff --git a/app/Generator/Report/Account/YearReportGenerator.php b/app/Generator/Report/Account/YearReportGenerator.php index e911928c85..4b39570840 100644 --- a/app/Generator/Report/Account/YearReportGenerator.php +++ b/app/Generator/Report/Account/YearReportGenerator.php @@ -31,6 +31,7 @@ class YearReportGenerator extends MonthReportGenerator /** * Returns the preferred period. */ + #[\Override] protected function preferredPeriod(): string { return 'month'; diff --git a/app/Generator/Webhook/StandardMessageGenerator.php b/app/Generator/Webhook/StandardMessageGenerator.php index 2d8770e99d..2f93fe2303 100644 --- a/app/Generator/Webhook/StandardMessageGenerator.php +++ b/app/Generator/Webhook/StandardMessageGenerator.php @@ -106,7 +106,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface */ private function generateMessage(Webhook $webhook, Model $model): void { - $class = get_class($model); + $class = $model::class; // Line is ignored because all of Firefly III's Models have an id property. app('log')->debug(sprintf('Now in generateMessage(#%d, %s#%d)', $webhook->id, $class, $model->id)); diff --git a/app/Handlers/Events/WebhookEventHandler.php b/app/Handlers/Events/WebhookEventHandler.php index bcab140724..679863e43c 100644 --- a/app/Handlers/Events/WebhookEventHandler.php +++ b/app/Handlers/Events/WebhookEventHandler.php @@ -42,9 +42,7 @@ class WebhookEventHandler $messages = WebhookMessage::where('webhook_messages.sent', false) ->get(['webhook_messages.*']) ->filter( - static function (WebhookMessage $message) { - return $message->webhookAttempts()->count() <= 2; - } + static fn(WebhookMessage $message) => $message->webhookAttempts()->count() <= 2 )->splice(0, 5) ; app('log')->debug(sprintf('Found %d webhook message(s) ready to be send.', $messages->count())); diff --git a/config/ide-helper.php b/config/ide-helper.php index 1ec85c18d8..1e110ae779 100644 --- a/config/ide-helper.php +++ b/config/ide-helper.php @@ -114,8 +114,8 @@ return [ */ 'extra' => [ - 'Eloquent' => ['Illuminate\Database\Eloquent\Builder', 'Illuminate\Database\Query\Builder'], - 'Session' => ['Illuminate\Session\Store'], + 'Eloquent' => [\Illuminate\Database\Eloquent\Builder::class, \Illuminate\Database\Query\Builder::class], + 'Session' => [\Illuminate\Session\Store::class], ], 'magic' => [ From e42107c03c07268cbeb5ff8bd204791abae00a4f Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 May 2025 13:04:33 +0200 Subject: [PATCH 23/87] Update more code. --- app/Support/Search/QueryParser/FieldNode.php | 7 +- .../Search/QueryParser/GdbotsQueryParser.php | 4 +- app/Support/Search/QueryParser/NodeGroup.php | 6 +- app/Support/Search/QueryParser/StringNode.php | 5 +- .../System/GeneratesInstallationId.php | 2 +- app/Support/Twig/AmountFormat.php | 2 + app/Support/Twig/General.php | 96 ++++--------------- app/Support/Twig/Rule.php | 13 ++- app/Support/Twig/TransactionGroupTwig.php | 1 + app/Support/Twig/Translation.php | 6 +- app/TransactionRules/Actions/AddTag.php | 5 +- .../Actions/AppendDescription.php | 5 +- .../Actions/AppendDescriptionToNotes.php | 5 +- app/TransactionRules/Actions/AppendNotes.php | 5 +- .../Actions/AppendNotesToDescription.php | 5 +- app/TransactionRules/Actions/ClearBudget.php | 5 +- .../Actions/ClearCategory.php | 5 +- app/TransactionRules/Actions/ClearNotes.php | 5 +- .../Actions/ConvertToDeposit.php | 5 +- .../Actions/ConvertToTransfer.php | 5 +- .../Actions/ConvertToWithdrawal.php | 5 +- .../Actions/DeleteTransaction.php | 5 +- app/TransactionRules/Actions/LinkToBill.php | 5 +- .../Actions/MoveDescriptionToNotes.php | 5 +- .../Actions/MoveNotesToDescription.php | 5 +- .../Actions/PrependDescription.php | 5 +- app/TransactionRules/Actions/PrependNotes.php | 5 +- .../Actions/RemoveAllTags.php | 5 +- app/TransactionRules/Actions/RemoveTag.php | 5 +- app/TransactionRules/Actions/SetAmount.php | 5 +- app/TransactionRules/Actions/SetBudget.php | 5 +- app/TransactionRules/Actions/SetCategory.php | 5 +- .../Actions/SetDescription.php | 5 +- .../Actions/SetDestinationAccount.php | 4 +- .../Actions/SetDestinationToCashAccount.php | 5 +- app/TransactionRules/Actions/SetNotes.php | 5 +- .../Actions/SetSourceAccount.php | 4 +- .../Actions/SetSourceToCashAccount.php | 5 +- .../Actions/SwitchAccounts.php | 5 +- .../Actions/UpdatePiggyBank.php | 5 +- .../Engine/SearchRuleEngine.php | 4 +- .../Expressions/ActionExpression.php | 12 +-- .../ActionExpressionLanguageProvider.php | 8 +- app/Transformers/AttachmentTransformer.php | 2 +- .../AvailableBudgetTransformer.php | 10 +- app/Transformers/BillTransformer.php | 8 +- app/Transformers/BudgetTransformer.php | 8 +- app/Transformers/CategoryTransformer.php | 8 +- .../PiggyBankEventTransformer.php | 4 +- app/Transformers/PiggyBankTransformer.php | 4 +- app/Transformers/RecurrenceTransformer.php | 10 +- app/Transformers/RuleTransformer.php | 2 +- .../TransactionGroupTransformer.php | 6 +- app/Transformers/V2/BillTransformer.php | 4 +- routes/channels.php | 4 +- 55 files changed, 106 insertions(+), 278 deletions(-) diff --git a/app/Support/Search/QueryParser/FieldNode.php b/app/Support/Search/QueryParser/FieldNode.php index a92be2a9f4..6faecc918f 100644 --- a/app/Support/Search/QueryParser/FieldNode.php +++ b/app/Support/Search/QueryParser/FieldNode.php @@ -30,13 +30,8 @@ namespace FireflyIII\Support\Search\QueryParser; */ class FieldNode extends Node { - private string $operator; - private string $value; - - public function __construct(string $operator, string $value, bool $prohibited = false) + public function __construct(private readonly string $operator, private readonly string $value, bool $prohibited = false) { - $this->operator = $operator; - $this->value = $value; $this->prohibited = $prohibited; } diff --git a/app/Support/Search/QueryParser/GdbotsQueryParser.php b/app/Support/Search/QueryParser/GdbotsQueryParser.php index 56dde78b20..a071c972fa 100644 --- a/app/Support/Search/QueryParser/GdbotsQueryParser.php +++ b/app/Support/Search/QueryParser/GdbotsQueryParser.php @@ -33,7 +33,7 @@ use Illuminate\Support\Facades\Log; class GdbotsQueryParser implements QueryParserInterface { - private BaseQueryParser $parser; + private readonly BaseQueryParser $parser; public function __construct() { @@ -98,7 +98,7 @@ class GdbotsQueryParser implements QueryParserInterface default: throw new FireflyException( - sprintf('Unsupported node type: %s', get_class($node)) + sprintf('Unsupported node type: %s', $node::class) ); } } diff --git a/app/Support/Search/QueryParser/NodeGroup.php b/app/Support/Search/QueryParser/NodeGroup.php index 8fcd2d7588..017a5a89c0 100644 --- a/app/Support/Search/QueryParser/NodeGroup.php +++ b/app/Support/Search/QueryParser/NodeGroup.php @@ -32,15 +32,11 @@ namespace FireflyIII\Support\Search\QueryParser; */ class NodeGroup extends Node { - /** @var Node[] */ - private array $nodes; - /** * @param Node[] $nodes */ - public function __construct(array $nodes, bool $prohibited = false) + public function __construct(private readonly array $nodes, bool $prohibited = false) { - $this->nodes = $nodes; $this->prohibited = $prohibited; } diff --git a/app/Support/Search/QueryParser/StringNode.php b/app/Support/Search/QueryParser/StringNode.php index 37d7bf5401..805334fbf1 100644 --- a/app/Support/Search/QueryParser/StringNode.php +++ b/app/Support/Search/QueryParser/StringNode.php @@ -30,11 +30,8 @@ namespace FireflyIII\Support\Search\QueryParser; */ class StringNode extends Node { - private string $value; - - public function __construct(string $value, bool $prohibited = false) + public function __construct(private readonly string $value, bool $prohibited = false) { - $this->value = $value; $this->prohibited = $prohibited; } diff --git a/app/Support/System/GeneratesInstallationId.php b/app/Support/System/GeneratesInstallationId.php index e3dde0e793..20cd0a303c 100644 --- a/app/Support/System/GeneratesInstallationId.php +++ b/app/Support/System/GeneratesInstallationId.php @@ -36,7 +36,7 @@ trait GeneratesInstallationId { try { $config = app('fireflyconfig')->get('installation_id'); - } catch (FireflyException $e) { + } catch (FireflyException) { app('log')->info('Could not create or generate installation ID. Do not continue.'); return; diff --git a/app/Support/Twig/AmountFormat.php b/app/Support/Twig/AmountFormat.php index 9a70e1da0f..7028a04a51 100644 --- a/app/Support/Twig/AmountFormat.php +++ b/app/Support/Twig/AmountFormat.php @@ -37,6 +37,7 @@ use Twig\TwigFunction; */ class AmountFormat extends AbstractExtension { + #[\Override] public function getFilters(): array { return [ @@ -71,6 +72,7 @@ class AmountFormat extends AbstractExtension ); } + #[\Override] public function getFunctions(): array { return [ diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index e0e4a8fdf3..8d3ac12203 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -43,6 +43,7 @@ use Twig\TwigFunction; */ class General extends AbstractExtension { + #[\Override] public function getFilters(): array { return [ @@ -74,7 +75,7 @@ class General extends AbstractExtension $default = Amount::getNativeCurrency(); $convertToNative = Amount::convertToNative(); $useNative = $convertToNative && $default->id !== $currency->id; - $currency = null === $currency ? $default : $currency; + $currency ??= $default; $strings = []; foreach ($info as $key => $balance) { if ('balance' === $key) { @@ -137,77 +138,15 @@ class General extends AbstractExtension { return new TwigFilter( 'mimeIcon', - static function (string $string): string { - switch ($string) { - default: - return 'fa-file-o'; - - case 'application/pdf': - return 'fa-file-pdf-o'; - - // image - case 'image/png': - case 'image/jpeg': - case 'image/svg+xml': - case 'image/heic': - case 'image/heic-sequence': - case 'application/vnd.oasis.opendocument.image': - return 'fa-file-image-o'; - - // MS word - case 'application/msword': - case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': - case 'application/vnd.openxmlformats-officedocument.wordprocessingml.template': - case 'application/x-iwork-pages-sffpages': - case 'application/vnd.sun.xml.writer': - case 'application/vnd.sun.xml.writer.template': - case 'application/vnd.sun.xml.writer.global': - case 'application/vnd.stardivision.writer': - case 'application/vnd.stardivision.writer-global': - case 'application/vnd.oasis.opendocument.text': - case 'application/vnd.oasis.opendocument.text-template': - case 'application/vnd.oasis.opendocument.text-web': - case 'application/vnd.oasis.opendocument.text-master': - return 'fa-file-word-o'; - - // MS excel - case 'application/vnd.ms-excel': - case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': - case 'application/vnd.openxmlformats-officedocument.spreadsheetml.template': - case 'application/vnd.sun.xml.calc': - case 'application/vnd.sun.xml.calc.template': - case 'application/vnd.stardivision.calc': - case 'application/vnd.oasis.opendocument.spreadsheet': - case 'application/vnd.oasis.opendocument.spreadsheet-template': - return 'fa-file-excel-o'; - - // MS powerpoint - case 'application/vnd.ms-powerpoint': - case 'application/vnd.openxmlformats-officedocument.presentationml.presentation': - case 'application/vnd.openxmlformats-officedocument.presentationml.template': - case 'application/vnd.openxmlformats-officedocument.presentationml.slideshow': - case 'application/vnd.sun.xml.impress': - case 'application/vnd.sun.xml.impress.template': - case 'application/vnd.stardivision.impress': - case 'application/vnd.oasis.opendocument.presentation': - case 'application/vnd.oasis.opendocument.presentation-template': - return 'fa-file-powerpoint-o'; - - // calc - case 'application/vnd.sun.xml.draw': - case 'application/vnd.sun.xml.draw.template': - case 'application/vnd.stardivision.draw': - case 'application/vnd.oasis.opendocument.chart': - return 'fa-paint-brush'; - - case 'application/vnd.oasis.opendocument.graphics': - case 'application/vnd.oasis.opendocument.graphics-template': - case 'application/vnd.sun.xml.math': - case 'application/vnd.stardivision.math': - case 'application/vnd.oasis.opendocument.formula': - case 'application/vnd.oasis.opendocument.database': - return 'fa-calculator'; - } + static fn(string $string): string => match ($string) { + 'application/pdf' => 'fa-file-pdf-o', + 'image/png', 'image/jpeg', 'image/svg+xml', 'image/heic', 'image/heic-sequence', 'application/vnd.oasis.opendocument.image' => 'fa-file-image-o', + 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'application/x-iwork-pages-sffpages', 'application/vnd.sun.xml.writer', 'application/vnd.sun.xml.writer.template', 'application/vnd.sun.xml.writer.global', 'application/vnd.stardivision.writer', 'application/vnd.stardivision.writer-global', 'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.text-template', 'application/vnd.oasis.opendocument.text-web', 'application/vnd.oasis.opendocument.text-master' => 'fa-file-word-o', + 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'application/vnd.sun.xml.calc', 'application/vnd.sun.xml.calc.template', 'application/vnd.stardivision.calc', 'application/vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.spreadsheet-template' => 'fa-file-excel-o', + 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.openxmlformats-officedocument.presentationml.template', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'application/vnd.sun.xml.impress', 'application/vnd.sun.xml.impress.template', 'application/vnd.stardivision.impress', 'application/vnd.oasis.opendocument.presentation', 'application/vnd.oasis.opendocument.presentation-template' => 'fa-file-powerpoint-o', + 'application/vnd.sun.xml.draw', 'application/vnd.sun.xml.draw.template', 'application/vnd.stardivision.draw', 'application/vnd.oasis.opendocument.chart' => 'fa-paint-brush', + 'application/vnd.oasis.opendocument.graphics', 'application/vnd.oasis.opendocument.graphics-template', 'application/vnd.sun.xml.math', 'application/vnd.stardivision.math', 'application/vnd.oasis.opendocument.formula', 'application/vnd.oasis.opendocument.database' => 'fa-calculator', + default => 'fa-file-o', }, ['is_safe' => ['html']] ); @@ -248,6 +187,7 @@ class General extends AbstractExtension ); } + #[\Override] public function getFunctions(): array { return [ @@ -271,9 +211,7 @@ class General extends AbstractExtension { return new TwigFunction( 'phpdate', - static function (string $str): string { - return \Safe\date($str); - } + static fn(string $str): string => \Safe\date($str) ); } @@ -333,8 +271,8 @@ class General extends AbstractExtension if ($objectType === $activeObjectType && false !== stripos( - \Route::getCurrentRoute()->getName(), - $route + (string) \Route::getCurrentRoute()->getName(), + (string) $route )) { return 'active'; } @@ -435,9 +373,7 @@ class General extends AbstractExtension { return new TwigFunction( 'carbonize', - static function (string $date): Carbon { - return new Carbon($date, config('app.timezone')); - } + static fn(string $date): Carbon => new Carbon($date, config('app.timezone')) ); } } diff --git a/app/Support/Twig/Rule.php b/app/Support/Twig/Rule.php index 42ef0f6ff9..1bc13eb461 100644 --- a/app/Support/Twig/Rule.php +++ b/app/Support/Twig/Rule.php @@ -31,6 +31,7 @@ use Twig\TwigFunction; */ class Rule extends AbstractExtension { + #[\Override] public function getFunctions(): array { return [ @@ -44,13 +45,11 @@ class Rule extends AbstractExtension { return new TwigFunction( 'allJournalTriggers', - static function () { - return [ - 'store-journal' => (string) trans('firefly.rule_trigger_store_journal'), - 'update-journal' => (string) trans('firefly.rule_trigger_update_journal'), - 'manual-activation' => (string) trans('firefly.rule_trigger_manual'), - ]; - } + static fn() => [ + 'store-journal' => (string) trans('firefly.rule_trigger_store_journal'), + 'update-journal' => (string) trans('firefly.rule_trigger_update_journal'), + 'manual-activation' => (string) trans('firefly.rule_trigger_manual'), + ] ); } diff --git a/app/Support/Twig/TransactionGroupTwig.php b/app/Support/Twig/TransactionGroupTwig.php index b3df2e485a..bc338d4b22 100644 --- a/app/Support/Twig/TransactionGroupTwig.php +++ b/app/Support/Twig/TransactionGroupTwig.php @@ -39,6 +39,7 @@ use Twig\TwigFunction; */ class TransactionGroupTwig extends AbstractExtension { + #[\Override] public function getFunctions(): array { return [ diff --git a/app/Support/Twig/Translation.php b/app/Support/Twig/Translation.php index 706dd74221..78781936ca 100644 --- a/app/Support/Twig/Translation.php +++ b/app/Support/Twig/Translation.php @@ -32,19 +32,19 @@ use Twig\TwigFunction; */ class Translation extends AbstractExtension { + #[\Override] public function getFilters(): array { return [ new TwigFilter( '_', - static function ($name) { - return (string) trans(sprintf('firefly.%s', $name)); - }, + static fn($name) => (string) trans(sprintf('firefly.%s', $name)), ['is_safe' => ['html']] ), ]; } + #[\Override] public function getFunctions(): array { return [ diff --git a/app/TransactionRules/Actions/AddTag.php b/app/TransactionRules/Actions/AddTag.php index 42330e2655..a7fa14473a 100644 --- a/app/TransactionRules/Actions/AddTag.php +++ b/app/TransactionRules/Actions/AddTag.php @@ -36,14 +36,11 @@ use Illuminate\Support\Facades\DB; */ class AddTag implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/AppendDescription.php b/app/TransactionRules/Actions/AppendDescription.php index fba8df1a58..120ddc591c 100644 --- a/app/TransactionRules/Actions/AppendDescription.php +++ b/app/TransactionRules/Actions/AppendDescription.php @@ -37,14 +37,11 @@ class AppendDescription implements ActionInterface { use RefreshNotesTrait; - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/AppendDescriptionToNotes.php b/app/TransactionRules/Actions/AppendDescriptionToNotes.php index 5ca9f9214f..47ecc75a78 100644 --- a/app/TransactionRules/Actions/AppendDescriptionToNotes.php +++ b/app/TransactionRules/Actions/AppendDescriptionToNotes.php @@ -39,14 +39,11 @@ class AppendDescriptionToNotes implements ActionInterface { use RefreshNotesTrait; - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/AppendNotes.php b/app/TransactionRules/Actions/AppendNotes.php index c3f06b8ada..d5d1737a05 100644 --- a/app/TransactionRules/Actions/AppendNotes.php +++ b/app/TransactionRules/Actions/AppendNotes.php @@ -37,14 +37,11 @@ class AppendNotes implements ActionInterface { use RefreshNotesTrait; - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/AppendNotesToDescription.php b/app/TransactionRules/Actions/AppendNotesToDescription.php index 5d8c4584fb..441b63878a 100644 --- a/app/TransactionRules/Actions/AppendNotesToDescription.php +++ b/app/TransactionRules/Actions/AppendNotesToDescription.php @@ -41,14 +41,11 @@ class AppendNotesToDescription implements ActionInterface use ConvertsDataTypes; use RefreshNotesTrait; - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/ClearBudget.php b/app/TransactionRules/Actions/ClearBudget.php index 06275d4bc8..8b227d8252 100644 --- a/app/TransactionRules/Actions/ClearBudget.php +++ b/app/TransactionRules/Actions/ClearBudget.php @@ -34,14 +34,11 @@ use Illuminate\Support\Facades\DB; */ class ClearBudget implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/ClearCategory.php b/app/TransactionRules/Actions/ClearCategory.php index 4831064c9b..bd0e206ef0 100644 --- a/app/TransactionRules/Actions/ClearCategory.php +++ b/app/TransactionRules/Actions/ClearCategory.php @@ -34,14 +34,11 @@ use Illuminate\Support\Facades\DB; */ class ClearCategory implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/ClearNotes.php b/app/TransactionRules/Actions/ClearNotes.php index 0aa0d693df..0ceeb84128 100644 --- a/app/TransactionRules/Actions/ClearNotes.php +++ b/app/TransactionRules/Actions/ClearNotes.php @@ -35,14 +35,11 @@ use Illuminate\Support\Facades\DB; */ class ClearNotes implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/ConvertToDeposit.php b/app/TransactionRules/Actions/ConvertToDeposit.php index d7aa0dfeb0..221aa4dac4 100644 --- a/app/TransactionRules/Actions/ConvertToDeposit.php +++ b/app/TransactionRules/Actions/ConvertToDeposit.php @@ -43,14 +43,11 @@ use Illuminate\Support\Facades\DB; */ class ConvertToDeposit implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/ConvertToTransfer.php b/app/TransactionRules/Actions/ConvertToTransfer.php index a2f6e69317..1b49d0ea20 100644 --- a/app/TransactionRules/Actions/ConvertToTransfer.php +++ b/app/TransactionRules/Actions/ConvertToTransfer.php @@ -42,14 +42,11 @@ use Illuminate\Support\Facades\DB; */ class ConvertToTransfer implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } /** diff --git a/app/TransactionRules/Actions/ConvertToWithdrawal.php b/app/TransactionRules/Actions/ConvertToWithdrawal.php index 05ded624b6..adcf28b6d1 100644 --- a/app/TransactionRules/Actions/ConvertToWithdrawal.php +++ b/app/TransactionRules/Actions/ConvertToWithdrawal.php @@ -43,14 +43,11 @@ use Illuminate\Support\Facades\DB; */ class ConvertToWithdrawal implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/DeleteTransaction.php b/app/TransactionRules/Actions/DeleteTransaction.php index 5863422fa3..ed6d8efbda 100644 --- a/app/TransactionRules/Actions/DeleteTransaction.php +++ b/app/TransactionRules/Actions/DeleteTransaction.php @@ -35,14 +35,11 @@ use FireflyIII\Services\Internal\Destroy\TransactionGroupDestroyService; */ class DeleteTransaction implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/LinkToBill.php b/app/TransactionRules/Actions/LinkToBill.php index 3e114846ac..3266d31a6a 100644 --- a/app/TransactionRules/Actions/LinkToBill.php +++ b/app/TransactionRules/Actions/LinkToBill.php @@ -37,14 +37,11 @@ use Illuminate\Support\Facades\DB; */ class LinkToBill implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/MoveDescriptionToNotes.php b/app/TransactionRules/Actions/MoveDescriptionToNotes.php index 6dae68c34d..4da820269b 100644 --- a/app/TransactionRules/Actions/MoveDescriptionToNotes.php +++ b/app/TransactionRules/Actions/MoveDescriptionToNotes.php @@ -36,14 +36,11 @@ use FireflyIII\Models\TransactionJournal; */ class MoveDescriptionToNotes implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/MoveNotesToDescription.php b/app/TransactionRules/Actions/MoveNotesToDescription.php index 108d3ce499..0732fb2fe2 100644 --- a/app/TransactionRules/Actions/MoveNotesToDescription.php +++ b/app/TransactionRules/Actions/MoveNotesToDescription.php @@ -42,14 +42,11 @@ class MoveNotesToDescription implements ActionInterface { use ConvertsDataTypes; - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/PrependDescription.php b/app/TransactionRules/Actions/PrependDescription.php index 8e409b0ee3..9dba455757 100644 --- a/app/TransactionRules/Actions/PrependDescription.php +++ b/app/TransactionRules/Actions/PrependDescription.php @@ -34,14 +34,11 @@ use Illuminate\Support\Facades\DB; */ class PrependDescription implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/PrependNotes.php b/app/TransactionRules/Actions/PrependNotes.php index 12cdacf466..b59230e02a 100644 --- a/app/TransactionRules/Actions/PrependNotes.php +++ b/app/TransactionRules/Actions/PrependNotes.php @@ -34,14 +34,11 @@ use FireflyIII\Models\TransactionJournal; */ class PrependNotes implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/RemoveAllTags.php b/app/TransactionRules/Actions/RemoveAllTags.php index e53a11404f..40a032354a 100644 --- a/app/TransactionRules/Actions/RemoveAllTags.php +++ b/app/TransactionRules/Actions/RemoveAllTags.php @@ -34,14 +34,11 @@ use Illuminate\Support\Facades\DB; */ class RemoveAllTags implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/RemoveTag.php b/app/TransactionRules/Actions/RemoveTag.php index 451ed252d0..528a786d29 100644 --- a/app/TransactionRules/Actions/RemoveTag.php +++ b/app/TransactionRules/Actions/RemoveTag.php @@ -35,14 +35,11 @@ use Illuminate\Support\Facades\DB; */ class RemoveTag implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/SetAmount.php b/app/TransactionRules/Actions/SetAmount.php index d08a2f78f4..db36221472 100644 --- a/app/TransactionRules/Actions/SetAmount.php +++ b/app/TransactionRules/Actions/SetAmount.php @@ -35,14 +35,11 @@ class SetAmount implements ActionInterface { use RefreshNotesTrait; - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/SetBudget.php b/app/TransactionRules/Actions/SetBudget.php index cd80f7872b..74b7640a8e 100644 --- a/app/TransactionRules/Actions/SetBudget.php +++ b/app/TransactionRules/Actions/SetBudget.php @@ -36,14 +36,11 @@ use Illuminate\Support\Facades\DB; */ class SetBudget implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/SetCategory.php b/app/TransactionRules/Actions/SetCategory.php index 9f9321a928..b6f8e5b2d5 100644 --- a/app/TransactionRules/Actions/SetCategory.php +++ b/app/TransactionRules/Actions/SetCategory.php @@ -36,14 +36,11 @@ use Illuminate\Support\Facades\DB; */ class SetCategory implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/SetDescription.php b/app/TransactionRules/Actions/SetDescription.php index 805dcd96f0..8897eb0cb1 100644 --- a/app/TransactionRules/Actions/SetDescription.php +++ b/app/TransactionRules/Actions/SetDescription.php @@ -36,14 +36,11 @@ class SetDescription implements ActionInterface { use RefreshNotesTrait; - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/SetDestinationAccount.php b/app/TransactionRules/Actions/SetDestinationAccount.php index 810dcbaa3b..6dc903564e 100644 --- a/app/TransactionRules/Actions/SetDestinationAccount.php +++ b/app/TransactionRules/Actions/SetDestinationAccount.php @@ -39,15 +39,13 @@ use Illuminate\Support\Facades\DB; */ class SetDestinationAccount implements ActionInterface { - private RuleAction $action; private AccountRepositoryInterface $repository; /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/SetDestinationToCashAccount.php b/app/TransactionRules/Actions/SetDestinationToCashAccount.php index fe88ddc06e..350a097b67 100644 --- a/app/TransactionRules/Actions/SetDestinationToCashAccount.php +++ b/app/TransactionRules/Actions/SetDestinationToCashAccount.php @@ -39,14 +39,11 @@ use Illuminate\Support\Facades\DB; */ class SetDestinationToCashAccount implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/SetNotes.php b/app/TransactionRules/Actions/SetNotes.php index e8e3e92f2c..4962649241 100644 --- a/app/TransactionRules/Actions/SetNotes.php +++ b/app/TransactionRules/Actions/SetNotes.php @@ -33,14 +33,11 @@ use FireflyIII\Models\TransactionJournal; */ class SetNotes implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/SetSourceAccount.php b/app/TransactionRules/Actions/SetSourceAccount.php index 2c656a815b..e2f9420b2d 100644 --- a/app/TransactionRules/Actions/SetSourceAccount.php +++ b/app/TransactionRules/Actions/SetSourceAccount.php @@ -39,15 +39,13 @@ use Illuminate\Support\Facades\DB; */ class SetSourceAccount implements ActionInterface { - private RuleAction $action; private AccountRepositoryInterface $repository; /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/SetSourceToCashAccount.php b/app/TransactionRules/Actions/SetSourceToCashAccount.php index af618b44a8..ebc8525005 100644 --- a/app/TransactionRules/Actions/SetSourceToCashAccount.php +++ b/app/TransactionRules/Actions/SetSourceToCashAccount.php @@ -39,14 +39,11 @@ use Illuminate\Support\Facades\DB; */ class SetSourceToCashAccount implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/SwitchAccounts.php b/app/TransactionRules/Actions/SwitchAccounts.php index 585a934281..7cd0579948 100644 --- a/app/TransactionRules/Actions/SwitchAccounts.php +++ b/app/TransactionRules/Actions/SwitchAccounts.php @@ -36,14 +36,11 @@ use FireflyIII\Models\TransactionJournal; */ class SwitchAccounts implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Actions/UpdatePiggyBank.php b/app/TransactionRules/Actions/UpdatePiggyBank.php index 4a4f00f35d..d0dc413a30 100644 --- a/app/TransactionRules/Actions/UpdatePiggyBank.php +++ b/app/TransactionRules/Actions/UpdatePiggyBank.php @@ -37,14 +37,11 @@ use Illuminate\Support\Facades\Log; class UpdatePiggyBank implements ActionInterface { - private RuleAction $action; - /** * TriggerInterface constructor. */ - public function __construct(RuleAction $action) + public function __construct(private readonly RuleAction $action) { - $this->action = $action; } public function actOnArray(array $journal): bool diff --git a/app/TransactionRules/Engine/SearchRuleEngine.php b/app/TransactionRules/Engine/SearchRuleEngine.php index fac43b1d59..fc5b1749d6 100644 --- a/app/TransactionRules/Engine/SearchRuleEngine.php +++ b/app/TransactionRules/Engine/SearchRuleEngine.php @@ -44,11 +44,11 @@ use Illuminate\Support\Facades\Log; */ class SearchRuleEngine implements RuleEngineInterface { - private Collection $groups; + private readonly Collection $groups; private array $operators; private bool $refreshTriggers; private array $resultCount; - private Collection $rules; + private readonly Collection $rules; private User $user; public function __construct() diff --git a/app/TransactionRules/Expressions/ActionExpression.php b/app/TransactionRules/Expressions/ActionExpression.php index fbabc1a3eb..97970c2634 100644 --- a/app/TransactionRules/Expressions/ActionExpression.php +++ b/app/TransactionRules/Expressions/ActionExpression.php @@ -82,17 +82,15 @@ class ActionExpression // 'destination_transaction_id', 'notes', ]; - private string $expr; - private ExpressionLanguage $expressionLanguage; - private bool $isExpression; - private ?SyntaxError $validationError; + private readonly ExpressionLanguage $expressionLanguage; + private readonly bool $isExpression; + private readonly ?SyntaxError $validationError; - public function __construct(string $expr) + public function __construct(private readonly string $expr) { $this->expressionLanguage = app(ExpressionLanguage::class); - $this->expr = $expr; - $this->isExpression = self::isExpression($expr); + $this->isExpression = self::isExpression($this->expr); $this->validationError = $this->validate(); } diff --git a/app/TransactionRules/Expressions/ActionExpressionLanguageProvider.php b/app/TransactionRules/Expressions/ActionExpressionLanguageProvider.php index b80a0eaf50..f215c6097f 100644 --- a/app/TransactionRules/Expressions/ActionExpressionLanguageProvider.php +++ b/app/TransactionRules/Expressions/ActionExpressionLanguageProvider.php @@ -45,16 +45,12 @@ class ActionExpressionLanguageProvider implements ExpressionFunctionProviderInte return [ new ExpressionFunction( 'constant2', - static function ($str): string { - return sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!'); - }, + static fn($str): string => sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!'), $function ), new ExpressionFunction( 'constant', - static function ($str): string { - return sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!'); - }, + static fn($str): string => sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!'), $function ), diff --git a/app/Transformers/AttachmentTransformer.php b/app/Transformers/AttachmentTransformer.php index 4bafc977a1..a0a2fa8670 100644 --- a/app/Transformers/AttachmentTransformer.php +++ b/app/Transformers/AttachmentTransformer.php @@ -32,7 +32,7 @@ use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface; */ class AttachmentTransformer extends AbstractTransformer { - private AttachmentRepositoryInterface $repository; + private readonly AttachmentRepositoryInterface $repository; /** * BillTransformer constructor. diff --git a/app/Transformers/AvailableBudgetTransformer.php b/app/Transformers/AvailableBudgetTransformer.php index 6d8881482e..100138acee 100644 --- a/app/Transformers/AvailableBudgetTransformer.php +++ b/app/Transformers/AvailableBudgetTransformer.php @@ -36,11 +36,11 @@ use FireflyIII\Support\Facades\Amount; */ class AvailableBudgetTransformer extends AbstractTransformer { - private NoBudgetRepositoryInterface $noBudgetRepository; - private OperationsRepositoryInterface $opsRepository; - private BudgetRepositoryInterface $repository; - private TransactionCurrency $default; - private bool $convertToNative; + private readonly NoBudgetRepositoryInterface $noBudgetRepository; + private readonly OperationsRepositoryInterface $opsRepository; + private readonly BudgetRepositoryInterface $repository; + private readonly TransactionCurrency $default; + private readonly bool $convertToNative; /** * CurrencyTransformer constructor. diff --git a/app/Transformers/BillTransformer.php b/app/Transformers/BillTransformer.php index b19fd5615f..e793bc015e 100644 --- a/app/Transformers/BillTransformer.php +++ b/app/Transformers/BillTransformer.php @@ -40,10 +40,10 @@ use Illuminate\Support\Collection; */ class BillTransformer extends AbstractTransformer { - private BillDateCalculator $calculator; - private BillRepositoryInterface $repository; - private TransactionCurrency $default; - private bool $convertToNative; + private readonly BillDateCalculator $calculator; + private readonly BillRepositoryInterface $repository; + private readonly TransactionCurrency $default; + private readonly bool $convertToNative; /** * BillTransformer constructor. diff --git a/app/Transformers/BudgetTransformer.php b/app/Transformers/BudgetTransformer.php index 504520916e..9dac0351bf 100644 --- a/app/Transformers/BudgetTransformer.php +++ b/app/Transformers/BudgetTransformer.php @@ -38,10 +38,10 @@ use Symfony\Component\HttpFoundation\ParameterBag; */ class BudgetTransformer extends AbstractTransformer { - private OperationsRepositoryInterface $opsRepository; - private BudgetRepositoryInterface $repository; - private bool $convertToNative; - private TransactionCurrency $default; + private readonly OperationsRepositoryInterface $opsRepository; + private readonly BudgetRepositoryInterface $repository; + private readonly bool $convertToNative; + private readonly TransactionCurrency $default; /** * BudgetTransformer constructor. diff --git a/app/Transformers/CategoryTransformer.php b/app/Transformers/CategoryTransformer.php index c60d80a3da..90ee854fcb 100644 --- a/app/Transformers/CategoryTransformer.php +++ b/app/Transformers/CategoryTransformer.php @@ -36,10 +36,10 @@ use Illuminate\Support\Collection; */ class CategoryTransformer extends AbstractTransformer { - private OperationsRepositoryInterface $opsRepository; - private CategoryRepositoryInterface $repository; - private TransactionCurrency $default; - private bool $convertToNative; + private readonly OperationsRepositoryInterface $opsRepository; + private readonly CategoryRepositoryInterface $repository; + private readonly TransactionCurrency $default; + private readonly bool $convertToNative; /** * CategoryTransformer constructor. diff --git a/app/Transformers/PiggyBankEventTransformer.php b/app/Transformers/PiggyBankEventTransformer.php index df89869f36..a125415676 100644 --- a/app/Transformers/PiggyBankEventTransformer.php +++ b/app/Transformers/PiggyBankEventTransformer.php @@ -34,8 +34,8 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; */ class PiggyBankEventTransformer extends AbstractTransformer { - private PiggyBankRepositoryInterface $piggyRepos; - private AccountRepositoryInterface $repository; + private readonly PiggyBankRepositoryInterface $piggyRepos; + private readonly AccountRepositoryInterface $repository; /** * PiggyBankEventTransformer constructor. diff --git a/app/Transformers/PiggyBankTransformer.php b/app/Transformers/PiggyBankTransformer.php index a8c0c3d19d..924ccbe43f 100644 --- a/app/Transformers/PiggyBankTransformer.php +++ b/app/Transformers/PiggyBankTransformer.php @@ -35,8 +35,8 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; */ class PiggyBankTransformer extends AbstractTransformer { - private AccountRepositoryInterface $accountRepos; - private PiggyBankRepositoryInterface $piggyRepos; + private readonly AccountRepositoryInterface $accountRepos; + private readonly PiggyBankRepositoryInterface $piggyRepos; /** * PiggyBankTransformer constructor. diff --git a/app/Transformers/RecurrenceTransformer.php b/app/Transformers/RecurrenceTransformer.php index 2bf862a7aa..5abe8b2615 100644 --- a/app/Transformers/RecurrenceTransformer.php +++ b/app/Transformers/RecurrenceTransformer.php @@ -42,11 +42,11 @@ use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface; */ class RecurrenceTransformer extends AbstractTransformer { - private BillRepositoryInterface $billRepos; - private BudgetRepositoryInterface $budgetRepos; - private CategoryFactory $factory; - private PiggyBankRepositoryInterface $piggyRepos; - private RecurringRepositoryInterface $repository; + private readonly BillRepositoryInterface $billRepos; + private readonly BudgetRepositoryInterface $budgetRepos; + private readonly CategoryFactory $factory; + private readonly PiggyBankRepositoryInterface $piggyRepos; + private readonly RecurringRepositoryInterface $repository; /** * RecurrenceTransformer constructor. diff --git a/app/Transformers/RuleTransformer.php b/app/Transformers/RuleTransformer.php index 313521ce50..8e58a519cb 100644 --- a/app/Transformers/RuleTransformer.php +++ b/app/Transformers/RuleTransformer.php @@ -35,7 +35,7 @@ use FireflyIII\Repositories\Rule\RuleRepositoryInterface; */ class RuleTransformer extends AbstractTransformer { - private RuleRepositoryInterface $ruleRepository; + private readonly RuleRepositoryInterface $ruleRepository; /** * CurrencyTransformer constructor. diff --git a/app/Transformers/TransactionGroupTransformer.php b/app/Transformers/TransactionGroupTransformer.php index d670901ada..e8239ac828 100644 --- a/app/Transformers/TransactionGroupTransformer.php +++ b/app/Transformers/TransactionGroupTransformer.php @@ -44,9 +44,9 @@ use Illuminate\Support\Facades\Log; */ class TransactionGroupTransformer extends AbstractTransformer { - private TransactionGroupRepositoryInterface $groupRepos; - private array $metaDateFields; - private array $metaFields; + private readonly TransactionGroupRepositoryInterface $groupRepos; + private readonly array $metaDateFields; + private readonly array $metaFields; /** * Constructor. diff --git a/app/Transformers/V2/BillTransformer.php b/app/Transformers/V2/BillTransformer.php index e0a63cf4f2..b19da5f420 100644 --- a/app/Transformers/V2/BillTransformer.php +++ b/app/Transformers/V2/BillTransformer.php @@ -325,9 +325,7 @@ class BillTransformer extends AbstractTransformer } } $simple = $set->map( // @phpstan-ignore-line - static function (Carbon $date) { - return $date->toAtomString(); - } + static fn(Carbon $date) => $date->toAtomString() ); return $simple->toArray(); diff --git a/routes/channels.php b/routes/channels.php index e67e782c51..8fee79356b 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -35,7 +35,5 @@ declare(strict_types=1); Broadcast::channel( 'App.User.{id}', - static function ($user, $id) { - return (int)$user->id === (int)$id; - } + static fn($user, $id) => (int)$user->id === (int)$id ); From 51e86448c7c60ab0633c4fa69b6b6b2894605e79 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 May 2025 13:47:00 +0200 Subject: [PATCH 24/87] More PHP8.4 updates --- app/Helpers/Attachments/AttachmentHelper.php | 4 +- app/Helpers/Report/NetWorth.php | 12 ++--- .../Webhook/Sha3SignatureGenerator.php | 2 +- .../Controllers/Account/EditController.php | 8 +-- .../Controllers/Account/IndexController.php | 2 +- .../Auth/ForgotPasswordController.php | 2 +- app/Http/Controllers/Auth/LoginController.php | 4 +- .../Controllers/Auth/RegisterController.php | 4 +- app/Http/Controllers/Bill/IndexController.php | 4 +- app/Http/Controllers/Bill/ShowController.php | 4 +- .../Budget/BudgetLimitController.php | 8 +-- .../Controllers/Budget/IndexController.php | 4 +- .../Controllers/Chart/AccountController.php | 6 +-- app/Http/Controllers/Chart/BillController.php | 4 +- .../Controllers/Chart/BudgetController.php | 12 ++--- .../Chart/BudgetReportController.php | 10 ++-- .../Controllers/Chart/CategoryController.php | 4 +- .../Chart/CategoryReportController.php | 18 +++---- .../Chart/DoubleReportController.php | 18 +++---- .../Controllers/Chart/PiggyBankController.php | 8 +-- .../Controllers/Chart/ReportController.php | 2 +- .../Controllers/Chart/TagReportController.php | 22 ++++---- .../Chart/TransactionController.php | 8 +-- app/Http/Controllers/Controller.php | 6 +-- .../Controllers/Export/IndexController.php | 2 +- app/Http/Controllers/HomeController.php | 2 +- app/Http/Controllers/Json/BoxController.php | 4 +- .../Controllers/Json/FrontpageController.php | 8 ++- .../Controllers/Json/ReconcileController.php | 6 +-- .../Controllers/Json/RecurrenceController.php | 8 +-- .../Controllers/PiggyBank/IndexController.php | 8 +-- .../Recurring/CreateController.php | 2 +- .../Controllers/Recurring/EditController.php | 2 +- .../Controllers/Recurring/ShowController.php | 2 +- .../Controllers/Report/BalanceController.php | 6 +-- .../Controllers/Report/BudgetController.php | 14 ++--- .../Controllers/Report/CategoryController.php | 52 +++++++++---------- .../Controllers/Report/DoubleController.php | 36 ++++++------- app/Http/Controllers/Report/TagController.php | 44 ++++++++-------- .../Transaction/MassController.php | 2 +- .../Transaction/ShowController.php | 6 +-- app/Http/Middleware/Authenticate.php | 13 +++-- app/Http/Middleware/InterestingMessage.php | 4 +- app/Http/Middleware/Range.php | 2 +- app/Http/Middleware/SecureHeaders.php | 2 +- app/Http/Middleware/StartFireflySession.php | 1 + app/Http/Middleware/TrustHosts.php | 1 + app/Http/Requests/AccountFormRequest.php | 2 +- app/Http/Requests/AttachmentFormRequest.php | 2 +- app/Http/Requests/BillStoreRequest.php | 2 +- app/Http/Requests/BillUpdateRequest.php | 2 +- app/Http/Requests/BudgetFormStoreRequest.php | 2 +- app/Http/Requests/BudgetFormUpdateRequest.php | 2 +- app/Http/Requests/BudgetIncomeRequest.php | 2 +- app/Http/Requests/BulkEditJournalRequest.php | 2 +- app/Http/Requests/CategoryFormRequest.php | 2 +- app/Http/Requests/ConfigurationRequest.php | 2 +- app/Http/Requests/CurrencyFormRequest.php | 2 +- .../Requests/DeleteAccountFormRequest.php | 2 +- app/Http/Requests/EmailFormRequest.php | 2 +- .../Requests/ExistingTokenFormRequest.php | 2 +- app/Http/Requests/InviteUserFormRequest.php | 2 +- app/Http/Requests/JournalLinkRequest.php | 4 +- app/Http/Requests/LinkTypeFormRequest.php | 2 +- .../Requests/MassDeleteJournalRequest.php | 2 +- app/Http/Requests/MassEditJournalRequest.php | 2 +- app/Http/Requests/NewUserFormRequest.php | 2 +- app/Http/Requests/ObjectGroupFormRequest.php | 2 +- app/Http/Requests/PiggyBankStoreRequest.php | 2 +- app/Http/Requests/PiggyBankUpdateRequest.php | 2 +- app/Http/Requests/ProfileFormRequest.php | 2 +- .../Requests/ReconciliationStoreRequest.php | 2 +- app/Http/Requests/RecurrenceFormRequest.php | 2 +- app/Http/Requests/ReportFormRequest.php | 2 +- app/Http/Requests/RuleFormRequest.php | 2 +- app/Http/Requests/RuleGroupFormRequest.php | 2 +- .../Requests/SelectTransactionsRequest.php | 2 +- app/Http/Requests/TagFormRequest.php | 2 +- app/Http/Requests/TestRuleFormRequest.php | 2 +- app/Http/Requests/TokenFormRequest.php | 2 +- .../Requests/TriggerRecurrenceRequest.php | 2 +- app/Http/Requests/UserFormRequest.php | 2 +- app/Http/Requests/UserRegistrationRequest.php | 2 +- app/Jobs/CreateRecurringTransactions.php | 6 +-- app/Jobs/MailError.php | 13 +---- app/Jobs/SendWebhookMessage.php | 5 +- app/Mail/BillWarningMail.php | 9 +--- app/Mail/ConfirmEmailChangeMail.php | 9 +--- app/Mail/InvitationMail.php | 11 +--- app/Mail/NewIPAddressWarningMail.php | 4 +- app/Mail/OAuthTokenCreatedMail.php | 5 +- app/Mail/RegisteredUser.php | 5 +- app/Mail/ReportNewJournalsMail.php | 5 +- app/Mail/RequestedNewPassword.php | 5 +- app/Mail/UndoEmailChangeMail.php | 9 +--- .../Admin/UnknownUserLoginAttempt.php | 5 +- app/Notifications/Admin/UserInvitation.php | 7 +-- app/Notifications/Admin/UserRegistration.php | 7 +-- .../Admin/VersionCheckResult.php | 7 +-- .../Security/DisabledMFANotification.php | 7 +-- .../Security/EnabledMFANotification.php | 7 +-- .../Security/MFABackupFewLeftNotification.php | 9 +--- .../Security/MFABackupNoLeftNotification.php | 7 +-- .../MFAManyFailedAttemptsNotification.php | 9 +--- .../MFAUsedBackupCodeNotification.php | 7 +-- .../Security/NewBackupCodesNotification.php | 7 +-- .../Security/UserFailedLoginAttempt.php | 7 +-- .../Test/OwnerTestNotificationEmail.php | 2 +- .../Test/UserTestNotificationEmail.php | 2 +- app/Notifications/User/BillReminder.php | 11 +--- app/Notifications/User/NewAccessToken.php | 2 +- .../User/TransactionCreation.php | 7 +-- app/Notifications/User/UserLogin.php | 2 +- app/Notifications/User/UserNewPassword.php | 7 +-- app/Notifications/User/UserRegistration.php | 2 +- app/Providers/AccountServiceProvider.php | 1 + app/Providers/AdminServiceProvider.php | 1 + app/Providers/AppServiceProvider.php | 1 + app/Providers/AttachmentServiceProvider.php | 1 + app/Providers/AuthServiceProvider.php | 8 +-- app/Providers/BillServiceProvider.php | 1 + app/Providers/BudgetServiceProvider.php | 1 + app/Providers/CategoryServiceProvider.php | 1 + app/Providers/CurrencyServiceProvider.php | 1 + app/Providers/EventServiceProvider.php | 1 + app/Providers/FireflyServiceProvider.php | 49 +++++------------ app/Providers/FireflySessionProvider.php | 10 ++-- app/Providers/JournalServiceProvider.php | 1 + app/Providers/PiggyBankServiceProvider.php | 1 + app/Providers/RecurringServiceProvider.php | 1 + app/Providers/RouteServiceProvider.php | 1 + app/Providers/RuleGroupServiceProvider.php | 1 + app/Providers/RuleServiceProvider.php | 1 + app/Providers/SearchServiceProvider.php | 1 + app/Providers/SessionServiceProvider.php | 1 + app/Providers/TagServiceProvider.php | 1 + .../Account/AccountRepository.php | 4 +- app/Repositories/Account/AccountTasker.php | 6 +-- .../Account/OperationsRepository.php | 16 +++--- .../Attachment/AttachmentRepository.php | 2 +- .../AuditLogEntry/ALERepository.php | 2 +- app/Repositories/Bill/BillRepository.php | 16 +++--- .../Budget/BudgetLimitRepository.php | 6 +-- app/Repositories/Budget/BudgetRepository.php | 24 ++++----- .../Budget/NoBudgetRepository.php | 2 +- .../Budget/OperationsRepository.php | 4 +- .../Category/NoCategoryRepository.php | 4 +- .../Category/OperationsRepository.php | 4 +- .../Currency/CurrencyRepository.php | 8 +-- .../LinkType/LinkTypeRepository.php | 10 ++-- .../PiggyBank/ModifiesPiggyBanks.php | 22 ++++---- .../PiggyBank/PiggyBankRepository.php | 6 +-- app/Repositories/Rule/RuleRepository.php | 6 +-- app/Repositories/Tag/TagRepository.php | 8 +-- .../TransactionGroupRepository.php | 2 +- .../UserGroup/UserGroupRepository.php | 4 +- .../UserGroups/Account/AccountRepository.php | 4 +- .../UserGroups/Bill/BillRepository.php | 6 +-- .../Budget/AvailableBudgetRepository.php | 2 +- .../Currency/CurrencyRepository.php | 8 +-- .../Webhook/WebhookRepository.php | 6 +-- app/Rules/BelongsUserGroup.php | 5 +- app/Rules/IsAllowedGroupAction.php | 8 +-- app/Rules/IsDefaultUserGroupName.php | 5 +- app/Rules/IsFilterValueIn.php | 7 +-- app/Rules/IsValidAttachmentModel.php | 2 +- app/Rules/IsValidBulkClause.php | 2 +- app/Rules/IsValidZeroOrMoreAmount.php | 4 +- app/Rules/UniqueAccountNumber.php | 13 ++--- app/Rules/UniqueIban.php | 4 +- .../FireflyIIIOrg/Update/UpdateRequest.php | 2 +- .../Internal/Support/AccountServiceTrait.php | 6 +-- .../Support/CreditRecalculateService.php | 24 ++++----- .../Internal/Update/CategoryUpdateService.php | 2 +- app/Support/Amount.php | 4 +- .../Authentication/RemoteUserGuard.php | 6 +-- app/Support/CacheProperties.php | 2 +- .../Chart/Budget/FrontpageChartGenerator.php | 16 +++--- .../Category/FrontpageChartGenerator.php | 6 +-- app/Support/Form/FormSupport.php | 2 +- .../Http/Api/AccountBalanceGrouped.php | 8 +-- .../Http/Api/SummaryBalanceGrouped.php | 12 ++--- app/Support/Http/Controllers/AugumentData.php | 10 ++-- .../Http/Controllers/PeriodOverview.php | 4 +- .../TransactionGroupEnrichment.php | 2 +- .../Models/AccountBalanceCalculator.php | 2 +- app/Support/Models/BillDateCalculator.php | 4 +- app/Support/Navigation.php | 28 +++------- app/Support/NullArrayObject.php | 6 +-- .../Report/Budget/BudgetReportGenerator.php | 28 +++++----- .../Category/CategoryReportGenerator.php | 32 ++++++------ .../Summarizer/TransactionSummarizer.php | 12 ++--- .../Repositories/UserGroup/UserGroupTrait.php | 2 +- app/Support/Request/ConvertsDataTypes.php | 6 +-- app/Support/Steam.php | 12 ++--- 195 files changed, 524 insertions(+), 715 deletions(-) diff --git a/app/Helpers/Attachments/AttachmentHelper.php b/app/Helpers/Attachments/AttachmentHelper.php index 42f7034bd3..3d8583805e 100644 --- a/app/Helpers/Attachments/AttachmentHelper.php +++ b/app/Helpers/Attachments/AttachmentHelper.php @@ -185,7 +185,7 @@ class AttachmentHelper implements AttachmentHelperInterface return false; } - Log::debug(sprintf('Now in saveAttachmentsForModel for model %s', get_class($model))); + Log::debug(sprintf('Now in saveAttachmentsForModel for model %s', $model::class)); if (is_array($files)) { Log::debug('$files is an array.'); @@ -335,7 +335,7 @@ class AttachmentHelper implements AttachmentHelperInterface { $md5 = \Safe\md5_file($file->getRealPath()); $name = $file->getClientOriginalName(); - $class = get_class($model); + $class = $model::class; $count = 0; // ignore lines about polymorphic calls. if ($model instanceof PiggyBank) { diff --git a/app/Helpers/Report/NetWorth.php b/app/Helpers/Report/NetWorth.php index 968e8e2640..cea39dbf67 100644 --- a/app/Helpers/Report/NetWorth.php +++ b/app/Helpers/Report/NetWorth.php @@ -50,7 +50,7 @@ class NetWorth implements NetWorthInterface private AccountRepositoryInterface $accountRepository; private CurrencyRepositoryInterface $currencyRepos; private User $user; // @phpstan-ignore-line - private ?UserGroup $userGroup; // @phpstan-ignore-line + private ?UserGroup $userGroup = null; // @phpstan-ignore-line /** * This method collects the user's net worth in ALL the user's currencies @@ -94,8 +94,8 @@ class NetWorth implements NetWorthInterface } Log::debug(sprintf('Balance is %s, native balance is %s', $balance, $nativeBalance)); // always subtract virtual balance again. - $balance = '' !== (string) $account->virtual_balance ? bcsub($balance, $account->virtual_balance) : $balance; - $nativeBalance = '' !== (string) $account->native_virtual_balance ? bcsub($nativeBalance, $account->native_virtual_balance) : $nativeBalance; + $balance = '' !== (string) $account->virtual_balance ? bcsub($balance, (string) $account->virtual_balance) : $balance; + $nativeBalance = '' !== (string) $account->native_virtual_balance ? bcsub($nativeBalance, (string) $account->native_virtual_balance) : $nativeBalance; $amountToUse = $useNative ? $nativeBalance : $balance; Log::debug(sprintf('Will use %s %s', $currencyCode, $amountToUse)); @@ -108,7 +108,7 @@ class NetWorth implements NetWorthInterface 'currency_decimal_places' => $currency->decimal_places, ]; - $netWorth[$currencyCode]['balance'] = bcadd($amountToUse, $netWorth[$currencyCode]['balance']); + $netWorth[$currencyCode]['balance'] = bcadd((string) $amountToUse, $netWorth[$currencyCode]['balance']); } $cache->store($netWorth); @@ -153,7 +153,7 @@ class NetWorth implements NetWorthInterface // always subtract virtual balance. $virtualBalance = $account->virtual_balance; if ('' !== $virtualBalance) { - $balance = bcsub($balance, $virtualBalance); + $balance = bcsub($balance, (string) $virtualBalance); } $return[$currency->id] ??= [ @@ -164,7 +164,7 @@ class NetWorth implements NetWorthInterface 'decimal_places' => $currency->decimal_places, 'sum' => '0', ]; - $return[$currency->id]['sum'] = bcadd($return[$currency->id]['sum'], $balance); + $return[$currency->id]['sum'] = bcadd($return[$currency->id]['sum'], (string) $balance); } return $return; diff --git a/app/Helpers/Webhook/Sha3SignatureGenerator.php b/app/Helpers/Webhook/Sha3SignatureGenerator.php index 25aee00464..e1b77af37d 100644 --- a/app/Helpers/Webhook/Sha3SignatureGenerator.php +++ b/app/Helpers/Webhook/Sha3SignatureGenerator.php @@ -64,7 +64,7 @@ class Sha3SignatureGenerator implements SignatureGeneratorInterface // The actual JSON payload (i.e., the request body) $timestamp = time(); $payload = sprintf('%s.%s', $timestamp, $json); - $signature = hash_hmac('sha3-256', $payload, $message->webhook->secret, false); + $signature = hash_hmac('sha3-256', $payload, (string) $message->webhook->secret, false); // signature string: // header included in each signed event contains a timestamp and one or more signatures. diff --git a/app/Http/Controllers/Account/EditController.php b/app/Http/Controllers/Account/EditController.php index a62bfc4a15..09e01612d9 100644 --- a/app/Http/Controllers/Account/EditController.php +++ b/app/Http/Controllers/Account/EditController.php @@ -94,9 +94,9 @@ class EditController extends Controller $hasLocation = null !== $location; $locations = [ 'location' => [ - 'latitude' => null !== old('location_latitude') ? old('location_latitude') : $latitude, - 'longitude' => null !== old('location_longitude') ? old('location_longitude') : $longitude, - 'zoom_level' => null !== old('location_zoom_level') ? old('location_zoom_level') : $zoomLevel, + 'latitude' => old('location_latitude') ?? $latitude, + 'longitude' => old('location_longitude') ?? $longitude, + 'zoom_level' => old('location_zoom_level') ?? $zoomLevel, 'has_location' => $hasLocation || 'true' === old('location_has_location'), ], ]; @@ -138,7 +138,7 @@ class EditController extends Controller // code to handle active-checkboxes $hasOldInput = null !== $request->old('_token'); - $virtualBalance = null === $account->virtual_balance ? '0' : $account->virtual_balance; + $virtualBalance = $account->virtual_balance ?? '0'; $preFilled = [ 'account_number' => $repository->getMetaValue($account, 'account_number'), 'account_role' => $repository->getMetaValue($account, 'account_role'), diff --git a/app/Http/Controllers/Account/IndexController.php b/app/Http/Controllers/Account/IndexController.php index 9afdba5f4f..80cafd6990 100644 --- a/app/Http/Controllers/Account/IndexController.php +++ b/app/Http/Controllers/Account/IndexController.php @@ -204,7 +204,7 @@ class IndexController extends Controller { $result = []; foreach ($endBalances as $key => $value) { - $result[$key] = bcsub($value, $startBalances[$key] ?? '0'); + $result[$key] = bcsub((string) $value, $startBalances[$key] ?? '0'); } return $result; diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 56388c6d46..e7e0819b0c 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -59,7 +59,7 @@ class ForgotPasswordController extends Controller * * @return Factory|RedirectResponse|View */ - public function sendResetLinkEmail(Request $request, UserRepositoryInterface $repository) + public function sendResetLinkEmail(Request $request, ?UserRepositoryInterface $repository = null) { app('log')->info('Start of sendResetLinkEmail()'); if ('web' !== config('firefly.authentication_guard')) { diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 1824453537..0ba8369ee8 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -89,7 +89,7 @@ class LoginController extends Controller try { $this->validateLogin($request); - } catch (ValidationException $e) { + } catch (ValidationException) { // basic validation exception. // report the failed login to the user if the count is 2 or 5. // TODO here be warning. @@ -220,7 +220,7 @@ class LoginController extends Controller * * @throws FireflyException */ - public function showLoginForm(Request $request) + public function showLoginForm(?Request $request = null) { Log::channel('audit')->info('Show login form (1.1).'); diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index effbd4f322..d15c6c0d59 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -121,7 +121,7 @@ class RegisterController extends Controller try { $singleUserMode = app('fireflyconfig')->get('single_user_mode', config('firefly.configuration.single_user_mode'))->data; - } catch (ContainerExceptionInterface|NotFoundExceptionInterface $e) { + } catch (ContainerExceptionInterface|NotFoundExceptionInterface) { $singleUserMode = true; } $userCount = User::count(); @@ -175,7 +175,7 @@ class RegisterController extends Controller * * @throws FireflyException */ - public function showRegistrationForm(Request $request) + public function showRegistrationForm(?Request $request = null) { $isDemoSite = app('fireflyconfig')->get('is_demo_site', config('firefly.configuration.is_demo_site'))->data; $pageTitle = (string) trans('firefly.register_page_title'); diff --git a/app/Http/Controllers/Bill/IndexController.php b/app/Http/Controllers/Bill/IndexController.php index cded2adb12..c42607eabb 100644 --- a/app/Http/Controllers/Bill/IndexController.php +++ b/app/Http/Controllers/Bill/IndexController.php @@ -243,8 +243,8 @@ class IndexController extends Controller 'period' => $entry['period'], 'per_period' => '0', ]; - $totals[$currencyId]['avg'] = bcadd($totals[$currencyId]['avg'], $entry['avg']); - $totals[$currencyId]['per_period'] = bcadd($totals[$currencyId]['per_period'], $entry['per_period']); + $totals[$currencyId]['avg'] = bcadd($totals[$currencyId]['avg'], (string) $entry['avg']); + $totals[$currencyId]['per_period'] = bcadd($totals[$currencyId]['per_period'], (string) $entry['per_period']); } } diff --git a/app/Http/Controllers/Bill/ShowController.php b/app/Http/Controllers/Bill/ShowController.php index a50540e6b3..81130d1f77 100644 --- a/app/Http/Controllers/Bill/ShowController.php +++ b/app/Http/Controllers/Bill/ShowController.php @@ -166,9 +166,7 @@ class ShowController extends Controller /** @var AttachmentTransformer $transformer */ $transformer = app(AttachmentTransformer::class); $attachments = $collection->each( - static function (Attachment $attachment) use ($transformer) { - return $transformer->transform($attachment); - } + static fn(Attachment $attachment) => $transformer->transform($attachment) ); } diff --git a/app/Http/Controllers/Budget/BudgetLimitController.php b/app/Http/Controllers/Budget/BudgetLimitController.php index f75a7a4c16..999768acd4 100644 --- a/app/Http/Controllers/Budget/BudgetLimitController.php +++ b/app/Http/Controllers/Budget/BudgetLimitController.php @@ -205,11 +205,11 @@ class BudgetLimitController extends Controller // add some extra metadata: $spentArr = $this->opsRepository->sumExpenses($limit->start_date, $limit->end_date, null, new Collection([$budget]), $currency); $array['spent'] = $spentArr[$currency->id]['sum'] ?? '0'; - $array['left_formatted'] = app('amount')->formatAnything($limit->transactionCurrency, bcadd($array['spent'], $array['amount'])); + $array['left_formatted'] = app('amount')->formatAnything($limit->transactionCurrency, bcadd($array['spent'], (string) $array['amount'])); $array['amount_formatted'] = app('amount')->formatAnything($limit->transactionCurrency, $limit['amount']); $array['days_left'] = (string) $this->activeDaysLeft($start, $end); // left per day: - $array['left_per_day'] = 0 === bccomp('0', $array['days_left']) ? bcadd($array['spent'], $array['amount']) : bcdiv(bcadd($array['spent'], $array['amount']), $array['days_left']); + $array['left_per_day'] = 0 === bccomp('0', $array['days_left']) ? bcadd((string) $array['spent'], (string) $array['amount']) : bcdiv(bcadd((string) $array['spent'], (string) $array['amount']), $array['days_left']); // left per day formatted. $array['left_per_day_formatted'] = app('amount')->formatAnything($limit->transactionCurrency, $array['left_per_day']); @@ -269,10 +269,10 @@ class BudgetLimitController extends Controller ); $daysLeft = $this->activeDaysLeft($limit->start_date, $limit->end_date); $array['spent'] = $spentArr[$budgetLimit->transactionCurrency->id]['sum'] ?? '0'; - $array['left_formatted'] = app('amount')->formatAnything($limit->transactionCurrency, bcadd($array['spent'], $array['amount'])); + $array['left_formatted'] = app('amount')->formatAnything($limit->transactionCurrency, bcadd($array['spent'], (string) $array['amount'])); $array['amount_formatted'] = app('amount')->formatAnything($limit->transactionCurrency, $limit['amount']); $array['days_left'] = (string) $daysLeft; - $array['left_per_day'] = 0 === $daysLeft ? bcadd($array['spent'], $array['amount']) : bcdiv(bcadd($array['spent'], $array['amount']), $array['days_left']); + $array['left_per_day'] = 0 === $daysLeft ? bcadd((string) $array['spent'], (string) $array['amount']) : bcdiv(bcadd((string) $array['spent'], (string) $array['amount']), $array['days_left']); // left per day formatted. $array['amount'] = app('steam')->bcround($limit['amount'], $limit->transactionCurrency->decimal_places); diff --git a/app/Http/Controllers/Budget/IndexController.php b/app/Http/Controllers/Budget/IndexController.php index c348e30a29..cbaf9d35d5 100644 --- a/app/Http/Controllers/Budget/IndexController.php +++ b/app/Http/Controllers/Budget/IndexController.php @@ -269,7 +269,7 @@ class IndexController extends Controller 'currency_symbol' => $spent['currency_symbol'], 'currency_decimal_places' => $spent['currency_decimal_places'], ]; - $sums['spent'][$currencyId]['amount'] = bcadd($sums['spent'][$currencyId]['amount'], $spent['spent']); + $sums['spent'][$currencyId]['amount'] = bcadd($sums['spent'][$currencyId]['amount'], (string) $spent['spent']); } /** @var array $budgeted */ @@ -282,7 +282,7 @@ class IndexController extends Controller 'currency_symbol' => $budgeted['currency_symbol'], 'currency_decimal_places' => $budgeted['currency_decimal_places'], ]; - $sums['budgeted'][$currencyId]['amount'] = bcadd($sums['budgeted'][$currencyId]['amount'], $budgeted['amount']); + $sums['budgeted'][$currencyId]['amount'] = bcadd($sums['budgeted'][$currencyId]['amount'], (string) $budgeted['amount']); // also calculate how much left from budgeted: $sums['left'][$currencyId] diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index dc4810aaed..a01ba3f2ed 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -250,7 +250,7 @@ class AccountController extends Controller 'currency_code' => $journal['currency_code'], ]; } - $result[$key]['total'] = bcadd($journal['amount'], $result[$key]['total']); + $result[$key]['total'] = bcadd((string) $journal['amount'], $result[$key]['total']); } $names = $this->getBudgetNames($budgetIds); @@ -312,7 +312,7 @@ class AccountController extends Controller 'currency_code' => $journal['currency_code'], ]; } - $result[$key]['total'] = bcadd($journal['amount'], $result[$key]['total']); + $result[$key]['total'] = bcadd((string) $journal['amount'], $result[$key]['total']); } $names = $this->getCategoryNames(array_keys($result)); @@ -401,7 +401,7 @@ class AccountController extends Controller 'currency_code' => $journal['currency_code'], ]; } - $result[$key]['total'] = bcadd($journal['amount'], $result[$key]['total']); + $result[$key]['total'] = bcadd((string) $journal['amount'], $result[$key]['total']); } $names = $this->getCategoryNames(array_keys($result)); diff --git a/app/Http/Controllers/Chart/BillController.php b/app/Http/Controllers/Chart/BillController.php index 737698fc6e..1d60113c62 100644 --- a/app/Http/Controllers/Chart/BillController.php +++ b/app/Http/Controllers/Chart/BillController.php @@ -177,12 +177,12 @@ class BillController extends Controller if (!array_key_exists($date, $chartData[2]['entries'])) { $chartData[2]['entries'][$date] = '0'; } - $amount = bcmul($journal['amount'], '-1'); + $amount = bcmul((string) $journal['amount'], '-1'); if ($this->convertToNative && $currencyId !== $journal['currency_id']) { $amount = bcmul($journal['native_amount'] ?? '0', '-1'); } if ($this->convertToNative && $currencyId === $journal['foreign_currency_id']) { - $amount = bcmul($journal['foreign_amount'], '-1'); + $amount = bcmul((string) $journal['foreign_amount'], '-1'); } $chartData[2]['entries'][$date] = bcadd($chartData[2]['entries'][$date], $amount); // amount of journal diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index 54492ade81..eea4e5b724 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -110,7 +110,7 @@ class BudgetController extends Controller /** @var Carbon $loopEnd */ $loopEnd = app('navigation')->endOfPeriod($loopStart, $step); $spent = $this->opsRepository->sumExpenses($loopStart, $loopEnd, null, $collection); // this method already converts to native. - $label = trim(app('navigation')->periodShow($loopStart, $step)); + $label = trim((string) app('navigation')->periodShow($loopStart, $step)); foreach ($spent as $row) { $currencyId = $row['currency_id']; @@ -133,7 +133,7 @@ class BudgetController extends Controller 'entries' => $defaultEntries, ]; foreach ($currency['spent'] as $label => $spent) { - $chartData[$currencyId]['entries'][$label] = bcmul($spent, '-1'); + $chartData[$currencyId]['entries'][$label] = bcmul((string) $spent, '-1'); } } $data = $this->generator->multiSet(array_values($chartData)); @@ -180,7 +180,7 @@ class BudgetController extends Controller $current = clone $start; $expenses = $this->opsRepository->sumExpenses($current, $current, null, $budgetCollection, $budgetLimit->transactionCurrency, $this->convertToNative); $spent = $expenses[$currency->id]['sum'] ?? '0'; - $amount = bcadd($amount, $spent); + $amount = bcadd((string) $amount, $spent); $format = $start->isoFormat((string) trans('config.month_and_day_js', [], $locale)); $entries[$format] = $amount; @@ -257,7 +257,7 @@ class BudgetController extends Controller 'currency_code' => $code, 'currency_name' => $name, ]; - $result[$key]['amount'] = bcadd($amount, $result[$key]['amount']); + $result[$key]['amount'] = bcadd((string) $amount, $result[$key]['amount']); } $names = $this->getAccountNames(array_keys($result)); @@ -341,7 +341,7 @@ class BudgetController extends Controller 'currency_code' => $code, 'currency_name' => $name, ]; - $result[$key]['amount'] = bcadd($amount, $result[$key]['amount']); + $result[$key]['amount'] = bcadd((string) $amount, $result[$key]['amount']); } $names = $this->getCategoryNames(array_keys($result)); @@ -424,7 +424,7 @@ class BudgetController extends Controller 'currency_code' => $code, 'currency_name' => $name, ]; - $result[$key]['amount'] = bcadd($amount, $result[$key]['amount']); + $result[$key]['amount'] = bcadd((string) $amount, $result[$key]['amount']); } $names = $this->getAccountNames(array_keys($result)); diff --git a/app/Http/Controllers/Chart/BudgetReportController.php b/app/Http/Controllers/Chart/BudgetReportController.php index 89d24d1e02..aee1d2a958 100644 --- a/app/Http/Controllers/Chart/BudgetReportController.php +++ b/app/Http/Controllers/Chart/BudgetReportController.php @@ -85,7 +85,7 @@ class BudgetReportController extends Controller ]; foreach ($budget['transaction_journals'] as $journal) { $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -115,7 +115,7 @@ class BudgetReportController extends Controller ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -145,7 +145,7 @@ class BudgetReportController extends Controller ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -186,7 +186,7 @@ class BudgetReportController extends Controller $key = $journal['date']->isoFormat($format); $amount = app('steam')->positive($journal['amount']); $chartData[$spentKey]['entries'][$key] ??= '0'; - $chartData[$spentKey]['entries'][$key] = bcadd($chartData[$spentKey]['entries'][$key], $amount); + $chartData[$spentKey]['entries'][$key] = bcadd($chartData[$spentKey]['entries'][$key], (string) $amount); } } } @@ -233,7 +233,7 @@ class BudgetReportController extends Controller ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index 79979e6a70..3a88fd8f5b 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -215,7 +215,7 @@ class CategoryController extends Controller $date = $journal['date']->isoFormat($format); $chartData[$outKey]['entries'][$date] ??= '0'; - $chartData[$outKey]['entries'][$date] = bcadd($amount, $chartData[$outKey]['entries'][$date]); + $chartData[$outKey]['entries'][$date] = bcadd((string) $amount, $chartData[$outKey]['entries'][$date]); } $inSet = $income[$currencyId]['categories'][$categoryId] ?? ['transaction_journals' => []]; @@ -223,7 +223,7 @@ class CategoryController extends Controller $amount = app('steam')->positive($journal['amount']); $date = $journal['date']->isoFormat($format); $chartData[$inKey]['entries'][$date] ??= '0'; - $chartData[$inKey]['entries'][$date] = bcadd($amount, $chartData[$inKey]['entries'][$date]); + $chartData[$inKey]['entries'][$date] = bcadd((string) $amount, $chartData[$inKey]['entries'][$date]); } } diff --git a/app/Http/Controllers/Chart/CategoryReportController.php b/app/Http/Controllers/Chart/CategoryReportController.php index 238065a1fc..e02288a458 100644 --- a/app/Http/Controllers/Chart/CategoryReportController.php +++ b/app/Http/Controllers/Chart/CategoryReportController.php @@ -83,7 +83,7 @@ class CategoryReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -110,7 +110,7 @@ class CategoryReportController extends Controller ]; foreach ($category['transaction_journals'] as $journal) { $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -138,7 +138,7 @@ class CategoryReportController extends Controller ]; foreach ($category['transaction_journals'] as $journal) { $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -166,7 +166,7 @@ class CategoryReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -194,7 +194,7 @@ class CategoryReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -233,7 +233,7 @@ class CategoryReportController extends Controller $key = $journal['date']->isoFormat($format); $amount = app('steam')->positive($journal['amount']); $chartData[$spentKey]['entries'][$key] ??= '0'; - $chartData[$spentKey]['entries'][$key] = bcadd($chartData[$spentKey]['entries'][$key], $amount); + $chartData[$spentKey]['entries'][$key] = bcadd($chartData[$spentKey]['entries'][$key], (string) $amount); } } } @@ -260,7 +260,7 @@ class CategoryReportController extends Controller $key = $journal['date']->isoFormat($format); $amount = app('steam')->positive($journal['amount']); $chartData[$spentKey]['entries'][$key] ??= '0'; - $chartData[$spentKey]['entries'][$key] = bcadd($chartData[$spentKey]['entries'][$key], $amount); + $chartData[$spentKey]['entries'][$key] = bcadd($chartData[$spentKey]['entries'][$key], (string) $amount); } } } @@ -308,7 +308,7 @@ class CategoryReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -336,7 +336,7 @@ class CategoryReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } diff --git a/app/Http/Controllers/Chart/DoubleReportController.php b/app/Http/Controllers/Chart/DoubleReportController.php index 159b6dfefa..1e88ceaa5d 100644 --- a/app/Http/Controllers/Chart/DoubleReportController.php +++ b/app/Http/Controllers/Chart/DoubleReportController.php @@ -82,7 +82,7 @@ class DoubleReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } @@ -109,7 +109,7 @@ class DoubleReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } @@ -136,7 +136,7 @@ class DoubleReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } @@ -178,7 +178,7 @@ class DoubleReportController extends Controller $key = $journal['date']->isoFormat($format); $amount = app('steam')->positive($journal['amount']); $chartData[$spentKey]['entries'][$key] ??= '0'; - $chartData[$spentKey]['entries'][$key] = bcadd($chartData[$spentKey]['entries'][$key], $amount); + $chartData[$spentKey]['entries'][$key] = bcadd($chartData[$spentKey]['entries'][$key], (string) $amount); } } // loop income. @@ -204,7 +204,7 @@ class DoubleReportController extends Controller $key = $journal['date']->isoFormat($format); $amount = app('steam')->positive($journal['amount']); $chartData[$earnedKey]['entries'][$key] ??= '0'; - $chartData[$earnedKey]['entries'][$key] = bcadd($chartData[$earnedKey]['entries'][$key], $amount); + $chartData[$earnedKey]['entries'][$key] = bcadd($chartData[$earnedKey]['entries'][$key], (string) $amount); } } @@ -275,7 +275,7 @@ class DoubleReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } // loop each tag: @@ -294,7 +294,7 @@ class DoubleReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -328,7 +328,7 @@ class DoubleReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } // loop each tag: @@ -347,7 +347,7 @@ class DoubleReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } diff --git a/app/Http/Controllers/Chart/PiggyBankController.php b/app/Http/Controllers/Chart/PiggyBankController.php index 661c362394..9aa4004a8b 100644 --- a/app/Http/Controllers/Chart/PiggyBankController.php +++ b/app/Http/Controllers/Chart/PiggyBankController.php @@ -90,9 +90,7 @@ class PiggyBankController extends Controller $chartData = []; while ($oldest <= $today) { $filtered = $set->filter( - static function (PiggyBankEvent $event) use ($oldest) { - return $event->date->lte($oldest); - } + static fn(PiggyBankEvent $event) => $event->date->lte($oldest) ); $currentSum = $filtered->sum('amount'); $label = $oldest->isoFormat((string) trans('config.month_and_day_js', [], $locale)); @@ -100,9 +98,7 @@ class PiggyBankController extends Controller $oldest = app('navigation')->addPeriod($oldest, $step, 0); } $finalFiltered = $set->filter( - static function (PiggyBankEvent $event) use ($today) { - return $event->date->lte($today); - } + static fn(PiggyBankEvent $event) => $event->date->lte($today) ); $finalSum = $finalFiltered->sum('amount'); $finalLabel = $today->isoFormat((string) trans('config.month_and_day_js', [], $locale)); diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.php index 1e1a048313..40bccc3727 100644 --- a/app/Http/Controllers/Chart/ReportController.php +++ b/app/Http/Controllers/Chart/ReportController.php @@ -207,7 +207,7 @@ class ReportController extends Controller && in_array($journal['destination_account_id'], $ids, true))) { $key = 'earned'; } - $data[$currencyId][$period][$key] = bcadd($data[$currencyId][$period][$key], $amount); + $data[$currencyId][$period][$key] = bcadd((string) $data[$currencyId][$period][$key], (string) $amount); } // loop this data, make chart bars for each currency: diff --git a/app/Http/Controllers/Chart/TagReportController.php b/app/Http/Controllers/Chart/TagReportController.php index 5bea78116c..dbc9451834 100644 --- a/app/Http/Controllers/Chart/TagReportController.php +++ b/app/Http/Controllers/Chart/TagReportController.php @@ -83,7 +83,7 @@ class TagReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -111,7 +111,7 @@ class TagReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -139,7 +139,7 @@ class TagReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -167,7 +167,7 @@ class TagReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -195,7 +195,7 @@ class TagReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -237,7 +237,7 @@ class TagReportController extends Controller $key = $journal['date']->isoFormat($format); $amount = app('steam')->positive($journal['amount']); $chartData[$spentKey]['entries'][$key] ??= '0'; - $chartData[$spentKey]['entries'][$key] = bcadd($chartData[$spentKey]['entries'][$key], $amount); + $chartData[$spentKey]['entries'][$key] = bcadd($chartData[$spentKey]['entries'][$key], (string) $amount); } } } @@ -264,7 +264,7 @@ class TagReportController extends Controller $key = $journal['date']->isoFormat($format); $amount = app('steam')->positive($journal['amount']); $chartData[$spentKey]['entries'][$key] ??= '0'; - $chartData[$spentKey]['entries'][$key] = bcadd($chartData[$spentKey]['entries'][$key], $amount); + $chartData[$spentKey]['entries'][$key] = bcadd($chartData[$spentKey]['entries'][$key], (string) $amount); } } } @@ -312,7 +312,7 @@ class TagReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -340,7 +340,7 @@ class TagReportController extends Controller 'currency_code' => $currency['currency_code'], ]; $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -367,7 +367,7 @@ class TagReportController extends Controller ]; foreach ($tag['transaction_journals'] as $journal) { $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } @@ -393,7 +393,7 @@ class TagReportController extends Controller ]; foreach ($tag['transaction_journals'] as $journal) { $amount = app('steam')->positive($journal['amount']); - $result[$title]['amount'] = bcadd($result[$title]['amount'], $amount); + $result[$title]['amount'] = bcadd($result[$title]['amount'], (string) $amount); } } } diff --git a/app/Http/Controllers/Chart/TransactionController.php b/app/Http/Controllers/Chart/TransactionController.php index 05ed97f518..973af0ee54 100644 --- a/app/Http/Controllers/Chart/TransactionController.php +++ b/app/Http/Controllers/Chart/TransactionController.php @@ -81,7 +81,7 @@ class TransactionController extends Controller 'currency_symbol' => $journal['currency_symbol'], 'currency_code' => $journal['currency_code'], ]; - $data[$title]['amount'] = bcadd($data[$title]['amount'], $journal['amount']); + $data[$title]['amount'] = bcadd($data[$title]['amount'], (string) $journal['amount']); } $chart = $this->generator->multiCurrencyPieChart($data); $cache->store($chart); @@ -131,7 +131,7 @@ class TransactionController extends Controller 'currency_symbol' => $journal['currency_symbol'], 'currency_code' => $journal['currency_code'], ]; - $data[$title]['amount'] = bcadd($data[$title]['amount'], $journal['amount']); + $data[$title]['amount'] = bcadd($data[$title]['amount'], (string) $journal['amount']); } $chart = $this->generator->multiCurrencyPieChart($data); $cache->store($chart); @@ -181,7 +181,7 @@ class TransactionController extends Controller 'currency_symbol' => $journal['currency_symbol'], 'currency_code' => $journal['currency_code'], ]; - $data[$title]['amount'] = bcadd($data[$title]['amount'], $journal['amount']); + $data[$title]['amount'] = bcadd($data[$title]['amount'], (string) $journal['amount']); } $chart = $this->generator->multiCurrencyPieChart($data); $cache->store($chart); @@ -231,7 +231,7 @@ class TransactionController extends Controller 'currency_symbol' => $journal['currency_symbol'], 'currency_code' => $journal['currency_code'], ]; - $data[$title]['amount'] = bcadd($data[$title]['amount'], $journal['amount']); + $data[$title]['amount'] = bcadd($data[$title]['amount'], (string) $journal['amount']); } $chart = $this->generator->multiCurrencyPieChart($data); $cache->store($chart); diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index ca4b5728be..7bbd63c15d 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -97,14 +97,14 @@ abstract class Controller extends BaseController $isAlpha = false; $isBeta = false; $isDevelop = false; - if (str_contains(config('firefly.version'), 'alpha')) { + if (str_contains((string) config('firefly.version'), 'alpha')) { $isAlpha = true; } - if (str_contains(config('firefly.version'), 'develop') || str_contains(config('firefly.version'), 'branch')) { + if (str_contains((string) config('firefly.version'), 'develop') || str_contains((string) config('firefly.version'), 'branch')) { $isDevelop = true; } - if (str_contains(config('firefly.version'), 'beta')) { + if (str_contains((string) config('firefly.version'), 'beta')) { $isBeta = true; } diff --git a/app/Http/Controllers/Export/IndexController.php b/app/Http/Controllers/Export/IndexController.php index 8fbadde074..d8a8da128a 100644 --- a/app/Http/Controllers/Export/IndexController.php +++ b/app/Http/Controllers/Export/IndexController.php @@ -106,7 +106,7 @@ class IndexController extends Controller ->header('Expires', '0') ->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0') ->header('Pragma', 'public') - ->header('Content-Length', (string) strlen($result['transactions'])) + ->header('Content-Length', (string) strlen((string) $result['transactions'])) ; // return CSV file made from 'transactions' array. diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index ab2f6d6720..48d41acc0f 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -75,7 +75,7 @@ class HomeController extends Controller try { $stringEnd = e((string) $request->get('end')); $end = Carbon::createFromFormat('Y-m-d', $stringEnd); - } catch (InvalidFormatException $e) { + } catch (InvalidFormatException) { app('log')->error(sprintf('End could not parse date string "%s" so ignore it.', $stringEnd)); $end = Carbon::now()->endOfMonth(); } diff --git a/app/Http/Controllers/Json/BoxController.php b/app/Http/Controllers/Json/BoxController.php index 42aeaca80b..cc3ff13787 100644 --- a/app/Http/Controllers/Json/BoxController.php +++ b/app/Http/Controllers/Json/BoxController.php @@ -92,9 +92,9 @@ class BoxController extends Controller $currencyId = $this->convertToNative && $this->defaultCurrency->id !== (int) $journal['currency_id'] ? $this->defaultCurrency->id : (int) $journal['currency_id']; $amount = Amount::getAmountFromJournal($journal); $incomes[$currencyId] ??= '0'; - $incomes[$currencyId] = bcadd($incomes[$currencyId], app('steam')->positive($amount)); + $incomes[$currencyId] = bcadd($incomes[$currencyId], (string) app('steam')->positive($amount)); $sums[$currencyId] ??= '0'; - $sums[$currencyId] = bcadd($sums[$currencyId], app('steam')->positive($amount)); + $sums[$currencyId] = bcadd($sums[$currencyId], (string) app('steam')->positive($amount)); } // collect expenses diff --git a/app/Http/Controllers/Json/FrontpageController.php b/app/Http/Controllers/Json/FrontpageController.php index 88717a51f5..9cda94934f 100644 --- a/app/Http/Controllers/Json/FrontpageController.php +++ b/app/Http/Controllers/Json/FrontpageController.php @@ -55,8 +55,8 @@ class FrontpageController extends Controller if (1 === bccomp($amount, '0')) { // percentage! $pct = 0; - if (0 !== bccomp($piggyBank->target_amount, '0')) { - $pct = (int) bcmul(bcdiv($amount, $piggyBank->target_amount), '100'); + if (0 !== bccomp((string) $piggyBank->target_amount, '0')) { + $pct = (int) bcmul(bcdiv($amount, (string) $piggyBank->target_amount), '100'); } $entry = [ @@ -82,9 +82,7 @@ class FrontpageController extends Controller // sort by current percentage (lowest at the top) uasort( $info, - static function (array $a, array $b) { - return $a['percentage'] <=> $b['percentage']; - } + static fn(array $a, array $b) => $a['percentage'] <=> $b['percentage'] ); $html = ''; diff --git a/app/Http/Controllers/Json/ReconcileController.php b/app/Http/Controllers/Json/ReconcileController.php index 5469be7251..8ae747758f 100644 --- a/app/Http/Controllers/Json/ReconcileController.php +++ b/app/Http/Controllers/Json/ReconcileController.php @@ -160,15 +160,15 @@ class ReconcileController extends Controller } if ($account->id === $journal['destination_account_id']) { if ($currency->id === $journal['currency_id']) { - $toAdd = bcmul($journal['amount'], '-1'); + $toAdd = bcmul((string) $journal['amount'], '-1'); } if (null !== $journal['foreign_currency_id'] && $journal['foreign_currency_id'] === $currency->id) { - $toAdd = bcmul($journal['foreign_amount'], '-1'); + $toAdd = bcmul((string) $journal['foreign_amount'], '-1'); } } app('log')->debug(sprintf('Going to add %s to %s', $toAdd, $amount)); - $amount = bcadd($amount, $toAdd); + $amount = bcadd($amount, (string) $toAdd); app('log')->debug(sprintf('Result is %s', $amount)); return $amount; diff --git a/app/Http/Controllers/Json/RecurrenceController.php b/app/Http/Controllers/Json/RecurrenceController.php index d4685e5a30..7d91dd0a68 100644 --- a/app/Http/Controllers/Json/RecurrenceController.php +++ b/app/Http/Controllers/Json/RecurrenceController.php @@ -74,7 +74,7 @@ class RecurrenceController extends Controller $firstDate = Carbon::createFromFormat('Y-m-d', $request->get('first_date')); $endDate = '' !== (string) $request->get('end_date') ? Carbon::createFromFormat('Y-m-d', $request->get('end_date')) : null; $endsAt = (string) $request->get('ends'); - $repetitionType = explode(',', $request->get('type'))[0]; + $repetitionType = explode(',', (string) $request->get('type'))[0]; $repetitions = (int) $request->get('reps'); $weekend = (int) $request->get('weekend'); $repetitionMoment = ''; @@ -101,13 +101,13 @@ class RecurrenceController extends Controller $actualStart = clone $firstDate; if ('weekly' === $repetitionType || 'monthly' === $repetitionType) { - $repetitionMoment = explode(',', $request->get('type'))[1] ?? '1'; + $repetitionMoment = explode(',', (string) $request->get('type'))[1] ?? '1'; } if ('ndom' === $repetitionType) { $repetitionMoment = str_ireplace('ndom,', '', $request->get('type')); } if ('yearly' === $repetitionType) { - $repetitionMoment = explode(',', $request->get('type'))[1] ?? '2018-01-01'; + $repetitionMoment = explode(',', (string) $request->get('type'))[1] ?? '2018-01-01'; } $actualStart->startOfDay(); $repetition = new RecurrenceRepetition(); @@ -158,7 +158,7 @@ class RecurrenceController extends Controller try { $date = Carbon::createFromFormat('Y-m-d', $string, config('app.timezone')); - } catch (InvalidFormatException $e) { + } catch (InvalidFormatException) { $date = Carbon::today(config('app.timezone')); } if (null === $date) { diff --git a/app/Http/Controllers/PiggyBank/IndexController.php b/app/Http/Controllers/PiggyBank/IndexController.php index 469c326243..b6379e859c 100644 --- a/app/Http/Controllers/PiggyBank/IndexController.php +++ b/app/Http/Controllers/PiggyBank/IndexController.php @@ -195,10 +195,10 @@ class IndexController extends Controller foreach ($piggyBank['accounts'] as $piggyAccount) { $accountId = $piggyAccount['id']; if (array_key_exists($accountId, $accounts)) { - $accounts[$accountId]['left'] = bcsub($accounts[$accountId]['left'], $piggyAccount['current_amount']); - $accounts[$accountId]['saved'] = bcadd($accounts[$accountId]['saved'], $piggyAccount['current_amount']); - $accounts[$accountId]['target'] = bcadd($accounts[$accountId]['target'], $piggyBank['target_amount']); - $accounts[$accountId]['to_save'] = bcadd($accounts[$accountId]['to_save'], bcsub($piggyBank['target_amount'], $piggyAccount['current_amount'])); + $accounts[$accountId]['left'] = bcsub((string) $accounts[$accountId]['left'], (string) $piggyAccount['current_amount']); + $accounts[$accountId]['saved'] = bcadd((string) $accounts[$accountId]['saved'], (string) $piggyAccount['current_amount']); + $accounts[$accountId]['target'] = bcadd((string) $accounts[$accountId]['target'], (string) $piggyBank['target_amount']); + $accounts[$accountId]['to_save'] = bcadd((string) $accounts[$accountId]['to_save'], bcsub((string) $piggyBank['target_amount'], (string) $piggyAccount['current_amount'])); } } } diff --git a/app/Http/Controllers/Recurring/CreateController.php b/app/Http/Controllers/Recurring/CreateController.php index 391bb75365..35f4e25a8f 100644 --- a/app/Http/Controllers/Recurring/CreateController.php +++ b/app/Http/Controllers/Recurring/CreateController.php @@ -152,7 +152,7 @@ class CreateController extends Controller ]; // fill prefilled with journal info - $type = strtolower($journal->transactionType->type); + $type = strtolower((string) $journal->transactionType->type); /** @var Transaction $source */ $source = $journal->transactions()->where('amount', '<', 0)->first(); diff --git a/app/Http/Controllers/Recurring/EditController.php b/app/Http/Controllers/Recurring/EditController.php index 0a2cae44a1..00fdac8243 100644 --- a/app/Http/Controllers/Recurring/EditController.php +++ b/app/Http/Controllers/Recurring/EditController.php @@ -135,7 +135,7 @@ class EditController extends Controller $hasOldInput = null !== $request->old('_token'); $preFilled = [ - 'transaction_type' => strtolower($recurrence->transactionType->type), + 'transaction_type' => strtolower((string) $recurrence->transactionType->type), 'active' => $hasOldInput ? (bool) $request->old('active') : $recurrence->active, 'apply_rules' => $hasOldInput ? (bool) $request->old('apply_rules') : $recurrence->apply_rules, 'deposit_source_id' => $array['transactions'][0]['source_id'], diff --git a/app/Http/Controllers/Recurring/ShowController.php b/app/Http/Controllers/Recurring/ShowController.php index 2e5f6bd137..6e6da1518d 100644 --- a/app/Http/Controllers/Recurring/ShowController.php +++ b/app/Http/Controllers/Recurring/ShowController.php @@ -94,7 +94,7 @@ class ShowController extends Controller // transform dates back to Carbon objects and expand information foreach ($array['repetitions'] as $index => $repetition) { foreach ($repetition['occurrences'] as $item => $occurrence) { - $date = (new Carbon($occurrence))->startOfDay(); + $date = new Carbon($occurrence)->startOfDay(); $set = [ 'date' => $date, 'fired' => $this->recurring->createdPreviously($recurrence, $date) diff --git a/app/Http/Controllers/Report/BalanceController.php b/app/Http/Controllers/Report/BalanceController.php index 8efcb083f4..914f12061c 100644 --- a/app/Http/Controllers/Report/BalanceController.php +++ b/app/Http/Controllers/Report/BalanceController.php @@ -113,7 +113,7 @@ class BalanceController extends Controller 'currency_decimal_places' => $journal['currency_decimal_places'], 'spent' => '0', ]; - $spent[$sourceAccount]['spent'] = bcadd($spent[$sourceAccount]['spent'], $journal['amount']); + $spent[$sourceAccount]['spent'] = bcadd($spent[$sourceAccount]['spent'], (string) $journal['amount']); // also fix sum: $report['sums'][$budgetId][$currencyId] ??= [ @@ -124,8 +124,8 @@ class BalanceController extends Controller 'currency_symbol' => $journal['currency_symbol'], 'currency_decimal_places' => $journal['currency_decimal_places'], ]; - $report['sums'][$budgetId][$currencyId]['sum'] = bcadd($report['sums'][$budgetId][$currencyId]['sum'], $journal['amount']); - $report['accounts'][$sourceAccount]['sum'] = bcadd($report['accounts'][$sourceAccount]['sum'], $journal['amount']); + $report['sums'][$budgetId][$currencyId]['sum'] = bcadd($report['sums'][$budgetId][$currencyId]['sum'], (string) $journal['amount']); + $report['accounts'][$sourceAccount]['sum'] = bcadd($report['accounts'][$sourceAccount]['sum'], (string) $journal['amount']); // add currency info for account sum $report['accounts'][$sourceAccount]['currency_id'] = $journal['currency_id']; diff --git a/app/Http/Controllers/Report/BudgetController.php b/app/Http/Controllers/Report/BudgetController.php index 286978f049..67c316891d 100644 --- a/app/Http/Controllers/Report/BudgetController.php +++ b/app/Http/Controllers/Report/BudgetController.php @@ -126,9 +126,9 @@ class BudgetController extends Controller ]; $report[$sourceAccountId]['currencies'][$currencyId]['sum'] = bcadd( $report[$sourceAccountId]['currencies'][$currencyId]['sum'], - $journal['amount'] + (string) $journal['amount'] ); - $sums[$currencyId]['sum'] = bcadd($sums[$currencyId]['sum'], $journal['amount']); + $sums[$currencyId]['sum'] = bcadd($sums[$currencyId]['sum'], (string) $journal['amount']); } } } @@ -163,7 +163,7 @@ class BudgetController extends Controller 'currency_decimal_places' => $currency['currency_decimal_places'], ]; ++$result[$key]['transactions']; - $result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']); + $result[$key]['sum'] = bcadd((string) $journal['amount'], $result[$key]['sum']); $result[$key]['avg'] = bcdiv($result[$key]['sum'], (string) $result[$key]['transactions']); $result[$key]['avg_float'] = (float) $result[$key]['avg']; // intentional float } @@ -229,8 +229,8 @@ class BudgetController extends Controller 'currency_name' => $currency['currency_name'], 'currency_decimal_places' => $currency['currency_decimal_places'], ]; - $report[$budgetId]['currencies'][$currencyId]['sum'] = bcadd($report[$budgetId]['currencies'][$currencyId]['sum'], $journal['amount']); - $sums[$currencyId]['sum'] = bcadd($sums[$currencyId]['sum'], $journal['amount']); + $report[$budgetId]['currencies'][$currencyId]['sum'] = bcadd($report[$budgetId]['currencies'][$currencyId]['sum'], (string) $journal['amount']); + $sums[$currencyId]['sum'] = bcadd($sums[$currencyId]['sum'], (string) $journal['amount']); } } } @@ -317,8 +317,8 @@ class BudgetController extends Controller 'entries' => [], ]; $report[$key]['entries'][$dateKey] ??= '0'; - $report[$key]['entries'][$dateKey] = bcadd($journal['amount'], $report[$key]['entries'][$dateKey]); - $report[$key]['sum'] = bcadd($report[$key]['sum'], $journal['amount']); + $report[$key]['entries'][$dateKey] = bcadd((string) $journal['amount'], $report[$key]['entries'][$dateKey]); + $report[$key]['sum'] = bcadd($report[$key]['sum'], (string) $journal['amount']); $report[$key]['avg'] = bcdiv($report[$key]['sum'], (string) count($periods)); } } diff --git a/app/Http/Controllers/Report/CategoryController.php b/app/Http/Controllers/Report/CategoryController.php index 258dba2d6a..0168fdd75e 100644 --- a/app/Http/Controllers/Report/CategoryController.php +++ b/app/Http/Controllers/Report/CategoryController.php @@ -107,11 +107,11 @@ class CategoryController extends Controller ]; $report[$sourceAccountId]['currencies'][$currencyId]['categories'][$category['id']]['spent'] = bcadd( $report[$sourceAccountId]['currencies'][$currencyId]['categories'][$category['id']]['spent'], - $journal['amount'] + (string) $journal['amount'] ); $report[$sourceAccountId]['currencies'][$currencyId]['categories'][$category['id']]['sum'] = bcadd( $report[$sourceAccountId]['currencies'][$currencyId]['categories'][$category['id']]['sum'], - $journal['amount'] + (string) $journal['amount'] ); } } @@ -140,11 +140,11 @@ class CategoryController extends Controller ]; $report[$destinationId]['currencies'][$currencyId]['categories'][$category['id']]['earned'] = bcadd( $report[$destinationId]['currencies'][$currencyId]['categories'][$category['id']]['earned'], - $journal['amount'] + (string) $journal['amount'] ); $report[$destinationId]['currencies'][$currencyId]['categories'][$category['id']]['sum'] = bcadd( $report[$destinationId]['currencies'][$currencyId]['categories'][$category['id']]['sum'], - $journal['amount'] + (string) $journal['amount'] ); } } @@ -202,14 +202,14 @@ class CategoryController extends Controller ]; $report[$sourceAccountId]['currencies'][$currencyId]['spent'] = bcadd( $report[$sourceAccountId]['currencies'][$currencyId]['spent'], - $journal['amount'] + (string) $journal['amount'] ); $report[$sourceAccountId]['currencies'][$currencyId]['sum'] = bcadd( $report[$sourceAccountId]['currencies'][$currencyId]['sum'], - $journal['amount'] + (string) $journal['amount'] ); - $sums[$currencyId]['spent_sum'] = bcadd($sums[$currencyId]['spent_sum'], $journal['amount']); - $sums[$currencyId]['total_sum'] = bcadd($sums[$currencyId]['total_sum'], $journal['amount']); + $sums[$currencyId]['spent_sum'] = bcadd($sums[$currencyId]['spent_sum'], (string) $journal['amount']); + $sums[$currencyId]['total_sum'] = bcadd($sums[$currencyId]['total_sum'], (string) $journal['amount']); } } } @@ -240,14 +240,14 @@ class CategoryController extends Controller ]; $report[$destinationAccountId]['currencies'][$currencyId]['earned'] = bcadd( $report[$destinationAccountId]['currencies'][$currencyId]['earned'], - $journal['amount'] + (string) $journal['amount'] ); $report[$destinationAccountId]['currencies'][$currencyId]['sum'] = bcadd( $report[$destinationAccountId]['currencies'][$currencyId]['sum'], - $journal['amount'] + (string) $journal['amount'] ); - $sums[$currencyId]['earned_sum'] = bcadd($sums[$currencyId]['earned_sum'], $journal['amount']); - $sums[$currencyId]['total_sum'] = bcadd($sums[$currencyId]['total_sum'], $journal['amount']); + $sums[$currencyId]['earned_sum'] = bcadd($sums[$currencyId]['earned_sum'], (string) $journal['amount']); + $sums[$currencyId]['total_sum'] = bcadd($sums[$currencyId]['total_sum'], (string) $journal['amount']); } } } @@ -282,7 +282,7 @@ class CategoryController extends Controller 'currency_decimal_places' => $currency['currency_decimal_places'], ]; ++$result[$key]['transactions']; - $result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']); + $result[$key]['sum'] = bcadd((string) $journal['amount'], $result[$key]['sum']); $result[$key]['avg'] = bcdiv($result[$key]['sum'], (string) $result[$key]['transactions']); $result[$key]['avg_float'] = (float) $result[$key]['avg']; // intentional float } @@ -332,7 +332,7 @@ class CategoryController extends Controller 'currency_decimal_places' => $currency['currency_decimal_places'], ]; ++$result[$key]['transactions']; - $result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']); + $result[$key]['sum'] = bcadd((string) $journal['amount'], $result[$key]['sum']); $result[$key]['avg'] = bcdiv($result[$key]['sum'], (string) $result[$key]['transactions']); $result[$key]['avg_float'] = (float) $result[$key]['avg']; } @@ -405,15 +405,15 @@ class CategoryController extends Controller ]; $report[$categoryId]['currencies'][$currencyId]['spent'] = bcadd( $report[$categoryId]['currencies'][$currencyId]['spent'], - $journal['amount'] + (string) $journal['amount'] ); $report[$categoryId]['currencies'][$currencyId]['sum'] = bcadd( $report[$categoryId]['currencies'][$currencyId]['sum'], - $journal['amount'] + (string) $journal['amount'] ); - $sums[$currencyId]['spent_sum'] = bcadd($sums[$currencyId]['spent_sum'], $journal['amount']); - $sums[$currencyId]['total_sum'] = bcadd($sums[$currencyId]['total_sum'], $journal['amount']); + $sums[$currencyId]['spent_sum'] = bcadd($sums[$currencyId]['spent_sum'], (string) $journal['amount']); + $sums[$currencyId]['total_sum'] = bcadd($sums[$currencyId]['total_sum'], (string) $journal['amount']); } } } @@ -447,15 +447,15 @@ class CategoryController extends Controller ]; $report[$categoryId]['currencies'][$currencyId]['earned'] = bcadd( $report[$categoryId]['currencies'][$currencyId]['earned'], - $journal['amount'] + (string) $journal['amount'] ); $report[$categoryId]['currencies'][$currencyId]['sum'] = bcadd( $report[$categoryId]['currencies'][$currencyId]['sum'], - $journal['amount'] + (string) $journal['amount'] ); - $sums[$currencyId]['earned_sum'] = bcadd($sums[$currencyId]['earned_sum'], $journal['amount']); - $sums[$currencyId]['total_sum'] = bcadd($sums[$currencyId]['total_sum'], $journal['amount']); + $sums[$currencyId]['earned_sum'] = bcadd($sums[$currencyId]['earned_sum'], (string) $journal['amount']); + $sums[$currencyId]['total_sum'] = bcadd($sums[$currencyId]['total_sum'], (string) $journal['amount']); } } } @@ -514,8 +514,8 @@ class CategoryController extends Controller foreach ($categoryRow['transaction_journals'] as $journal) { $date = $journal['date']->format($format); $data[$key]['entries'][$date] ??= '0'; - $data[$key]['entries'][$date] = bcadd($data[$key]['entries'][$date], $journal['amount']); - $data[$key]['sum'] = bcadd($data[$key]['sum'], $journal['amount']); + $data[$key]['entries'][$date] = bcadd($data[$key]['entries'][$date], (string) $journal['amount']); + $data[$key]['sum'] = bcadd($data[$key]['sum'], (string) $journal['amount']); } } } @@ -588,8 +588,8 @@ class CategoryController extends Controller foreach ($categoryRow['transaction_journals'] as $journal) { $date = $journal['date']->format($format); $data[$key]['entries'][$date] ??= '0'; - $data[$key]['entries'][$date] = bcadd($data[$key]['entries'][$date], $journal['amount']); - $data[$key]['sum'] = bcadd($data[$key]['sum'], $journal['amount']); + $data[$key]['entries'][$date] = bcadd($data[$key]['entries'][$date], (string) $journal['amount']); + $data[$key]['sum'] = bcadd($data[$key]['sum'], (string) $journal['amount']); } } } diff --git a/app/Http/Controllers/Report/DoubleController.php b/app/Http/Controllers/Report/DoubleController.php index d8a76e3f78..79d9d5fc1e 100644 --- a/app/Http/Controllers/Report/DoubleController.php +++ b/app/Http/Controllers/Report/DoubleController.php @@ -90,7 +90,7 @@ class DoubleController extends Controller 'currency_decimal_places' => $currency['currency_decimal_places'], ]; ++$result[$key]['transactions']; - $result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']); + $result[$key]['sum'] = bcadd((string) $journal['amount'], $result[$key]['sum']); $result[$key]['avg'] = bcdiv($result[$key]['sum'], (string) $result[$key]['transactions']); $result[$key]['avg_float'] = (float) $result[$key]['avg']; } @@ -140,7 +140,7 @@ class DoubleController extends Controller 'currency_decimal_places' => $currency['currency_decimal_places'], ]; ++$result[$key]['transactions']; - $result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']); + $result[$key]['sum'] = bcadd((string) $journal['amount'], $result[$key]['sum']); $result[$key]['avg'] = bcdiv($result[$key]['sum'], (string) $result[$key]['transactions']); $result[$key]['avg_float'] = (float) $result[$key]['avg']; } @@ -219,10 +219,10 @@ class DoubleController extends Controller $report[$objectName]['dest_iban'] = $destIban; // add amounts: - $report[$objectName]['spent'] = bcadd($report[$objectName]['spent'], $journal['amount']); - $report[$objectName]['sum'] = bcadd($report[$objectName]['sum'], $journal['amount']); - $sums[$currencyId]['spent'] = bcadd($sums[$currencyId]['spent'], $journal['amount']); - $sums[$currencyId]['sum'] = bcadd($sums[$currencyId]['sum'], $journal['amount']); + $report[$objectName]['spent'] = bcadd($report[$objectName]['spent'], (string) $journal['amount']); + $report[$objectName]['sum'] = bcadd($report[$objectName]['sum'], (string) $journal['amount']); + $sums[$currencyId]['spent'] = bcadd($sums[$currencyId]['spent'], (string) $journal['amount']); + $sums[$currencyId]['sum'] = bcadd($sums[$currencyId]['sum'], (string) $journal['amount']); } } @@ -268,10 +268,10 @@ class DoubleController extends Controller $report[$objectName]['source_iban'] = $sourceIban; // add amounts: - $report[$objectName]['earned'] = bcadd($report[$objectName]['earned'], $journal['amount']); - $report[$objectName]['sum'] = bcadd($report[$objectName]['sum'], $journal['amount']); - $sums[$currencyId]['earned'] = bcadd($sums[$currencyId]['earned'], $journal['amount']); - $sums[$currencyId]['sum'] = bcadd($sums[$currencyId]['sum'], $journal['amount']); + $report[$objectName]['earned'] = bcadd($report[$objectName]['earned'], (string) $journal['amount']); + $report[$objectName]['sum'] = bcadd($report[$objectName]['sum'], (string) $journal['amount']); + $sums[$currencyId]['earned'] = bcadd($sums[$currencyId]['earned'], (string) $journal['amount']); + $sums[$currencyId]['sum'] = bcadd($sums[$currencyId]['sum'], (string) $journal['amount']); } } @@ -342,10 +342,10 @@ class DoubleController extends Controller ]; // set name // add amounts: - $report[$objectName]['spent'] = bcadd($report[$objectName]['spent'], $journal['amount']); - $report[$objectName]['sum'] = bcadd($report[$objectName]['sum'], $journal['amount']); - $sums[$currencyId]['spent'] = bcadd($sums[$currencyId]['spent'], $journal['amount']); - $sums[$currencyId]['sum'] = bcadd($sums[$currencyId]['sum'], $journal['amount']); + $report[$objectName]['spent'] = bcadd($report[$objectName]['spent'], (string) $journal['amount']); + $report[$objectName]['sum'] = bcadd($report[$objectName]['sum'], (string) $journal['amount']); + $sums[$currencyId]['spent'] = bcadd($sums[$currencyId]['spent'], (string) $journal['amount']); + $sums[$currencyId]['sum'] = bcadd($sums[$currencyId]['sum'], (string) $journal['amount']); } } @@ -381,10 +381,10 @@ class DoubleController extends Controller ]; // add amounts: - $report[$objectName]['earned'] = bcadd($report[$objectName]['earned'], $journal['amount']); - $report[$objectName]['sum'] = bcadd($report[$objectName]['sum'], $journal['amount']); - $sums[$currencyId]['earned'] = bcadd($sums[$currencyId]['earned'], $journal['amount']); - $sums[$currencyId]['sum'] = bcadd($sums[$currencyId]['sum'], $journal['amount']); + $report[$objectName]['earned'] = bcadd($report[$objectName]['earned'], (string) $journal['amount']); + $report[$objectName]['sum'] = bcadd($report[$objectName]['sum'], (string) $journal['amount']); + $sums[$currencyId]['earned'] = bcadd($sums[$currencyId]['earned'], (string) $journal['amount']); + $sums[$currencyId]['sum'] = bcadd($sums[$currencyId]['sum'], (string) $journal['amount']); } } diff --git a/app/Http/Controllers/Report/TagController.php b/app/Http/Controllers/Report/TagController.php index a60387539a..0b8f8cde7b 100644 --- a/app/Http/Controllers/Report/TagController.php +++ b/app/Http/Controllers/Report/TagController.php @@ -103,11 +103,11 @@ class TagController extends Controller ]; $report[$sourceAccountId]['currencies'][$currencyId]['tags'][$tagId]['spent'] = bcadd( $report[$sourceAccountId]['currencies'][$currencyId]['tags'][$tagId]['spent'], - $journal['amount'] + (string) $journal['amount'] ); $report[$sourceAccountId]['currencies'][$currencyId]['tags'][$tagId]['sum'] = bcadd( $report[$sourceAccountId]['currencies'][$currencyId]['tags'][$tagId]['sum'], - $journal['amount'] + (string) $journal['amount'] ); } } @@ -137,11 +137,11 @@ class TagController extends Controller ]; $report[$destinationId]['currencies'][$currencyId]['tags'][$tagId]['earned'] = bcadd( $report[$destinationId]['currencies'][$currencyId]['tags'][$tagId]['earned'], - $journal['amount'] + (string) $journal['amount'] ); $report[$destinationId]['currencies'][$currencyId]['tags'][$tagId]['sum'] = bcadd( $report[$destinationId]['currencies'][$currencyId]['tags'][$tagId]['sum'], - $journal['amount'] + (string) $journal['amount'] ); } } @@ -199,14 +199,14 @@ class TagController extends Controller ]; $report[$sourceAccountId]['currencies'][$currencyId]['spent'] = bcadd( $report[$sourceAccountId]['currencies'][$currencyId]['spent'], - $journal['amount'] + (string) $journal['amount'] ); $report[$sourceAccountId]['currencies'][$currencyId]['sum'] = bcadd( $report[$sourceAccountId]['currencies'][$currencyId]['sum'], - $journal['amount'] + (string) $journal['amount'] ); - $sums[$currencyId]['spent_sum'] = bcadd($sums[$currencyId]['spent_sum'], $journal['amount']); - $sums[$currencyId]['total_sum'] = bcadd($sums[$currencyId]['total_sum'], $journal['amount']); + $sums[$currencyId]['spent_sum'] = bcadd($sums[$currencyId]['spent_sum'], (string) $journal['amount']); + $sums[$currencyId]['total_sum'] = bcadd($sums[$currencyId]['total_sum'], (string) $journal['amount']); } } } @@ -237,14 +237,14 @@ class TagController extends Controller ]; $report[$destinationAccountId]['currencies'][$currencyId]['earned'] = bcadd( $report[$destinationAccountId]['currencies'][$currencyId]['earned'], - $journal['amount'] + (string) $journal['amount'] ); $report[$destinationAccountId]['currencies'][$currencyId]['sum'] = bcadd( $report[$destinationAccountId]['currencies'][$currencyId]['sum'], - $journal['amount'] + (string) $journal['amount'] ); - $sums[$currencyId]['earned_sum'] = bcadd($sums[$currencyId]['earned_sum'], $journal['amount']); - $sums[$currencyId]['total_sum'] = bcadd($sums[$currencyId]['total_sum'], $journal['amount']); + $sums[$currencyId]['earned_sum'] = bcadd($sums[$currencyId]['earned_sum'], (string) $journal['amount']); + $sums[$currencyId]['total_sum'] = bcadd($sums[$currencyId]['total_sum'], (string) $journal['amount']); } } } @@ -279,7 +279,7 @@ class TagController extends Controller 'currency_decimal_places' => $currency['currency_decimal_places'], ]; ++$result[$key]['transactions']; - $result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']); + $result[$key]['sum'] = bcadd((string) $journal['amount'], $result[$key]['sum']); $result[$key]['avg'] = bcdiv($result[$key]['sum'], (string) $result[$key]['transactions']); $result[$key]['avg_float'] = (float) $result[$key]['avg']; } @@ -329,7 +329,7 @@ class TagController extends Controller 'currency_decimal_places' => $currency['currency_decimal_places'], ]; ++$result[$key]['transactions']; - $result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']); + $result[$key]['sum'] = bcadd((string) $journal['amount'], $result[$key]['sum']); $result[$key]['avg'] = bcdiv($result[$key]['sum'], (string) $result[$key]['transactions']); $result[$key]['avg_float'] = (float) $result[$key]['avg']; } @@ -403,10 +403,10 @@ class TagController extends Controller 'currency_name' => $currency['currency_name'], 'currency_decimal_places' => $currency['currency_decimal_places'], ]; - $report[$tagId]['currencies'][$currencyId]['spent'] = bcadd($report[$tagId]['currencies'][$currencyId]['spent'], $journal['amount']); - $report[$tagId]['currencies'][$currencyId]['sum'] = bcadd($report[$tagId]['currencies'][$currencyId]['sum'], $journal['amount']); - $sums[$currencyId]['spent_sum'] = bcadd($sums[$currencyId]['spent_sum'], $journal['amount']); - $sums[$currencyId]['total_sum'] = bcadd($sums[$currencyId]['total_sum'], $journal['amount']); + $report[$tagId]['currencies'][$currencyId]['spent'] = bcadd((string) $report[$tagId]['currencies'][$currencyId]['spent'], (string) $journal['amount']); + $report[$tagId]['currencies'][$currencyId]['sum'] = bcadd((string) $report[$tagId]['currencies'][$currencyId]['sum'], (string) $journal['amount']); + $sums[$currencyId]['spent_sum'] = bcadd($sums[$currencyId]['spent_sum'], (string) $journal['amount']); + $sums[$currencyId]['total_sum'] = bcadd($sums[$currencyId]['total_sum'], (string) $journal['amount']); } } } @@ -441,10 +441,10 @@ class TagController extends Controller 'currency_name' => $currency['currency_name'], 'currency_decimal_places' => $currency['currency_decimal_places'], ]; - $report[$tagId]['currencies'][$currencyId]['earned'] = bcadd($report[$tagId]['currencies'][$currencyId]['earned'], $journal['amount']); - $report[$tagId]['currencies'][$currencyId]['sum'] = bcadd($report[$tagId]['currencies'][$currencyId]['sum'], $journal['amount']); - $sums[$currencyId]['earned_sum'] = bcadd($sums[$currencyId]['earned_sum'], $journal['amount']); - $sums[$currencyId]['total_sum'] = bcadd($sums[$currencyId]['total_sum'], $journal['amount']); + $report[$tagId]['currencies'][$currencyId]['earned'] = bcadd((string) $report[$tagId]['currencies'][$currencyId]['earned'], (string) $journal['amount']); + $report[$tagId]['currencies'][$currencyId]['sum'] = bcadd((string) $report[$tagId]['currencies'][$currencyId]['sum'], (string) $journal['amount']); + $sums[$currencyId]['earned_sum'] = bcadd($sums[$currencyId]['earned_sum'], (string) $journal['amount']); + $sums[$currencyId]['total_sum'] = bcadd($sums[$currencyId]['total_sum'], (string) $journal['amount']); } } } diff --git a/app/Http/Controllers/Transaction/MassController.php b/app/Http/Controllers/Transaction/MassController.php index 67a2fc6add..cd2bd4ec4a 100644 --- a/app/Http/Controllers/Transaction/MassController.php +++ b/app/Http/Controllers/Transaction/MassController.php @@ -173,7 +173,7 @@ class MassController extends Controller try { $this->updateJournal($integer, $request); ++$count; - } catch (FireflyException $e) { + } catch (FireflyException) { // @ignoreException } } diff --git a/app/Http/Controllers/Transaction/ShowController.php b/app/Http/Controllers/Transaction/ShowController.php index 5336712538..f9eaa1a490 100644 --- a/app/Http/Controllers/Transaction/ShowController.php +++ b/app/Http/Controllers/Transaction/ShowController.php @@ -150,11 +150,11 @@ class ShowController extends Controller 'decimal_places' => $transaction['currency_decimal_places'], ]; } - $amounts[$symbol]['amount'] = bcadd($amounts[$symbol]['amount'], $transaction['amount']); + $amounts[$symbol]['amount'] = bcadd($amounts[$symbol]['amount'], (string) $transaction['amount']); if (null !== $transaction['foreign_amount'] && '' !== $transaction['foreign_amount'] && 0 !== bccomp( '0', - $transaction['foreign_amount'] + (string) $transaction['foreign_amount'] )) { // same for foreign currency: $foreignSymbol = $transaction['foreign_currency_symbol']; @@ -167,7 +167,7 @@ class ShowController extends Controller } $amounts[$foreignSymbol]['amount'] = bcadd( $amounts[$foreignSymbol]['amount'], - $transaction['foreign_amount'] + (string) $transaction['foreign_amount'] ); } } diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 4dafb75854..358b9b71c2 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -35,17 +35,16 @@ use Illuminate\Http\Request; */ class Authenticate { - /** - * The authentication factory instance. - */ - protected Auth $auth; - /** * Create a new middleware instance. */ - public function __construct(Auth $auth) + public function __construct( + /** + * The authentication factory instance. + */ + protected Auth $auth + ) { - $this->auth = $auth; } /** diff --git a/app/Http/Middleware/InterestingMessage.php b/app/Http/Middleware/InterestingMessage.php index 30f5bfd238..a953365c99 100644 --- a/app/Http/Middleware/InterestingMessage.php +++ b/app/Http/Middleware/InterestingMessage.php @@ -130,12 +130,12 @@ class InterestingMessage session()->flash('success', (string) trans('firefly.stored_journal', ['description' => $title])); } if ('updated' === $message) { - $type = strtolower($journal->transactionType->type); + $type = strtolower((string) $journal->transactionType->type); session()->flash('success_url', route('transactions.show', [$transactionGroupId])); session()->flash('success', (string) trans(sprintf('firefly.updated_%s', $type), ['description' => $title])); } if ('no_change' === $message) { - $type = strtolower($journal->transactionType->type); + $type = strtolower((string) $journal->transactionType->type); session()->flash('warning_url', route('transactions.show', [$transactionGroupId])); session()->flash('warning', (string) trans(sprintf('firefly.no_changes_%s', $type), ['description' => $title])); } diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index 60ca8eee65..7db74aa139 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -102,7 +102,7 @@ class Range $language = app('steam')->getLanguage(); $locale = app('steam')->getLocale(); \App::setLocale($language); - Carbon::setLocale(substr($locale, 0, 2)); + Carbon::setLocale(substr((string) $locale, 0, 2)); $localeArray = app('steam')->getLocaleArray($locale); diff --git a/app/Http/Middleware/SecureHeaders.php b/app/Http/Middleware/SecureHeaders.php index d481c820af..d316e8a677 100644 --- a/app/Http/Middleware/SecureHeaders.php +++ b/app/Http/Middleware/SecureHeaders.php @@ -45,7 +45,7 @@ class SecureHeaders // generate and share nonce. $nonce = base64_encode(random_bytes(16)); Vite::useCspNonce($nonce); - if (class_exists('Barryvdh\Debugbar\Facades\Debugbar')) { + if (class_exists(\Barryvdh\Debugbar\Facades\Debugbar::class)) { Debugbar::getJavascriptRenderer()->setCspNonce($nonce); } app('view')->share('JS_NONCE', $nonce); diff --git a/app/Http/Middleware/StartFireflySession.php b/app/Http/Middleware/StartFireflySession.php index dad24baa3c..03359f735a 100644 --- a/app/Http/Middleware/StartFireflySession.php +++ b/app/Http/Middleware/StartFireflySession.php @@ -37,6 +37,7 @@ class StartFireflySession extends StartSession * * @param Session $session */ + #[\Override] protected function storeCurrentUrl(Request $request, $session): void { $url = $request->fullUrl(); diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php index 9c27228c4a..9dcd6a249a 100644 --- a/app/Http/Middleware/TrustHosts.php +++ b/app/Http/Middleware/TrustHosts.php @@ -33,6 +33,7 @@ class TrustHosts extends Middleware * * @return array */ + #[\Override] public function hosts(): array { return [ diff --git a/app/Http/Requests/AccountFormRequest.php b/app/Http/Requests/AccountFormRequest.php index fba3a9c101..9cd8d51163 100644 --- a/app/Http/Requests/AccountFormRequest.php +++ b/app/Http/Requests/AccountFormRequest.php @@ -137,7 +137,7 @@ class AccountFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/AttachmentFormRequest.php b/app/Http/Requests/AttachmentFormRequest.php index 0845dea163..f481510ee6 100644 --- a/app/Http/Requests/AttachmentFormRequest.php +++ b/app/Http/Requests/AttachmentFormRequest.php @@ -63,7 +63,7 @@ class AttachmentFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/BillStoreRequest.php b/app/Http/Requests/BillStoreRequest.php index ceb6f3d0e0..37e9f7ef02 100644 --- a/app/Http/Requests/BillStoreRequest.php +++ b/app/Http/Requests/BillStoreRequest.php @@ -83,7 +83,7 @@ class BillStoreRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/BillUpdateRequest.php b/app/Http/Requests/BillUpdateRequest.php index 8494b80294..cde6978364 100644 --- a/app/Http/Requests/BillUpdateRequest.php +++ b/app/Http/Requests/BillUpdateRequest.php @@ -87,7 +87,7 @@ class BillUpdateRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/BudgetFormStoreRequest.php b/app/Http/Requests/BudgetFormStoreRequest.php index f43a4c0624..86779d3794 100644 --- a/app/Http/Requests/BudgetFormStoreRequest.php +++ b/app/Http/Requests/BudgetFormStoreRequest.php @@ -84,7 +84,7 @@ class BudgetFormStoreRequest extends FormRequest ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/BudgetFormUpdateRequest.php b/app/Http/Requests/BudgetFormUpdateRequest.php index 81396f1748..5dbecfd4c8 100644 --- a/app/Http/Requests/BudgetFormUpdateRequest.php +++ b/app/Http/Requests/BudgetFormUpdateRequest.php @@ -93,7 +93,7 @@ class BudgetFormUpdateRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/BudgetIncomeRequest.php b/app/Http/Requests/BudgetIncomeRequest.php index 0ba22c3f06..d75f81faa9 100644 --- a/app/Http/Requests/BudgetIncomeRequest.php +++ b/app/Http/Requests/BudgetIncomeRequest.php @@ -52,7 +52,7 @@ class BudgetIncomeRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/BulkEditJournalRequest.php b/app/Http/Requests/BulkEditJournalRequest.php index 40b0e794fa..4bbaafa77b 100644 --- a/app/Http/Requests/BulkEditJournalRequest.php +++ b/app/Http/Requests/BulkEditJournalRequest.php @@ -52,7 +52,7 @@ class BulkEditJournalRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/CategoryFormRequest.php b/app/Http/Requests/CategoryFormRequest.php index 367dede1a8..8ca3455168 100644 --- a/app/Http/Requests/CategoryFormRequest.php +++ b/app/Http/Requests/CategoryFormRequest.php @@ -73,7 +73,7 @@ class CategoryFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/ConfigurationRequest.php b/app/Http/Requests/ConfigurationRequest.php index ff7eb9b743..57f8a969b4 100644 --- a/app/Http/Requests/ConfigurationRequest.php +++ b/app/Http/Requests/ConfigurationRequest.php @@ -61,7 +61,7 @@ class ConfigurationRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/CurrencyFormRequest.php b/app/Http/Requests/CurrencyFormRequest.php index 02587f9b22..b1707e91ce 100644 --- a/app/Http/Requests/CurrencyFormRequest.php +++ b/app/Http/Requests/CurrencyFormRequest.php @@ -85,7 +85,7 @@ class CurrencyFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/DeleteAccountFormRequest.php b/app/Http/Requests/DeleteAccountFormRequest.php index 5d5296a99a..31222e084a 100644 --- a/app/Http/Requests/DeleteAccountFormRequest.php +++ b/app/Http/Requests/DeleteAccountFormRequest.php @@ -49,7 +49,7 @@ class DeleteAccountFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/EmailFormRequest.php b/app/Http/Requests/EmailFormRequest.php index 0cb58eb4ed..cd4369f3ec 100644 --- a/app/Http/Requests/EmailFormRequest.php +++ b/app/Http/Requests/EmailFormRequest.php @@ -51,7 +51,7 @@ class EmailFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/ExistingTokenFormRequest.php b/app/Http/Requests/ExistingTokenFormRequest.php index 243d1ac1bd..b843012fba 100644 --- a/app/Http/Requests/ExistingTokenFormRequest.php +++ b/app/Http/Requests/ExistingTokenFormRequest.php @@ -50,7 +50,7 @@ class ExistingTokenFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/InviteUserFormRequest.php b/app/Http/Requests/InviteUserFormRequest.php index 9e2cde1ede..2c31d965ce 100644 --- a/app/Http/Requests/InviteUserFormRequest.php +++ b/app/Http/Requests/InviteUserFormRequest.php @@ -51,7 +51,7 @@ class InviteUserFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/JournalLinkRequest.php b/app/Http/Requests/JournalLinkRequest.php index f03e2bf323..185aaea191 100644 --- a/app/Http/Requests/JournalLinkRequest.php +++ b/app/Http/Requests/JournalLinkRequest.php @@ -45,7 +45,7 @@ class JournalLinkRequest extends FormRequest { $return = []; $linkType = $this->get('link_type'); - $parts = explode('_', $linkType); + $parts = explode('_', (string) $linkType); $return['link_type_id'] = (int) $parts[0]; $return['transaction_journal_id'] = $this->convertInteger('opposing'); $return['notes'] = $this->convertString('notes'); @@ -80,7 +80,7 @@ class JournalLinkRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/LinkTypeFormRequest.php b/app/Http/Requests/LinkTypeFormRequest.php index 5b9b4470f7..3fb7511c6a 100644 --- a/app/Http/Requests/LinkTypeFormRequest.php +++ b/app/Http/Requests/LinkTypeFormRequest.php @@ -65,7 +65,7 @@ class LinkTypeFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/MassDeleteJournalRequest.php b/app/Http/Requests/MassDeleteJournalRequest.php index f6da58b661..603e8a7d51 100644 --- a/app/Http/Requests/MassDeleteJournalRequest.php +++ b/app/Http/Requests/MassDeleteJournalRequest.php @@ -49,7 +49,7 @@ class MassDeleteJournalRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/MassEditJournalRequest.php b/app/Http/Requests/MassEditJournalRequest.php index cb48c0b736..7f217aaf67 100644 --- a/app/Http/Requests/MassEditJournalRequest.php +++ b/app/Http/Requests/MassEditJournalRequest.php @@ -55,7 +55,7 @@ class MassEditJournalRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/NewUserFormRequest.php b/app/Http/Requests/NewUserFormRequest.php index 2e16f47c48..bed1e3def7 100644 --- a/app/Http/Requests/NewUserFormRequest.php +++ b/app/Http/Requests/NewUserFormRequest.php @@ -58,7 +58,7 @@ class NewUserFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/ObjectGroupFormRequest.php b/app/Http/Requests/ObjectGroupFormRequest.php index 03948c4486..8d8dcb1b8a 100644 --- a/app/Http/Requests/ObjectGroupFormRequest.php +++ b/app/Http/Requests/ObjectGroupFormRequest.php @@ -69,7 +69,7 @@ class ObjectGroupFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/PiggyBankStoreRequest.php b/app/Http/Requests/PiggyBankStoreRequest.php index ddef5126e3..d3ce9e2507 100644 --- a/app/Http/Requests/PiggyBankStoreRequest.php +++ b/app/Http/Requests/PiggyBankStoreRequest.php @@ -117,7 +117,7 @@ class PiggyBankStoreRequest extends FormRequest ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } diff --git a/app/Http/Requests/PiggyBankUpdateRequest.php b/app/Http/Requests/PiggyBankUpdateRequest.php index d1d38467e5..56f023768c 100644 --- a/app/Http/Requests/PiggyBankUpdateRequest.php +++ b/app/Http/Requests/PiggyBankUpdateRequest.php @@ -122,7 +122,7 @@ class PiggyBankUpdateRequest extends FormRequest if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } diff --git a/app/Http/Requests/ProfileFormRequest.php b/app/Http/Requests/ProfileFormRequest.php index 690697681e..bf741778e6 100644 --- a/app/Http/Requests/ProfileFormRequest.php +++ b/app/Http/Requests/ProfileFormRequest.php @@ -51,7 +51,7 @@ class ProfileFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/ReconciliationStoreRequest.php b/app/Http/Requests/ReconciliationStoreRequest.php index bd1d4bb239..75a1a6d8e3 100644 --- a/app/Http/Requests/ReconciliationStoreRequest.php +++ b/app/Http/Requests/ReconciliationStoreRequest.php @@ -82,7 +82,7 @@ class ReconciliationStoreRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/RecurrenceFormRequest.php b/app/Http/Requests/RecurrenceFormRequest.php index e08bca3a47..9613291d3f 100644 --- a/app/Http/Requests/RecurrenceFormRequest.php +++ b/app/Http/Requests/RecurrenceFormRequest.php @@ -281,7 +281,7 @@ class RecurrenceFormRequest extends FormRequest } ); if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } diff --git a/app/Http/Requests/ReportFormRequest.php b/app/Http/Requests/ReportFormRequest.php index 250d520122..a961936c3e 100644 --- a/app/Http/Requests/ReportFormRequest.php +++ b/app/Http/Requests/ReportFormRequest.php @@ -251,7 +251,7 @@ class ReportFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/RuleFormRequest.php b/app/Http/Requests/RuleFormRequest.php index aadf8c7fee..8b7d9ca061 100644 --- a/app/Http/Requests/RuleFormRequest.php +++ b/app/Http/Requests/RuleFormRequest.php @@ -165,7 +165,7 @@ class RuleFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/RuleGroupFormRequest.php b/app/Http/Requests/RuleGroupFormRequest.php index ac0a4fc891..8f5c4af01b 100644 --- a/app/Http/Requests/RuleGroupFormRequest.php +++ b/app/Http/Requests/RuleGroupFormRequest.php @@ -80,7 +80,7 @@ class RuleGroupFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/SelectTransactionsRequest.php b/app/Http/Requests/SelectTransactionsRequest.php index 13a5f7729a..e87b4af6b1 100644 --- a/app/Http/Requests/SelectTransactionsRequest.php +++ b/app/Http/Requests/SelectTransactionsRequest.php @@ -58,7 +58,7 @@ class SelectTransactionsRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/TagFormRequest.php b/app/Http/Requests/TagFormRequest.php index a7c5b25645..2529907f0f 100644 --- a/app/Http/Requests/TagFormRequest.php +++ b/app/Http/Requests/TagFormRequest.php @@ -83,7 +83,7 @@ class TagFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/TestRuleFormRequest.php b/app/Http/Requests/TestRuleFormRequest.php index 40511100b2..0cf0524667 100644 --- a/app/Http/Requests/TestRuleFormRequest.php +++ b/app/Http/Requests/TestRuleFormRequest.php @@ -55,7 +55,7 @@ class TestRuleFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/TokenFormRequest.php b/app/Http/Requests/TokenFormRequest.php index 108d45d1ee..3a53cbe7ab 100644 --- a/app/Http/Requests/TokenFormRequest.php +++ b/app/Http/Requests/TokenFormRequest.php @@ -50,7 +50,7 @@ class TokenFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/TriggerRecurrenceRequest.php b/app/Http/Requests/TriggerRecurrenceRequest.php index a1ad139b6e..c03e531a00 100644 --- a/app/Http/Requests/TriggerRecurrenceRequest.php +++ b/app/Http/Requests/TriggerRecurrenceRequest.php @@ -61,7 +61,7 @@ class TriggerRecurrenceRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/UserFormRequest.php b/app/Http/Requests/UserFormRequest.php index fa9d62cb8e..409cfba453 100644 --- a/app/Http/Requests/UserFormRequest.php +++ b/app/Http/Requests/UserFormRequest.php @@ -69,7 +69,7 @@ class UserFormRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Http/Requests/UserRegistrationRequest.php b/app/Http/Requests/UserRegistrationRequest.php index 026fd05a9d..6e26763831 100644 --- a/app/Http/Requests/UserRegistrationRequest.php +++ b/app/Http/Requests/UserRegistrationRequest.php @@ -59,7 +59,7 @@ class UserRegistrationRequest extends FormRequest public function withValidator(Validator $validator): void { if ($validator->fails()) { - Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray()); + Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray()); } } } diff --git a/app/Jobs/CreateRecurringTransactions.php b/app/Jobs/CreateRecurringTransactions.php index aac62c76dc..0eb0ef76ba 100644 --- a/app/Jobs/CreateRecurringTransactions.php +++ b/app/Jobs/CreateRecurringTransactions.php @@ -156,9 +156,7 @@ class CreateRecurringTransactions implements ShouldQueue private function filterRecurrences(Collection $recurrences): Collection { return $recurrences->filter( - function (Recurrence $recurrence) { - return $this->validRecurrence($recurrence); - } + fn(Recurrence $recurrence) => $this->validRecurrence($recurrence) ); } @@ -420,7 +418,7 @@ class CreateRecurringTransactions implements ShouldQueue /** @var RecurrenceTransaction $transaction */ foreach ($transactions as $index => $transaction) { $single = [ - 'type' => null === $transaction?->transactionType?->type ? strtolower($recurrence->transactionType->type) : strtolower($transaction->transactionType->type), // @phpstan-ignore-line + 'type' => null === $transaction?->transactionType?->type ? strtolower((string) $recurrence->transactionType->type) : strtolower($transaction->transactionType->type), // @phpstan-ignore-line 'date' => $date, 'user' => $recurrence->user, 'user_group' => $recurrence->user->userGroup, diff --git a/app/Jobs/MailError.php b/app/Jobs/MailError.php index 21984409af..192a17359c 100644 --- a/app/Jobs/MailError.php +++ b/app/Jobs/MailError.php @@ -38,21 +38,12 @@ class MailError extends Job implements ShouldQueue use InteractsWithQueue; use SerializesModels; - protected string $destination; - protected array $exception; - protected string $ipAddress; - protected array $userData; - /** * MailError constructor. */ - public function __construct(array $userData, string $destination, string $ipAddress, array $exceptionData) + public function __construct(protected array $userData, protected string $destination, protected string $ipAddress, protected array $exception) { - $this->userData = $userData; - $this->destination = $destination; - $this->ipAddress = $ipAddress; - $this->exception = $exceptionData; - $debug = $exceptionData; + $debug = $this->exception; unset($debug['stackTrace'], $debug['headers']); app('log')->error(sprintf('Exception is: %s', \Safe\json_encode($debug))); diff --git a/app/Jobs/SendWebhookMessage.php b/app/Jobs/SendWebhookMessage.php index b656b58df3..267183deaa 100644 --- a/app/Jobs/SendWebhookMessage.php +++ b/app/Jobs/SendWebhookMessage.php @@ -42,14 +42,11 @@ class SendWebhookMessage implements ShouldQueue use Queueable; use SerializesModels; - private WebhookMessage $message; - /** * Create a new job instance. */ - public function __construct(WebhookMessage $message) + public function __construct(private WebhookMessage $message) { - $this->message = $message; } /** diff --git a/app/Mail/BillWarningMail.php b/app/Mail/BillWarningMail.php index ac16d4a1de..654cfe34b9 100644 --- a/app/Mail/BillWarningMail.php +++ b/app/Mail/BillWarningMail.php @@ -37,18 +37,11 @@ class BillWarningMail extends Mailable use Queueable; use SerializesModels; - public Bill $bill; - public int $diff; - public string $field; - /** * ConfirmEmailChangeMail constructor. */ - public function __construct(Bill $bill, string $field, int $diff) + public function __construct(public Bill $bill, public string $field, public int $diff) { - $this->bill = $bill; - $this->field = $field; - $this->diff = $diff; } /** diff --git a/app/Mail/ConfirmEmailChangeMail.php b/app/Mail/ConfirmEmailChangeMail.php index d5161e2a66..7d872ea523 100644 --- a/app/Mail/ConfirmEmailChangeMail.php +++ b/app/Mail/ConfirmEmailChangeMail.php @@ -37,18 +37,11 @@ class ConfirmEmailChangeMail extends Mailable use Queueable; use SerializesModels; - public string $newEmail; - public string $oldEmail; - public string $url; - /** * ConfirmEmailChangeMail constructor. */ - public function __construct(string $newEmail, string $oldEmail, string $url) + public function __construct(public string $newEmail, public string $oldEmail, public string $url) { - $this->newEmail = $newEmail; - $this->oldEmail = $oldEmail; - $this->url = $url; } /** diff --git a/app/Mail/InvitationMail.php b/app/Mail/InvitationMail.php index 8a368d9a25..96b3493242 100644 --- a/app/Mail/InvitationMail.php +++ b/app/Mail/InvitationMail.php @@ -35,21 +35,14 @@ class InvitationMail extends Mailable { use Queueable; use SerializesModels; - - public string $admin; public string $host; - public string $invitee; - public string $url; /** * OAuthTokenCreatedMail constructor. */ - public function __construct(string $invitee, string $admin, string $url) + public function __construct(public string $invitee, public string $admin, public string $url) { - $this->invitee = $invitee; - $this->admin = $admin; - $this->url = $url; - $this->host = (string) \Safe\parse_url($url, PHP_URL_HOST); + $this->host = (string) \Safe\parse_url($this->url, PHP_URL_HOST); } /** diff --git a/app/Mail/NewIPAddressWarningMail.php b/app/Mail/NewIPAddressWarningMail.php index a1a311977d..18497eb97e 100644 --- a/app/Mail/NewIPAddressWarningMail.php +++ b/app/Mail/NewIPAddressWarningMail.php @@ -38,15 +38,13 @@ class NewIPAddressWarningMail extends Mailable use SerializesModels; public string $host; - public string $ipAddress; public string $time; /** * OAuthTokenCreatedMail constructor. */ - public function __construct(string $ipAddress) + public function __construct(public string $ipAddress) { - $this->ipAddress = $ipAddress; } /** diff --git a/app/Mail/OAuthTokenCreatedMail.php b/app/Mail/OAuthTokenCreatedMail.php index 3c252b6ad6..9f14cfebe1 100644 --- a/app/Mail/OAuthTokenCreatedMail.php +++ b/app/Mail/OAuthTokenCreatedMail.php @@ -37,14 +37,11 @@ class OAuthTokenCreatedMail extends Mailable use Queueable; use SerializesModels; - public Client $client; - /** * OAuthTokenCreatedMail constructor. */ - public function __construct(Client $client) + public function __construct(public Client $client) { - $this->client = $client; } /** diff --git a/app/Mail/RegisteredUser.php b/app/Mail/RegisteredUser.php index fbbe6d2aaa..f688c14452 100644 --- a/app/Mail/RegisteredUser.php +++ b/app/Mail/RegisteredUser.php @@ -37,14 +37,11 @@ class RegisteredUser extends Mailable use Queueable; use SerializesModels; - public string $address; - /** * Create a new message instance. */ - public function __construct(string $address) + public function __construct(public string $address) { - $this->address = $address; } /** diff --git a/app/Mail/ReportNewJournalsMail.php b/app/Mail/ReportNewJournalsMail.php index ff7515ff68..77ae45f62d 100644 --- a/app/Mail/ReportNewJournalsMail.php +++ b/app/Mail/ReportNewJournalsMail.php @@ -40,16 +40,13 @@ class ReportNewJournalsMail extends Mailable { use Queueable; use SerializesModels; - - public Collection $groups; public array $transformed; /** * ConfirmEmailChangeMail constructor. */ - public function __construct(Collection $groups) + public function __construct(public Collection $groups) { - $this->groups = $groups; } /** diff --git a/app/Mail/RequestedNewPassword.php b/app/Mail/RequestedNewPassword.php index 8d1342908e..f8d1e3dfb4 100644 --- a/app/Mail/RequestedNewPassword.php +++ b/app/Mail/RequestedNewPassword.php @@ -36,14 +36,11 @@ class RequestedNewPassword extends Mailable use Queueable; use SerializesModels; - public string $url; - /** * RequestedNewPassword constructor. */ - public function __construct(string $url) + public function __construct(public string $url) { - $this->url = $url; } /** diff --git a/app/Mail/UndoEmailChangeMail.php b/app/Mail/UndoEmailChangeMail.php index 5f676b24d3..abb9ed85b7 100644 --- a/app/Mail/UndoEmailChangeMail.php +++ b/app/Mail/UndoEmailChangeMail.php @@ -35,18 +35,11 @@ class UndoEmailChangeMail extends Mailable use Queueable; use SerializesModels; - public string $newEmail; - public string $oldEmail; - public string $url; - /** * UndoEmailChangeMail constructor. */ - public function __construct(string $newEmail, string $oldEmail, string $url) + public function __construct(public string $newEmail, public string $oldEmail, public string $url) { - $this->newEmail = $newEmail; - $this->oldEmail = $oldEmail; - $this->url = $url; } /** diff --git a/app/Notifications/Admin/UnknownUserLoginAttempt.php b/app/Notifications/Admin/UnknownUserLoginAttempt.php index 57723356fc..a36ef56ae9 100644 --- a/app/Notifications/Admin/UnknownUserLoginAttempt.php +++ b/app/Notifications/Admin/UnknownUserLoginAttempt.php @@ -41,11 +41,8 @@ class UnknownUserLoginAttempt extends Notification { use Queueable; - private string $address; - - public function __construct(string $address) + public function __construct(private string $address) { - $this->address = $address; } /** diff --git a/app/Notifications/Admin/UserInvitation.php b/app/Notifications/Admin/UserInvitation.php index eed76f98a3..6ca16535d8 100644 --- a/app/Notifications/Admin/UserInvitation.php +++ b/app/Notifications/Admin/UserInvitation.php @@ -45,11 +45,8 @@ class UserInvitation extends Notification { use Queueable; - private InvitedUser $invitee; - - public function __construct(InvitedUser $invitee) + public function __construct(private InvitedUser $invitee) { - $this->invitee = $invitee; } /** @@ -72,7 +69,7 @@ class UserInvitation extends Notification $time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js')); - return (new MailMessage()) + return new MailMessage() ->markdown('emails.invitation-created', ['email' => $this->invitee->user->email, 'invitee' => $this->invitee->email, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time]) ->subject((string) trans('email.invitation_created_subject')) ; diff --git a/app/Notifications/Admin/UserRegistration.php b/app/Notifications/Admin/UserRegistration.php index ef51a2fb24..faefc8dd2e 100644 --- a/app/Notifications/Admin/UserRegistration.php +++ b/app/Notifications/Admin/UserRegistration.php @@ -45,11 +45,8 @@ class UserRegistration extends Notification { use Queueable; - private User $user; - - public function __construct(User $user) + public function __construct(private User $user) { - $this->user = $user; } /** @@ -71,7 +68,7 @@ class UserRegistration extends Notification $userAgent = Request::userAgent(); $time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js')); - return (new MailMessage()) + return new MailMessage() ->markdown('emails.registered-admin', ['email' => $this->user->email, 'id' => $this->user->id, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time]) ->subject((string) trans('email.registered_subject_admin')) ; diff --git a/app/Notifications/Admin/VersionCheckResult.php b/app/Notifications/Admin/VersionCheckResult.php index d966313d45..bff0d12a8c 100644 --- a/app/Notifications/Admin/VersionCheckResult.php +++ b/app/Notifications/Admin/VersionCheckResult.php @@ -42,11 +42,8 @@ class VersionCheckResult extends Notification { use Queueable; - private string $message; - - public function __construct(string $message) + public function __construct(private string $message) { - $this->message = $message; } /** @@ -63,7 +60,7 @@ class VersionCheckResult extends Notification */ public function toMail(OwnerNotifiable $notifiable): MailMessage { - return (new MailMessage()) + return new MailMessage() ->markdown('emails.new-version', ['message' => $this->message]) ->subject((string) trans('email.new_version_email_subject')) ; diff --git a/app/Notifications/Security/DisabledMFANotification.php b/app/Notifications/Security/DisabledMFANotification.php index 991d98d7e8..6d4fde6fba 100644 --- a/app/Notifications/Security/DisabledMFANotification.php +++ b/app/Notifications/Security/DisabledMFANotification.php @@ -40,11 +40,8 @@ class DisabledMFANotification extends Notification { use Queueable; - private User $user; - - public function __construct(User $user) + public function __construct(private User $user) { - $this->user = $user; } /** @@ -67,7 +64,7 @@ class DisabledMFANotification extends Notification $userAgent = Request::userAgent(); $time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js')); - return (new MailMessage())->markdown('emails.security.disabled-mfa', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject); + return new MailMessage()->markdown('emails.security.disabled-mfa', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject); } public function toNtfy(User $notifiable): Message diff --git a/app/Notifications/Security/EnabledMFANotification.php b/app/Notifications/Security/EnabledMFANotification.php index dea2facf36..871f424a55 100644 --- a/app/Notifications/Security/EnabledMFANotification.php +++ b/app/Notifications/Security/EnabledMFANotification.php @@ -40,11 +40,8 @@ class EnabledMFANotification extends Notification { use Queueable; - private User $user; - - public function __construct(User $user) + public function __construct(private User $user) { - $this->user = $user; } /** @@ -67,7 +64,7 @@ class EnabledMFANotification extends Notification $userAgent = Request::userAgent(); $time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js')); - return (new MailMessage())->markdown('emails.security.enabled-mfa', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject); + return new MailMessage()->markdown('emails.security.enabled-mfa', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject); } public function toNtfy(User $notifiable): Message diff --git a/app/Notifications/Security/MFABackupFewLeftNotification.php b/app/Notifications/Security/MFABackupFewLeftNotification.php index da683b1f4e..4ae483eaca 100644 --- a/app/Notifications/Security/MFABackupFewLeftNotification.php +++ b/app/Notifications/Security/MFABackupFewLeftNotification.php @@ -40,13 +40,8 @@ class MFABackupFewLeftNotification extends Notification { use Queueable; - private int $count; - private User $user; - - public function __construct(User $user, int $count) + public function __construct(private User $user, private int $count) { - $this->user = $user; - $this->count = $count; } /** @@ -69,7 +64,7 @@ class MFABackupFewLeftNotification extends Notification $userAgent = Request::userAgent(); $time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js')); - return (new MailMessage())->markdown('emails.security.few-backup-codes', ['user' => $this->user, 'count' => $this->count, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject); + return new MailMessage()->markdown('emails.security.few-backup-codes', ['user' => $this->user, 'count' => $this->count, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject); } public function toNtfy(User $notifiable): Message diff --git a/app/Notifications/Security/MFABackupNoLeftNotification.php b/app/Notifications/Security/MFABackupNoLeftNotification.php index 5bea9e6aa2..e521bdacd7 100644 --- a/app/Notifications/Security/MFABackupNoLeftNotification.php +++ b/app/Notifications/Security/MFABackupNoLeftNotification.php @@ -40,11 +40,8 @@ class MFABackupNoLeftNotification extends Notification { use Queueable; - private User $user; - - public function __construct(User $user) + public function __construct(private User $user) { - $this->user = $user; } /** @@ -67,7 +64,7 @@ class MFABackupNoLeftNotification extends Notification $userAgent = Request::userAgent(); $time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js')); - return (new MailMessage())->markdown('emails.security.no-backup-codes', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject); + return new MailMessage()->markdown('emails.security.no-backup-codes', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject); } public function toNtfy(User $notifiable): Message diff --git a/app/Notifications/Security/MFAManyFailedAttemptsNotification.php b/app/Notifications/Security/MFAManyFailedAttemptsNotification.php index 781bf62e95..c28c7b9eb4 100644 --- a/app/Notifications/Security/MFAManyFailedAttemptsNotification.php +++ b/app/Notifications/Security/MFAManyFailedAttemptsNotification.php @@ -40,13 +40,8 @@ class MFAManyFailedAttemptsNotification extends Notification { use Queueable; - private int $count; - private User $user; - - public function __construct(User $user, int $count) + public function __construct(private User $user, private int $count) { - $this->user = $user; - $this->count = $count; } public function toArray(User $notifiable): array @@ -66,7 +61,7 @@ class MFAManyFailedAttemptsNotification extends Notification $userAgent = Request::userAgent(); $time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js')); - return (new MailMessage())->markdown('emails.security.many-failed-attempts', ['user' => $this->user, 'count' => $this->count, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject); + return new MailMessage()->markdown('emails.security.many-failed-attempts', ['user' => $this->user, 'count' => $this->count, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject); } public function toNtfy(User $notifiable): Message diff --git a/app/Notifications/Security/MFAUsedBackupCodeNotification.php b/app/Notifications/Security/MFAUsedBackupCodeNotification.php index 0b03853275..264d6c153c 100644 --- a/app/Notifications/Security/MFAUsedBackupCodeNotification.php +++ b/app/Notifications/Security/MFAUsedBackupCodeNotification.php @@ -40,11 +40,8 @@ class MFAUsedBackupCodeNotification extends Notification { use Queueable; - private User $user; - - public function __construct(User $user) + public function __construct(private User $user) { - $this->user = $user; } /** @@ -67,7 +64,7 @@ class MFAUsedBackupCodeNotification extends Notification $userAgent = Request::userAgent(); $time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js')); - return (new MailMessage())->markdown('emails.security.used-backup-code', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject); + return new MailMessage()->markdown('emails.security.used-backup-code', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject); } public function toNtfy(User $notifiable): Message diff --git a/app/Notifications/Security/NewBackupCodesNotification.php b/app/Notifications/Security/NewBackupCodesNotification.php index 06ef35f89e..d7f25e805c 100644 --- a/app/Notifications/Security/NewBackupCodesNotification.php +++ b/app/Notifications/Security/NewBackupCodesNotification.php @@ -40,11 +40,8 @@ class NewBackupCodesNotification extends Notification { use Queueable; - private User $user; - - public function __construct(User $user) + public function __construct(private User $user) { - $this->user = $user; } /** @@ -67,7 +64,7 @@ class NewBackupCodesNotification extends Notification $userAgent = Request::userAgent(); $time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js')); - return (new MailMessage())->markdown('emails.security.new-backup-codes', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject); + return new MailMessage()->markdown('emails.security.new-backup-codes', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject); } public function toNtfy(User $notifiable): Message diff --git a/app/Notifications/Security/UserFailedLoginAttempt.php b/app/Notifications/Security/UserFailedLoginAttempt.php index c8eb674d30..e1c97f7559 100644 --- a/app/Notifications/Security/UserFailedLoginAttempt.php +++ b/app/Notifications/Security/UserFailedLoginAttempt.php @@ -41,11 +41,8 @@ class UserFailedLoginAttempt extends Notification { use Queueable; - private User $user; - - public function __construct(User $user) + public function __construct(private User $user) { - $this->user = $user; } public function toArray(User $notifiable): array @@ -65,7 +62,7 @@ class UserFailedLoginAttempt extends Notification $userAgent = Request::userAgent(); $time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js')); - return (new MailMessage())->markdown('emails.security.failed-login', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject); + return new MailMessage()->markdown('emails.security.failed-login', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject); } public function toNtfy(User $notifiable): Message diff --git a/app/Notifications/Test/OwnerTestNotificationEmail.php b/app/Notifications/Test/OwnerTestNotificationEmail.php index e80cb6e923..498e7e3baa 100644 --- a/app/Notifications/Test/OwnerTestNotificationEmail.php +++ b/app/Notifications/Test/OwnerTestNotificationEmail.php @@ -53,7 +53,7 @@ class OwnerTestNotificationEmail extends Notification { $address = (string) config('firefly.site_owner'); - return (new MailMessage()) + return new MailMessage() ->markdown('emails.admin-test', ['email' => $address]) ->subject((string) trans('email.admin_test_subject')) ; diff --git a/app/Notifications/Test/UserTestNotificationEmail.php b/app/Notifications/Test/UserTestNotificationEmail.php index 35f5836dbf..2fbc0dd293 100644 --- a/app/Notifications/Test/UserTestNotificationEmail.php +++ b/app/Notifications/Test/UserTestNotificationEmail.php @@ -50,7 +50,7 @@ class UserTestNotificationEmail extends Notification { $address = (string) $notifiable->email; - return (new MailMessage()) + return new MailMessage() ->markdown('emails.admin-test', ['email' => $address]) ->subject((string) trans('email.admin_test_subject')) ; diff --git a/app/Notifications/User/BillReminder.php b/app/Notifications/User/BillReminder.php index 77de530d55..a8a353d219 100644 --- a/app/Notifications/User/BillReminder.php +++ b/app/Notifications/User/BillReminder.php @@ -42,15 +42,8 @@ class BillReminder extends Notification { use Queueable; - private Bill $bill; - private int $diff; - private string $field; - - public function __construct(Bill $bill, string $field, int $diff) + public function __construct(private Bill $bill, private string $field, private int $diff) { - $this->bill = $bill; - $this->field = $field; - $this->diff = $diff; } /** @@ -67,7 +60,7 @@ class BillReminder extends Notification */ public function toMail(User $notifiable): MailMessage { - return (new MailMessage()) + return new MailMessage() ->markdown('emails.bill-warning', ['field' => $this->field, 'diff' => $this->diff, 'bill' => $this->bill]) ->subject($this->getSubject()) ; diff --git a/app/Notifications/User/NewAccessToken.php b/app/Notifications/User/NewAccessToken.php index f614c12bd9..29d2c51b36 100644 --- a/app/Notifications/User/NewAccessToken.php +++ b/app/Notifications/User/NewAccessToken.php @@ -62,7 +62,7 @@ class NewAccessToken extends Notification $userAgent = Request::userAgent(); $time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js')); - return (new MailMessage()) + return new MailMessage() ->markdown('emails.token-created', ['ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time]) ->subject((string) trans('email.access_token_created_subject')) ; diff --git a/app/Notifications/User/TransactionCreation.php b/app/Notifications/User/TransactionCreation.php index bca7218b62..96a09725ff 100644 --- a/app/Notifications/User/TransactionCreation.php +++ b/app/Notifications/User/TransactionCreation.php @@ -36,11 +36,8 @@ class TransactionCreation extends Notification { use Queueable; - private array $collection; - - public function __construct(array $collection) + public function __construct(private array $collection) { - $this->collection = $collection; } /** @@ -57,7 +54,7 @@ class TransactionCreation extends Notification */ public function toMail(User $notifiable): MailMessage { - return (new MailMessage()) + return new MailMessage() ->markdown('emails.report-new-journals', ['transformed' => $this->collection]) ->subject(trans_choice('email.new_journals_subject', count($this->collection))) ; diff --git a/app/Notifications/User/UserLogin.php b/app/Notifications/User/UserLogin.php index c142c1ea69..5fc368d7e0 100644 --- a/app/Notifications/User/UserLogin.php +++ b/app/Notifications/User/UserLogin.php @@ -59,7 +59,7 @@ class UserLogin extends Notification $userAgent = Request::userAgent(); $time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js')); - return (new MailMessage()) + return new MailMessage() ->markdown('emails.new-ip', ['ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time]) ->subject((string) trans('email.login_from_new_ip')) ; diff --git a/app/Notifications/User/UserNewPassword.php b/app/Notifications/User/UserNewPassword.php index d69e4abd8e..cb9bcf93d7 100644 --- a/app/Notifications/User/UserNewPassword.php +++ b/app/Notifications/User/UserNewPassword.php @@ -43,11 +43,8 @@ class UserNewPassword extends Notification { use Queueable; - private string $url; - - public function __construct(string $url) + public function __construct(private string $url) { - $this->url = $url; } /** @@ -69,7 +66,7 @@ class UserNewPassword extends Notification $userAgent = Request::userAgent(); $time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js')); - return (new MailMessage()) + return new MailMessage() ->markdown('emails.password', ['url' => $this->url, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time]) ->subject((string) trans('email.reset_pw_subject')) ; diff --git a/app/Notifications/User/UserRegistration.php b/app/Notifications/User/UserRegistration.php index 9ab267fef1..fe0bbde10f 100644 --- a/app/Notifications/User/UserRegistration.php +++ b/app/Notifications/User/UserRegistration.php @@ -52,7 +52,7 @@ class UserRegistration extends Notification */ public function toMail(User $notifiable): MailMessage { - return (new MailMessage()) + return new MailMessage() ->markdown('emails.registered', ['address' => route('index')]) ->subject((string) trans('email.registered_subject')) ; diff --git a/app/Providers/AccountServiceProvider.php b/app/Providers/AccountServiceProvider.php index 8dcc8bdc7a..939815c8a8 100644 --- a/app/Providers/AccountServiceProvider.php +++ b/app/Providers/AccountServiceProvider.php @@ -45,6 +45,7 @@ class AccountServiceProvider extends ServiceProvider /** * Register the application services. */ + #[\Override] public function register(): void { $this->registerRepository(); diff --git a/app/Providers/AdminServiceProvider.php b/app/Providers/AdminServiceProvider.php index 307efca1ff..1709ca658d 100644 --- a/app/Providers/AdminServiceProvider.php +++ b/app/Providers/AdminServiceProvider.php @@ -41,6 +41,7 @@ class AdminServiceProvider extends ServiceProvider /** * Register the application services. */ + #[\Override] public function register(): void { $this->linkType(); diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 32d30664a8..a7d13a7dfe 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -86,6 +86,7 @@ class AppServiceProvider extends ServiceProvider /** * Register any application services. */ + #[\Override] public function register(): void { Passport::ignoreRoutes(); diff --git a/app/Providers/AttachmentServiceProvider.php b/app/Providers/AttachmentServiceProvider.php index 6947d5d8a1..c4cfb6d264 100644 --- a/app/Providers/AttachmentServiceProvider.php +++ b/app/Providers/AttachmentServiceProvider.php @@ -41,6 +41,7 @@ class AttachmentServiceProvider extends ServiceProvider /** * Register the application services. */ + #[\Override] public function register(): void { $this->app->bind( diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index e562dd71de..4c119ca3ef 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -48,16 +48,12 @@ class AuthServiceProvider extends ServiceProvider { Auth::provider( 'remote_user_provider', - static function ($app, array $config) { - return new RemoteUserProvider(); - } + static fn($app, array $config) => new RemoteUserProvider() ); Auth::extend( 'remote_user_guard', - static function ($app, string $name, array $config) { - return new RemoteUserGuard(Auth::createUserProvider($config['provider']), $app); - } + static fn($app, string $name, array $config) => new RemoteUserGuard(Auth::createUserProvider($config['provider']), $app) ); Passport::tokensExpireIn(now()->addDays(14)); diff --git a/app/Providers/BillServiceProvider.php b/app/Providers/BillServiceProvider.php index 1e8038099c..e2a3a42e71 100644 --- a/app/Providers/BillServiceProvider.php +++ b/app/Providers/BillServiceProvider.php @@ -41,6 +41,7 @@ class BillServiceProvider extends ServiceProvider /** * Register the application services. */ + #[\Override] public function register(): void { $this->app->bind( diff --git a/app/Providers/BudgetServiceProvider.php b/app/Providers/BudgetServiceProvider.php index c07e9d0612..8da9ef97b8 100644 --- a/app/Providers/BudgetServiceProvider.php +++ b/app/Providers/BudgetServiceProvider.php @@ -51,6 +51,7 @@ class BudgetServiceProvider extends ServiceProvider * * @SuppressWarnings("PHPMD.ExcessiveMethodLength") */ + #[\Override] public function register(): void { // reference to auth is not understood by phpstan. diff --git a/app/Providers/CategoryServiceProvider.php b/app/Providers/CategoryServiceProvider.php index d8bc20a299..4c86c9800e 100644 --- a/app/Providers/CategoryServiceProvider.php +++ b/app/Providers/CategoryServiceProvider.php @@ -45,6 +45,7 @@ class CategoryServiceProvider extends ServiceProvider /** * Register the application services. */ + #[\Override] public function register(): void { // phpstan does not understand reference to 'auth'. diff --git a/app/Providers/CurrencyServiceProvider.php b/app/Providers/CurrencyServiceProvider.php index 152b6985c6..05b875811e 100644 --- a/app/Providers/CurrencyServiceProvider.php +++ b/app/Providers/CurrencyServiceProvider.php @@ -45,6 +45,7 @@ class CurrencyServiceProvider extends ServiceProvider /** * Register the application services. */ + #[\Override] public function register(): void { $this->app->bind( diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index fe465411ea..7b3be85ddc 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -260,6 +260,7 @@ class EventServiceProvider extends ServiceProvider /** * Register any events for your application. */ + #[\Override] public function boot(): void { $this->registerObservers(); diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php index dac85566f3..6e88e96041 100644 --- a/app/Providers/FireflyServiceProvider.php +++ b/app/Providers/FireflyServiceProvider.php @@ -90,9 +90,7 @@ class FireflyServiceProvider extends ServiceProvider public function boot(): void { Validator::resolver( - static function ($translator, $data, $rules, $messages) { - return new FireflyValidator($translator, $data, $rules, $messages); - } + static fn($translator, $data, $rules, $messages) => new FireflyValidator($translator, $data, $rules, $messages) ); } @@ -101,78 +99,57 @@ class FireflyServiceProvider extends ServiceProvider * * @SuppressWarnings("PHPMD.ExcessiveMethodLength") */ + #[\Override] public function register(): void { $this->app->bind( 'preferences', - static function () { - return new Preferences(); - } + static fn() => new Preferences() ); $this->app->bind( 'fireflyconfig', - static function () { - return new FireflyConfig(); - } + static fn() => new FireflyConfig() ); $this->app->bind( 'navigation', - static function () { - return new Navigation(); - } + static fn() => new Navigation() ); $this->app->bind( 'amount', - static function () { - return new Amount(); - } + static fn() => new Amount() ); $this->app->bind( 'steam', - static function () { - return new Steam(); - } + static fn() => new Steam() ); $this->app->bind( 'balance', - static function () { - return new Balance(); - } + static fn() => new Balance() ); $this->app->bind( 'expandedform', - static function () { - return new ExpandedForm(); - } + static fn() => new ExpandedForm() ); $this->app->bind( 'accountform', - static function () { - return new AccountForm(); - } + static fn() => new AccountForm() ); $this->app->bind( 'currencyform', - static function () { - return new CurrencyForm(); - } + static fn() => new CurrencyForm() ); $this->app->bind( 'piggybankform', - static function () { - return new PiggyBankForm(); - } + static fn() => new PiggyBankForm() ); $this->app->bind( 'ruleform', - static function () { - return new RuleForm(); - } + static fn() => new RuleForm() ); // chart generator: diff --git a/app/Providers/FireflySessionProvider.php b/app/Providers/FireflySessionProvider.php index 3ffeb23a0d..1817ab280b 100644 --- a/app/Providers/FireflySessionProvider.php +++ b/app/Providers/FireflySessionProvider.php @@ -35,6 +35,7 @@ class FireflySessionProvider extends ServiceProvider /** * Register the service provider. */ + #[\Override] public function register(): void { $this->registerSessionManager(); @@ -51,9 +52,7 @@ class FireflySessionProvider extends ServiceProvider { $this->app->singleton( 'session', - static function ($app) { - return new SessionManager($app); - } + static fn($app) => new SessionManager($app) ); } @@ -64,12 +63,11 @@ class FireflySessionProvider extends ServiceProvider { $this->app->singleton( 'session.store', - static function ($app) { + static fn($app) => // First, we will create the session manager which is responsible for the // creation of the various session drivers when they are needed by the // application instance, and will resolve them on a lazy load basis. - return $app->make('session')->driver(); - } + $app->make('session')->driver() ); } } diff --git a/app/Providers/JournalServiceProvider.php b/app/Providers/JournalServiceProvider.php index 26ab3012ca..8e758ca143 100644 --- a/app/Providers/JournalServiceProvider.php +++ b/app/Providers/JournalServiceProvider.php @@ -49,6 +49,7 @@ class JournalServiceProvider extends ServiceProvider /** * Register the application services. */ + #[\Override] public function register(): void { $this->registerRepository(); diff --git a/app/Providers/PiggyBankServiceProvider.php b/app/Providers/PiggyBankServiceProvider.php index 7252098c8a..53e35d02fe 100644 --- a/app/Providers/PiggyBankServiceProvider.php +++ b/app/Providers/PiggyBankServiceProvider.php @@ -41,6 +41,7 @@ class PiggyBankServiceProvider extends ServiceProvider /** * Register the application services. */ + #[\Override] public function register(): void { $this->app->bind( diff --git a/app/Providers/RecurringServiceProvider.php b/app/Providers/RecurringServiceProvider.php index 884dc1f036..9f77c8bdc9 100644 --- a/app/Providers/RecurringServiceProvider.php +++ b/app/Providers/RecurringServiceProvider.php @@ -41,6 +41,7 @@ class RecurringServiceProvider extends ServiceProvider /** * Register the application services. */ + #[\Override] public function register(): void { $this->app->bind( diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 4382229f44..6e02c53603 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -37,6 +37,7 @@ class RouteServiceProvider extends ServiceProvider /** * Define the routes for the application. */ + #[\Override] public function boot(): void { $this->routes(function (): void { diff --git a/app/Providers/RuleGroupServiceProvider.php b/app/Providers/RuleGroupServiceProvider.php index e43ee595e2..ff1f0c777d 100644 --- a/app/Providers/RuleGroupServiceProvider.php +++ b/app/Providers/RuleGroupServiceProvider.php @@ -41,6 +41,7 @@ class RuleGroupServiceProvider extends ServiceProvider /** * Register the application services. */ + #[\Override] public function register(): void { $this->app->bind( diff --git a/app/Providers/RuleServiceProvider.php b/app/Providers/RuleServiceProvider.php index 9073b9cc7d..e6ef01b7fd 100644 --- a/app/Providers/RuleServiceProvider.php +++ b/app/Providers/RuleServiceProvider.php @@ -41,6 +41,7 @@ class RuleServiceProvider extends ServiceProvider /** * Register the application services. */ + #[\Override] public function register(): void { $this->app->bind( diff --git a/app/Providers/SearchServiceProvider.php b/app/Providers/SearchServiceProvider.php index 74ed2f325f..56b1c86b40 100644 --- a/app/Providers/SearchServiceProvider.php +++ b/app/Providers/SearchServiceProvider.php @@ -44,6 +44,7 @@ class SearchServiceProvider extends ServiceProvider /** * Register the application services. */ + #[\Override] public function register(): void { $this->app->bind( diff --git a/app/Providers/SessionServiceProvider.php b/app/Providers/SessionServiceProvider.php index ea840005df..9c5f4e86f2 100644 --- a/app/Providers/SessionServiceProvider.php +++ b/app/Providers/SessionServiceProvider.php @@ -34,6 +34,7 @@ class SessionServiceProvider extends BaseSessionServiceProvider /** * Register the service provider. */ + #[\Override] public function register(): void { $this->registerSessionManager(); diff --git a/app/Providers/TagServiceProvider.php b/app/Providers/TagServiceProvider.php index ae29a28caa..271e4160d2 100644 --- a/app/Providers/TagServiceProvider.php +++ b/app/Providers/TagServiceProvider.php @@ -43,6 +43,7 @@ class TagServiceProvider extends ServiceProvider /** * Register the application services. */ + #[\Override] public function register(): void { $this->app->bind( diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index ae6b6f3a1f..e4a71d69ac 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -409,9 +409,7 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac public function getMetaValue(Account $account, string $field): ?string { $result = $account->accountMeta->filter( - static function (AccountMeta $meta) use ($field) { - return strtolower($meta->name) === strtolower($field); - } + static fn(AccountMeta $meta) => strtolower($meta->name) === strtolower($field) ); if (0 === $result->count()) { return null; diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.php index 2447de9f43..031794595e 100644 --- a/app/Repositories/Account/AccountTasker.php +++ b/app/Repositories/Account/AccountTasker.php @@ -100,7 +100,7 @@ class AccountTasker implements AccountTaskerInterface, UserGroupInterface $entry['start_balance'] = $first->transactions()->where('account_id', $account->id)->first()->amount; Log::debug(sprintf('Account %s was opened on %s, so opening balance is %f', $account->name, $yesterday->format('Y-m-d'), $entry['start_balance'])); } - $return['sums'][$currency->id]['start'] = bcadd($return['sums'][$currency->id]['start'], $entry['start_balance']); + $return['sums'][$currency->id]['start'] = bcadd($return['sums'][$currency->id]['start'], (string) $entry['start_balance']); $return['sums'][$currency->id]['end'] = bcadd($return['sums'][$currency->id]['end'], $entry['end_balance']); $return['accounts'][$id] = $entry; } @@ -176,7 +176,7 @@ class AccountTasker implements AccountTaskerInterface, UserGroupInterface 'currency_code' => $currencies[$currencyId]->code, 'currency_decimal_places' => $currencies[$currencyId]->decimal_places, ]; - $report['accounts'][$key]['sum'] = bcadd($report['accounts'][$key]['sum'], $journal['amount']); + $report['accounts'][$key]['sum'] = bcadd($report['accounts'][$key]['sum'], (string) $journal['amount']); Log::debug(sprintf('Sum for %s is now %s', $journal['destination_account_name'], $report['accounts'][$key]['sum'])); @@ -266,7 +266,7 @@ class AccountTasker implements AccountTaskerInterface, UserGroupInterface 'currency_decimal_places' => $currencies[$currencyId]->decimal_places, ]; } - $report['accounts'][$key]['sum'] = bcadd($report['accounts'][$key]['sum'], bcmul($journal['amount'], '-1')); + $report['accounts'][$key]['sum'] = bcadd($report['accounts'][$key]['sum'], bcmul((string) $journal['amount'], '-1')); ++$report['accounts'][$key]['count']; } diff --git a/app/Repositories/Account/OperationsRepository.php b/app/Repositories/Account/OperationsRepository.php index fb71bb7235..c6a7604861 100644 --- a/app/Repositories/Account/OperationsRepository.php +++ b/app/Repositories/Account/OperationsRepository.php @@ -361,12 +361,12 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn ]; // source account? money goes out! - $return[$sourceKey]['out'] = bcadd($return[$sourceKey]['out'], app('steam')->negative($amount)); - $return[$sourceKey]['difference'] = bcadd($return[$sourceKey]['out'], $return[$sourceKey]['in']); + $return[$sourceKey]['out'] = bcadd((string) $return[$sourceKey]['out'], (string) app('steam')->negative($amount)); + $return[$sourceKey]['difference'] = bcadd($return[$sourceKey]['out'], (string) $return[$sourceKey]['in']); // destination account? money comes in: - $return[$destKey]['in'] = bcadd($return[$destKey]['in'], $amount); - $return[$destKey]['difference'] = bcadd($return[$destKey]['out'], $return[$destKey]['in']); + $return[$destKey]['in'] = bcadd((string) $return[$destKey]['in'], (string) $amount); + $return[$destKey]['difference'] = bcadd((string) $return[$destKey]['out'], $return[$destKey]['in']); // foreign currency if (null !== $journal['foreign_currency_id'] && null !== $journal['foreign_amount']) { @@ -404,12 +404,12 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn 'currency_code' => $journal['foreign_currency_code'], ]; // source account? money goes out! (same as above) - $return[$sourceKey]['out'] = bcadd($return[$sourceKey]['out'], app('steam')->negative($amount)); - $return[$sourceKey]['difference'] = bcadd($return[$sourceKey]['out'], $return[$sourceKey]['in']); + $return[$sourceKey]['out'] = bcadd((string) $return[$sourceKey]['out'], (string) app('steam')->negative($amount)); + $return[$sourceKey]['difference'] = bcadd($return[$sourceKey]['out'], (string) $return[$sourceKey]['in']); // destination account? money comes in: - $return[$destKey]['in'] = bcadd($return[$destKey]['in'], $amount); - $return[$destKey]['difference'] = bcadd($return[$destKey]['out'], $return[$destKey]['in']); + $return[$destKey]['in'] = bcadd((string) $return[$destKey]['in'], (string) $amount); + $return[$destKey]['difference'] = bcadd((string) $return[$destKey]['out'], $return[$destKey]['in']); } return $return; diff --git a/app/Repositories/Attachment/AttachmentRepository.php b/app/Repositories/Attachment/AttachmentRepository.php index 17ec138917..961127f085 100644 --- a/app/Repositories/Attachment/AttachmentRepository.php +++ b/app/Repositories/Attachment/AttachmentRepository.php @@ -55,7 +55,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface, UserGroupIn try { Storage::disk('upload')->delete($path); - } catch (UnableToDeleteFile $e) { + } catch (UnableToDeleteFile) { // @ignoreException } $attachment->delete(); diff --git a/app/Repositories/AuditLogEntry/ALERepository.php b/app/Repositories/AuditLogEntry/ALERepository.php index 02f60db94e..97cc76def6 100644 --- a/app/Repositories/AuditLogEntry/ALERepository.php +++ b/app/Repositories/AuditLogEntry/ALERepository.php @@ -36,7 +36,7 @@ class ALERepository implements ALERepositoryInterface public function getForObject(Model $model): Collection { // all Models have an ID. - return AuditLogEntry::where('auditable_id', $model->id)->where('auditable_type', get_class($model))->get(); + return AuditLogEntry::where('auditable_id', $model->id)->where('auditable_type', $model::class)->get(); } public function store(array $data): AuditLogEntry diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index 8e1d113ab8..56094d1199 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -272,10 +272,10 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface 'currency_symbol' => $currency->symbol, 'currency_decimal_places' => $currency->decimal_places, ]; - $result[$currencyId]['sum'] = bcadd($result[$currencyId]['sum'], $transaction->amount); + $result[$currencyId]['sum'] = bcadd($result[$currencyId]['sum'], (string) $transaction->amount); $result[$currencyId]['native_sum'] = bcadd($result[$currencyId]['native_sum'], $transaction->native_amount ?? '0'); if ($journal->foreign_currency_id === Amount::getNativeCurrency()->id) { - $result[$currencyId]['native_sum'] = bcadd($result[$currencyId]['native_sum'], $transaction->amount); + $result[$currencyId]['native_sum'] = bcadd($result[$currencyId]['native_sum'], (string) $transaction->amount); } ++$result[$currencyId]['count']; } @@ -286,8 +286,8 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface * @var array $arr */ foreach ($result as $currencyId => $arr) { - $result[$currencyId]['avg'] = bcdiv($arr['sum'], (string) $arr['count']); - $result[$currencyId]['native_avg'] = bcdiv($arr['native_sum'], (string) $arr['count']); + $result[$currencyId]['avg'] = bcdiv((string) $arr['sum'], (string) $arr['count']); + $result[$currencyId]['native_avg'] = bcdiv((string) $arr['native_sum'], (string) $arr['count']); } return $result; @@ -396,10 +396,10 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface 'currency_symbol' => $currency->symbol, 'currency_decimal_places' => $currency->decimal_places, ]; - $result[$currencyId]['sum'] = bcadd($result[$currencyId]['sum'], $transaction->amount); + $result[$currencyId]['sum'] = bcadd($result[$currencyId]['sum'], (string) $transaction->amount); $result[$currencyId]['native_sum'] = bcadd($result[$currencyId]['native_sum'], $transaction->native_amount ?? '0'); if ($journal->foreign_currency_id === Amount::getNativeCurrency()->id) { - $result[$currencyId]['native_sum'] = bcadd($result[$currencyId]['native_sum'], $transaction->amount); + $result[$currencyId]['native_sum'] = bcadd($result[$currencyId]['native_sum'], (string) $transaction->amount); } ++$result[$currencyId]['count']; } @@ -410,8 +410,8 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface * @var array $arr */ foreach ($result as $currencyId => $arr) { - $result[$currencyId]['avg'] = bcdiv($arr['sum'], (string) $arr['count']); - $result[$currencyId]['native_avg'] = bcdiv($arr['native_sum'], (string) $arr['count']); + $result[$currencyId]['avg'] = bcdiv((string) $arr['sum'], (string) $arr['count']); + $result[$currencyId]['native_avg'] = bcdiv((string) $arr['native_sum'], (string) $arr['count']); } return $result; diff --git a/app/Repositories/Budget/BudgetLimitRepository.php b/app/Repositories/Budget/BudgetLimitRepository.php index 719073f94f..1db1310429 100644 --- a/app/Repositories/Budget/BudgetLimitRepository.php +++ b/app/Repositories/Budget/BudgetLimitRepository.php @@ -96,7 +96,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface, UserGroup /** @var BudgetLimit $budgetLimit */ foreach ($set as $budgetLimit) { - $result = bcadd($budgetLimit->amount, $result); + $result = bcadd((string) $budgetLimit->amount, $result); } return $result; @@ -127,9 +127,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface, UserGroup public function getAllBudgetLimitsByCurrency(TransactionCurrency $currency, ?Carbon $start = null, ?Carbon $end = null): Collection { return $this->getAllBudgetLimits($start, $end)->filter( - static function (BudgetLimit $budgetLimit) use ($currency) { - return $budgetLimit->transaction_currency_id === $currency->id; - } + static fn(BudgetLimit $budgetLimit) => $budgetLimit->transaction_currency_id === $currency->id ); } diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 858f48f417..09ffa8a636 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -121,7 +121,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface ]; // same period if ($limit->start_date->isSameDay($start) && $limit->end_date->isSameDay($end)) { - $return[$currencyCode]['sum'] = bcadd($return[$currencyCode]['sum'], $limit->amount); + $return[$currencyCode]['sum'] = bcadd($return[$currencyCode]['sum'], (string) $limit->amount); $return[$currencyCode]['native_sum'] = bcmul($rate, $return[$currencyCode]['sum']); app('log')->debug(sprintf('Add full amount [1]: %s', $limit->amount)); @@ -129,7 +129,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface } // limit is inside of date range if ($start->lte($limit->start_date) && $end->gte($limit->end_date)) { - $return[$currencyCode]['sum'] = bcadd($return[$currencyCode]['sum'], $limit->amount); + $return[$currencyCode]['sum'] = bcadd($return[$currencyCode]['sum'], (string) $limit->amount); $return[$currencyCode]['native_sum'] = bcmul($rate, $return[$currencyCode]['sum']); app('log')->debug(sprintf('Add full amount [2]: %s', $limit->amount)); @@ -137,13 +137,13 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface } $total = $limit->start_date->diffInDays($limit->end_date, true) + 1; // include the day itself. $days = $this->daysInOverlap($limit, $start, $end); - $amount = bcmul(bcdiv($limit->amount, (string) $total), (string) $days); + $amount = bcmul(bcdiv((string) $limit->amount, (string) $total), (string) $days); $return[$currencyCode]['sum'] = bcadd($return[$currencyCode]['sum'], $amount); $return[$currencyCode]['native_sum'] = bcmul($rate, $return[$currencyCode]['sum']); app('log')->debug( sprintf( 'Amount per day: %s (%s over %d days). Total amount for %d days: %s', - bcdiv($limit->amount, (string) $total), + bcdiv((string) $limit->amount, (string) $total), $limit->amount, $total, $days, @@ -225,26 +225,26 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface ]; // same period if ($limit->start_date->isSameDay($start) && $limit->end_date->isSameDay($end)) { - $return[$currency->id]['sum'] = bcadd($return[$currency->id]['sum'], $limit->amount); + $return[$currency->id]['sum'] = bcadd($return[$currency->id]['sum'], (string) $limit->amount); app('log')->debug(sprintf('Add full amount [1]: %s', $limit->amount)); continue; } // limit is inside of date range if ($start->lte($limit->start_date) && $end->gte($limit->end_date)) { - $return[$currency->id]['sum'] = bcadd($return[$currency->id]['sum'], $limit->amount); + $return[$currency->id]['sum'] = bcadd($return[$currency->id]['sum'], (string) $limit->amount); app('log')->debug(sprintf('Add full amount [2]: %s', $limit->amount)); continue; } $total = $limit->start_date->diffInDays($limit->end_date) + 1; // include the day itself. $days = $this->daysInOverlap($limit, $start, $end); - $amount = bcmul(bcdiv($limit->amount, (string) $total), (string) $days); + $amount = bcmul(bcdiv((string) $limit->amount, (string) $total), (string) $days); $return[$currency->id]['sum'] = bcadd($return[$currency->id]['sum'], $amount); app('log')->debug( sprintf( 'Amount per day: %s (%s over %d days). Total amount for %d days: %s', - bcdiv($limit->amount, (string) $total), + bcdiv((string) $limit->amount, (string) $total), $limit->amount, $total, $days, @@ -632,7 +632,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface 'decimal_places' => $journal['currency_decimal_places'], 'sum' => '0', ]; - $array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], app('steam')->negative($journal['amount'])); + $array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], (string) app('steam')->negative($journal['amount'])); // also do foreign amount: $foreignId = (int) $journal['foreign_currency_id']; @@ -645,7 +645,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface 'decimal_places' => $journal['foreign_currency_decimal_places'], 'sum' => '0', ]; - $array[$foreignId]['sum'] = bcadd($array[$foreignId]['sum'], app('steam')->negative($journal['foreign_amount'])); + $array[$foreignId]['sum'] = bcadd($array[$foreignId]['sum'], (string) app('steam')->negative($journal['foreign_amount'])); } } @@ -694,7 +694,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface 'decimal_places' => $journal['currency_decimal_places'], 'sum' => '0', ]; - $array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], app('steam')->negative($journal['amount'])); + $array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], (string) app('steam')->negative($journal['amount'])); // also do foreign amount: $foreignId = (int) $journal['foreign_currency_id']; @@ -707,7 +707,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface 'decimal_places' => $journal['foreign_currency_decimal_places'], 'sum' => '0', ]; - $array[$foreignId]['sum'] = bcadd($array[$foreignId]['sum'], app('steam')->negative($journal['foreign_amount'])); + $array[$foreignId]['sum'] = bcadd($array[$foreignId]['sum'], (string) app('steam')->negative($journal['foreign_amount'])); } } diff --git a/app/Repositories/Budget/NoBudgetRepository.php b/app/Repositories/Budget/NoBudgetRepository.php index fa9d367d8a..a82f593217 100644 --- a/app/Repositories/Budget/NoBudgetRepository.php +++ b/app/Repositories/Budget/NoBudgetRepository.php @@ -73,7 +73,7 @@ class NoBudgetRepository implements NoBudgetRepositoryInterface, UserGroupInterf if (!array_key_exists($date, $data[$currencyId]['entries'])) { $data[$currencyId]['entries'][$date] = '0'; } - $data[$currencyId]['entries'][$date] = bcadd($data[$currencyId]['entries'][$date], $journal['amount']); + $data[$currencyId]['entries'][$date] = bcadd($data[$currencyId]['entries'][$date], (string) $journal['amount']); } return $data; diff --git a/app/Repositories/Budget/OperationsRepository.php b/app/Repositories/Budget/OperationsRepository.php index db4d43834d..45bd5d505f 100644 --- a/app/Repositories/Budget/OperationsRepository.php +++ b/app/Repositories/Budget/OperationsRepository.php @@ -57,7 +57,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn $diff = (int) $limit->start_date->diffInDays($limit->end_date, true); $diff = 0 === $diff ? 1 : $diff; $amount = $limit->amount; - $perDay = bcdiv($amount, (string) $diff); + $perDay = bcdiv((string) $amount, (string) $diff); $total = bcadd($total, $perDay); ++$count; app('log')->debug(sprintf('Found %d budget limits. Per day is %s, total is %s', $count, $perDay, $total)); @@ -110,7 +110,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn 'entries' => [], ]; $date = $journal['date']->format($carbonFormat); - $data[$key]['entries'][$date] = bcadd($data[$key]['entries'][$date] ?? '0', $journal['amount']); + $data[$key]['entries'][$date] = bcadd($data[$key]['entries'][$date] ?? '0', (string) $journal['amount']); } return $data; diff --git a/app/Repositories/Category/NoCategoryRepository.php b/app/Repositories/Category/NoCategoryRepository.php index f674cc04d0..8c687125f6 100644 --- a/app/Repositories/Category/NoCategoryRepository.php +++ b/app/Repositories/Category/NoCategoryRepository.php @@ -174,7 +174,7 @@ class NoCategoryRepository implements NoCategoryRepositoryInterface, UserGroupIn 'currency_code' => $journal['currency_code'], 'currency_decimal_places' => $journal['currency_decimal_places'], ]; - $array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], app('steam')->positive($journal['amount'])); + $array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], (string) app('steam')->positive($journal['amount'])); } return $array; @@ -202,7 +202,7 @@ class NoCategoryRepository implements NoCategoryRepositoryInterface, UserGroupIn 'currency_code' => $journal['currency_code'], 'currency_decimal_places' => $journal['currency_decimal_places'], ]; - $array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], app('steam')->positive($journal['amount'])); + $array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], (string) app('steam')->positive($journal['amount'])); } return $array; diff --git a/app/Repositories/Category/OperationsRepository.php b/app/Repositories/Category/OperationsRepository.php index 5e537041b6..ff98d9bdab 100644 --- a/app/Repositories/Category/OperationsRepository.php +++ b/app/Repositories/Category/OperationsRepository.php @@ -402,7 +402,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn 'currency_code' => $currencyCode, 'currency_decimal_places' => $currencyDecimalPlaces, ]; - $array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], app('steam')->positive($amount)); + $array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], (string) app('steam')->positive($amount)); } return $array; @@ -439,7 +439,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn 'currency_code' => $journal['currency_code'], 'currency_decimal_places' => $journal['currency_decimal_places'], ]; - $array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], app('steam')->positive($journal['amount'])); + $array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], (string) app('steam')->positive($journal['amount'])); } return $array; diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index f6c00d39a4..2738577563 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -179,12 +179,8 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf $local = $this->get(); return $all->map(static function (TransactionCurrency $current) use ($local) { - $hasId = $local->contains(static function (TransactionCurrency $entry) use ($current) { - return $entry->id === $current->id; - }); - $isNative = $local->contains(static function (TransactionCurrency $entry) use ($current) { - return 1 === (int) $entry->pivot->group_default && $entry->id === $current->id; - }); + $hasId = $local->contains(static fn(TransactionCurrency $entry) => $entry->id === $current->id); + $isNative = $local->contains(static fn(TransactionCurrency $entry) => 1 === (int) $entry->pivot->group_default && $entry->id === $current->id); $current->userGroupEnabled = $hasId; $current->userGroupNative = $isNative; diff --git a/app/Repositories/LinkType/LinkTypeRepository.php b/app/Repositories/LinkType/LinkTypeRepository.php index 024e097959..3485e9560f 100644 --- a/app/Repositories/LinkType/LinkTypeRepository.php +++ b/app/Repositories/LinkType/LinkTypeRepository.php @@ -151,9 +151,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface, UserGroupInterf $merged = $outward->merge($inward); return $merged->filter( - static function (TransactionJournalLink $link) { - return null !== $link->source && null !== $link->destination; - } + static fn(TransactionJournalLink $link) => null !== $link->source && null !== $link->destination ); } @@ -285,8 +283,8 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface, UserGroupInterf */ public function updateLink(TransactionJournalLink $journalLink, array $data): TransactionJournalLink { - $journalLink->source_id = null === $data['inward_id'] ? $journalLink->source_id : $data['inward_id']; - $journalLink->destination_id = null === $data['outward_id'] ? $journalLink->destination_id : $data['outward_id']; + $journalLink->source_id = $data['inward_id'] ?? $journalLink->source_id; + $journalLink->destination_id = $data['outward_id'] ?? $journalLink->destination_id; $journalLink->save(); if (array_key_exists('link_type_name', $data)) { $linkType = LinkType::whereName($data['link_type_name'])->first(); @@ -297,7 +295,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface, UserGroupInterf $journalLink->refresh(); } - $journalLink->link_type_id = null === $data['link_type_id'] ? $journalLink->link_type_id : $data['link_type_id']; + $journalLink->link_type_id = $data['link_type_id'] ?? $journalLink->link_type_id; $journalLink->save(); if (array_key_exists('notes', $data) && null !== $data['notes']) { $this->setNoteText($journalLink, $data['notes']); diff --git a/app/Repositories/PiggyBank/ModifiesPiggyBanks.php b/app/Repositories/PiggyBank/ModifiesPiggyBanks.php index 0be738ef48..dd05aefcc4 100644 --- a/app/Repositories/PiggyBank/ModifiesPiggyBanks.php +++ b/app/Repositories/PiggyBank/ModifiesPiggyBanks.php @@ -65,7 +65,7 @@ trait ModifiesPiggyBanks { $currentAmount = $this->getCurrentAmount($piggyBank, $account); $pivot = $piggyBank->accounts()->where('accounts.id', $account->id)->first()->pivot; - $pivot->current_amount = bcsub($currentAmount, $amount); + $pivot->current_amount = bcsub((string) $currentAmount, $amount); $pivot->native_current_amount = null; // also update native_current_amount. @@ -88,7 +88,7 @@ trait ModifiesPiggyBanks { $currentAmount = $this->getCurrentAmount($piggyBank, $account); $pivot = $piggyBank->accounts()->where('accounts.id', $account->id)->first()->pivot; - $pivot->current_amount = bcadd($currentAmount, $amount); + $pivot->current_amount = bcadd((string) $currentAmount, $amount); $pivot->native_current_amount = null; // also update native_current_amount. @@ -120,13 +120,13 @@ trait ModifiesPiggyBanks if (0 !== bccomp($piggyBank->target_amount, '0')) { - $leftToSave = bcsub($piggyBank->target_amount, $savedSoFar); - $maxAmount = 1 === bccomp($leftOnAccount, $leftToSave) ? $leftToSave : $leftOnAccount; + $leftToSave = bcsub($piggyBank->target_amount, (string) $savedSoFar); + $maxAmount = 1 === bccomp((string) $leftOnAccount, $leftToSave) ? $leftToSave : $leftOnAccount; Log::debug(sprintf('Left to save: %s', $leftToSave)); Log::debug(sprintf('Maximum amount: %s', $maxAmount)); } - $compare = bccomp($amount, $maxAmount); + $compare = bccomp($amount, (string) $maxAmount); $result = $compare <= 0; Log::debug(sprintf('Compare <= 0? %d, so canAddAmount is %s', $compare, var_export($result, true))); @@ -138,7 +138,7 @@ trait ModifiesPiggyBanks { $savedSoFar = $this->getCurrentAmount($piggyBank, $account); - return bccomp($amount, $savedSoFar) <= 0; + return bccomp($amount, (string) $savedSoFar) <= 0; } /** @@ -169,7 +169,7 @@ trait ModifiesPiggyBanks if (1 === bccomp($amount, $max) && 0 !== bccomp($piggyBank->target_amount, '0')) { $amount = $max; } - $difference = bcsub($amount, $repetition->current_amount); + $difference = bcsub($amount, (string) $repetition->current_amount); $repetition->current_amount = $amount; $repetition->save(); @@ -232,9 +232,9 @@ trait ModifiesPiggyBanks // if the piggy bank is now smaller than the sum of the money saved, // remove money from all accounts until the piggy bank is the right amount. $currentAmount = $this->getCurrentAmount($piggyBank); - if (1 === bccomp($currentAmount, $piggyBank->target_amount) && 0 !== bccomp($piggyBank->target_amount, '0')) { + if (1 === bccomp((string) $currentAmount, (string) $piggyBank->target_amount) && 0 !== bccomp((string) $piggyBank->target_amount, '0')) { Log::debug(sprintf('Current amount is %s, target amount is %s', $currentAmount, $piggyBank->target_amount)); - $difference = bcsub($piggyBank->target_amount, $currentAmount); + $difference = bcsub((string) $piggyBank->target_amount, (string) $currentAmount); // an amount will be removed, create "negative" event: // Log::debug(sprintf('ChangedAmount: is triggered with difference "%s"', $difference)); @@ -365,14 +365,14 @@ trait ModifiesPiggyBanks foreach ($piggyBank->accounts as $account) { $current = $account->pivot->current_amount; // if this account contains more than the amount, remove the amount and return. - if (1 === bccomp($current, $amount)) { + if (1 === bccomp((string) $current, $amount)) { $this->removeAmount($piggyBank, $account, $amount); return; } // if this account contains less than the amount, remove the current amount, update the amount and continue. $this->removeAmount($piggyBank, $account, $current); - $amount = bcsub($amount, $current); + $amount = bcsub($amount, (string) $current); } } } diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php index 5b093fda89..4118bee399 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepository.php +++ b/app/Repositories/PiggyBank/PiggyBankRepository.php @@ -238,7 +238,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface, UserGroupInte app('log')->debug(sprintf('Will add/remove %f to piggy bank #%d ("%s")', $amount, $piggyBank->id, $piggyBank->name)); // if the amount is positive, make sure it fits in piggy bank: - if (1 === bccomp($amount, '0') && -1 === bccomp($room, $amount)) { + if (1 === bccomp($amount, '0') && -1 === bccomp((string) $room, $amount)) { // amount is positive and $room is smaller than $amount app('log')->debug(sprintf('Room in piggy bank for extra money is %f', $room)); app('log')->debug(sprintf('There is NO room to add %f to piggy bank #%d ("%s")', $amount, $piggyBank->id, $piggyBank->name)); @@ -349,7 +349,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface, UserGroupInte $now = today(config('app.timezone')); $startDate = null !== $piggyBank->start_date && $piggyBank->start_date->gte($now) ? $piggyBank->start_date : $now; $diffInMonths = (int) $startDate->diffInMonths($piggyBank->target_date); - $remainingAmount = bcsub($piggyBank->target_amount, $currentAmount); + $remainingAmount = bcsub((string) $piggyBank->target_amount, $currentAmount); // more than 1 month to go and still need money to save: if ($diffInMonths > 0 && 1 === bccomp($remainingAmount, '0')) { @@ -382,7 +382,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface, UserGroupInte /** @var PiggyBank $current */ foreach ($piggies as $current) { $amount = $this->getCurrentAmount($current, $account); - $balance = bcsub($balance, $amount); + $balance = bcsub((string) $balance, $amount); Log::debug(sprintf('Piggy bank: #%d with amount %s, balance is now %s', $current->id, $amount, $balance)); } Log::debug(sprintf('Final balance is: %s', $balance)); diff --git a/app/Repositories/Rule/RuleRepository.php b/app/Repositories/Rule/RuleRepository.php index ca214c6edd..1af214b037 100644 --- a/app/Repositories/Rule/RuleRepository.php +++ b/app/Repositories/Rule/RuleRepository.php @@ -142,8 +142,8 @@ class RuleRepository implements RuleRepositoryInterface, UserGroupInterface continue; } $triggerType = $trigger->trigger_type; - if (str_starts_with($trigger->trigger_type, '-')) { - $triggerType = substr($trigger->trigger_type, 1); + if (str_starts_with((string) $trigger->trigger_type, '-')) { + $triggerType = substr((string) $trigger->trigger_type, 1); } $needsContext = config(sprintf('search.operators.%s.needs_context', $triggerType)) ?? true; if (false === $needsContext) { @@ -359,7 +359,7 @@ class RuleRepository implements RuleRepositoryInterface, UserGroupInterface $stopProcessing = $trigger['stop_processing'] ?? false; $active = $trigger['active'] ?? true; $type = $trigger['type']; - if (true === ($trigger['prohibited'] ?? false) && !str_starts_with($type, '-')) { + if (true === ($trigger['prohibited'] ?? false) && !str_starts_with((string) $type, '-')) { $type = sprintf('-%s', $type); } diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index 3e74489477..425582b559 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -269,9 +269,9 @@ class TagRepository implements TagRepositoryInterface, UserGroupInterface $amount = app('steam')->positive((string) $journal['amount']); $type = $journal['transaction_type_type']; if (TransactionTypeEnum::WITHDRAWAL->value === $type) { - $amount = bcmul($amount, '-1'); + $amount = bcmul((string) $amount, '-1'); } - $sums[$currencyId][$type] = bcadd($sums[$currencyId][$type], $amount); + $sums[$currencyId][$type] = bcadd((string) $sums[$currencyId][$type], (string) $amount); $foreignCurrencyId = $journal['foreign_currency_id']; if (null !== $foreignCurrencyId && 0 !== $foreignCurrencyId) { @@ -289,9 +289,9 @@ class TagRepository implements TagRepositoryInterface, UserGroupInterface // add foreign amount to correct type: $amount = app('steam')->positive((string) $journal['foreign_amount']); if (TransactionTypeEnum::WITHDRAWAL->value === $type) { - $amount = bcmul($amount, '-1'); + $amount = bcmul((string) $amount, '-1'); } - $sums[$foreignCurrencyId][$type] = bcadd($sums[$foreignCurrencyId][$type], $amount); + $sums[$foreignCurrencyId][$type] = bcadd((string) $sums[$foreignCurrencyId][$type], (string) $amount); } } diff --git a/app/Repositories/TransactionGroup/TransactionGroupRepository.php b/app/Repositories/TransactionGroup/TransactionGroupRepository.php index 50eddb7fd6..c9c3063685 100644 --- a/app/Repositories/TransactionGroup/TransactionGroupRepository.php +++ b/app/Repositories/TransactionGroup/TransactionGroupRepository.php @@ -262,7 +262,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface, if (null === $transaction->foreign_amount || '' === $transaction->foreign_amount) { return ''; } - if (0 === bccomp('0', $transaction->foreign_amount)) { + if (0 === bccomp('0', (string) $transaction->foreign_amount)) { return ''; } $currency = $transaction->foreignCurrency; diff --git a/app/Repositories/UserGroup/UserGroupRepository.php b/app/Repositories/UserGroup/UserGroupRepository.php index e75221c4e3..e2c266b5e1 100644 --- a/app/Repositories/UserGroup/UserGroupRepository.php +++ b/app/Repositories/UserGroup/UserGroupRepository.php @@ -140,7 +140,7 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte } if (null !== $existingGroup) { // group already exists - $groupName = sprintf('%s-%s', $user->email, substr(sha1(rand(1000, 9999).microtime()), 0, 4)); + $groupName = sprintf('%s-%s', $user->email, substr(sha1(random_int(1000, 9999).microtime()), 0, 4)); } ++$loop; } @@ -286,7 +286,7 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte foreach ($rolesSimplified as $role) { try { $enum = UserRoleEnum::from($role); - } catch (\ValueError $e) { + } catch (\ValueError) { // TODO error message continue; } diff --git a/app/Repositories/UserGroups/Account/AccountRepository.php b/app/Repositories/UserGroups/Account/AccountRepository.php index 37b0c24859..f9d5ad6f90 100644 --- a/app/Repositories/UserGroups/Account/AccountRepository.php +++ b/app/Repositories/UserGroups/Account/AccountRepository.php @@ -149,9 +149,7 @@ class AccountRepository implements AccountRepositoryInterface public function getMetaValue(Account $account, string $field): ?string { $result = $account->accountMeta->filter( - static function (AccountMeta $meta) use ($field) { - return strtolower($meta->name) === strtolower($field); - } + static fn(AccountMeta $meta) => strtolower($meta->name) === strtolower($field) ); if (0 === $result->count()) { return null; diff --git a/app/Repositories/UserGroups/Bill/BillRepository.php b/app/Repositories/UserGroups/Bill/BillRepository.php index ad2558a70f..df61518b1c 100644 --- a/app/Repositories/UserGroups/Bill/BillRepository.php +++ b/app/Repositories/UserGroups/Bill/BillRepository.php @@ -117,8 +117,8 @@ class BillRepository implements BillRepositoryInterface // ignore conversion, use foreign amount $nativeAmount = (string) $sourceTransaction->foreign_amount; } - $return[$currencyId]['sum'] = bcadd($return[$currencyId]['sum'], $amount); - $return[$currencyId]['native_sum'] = bcadd($return[$currencyId]['native_sum'], $nativeAmount); + $return[$currencyId]['sum'] = bcadd($return[$currencyId]['sum'], (string) $amount); + $return[$currencyId]['native_sum'] = bcadd($return[$currencyId]['native_sum'], (string) $nativeAmount); } } } @@ -153,7 +153,7 @@ class BillRepository implements BillRepositoryInterface if ($total > 0) { $currency = $bill->transactionCurrency; $currencyId = $bill->transaction_currency_id; - $average = bcdiv(bcadd($bill->amount_max, $bill->amount_min), '2'); + $average = bcdiv(bcadd((string) $bill->amount_max, (string) $bill->amount_min), '2'); $nativeAverage = $converter->convert($currency, $default, $start, $average); $return[$currencyId] ??= [ 'currency_id' => (string) $currency->id, diff --git a/app/Repositories/UserGroups/Budget/AvailableBudgetRepository.php b/app/Repositories/UserGroups/Budget/AvailableBudgetRepository.php index e6118cb938..277832c924 100644 --- a/app/Repositories/UserGroups/Budget/AvailableBudgetRepository.php +++ b/app/Repositories/UserGroups/Budget/AvailableBudgetRepository.php @@ -68,7 +68,7 @@ class AvailableBudgetRepository implements AvailableBudgetRepositoryInterface 'native_amount' => '0', ]; $nativeAmount = $converter->convert($availableBudget->transactionCurrency, $default, $availableBudget->start_date, $availableBudget->amount); - $return[$currencyId]['amount'] = bcadd($return[$currencyId]['amount'], $availableBudget->amount); + $return[$currencyId]['amount'] = bcadd($return[$currencyId]['amount'], (string) $availableBudget->amount); $return[$currencyId]['native_amount'] = bcadd($return[$currencyId]['native_amount'], $nativeAmount); } $converter->summarize(); diff --git a/app/Repositories/UserGroups/Currency/CurrencyRepository.php b/app/Repositories/UserGroups/Currency/CurrencyRepository.php index d935fe6502..73098d5b0f 100644 --- a/app/Repositories/UserGroups/Currency/CurrencyRepository.php +++ b/app/Repositories/UserGroups/Currency/CurrencyRepository.php @@ -179,12 +179,8 @@ class CurrencyRepository implements CurrencyRepositoryInterface $local = $this->get(); return $all->map(static function (TransactionCurrency $current) use ($local) { - $hasId = $local->contains(static function (TransactionCurrency $entry) use ($current) { - return $entry->id === $current->id; - }); - $isNative = $local->contains(static function (TransactionCurrency $entry) use ($current) { - return 1 === (int) $entry->pivot->group_default && $entry->id === $current->id; - }); + $hasId = $local->contains(static fn(TransactionCurrency $entry) => $entry->id === $current->id); + $isNative = $local->contains(static fn(TransactionCurrency $entry) => 1 === (int) $entry->pivot->group_default && $entry->id === $current->id); $current->userGroupEnabled = $hasId; $current->userGroupNative = $isNative; diff --git a/app/Repositories/Webhook/WebhookRepository.php b/app/Repositories/Webhook/WebhookRepository.php index 0cc7dee0e2..c6a7827856 100644 --- a/app/Repositories/Webhook/WebhookRepository.php +++ b/app/Repositories/Webhook/WebhookRepository.php @@ -79,9 +79,9 @@ class WebhookRepository implements WebhookRepositoryInterface, UserGroupInterfac ->where('webhook_messages.errored', 0) ->get(['webhook_messages.*']) ->filter( - static function (WebhookMessage $message) { // @phpstan-ignore-line - return $message->webhookAttempts()->count() <= 2; - } + static fn(WebhookMessage $message) => + // @phpstan-ignore-line + $message->webhookAttempts()->count() <= 2 )->splice(0, 3) ; } diff --git a/app/Rules/BelongsUserGroup.php b/app/Rules/BelongsUserGroup.php index dc30295e27..ac67b72e95 100644 --- a/app/Rules/BelongsUserGroup.php +++ b/app/Rules/BelongsUserGroup.php @@ -42,14 +42,11 @@ use Illuminate\Contracts\Validation\ValidationRule; */ class BelongsUserGroup implements ValidationRule { - private UserGroup $userGroup; - /** * Create a new rule instance. */ - public function __construct(UserGroup $userGroup) + public function __construct(private readonly UserGroup $userGroup) { - $this->userGroup = $userGroup; } public function validate(string $attribute, mixed $value, \Closure $fail): void diff --git a/app/Rules/IsAllowedGroupAction.php b/app/Rules/IsAllowedGroupAction.php index 383edce267..b671526366 100644 --- a/app/Rules/IsAllowedGroupAction.php +++ b/app/Rules/IsAllowedGroupAction.php @@ -35,14 +35,10 @@ use Illuminate\Support\Facades\Log; class IsAllowedGroupAction implements ValidationRule { private array $acceptedRoles; - private string $className; - private string $methodName; - private UserGroupRepositoryInterface $repository; + private readonly UserGroupRepositoryInterface $repository; - public function __construct(string $className, string $methodName) + public function __construct(private readonly string $className, private readonly string $methodName) { - $this->className = $className; - $this->methodName = $methodName; // you need these roles to do anything with any endpoint. $this->acceptedRoles = [UserRoleEnum::OWNER, UserRoleEnum::FULL]; $this->repository = app(UserGroupRepositoryInterface::class); diff --git a/app/Rules/IsDefaultUserGroupName.php b/app/Rules/IsDefaultUserGroupName.php index 4113d222b7..70972a980a 100644 --- a/app/Rules/IsDefaultUserGroupName.php +++ b/app/Rules/IsDefaultUserGroupName.php @@ -34,11 +34,8 @@ use Illuminate\Contracts\Validation\ValidationRule; */ class IsDefaultUserGroupName implements ValidationRule { - private UserGroup $userGroup; - - public function __construct(UserGroup $userGroup) + public function __construct(private readonly UserGroup $userGroup) { - $this->userGroup = $userGroup; } /** diff --git a/app/Rules/IsFilterValueIn.php b/app/Rules/IsFilterValueIn.php index 3a08483811..c540748a53 100644 --- a/app/Rules/IsFilterValueIn.php +++ b/app/Rules/IsFilterValueIn.php @@ -28,13 +28,8 @@ use Illuminate\Contracts\Validation\ValidationRule; class IsFilterValueIn implements ValidationRule { - private string $key; - private array $values; - - public function __construct(string $key, array $values) + public function __construct(private readonly string $key, private readonly array $values) { - $this->key = $key; - $this->values = $values; } /** diff --git a/app/Rules/IsValidAttachmentModel.php b/app/Rules/IsValidAttachmentModel.php index 5a547d092a..16388e6242 100644 --- a/app/Rules/IsValidAttachmentModel.php +++ b/app/Rules/IsValidAttachmentModel.php @@ -47,7 +47,7 @@ use Illuminate\Contracts\Validation\ValidationRule; */ class IsValidAttachmentModel implements ValidationRule { - private string $model; + private readonly string $model; /** * IsValidAttachmentModel constructor. diff --git a/app/Rules/IsValidBulkClause.php b/app/Rules/IsValidBulkClause.php index 7487a8ba41..148d5600b1 100644 --- a/app/Rules/IsValidBulkClause.php +++ b/app/Rules/IsValidBulkClause.php @@ -64,7 +64,7 @@ class IsValidBulkClause implements ValidationRule { try { $array = \Safe\json_decode($value, true, 8, JSON_THROW_ON_ERROR); - } catch (\JsonException $e) { + } catch (\JsonException) { $this->error = (string) trans('validation.json'); return false; diff --git a/app/Rules/IsValidZeroOrMoreAmount.php b/app/Rules/IsValidZeroOrMoreAmount.php index 03df93bc00..be6e61e8d9 100644 --- a/app/Rules/IsValidZeroOrMoreAmount.php +++ b/app/Rules/IsValidZeroOrMoreAmount.php @@ -32,11 +32,9 @@ use Illuminate\Support\Facades\Log; class IsValidZeroOrMoreAmount implements ValidationRule { use ValidatesAmountsTrait; - private bool $nullable = false; - public function __construct(bool $nullable = false) + public function __construct(private bool $nullable = false) { - $this->nullable = $nullable; } /** diff --git a/app/Rules/UniqueAccountNumber.php b/app/Rules/UniqueAccountNumber.php index 921f78ae33..3e02e2c7e9 100644 --- a/app/Rules/UniqueAccountNumber.php +++ b/app/Rules/UniqueAccountNumber.php @@ -34,27 +34,22 @@ use Illuminate\Contracts\Validation\ValidationRule; */ class UniqueAccountNumber implements ValidationRule { - private ?Account $account; - private ?string $expectedType; - /** * Create a new rule instance. */ - public function __construct(?Account $account, ?string $expectedType) + public function __construct(private readonly ?Account $account, private ?string $expectedType) { app('log') ->debug('Constructed UniqueAccountNumber') ; - $this->account = $account; - $this->expectedType = $expectedType; // a very basic fix to make sure we get the correct account type: - if ('expense' === $expectedType) { + if ('expense' === $this->expectedType) { $this->expectedType = AccountTypeEnum::EXPENSE->value; } - if ('revenue' === $expectedType) { + if ('revenue' === $this->expectedType) { $this->expectedType = AccountTypeEnum::REVENUE->value; } - if ('asset' === $expectedType) { + if ('asset' === $this->expectedType) { $this->expectedType = AccountTypeEnum::ASSET->value; } app('log')->debug(sprintf('Expected type is "%s"', $this->expectedType)); diff --git a/app/Rules/UniqueIban.php b/app/Rules/UniqueIban.php index 62e6cdc89d..1a4167ee3f 100644 --- a/app/Rules/UniqueIban.php +++ b/app/Rules/UniqueIban.php @@ -34,15 +34,13 @@ use Illuminate\Contracts\Validation\ValidationRule; */ class UniqueIban implements ValidationRule { - private ?Account $account; private array $expectedTypes; /** * Create a new rule instance. */ - public function __construct(?Account $account, ?string $expectedType) + public function __construct(private readonly ?Account $account, ?string $expectedType) { - $this->account = $account; $this->expectedTypes = []; if (null === $expectedType) { return; diff --git a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php index a72e1f35cb..29499570bc 100644 --- a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php +++ b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php @@ -100,7 +100,7 @@ class UpdateRequest implements UpdateRequestInterface try { $json = \Safe\json_decode($body, true, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $e) { + } catch (\JsonException) { Log::error('Body is not valid JSON'); Log::error($body); $return['message'] = 'Invalid JSON :('; diff --git a/app/Services/Internal/Support/AccountServiceTrait.php b/app/Services/Internal/Support/AccountServiceTrait.php index c43478a64e..75cb0ad95c 100644 --- a/app/Services/Internal/Support/AccountServiceTrait.php +++ b/app/Services/Internal/Support/AccountServiceTrait.php @@ -209,19 +209,19 @@ trait AccountServiceTrait $amount = array_key_exists('opening_balance', $data) ? $data['opening_balance'] : '0'; // amount is positive. - if (1 === bccomp($amount, '0')) { + if (1 === bccomp((string) $amount, '0')) { app('log')->debug(sprintf('Amount is %s, which is positive. Source is a new IB account, destination is #%d', $amount, $account->id)); $sourceName = trans('firefly.initial_balance_description', ['account' => $account->name], $language); $destId = $account->id; } // amount is not positive - if (-1 === bccomp($amount, '0')) { + if (-1 === bccomp((string) $amount, '0')) { app('log')->debug(sprintf('Amount is %s, which is negative. Destination is a new IB account, source is #%d', $amount, $account->id)); $destName = trans('firefly.initial_balance_account', ['account' => $account->name], $language); $sourceId = $account->id; } // amount is 0 - if (0 === bccomp($amount, '0')) { + if (0 === bccomp((string) $amount, '0')) { app('log')->debug('Amount is zero, so will not make an OB group.'); throw new FireflyException('Amount for new opening balance was unexpectedly 0.'); diff --git a/app/Services/Internal/Support/CreditRecalculateService.php b/app/Services/Internal/Support/CreditRecalculateService.php index f9368bac65..7c105ac472 100644 --- a/app/Services/Internal/Support/CreditRecalculateService.php +++ b/app/Services/Internal/Support/CreditRecalculateService.php @@ -192,7 +192,7 @@ class CreditRecalculateService // Log::debug(sprintf('Found %d transaction(s) to process.', $total)); /** @var Transaction $transaction */ - foreach ($transactions as $index => $transaction) { + foreach ($transactions as $transaction) { // Log::debug(sprintf('[%d/%d] Processing transaction.', $index + 1, $total)); $leftOfDebt = $this->processTransaction($account, $direction, $transaction, $leftOfDebt); } @@ -277,66 +277,66 @@ class CreditRecalculateService if ($isSameAccount && $isCredit && $this->isWithdrawalIn($usedAmount, $type)) { // case 1 $usedAmount = app('steam')->positive($usedAmount); - return bcadd($leftOfDebt, $usedAmount); + return bcadd($leftOfDebt, (string) $usedAmount); // Log::debug(sprintf('Case 1 (withdrawal into credit liability): %s + %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2))); } if ($isSameAccount && $isCredit && $this->isWithdrawalOut($usedAmount, $type)) { // case 2 $usedAmount = app('steam')->positive($usedAmount); - return bcsub($leftOfDebt, $usedAmount); + return bcsub($leftOfDebt, (string) $usedAmount); // Log::debug(sprintf('Case 2 (withdrawal away from liability): %s - %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2))); } if ($isSameAccount && $isCredit && $this->isDepositOut($usedAmount, $type)) { // case 3 $usedAmount = app('steam')->positive($usedAmount); - return bcsub($leftOfDebt, $usedAmount); + return bcsub($leftOfDebt, (string) $usedAmount); // Log::debug(sprintf('Case 3 (deposit away from liability): %s - %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2))); } if ($isSameAccount && $isCredit && $this->isDepositIn($usedAmount, $type)) { // case 4 $usedAmount = app('steam')->positive($usedAmount); - return bcadd($leftOfDebt, $usedAmount); + return bcadd($leftOfDebt, (string) $usedAmount); // Log::debug(sprintf('Case 4 (deposit into credit liability): %s + %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2))); } if ($isSameAccount && $isCredit && $this->isTransferIn($usedAmount, $type)) { // case 5 $usedAmount = app('steam')->positive($usedAmount); - return bcadd($leftOfDebt, $usedAmount); + return bcadd($leftOfDebt, (string) $usedAmount); // Log::debug(sprintf('Case 5 (transfer into credit liability): %s + %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2))); } if ($isSameAccount && $isDebit && $this->isWithdrawalIn($usedAmount, $type)) { // case 6 $usedAmount = app('steam')->positive($usedAmount); - return bcsub($leftOfDebt, $usedAmount); + return bcsub($leftOfDebt, (string) $usedAmount); // Log::debug(sprintf('Case 6 (withdrawal into debit liability): %s - %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2))); } if ($isSameAccount && $isDebit && $this->isDepositOut($usedAmount, $type)) { // case 7 $usedAmount = app('steam')->positive($usedAmount); - return bcadd($leftOfDebt, $usedAmount); + return bcadd($leftOfDebt, (string) $usedAmount); // Log::debug(sprintf('Case 7 (deposit away from liability): %s + %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2))); } if ($isSameAccount && $isDebit && $this->isWithdrawalOut($usedAmount, $type)) { // case 8 $usedAmount = app('steam')->positive($usedAmount); - return bcadd($leftOfDebt, $usedAmount); + return bcadd($leftOfDebt, (string) $usedAmount); // Log::debug(sprintf('Case 8 (withdrawal away from liability): %s + %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2))); } if ($isSameAccount && $isDebit && $this->isTransferIn($usedAmount, $type)) { // case 9 $usedAmount = app('steam')->positive($usedAmount); - return bcsub($leftOfDebt, $usedAmount); + return bcsub($leftOfDebt, (string) $usedAmount); // 2024-10-05, #9225 this used to say you would owe more, but a transfer INTO a debit from wherever means you owe LESS. // Log::debug(sprintf('Case 9 (transfer into debit liability, means you owe LESS): %s - %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2))); } if ($isSameAccount && $isDebit && $this->isTransferOut($usedAmount, $type)) { // case 10 $usedAmount = app('steam')->positive($usedAmount); - return bcadd($leftOfDebt, $usedAmount); + return bcadd($leftOfDebt, (string) $usedAmount); // 2024-10-05, #9225 this used to say you would owe less, but a transfer OUT OF a debit from wherever means you owe MORE. // Log::debug(sprintf('Case 10 (transfer out of debit liability, means you owe MORE): %s + %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2))); } @@ -345,7 +345,7 @@ class CreditRecalculateService if (in_array($type, [TransactionTypeEnum::WITHDRAWAL->value, TransactionTypeEnum::DEPOSIT->value, TransactionTypeEnum::TRANSFER->value], true)) { $usedAmount = app('steam')->negative($usedAmount); - return bcadd($leftOfDebt, $usedAmount); + return bcadd($leftOfDebt, (string) $usedAmount); // Log::debug(sprintf('Case X (all other cases): %s + %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2))); } diff --git a/app/Services/Internal/Update/CategoryUpdateService.php b/app/Services/Internal/Update/CategoryUpdateService.php index e4f02544fd..aff42c2d05 100644 --- a/app/Services/Internal/Update/CategoryUpdateService.php +++ b/app/Services/Internal/Update/CategoryUpdateService.php @@ -149,7 +149,7 @@ class CategoryUpdateService $dbNote = new Note(); $dbNote->noteable()->associate($category); } - $dbNote->text = trim($note); + $dbNote->text = trim((string) $note); $dbNote->save(); } } diff --git a/app/Support/Amount.php b/app/Support/Amount.php index f01ab27085..e4b792acd7 100644 --- a/app/Support/Amount.php +++ b/app/Support/Amount.php @@ -122,10 +122,10 @@ class Amount $result = (string) $fmt->format((float) $rounded); // intentional float if (true === $coloured) { - if (1 === bccomp($rounded, '0')) { + if (1 === bccomp((string) $rounded, '0')) { return sprintf('%s', $result); } - if (-1 === bccomp($rounded, '0')) { + if (-1 === bccomp((string) $rounded, '0')) { return sprintf('%s', $result); } diff --git a/app/Support/Authentication/RemoteUserGuard.php b/app/Support/Authentication/RemoteUserGuard.php index c73cd0da42..31d4874d52 100644 --- a/app/Support/Authentication/RemoteUserGuard.php +++ b/app/Support/Authentication/RemoteUserGuard.php @@ -39,19 +39,17 @@ use Illuminate\Support\Facades\Log; class RemoteUserGuard implements Guard { protected Application $application; - protected UserProvider $provider; protected ?User $user; /** * Create a new authentication guard. */ - public function __construct(UserProvider $provider, Application $app) + public function __construct(protected UserProvider $provider, Application $app) { /** @var null|Request $request */ $request = $app->get('request'); Log::debug(sprintf('Created RemoteUserGuard for %s "%s"', $request?->getMethod(), $request?->getRequestUri())); $this->application = $app; - $this->provider = $provider; $this->user = null; } @@ -59,7 +57,7 @@ class RemoteUserGuard implements Guard { Log::debug(sprintf('Now at %s', __METHOD__)); if (null !== $this->user) { - Log::debug(sprintf('%s is found: #%d, "%s".', get_class($this->user), $this->user->id, $this->user->email)); + Log::debug(sprintf('%s is found: #%d, "%s".', $this->user::class, $this->user->id, $this->user->email)); return; } diff --git a/app/Support/CacheProperties.php b/app/Support/CacheProperties.php index 5f783af1c1..a79633497f 100644 --- a/app/Support/CacheProperties.php +++ b/app/Support/CacheProperties.php @@ -80,7 +80,7 @@ class CacheProperties foreach ($this->properties as $property) { try { $content = sprintf('%s%s', $content, \Safe\json_encode($property, JSON_THROW_ON_ERROR)); - } catch (\JsonException $e) { + } catch (\JsonException) { // @ignoreException $content = sprintf('%s%s', $content, hash('sha256', (string) time())); } diff --git a/app/Support/Chart/Budget/FrontpageChartGenerator.php b/app/Support/Chart/Budget/FrontpageChartGenerator.php index 530ffbd8c9..4ce9d137f9 100644 --- a/app/Support/Chart/Budget/FrontpageChartGenerator.php +++ b/app/Support/Chart/Budget/FrontpageChartGenerator.php @@ -40,8 +40,8 @@ use Illuminate\Support\Facades\Log; class FrontpageChartGenerator { protected OperationsRepositoryInterface $opsRepository; - private BudgetLimitRepositoryInterface $blRepository; - private BudgetRepositoryInterface $budgetRepository; + private readonly BudgetLimitRepositoryInterface $blRepository; + private readonly BudgetRepositoryInterface $budgetRepository; private Carbon $end; private string $monthAndDayFormat; private Carbon $start; @@ -119,7 +119,7 @@ class FrontpageChartGenerator /** @var array $entry */ foreach ($spent as $entry) { $title = sprintf('%s (%s)', $budget->name, $entry['currency_name']); - $data[0]['entries'][$title] = bcmul($entry['sum'], '-1'); // spent + $data[0]['entries'][$title] = bcmul((string) $entry['sum'], '-1'); // spent $data[1]['entries'][$title] = 0; // left to spend $data[2]['entries'][$title] = 0; // overspent } @@ -203,15 +203,15 @@ class FrontpageChartGenerator $amount = $limit->native_amount; Log::debug(sprintf('Amount is now "%s".', $amount)); } - $amount = null === $amount ? '0' : $amount; - $sumSpent = bcmul($entry['sum'], '-1'); // spent + $amount ??= '0'; + $sumSpent = bcmul((string) $entry['sum'], '-1'); // spent $data[0]['entries'][$title] ??= '0'; $data[1]['entries'][$title] ??= '0'; $data[2]['entries'][$title] ??= '0'; - $data[0]['entries'][$title] = bcadd($data[0]['entries'][$title], 1 === bccomp($sumSpent, $amount) ? $amount : $sumSpent); // spent - $data[1]['entries'][$title] = bcadd($data[1]['entries'][$title], 1 === bccomp($amount, $sumSpent) ? bcadd($entry['sum'], $amount) : '0'); // left to spent - $data[2]['entries'][$title] = bcadd($data[2]['entries'][$title], 1 === bccomp($amount, $sumSpent) ? '0' : bcmul(bcadd($entry['sum'], $amount), '-1')); // overspent + $data[0]['entries'][$title] = bcadd((string) $data[0]['entries'][$title], 1 === bccomp($sumSpent, $amount) ? $amount : $sumSpent); // spent + $data[1]['entries'][$title] = bcadd((string) $data[1]['entries'][$title], 1 === bccomp($amount, $sumSpent) ? bcadd((string) $entry['sum'], $amount) : '0'); // left to spent + $data[2]['entries'][$title] = bcadd((string) $data[2]['entries'][$title], 1 === bccomp($amount, $sumSpent) ? '0' : bcmul(bcadd((string) $entry['sum'], $amount), '-1')); // overspent Log::debug(sprintf('Amount [spent] is now %s.', $data[0]['entries'][$title])); Log::debug(sprintf('Amount [left] is now %s.', $data[1]['entries'][$title])); diff --git a/app/Support/Chart/Category/FrontpageChartGenerator.php b/app/Support/Chart/Category/FrontpageChartGenerator.php index ddba057a18..12882ae050 100644 --- a/app/Support/Chart/Category/FrontpageChartGenerator.php +++ b/app/Support/Chart/Category/FrontpageChartGenerator.php @@ -45,22 +45,18 @@ class FrontpageChartGenerator private AccountRepositoryInterface $accountRepos; private array $currencies; - private Carbon $end; private NoCategoryRepositoryInterface $noCatRepos; private OperationsRepositoryInterface $opsRepos; private CategoryRepositoryInterface $repository; public bool $convertToNative = false; public TransactionCurrency $defaultCurrency; - private Carbon $start; /** * FrontpageChartGenerator constructor. */ - public function __construct(Carbon $start, Carbon $end) + public function __construct(private Carbon $start, private Carbon $end) { $this->currencies = []; - $this->start = $start; - $this->end = $end; $this->repository = app(CategoryRepositoryInterface::class); $this->accountRepos = app(AccountRepositoryInterface::class); $this->opsRepos = app(OperationsRepositoryInterface::class); diff --git a/app/Support/Form/FormSupport.php b/app/Support/Form/FormSupport.php index 06d50030ff..4b0417f2be 100644 --- a/app/Support/Form/FormSupport.php +++ b/app/Support/Form/FormSupport.php @@ -75,7 +75,7 @@ trait FormSupport $options['class'] = 'form-control'; $options['id'] = 'ffInput_'.$name; $options['autocomplete'] = 'off'; - $options['placeholder'] = ucfirst($label); + $options['placeholder'] = ucfirst((string) $label); return $options; } diff --git a/app/Support/Http/Api/AccountBalanceGrouped.php b/app/Support/Http/Api/AccountBalanceGrouped.php index 95c5e2ea69..d4763ea6ed 100644 --- a/app/Support/Http/Api/AccountBalanceGrouped.php +++ b/app/Support/Http/Api/AccountBalanceGrouped.php @@ -38,7 +38,7 @@ class AccountBalanceGrouped { private array $accountIds; private string $carbonFormat; - private ExchangeRateConverter $converter; + private readonly ExchangeRateConverter $converter; private array $currencies = []; private array $data = []; private TransactionCurrency $default; @@ -157,7 +157,7 @@ class AccountBalanceGrouped // get conversion rate $rate = $this->getRate($currency, $journal['date']); - $amountConverted = bcmul($amount, $rate); + $amountConverted = bcmul((string) $amount, $rate); // perhaps transaction already has the foreign amount in the native currency. if ((int) $journal['foreign_currency_id'] === $this->default->id) { @@ -166,11 +166,11 @@ class AccountBalanceGrouped } // add normal entry - $this->data[$currencyId][$period][$key] = bcadd($this->data[$currencyId][$period][$key], $amount); + $this->data[$currencyId][$period][$key] = bcadd((string) $this->data[$currencyId][$period][$key], (string) $amount); // add converted entry $convertedKey = sprintf('native_%s', $key); - $this->data[$currencyId][$period][$convertedKey] = bcadd($this->data[$currencyId][$period][$convertedKey], $amountConverted); + $this->data[$currencyId][$period][$convertedKey] = bcadd((string) $this->data[$currencyId][$period][$convertedKey], (string) $amountConverted); } private function findCurrency(int $currencyId): TransactionCurrency diff --git a/app/Support/Http/Api/SummaryBalanceGrouped.php b/app/Support/Http/Api/SummaryBalanceGrouped.php index 1f03ed2e5d..f9fbd65aac 100644 --- a/app/Support/Http/Api/SummaryBalanceGrouped.php +++ b/app/Support/Http/Api/SummaryBalanceGrouped.php @@ -33,7 +33,7 @@ class SummaryBalanceGrouped private const string SUM = 'sum'; private array $amounts = []; private array $currencies; - private CurrencyRepositoryInterface $currencyRepository; + private readonly CurrencyRepositoryInterface $currencyRepository; private TransactionCurrency $default; private array $keys; @@ -109,7 +109,7 @@ class SummaryBalanceGrouped foreach ($journals as $journal) { // transaction info: $currencyId = (int) $journal['currency_id']; - $amount = bcmul($journal['amount'], $multiplier); + $amount = bcmul((string) $journal['amount'], $multiplier); $currency = $this->currencies[$currencyId] ?? TransactionCurrency::find($currencyId); $this->currencies[$currencyId] = $currency; $nativeAmount = $converter->convert($currency, $this->default, $journal['date'], $amount); @@ -125,10 +125,10 @@ class SummaryBalanceGrouped $this->amounts[self::SUM]['native'] ??= '0'; // add values: - $this->amounts[$key][$currencyId] = bcadd($this->amounts[$key][$currencyId], $amount); - $this->amounts[self::SUM][$currencyId] = bcadd($this->amounts[self::SUM][$currencyId], $amount); - $this->amounts[$key]['native'] = bcadd($this->amounts[$key]['native'], $nativeAmount); - $this->amounts[self::SUM]['native'] = bcadd($this->amounts[self::SUM]['native'], $nativeAmount); + $this->amounts[$key][$currencyId] = bcadd((string) $this->amounts[$key][$currencyId], $amount); + $this->amounts[self::SUM][$currencyId] = bcadd((string) $this->amounts[self::SUM][$currencyId], $amount); + $this->amounts[$key]['native'] = bcadd((string) $this->amounts[$key]['native'], (string) $nativeAmount); + $this->amounts[self::SUM]['native'] = bcadd((string) $this->amounts[self::SUM]['native'], (string) $nativeAmount); } $converter->summarize(); } diff --git a/app/Support/Http/Controllers/AugumentData.php b/app/Support/Http/Controllers/AugumentData.php index 301c4904c8..487446d6d1 100644 --- a/app/Support/Http/Controllers/AugumentData.php +++ b/app/Support/Http/Controllers/AugumentData.php @@ -110,7 +110,7 @@ trait AugumentData $grouped = $accounts->groupBy('id')->toArray(); $return = []; foreach ($accountIds as $combinedId) { - $parts = explode('-', $combinedId); + $parts = explode('-', (string) $combinedId); $accountId = (int) $parts[0]; if (array_key_exists($accountId, $grouped)) { $return[$accountId] = $grouped[$accountId][0]['name']; @@ -152,7 +152,7 @@ trait AugumentData $grouped = $categories->groupBy('id')->toArray(); $return = []; foreach ($categoryIds as $combinedId) { - $parts = explode('-', $combinedId); + $parts = explode('-', (string) $combinedId); $categoryId = (int) $parts[0]; if (array_key_exists($categoryId, $grouped)) { $return[$categoryId] = $grouped[$categoryId][0]['name']; @@ -249,7 +249,7 @@ trait AugumentData } $grouped[$name] ??= '0'; - $grouped[$name] = bcadd($journal['amount'], $grouped[$name]); + $grouped[$name] = bcadd((string) $journal['amount'], $grouped[$name]); } return $grouped; @@ -287,8 +287,8 @@ trait AugumentData } // add amount - $sum['per_currency'][$currencyId]['sum'] = bcadd($sum['per_currency'][$currencyId]['sum'], $journal['amount']); - $sum['grand_sum'] = bcadd($sum['grand_sum'], $journal['amount']); + $sum['per_currency'][$currencyId]['sum'] = bcadd($sum['per_currency'][$currencyId]['sum'], (string) $journal['amount']); + $sum['grand_sum'] = bcadd($sum['grand_sum'], (string) $journal['amount']); } return $sum; diff --git a/app/Support/Http/Controllers/PeriodOverview.php b/app/Support/Http/Controllers/PeriodOverview.php index 79b4979029..82b4165f22 100644 --- a/app/Support/Http/Controllers/PeriodOverview.php +++ b/app/Support/Http/Controllers/PeriodOverview.php @@ -135,11 +135,11 @@ trait PeriodOverview foreach ($transactions as $index => $item) { $date = Carbon::parse($item['date']); if ($date >= $start && $date <= $end) { - if ('away' === $direction && -1 === bccomp($item['amount'], '0')) { + if ('away' === $direction && -1 === bccomp((string) $item['amount'], '0')) { $result[] = $item; unset($transactions[$index]); } - if ('in' === $direction && 1 === bccomp($item['amount'], '0')) { + if ('in' === $direction && 1 === bccomp((string) $item['amount'], '0')) { $result[] = $item; unset($transactions[$index]); } diff --git a/app/Support/JsonApi/Enrichments/TransactionGroupEnrichment.php b/app/Support/JsonApi/Enrichments/TransactionGroupEnrichment.php index ff70a0ba5f..45a79daac1 100644 --- a/app/Support/JsonApi/Enrichments/TransactionGroupEnrichment.php +++ b/app/Support/JsonApi/Enrichments/TransactionGroupEnrichment.php @@ -50,7 +50,7 @@ class TransactionGroupEnrichment implements EnrichmentInterface private User $user; // @phpstan-ignore-line private UserGroup $userGroup; // @phpstan-ignore-line private array $metaData; - private array $dateFields; + private readonly array $dateFields; private array $attachmentCount; public function __construct() diff --git a/app/Support/Models/AccountBalanceCalculator.php b/app/Support/Models/AccountBalanceCalculator.php index 11ee28f04b..ce1e9874aa 100644 --- a/app/Support/Models/AccountBalanceCalculator.php +++ b/app/Support/Models/AccountBalanceCalculator.php @@ -101,7 +101,7 @@ class AccountBalanceCalculator // before and after are easy: $before = $balances[$entry->account_id][$entry->transaction_currency_id][0]; - $after = bcadd($before, $entry->amount); + $after = bcadd($before, (string) $entry->amount); if (true === $entry->balance_dirty || $accounts->count() > 0) { // update the transaction: $entry->balance_before = $before; diff --git a/app/Support/Models/BillDateCalculator.php b/app/Support/Models/BillDateCalculator.php index f8b5e9f376..ffda4ef355 100644 --- a/app/Support/Models/BillDateCalculator.php +++ b/app/Support/Models/BillDateCalculator.php @@ -118,9 +118,7 @@ class BillDateCalculator } Log::debug('end of loop'); $simple = $set->map( // @phpstan-ignore-line - static function (Carbon $date) { - return $date->format('Y-m-d'); - } + static fn(Carbon $date) => $date->format('Y-m-d') ); Log::debug(sprintf('Found %d pay dates', $set->count()), $simple->toArray()); diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index 821dab72e5..c21a9353a7 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -36,7 +36,7 @@ use Illuminate\Support\Facades\Log; */ class Navigation { - private Calculator $calculator; + private readonly Calculator $calculator; public function __construct(?Calculator $calculator = null) { @@ -442,25 +442,13 @@ class Navigation return $range; } - switch ($range) { - default: - return $range; - - case 'last7': - return '1W'; - - case 'last30': - case 'MTD': - return '1M'; - - case 'last90': - case 'QTD': - return '3M'; - - case 'last365': - case 'YTD': - return '1Y'; - } + return match ($range) { + 'last7' => '1W', + 'last30', 'MTD' => '1M', + 'last90', 'QTD' => '3M', + 'last365', 'YTD' => '1Y', + default => $range, + }; } /** diff --git a/app/Support/NullArrayObject.php b/app/Support/NullArrayObject.php index 0532b7b2ef..f4a0c7f4fa 100644 --- a/app/Support/NullArrayObject.php +++ b/app/Support/NullArrayObject.php @@ -29,19 +29,15 @@ namespace FireflyIII\Support; */ class NullArrayObject extends \ArrayObject { - /** @var null|mixed */ - public $default; - /** * NullArrayObject constructor. * * @param null $default */ /** @phpstan-ignore-next-line */ - public function __construct(array $array, $default = null) + public function __construct(array $array, public $default = null) { parent::__construct($array); - $this->default = $default; } /** diff --git a/app/Support/Report/Budget/BudgetReportGenerator.php b/app/Support/Report/Budget/BudgetReportGenerator.php index 91c58b4b30..96fffd63b4 100644 --- a/app/Support/Report/Budget/BudgetReportGenerator.php +++ b/app/Support/Report/Budget/BudgetReportGenerator.php @@ -44,14 +44,14 @@ use Illuminate\Support\Collection; class BudgetReportGenerator { private Collection $accounts; - private BudgetLimitRepositoryInterface $blRepository; + private readonly BudgetLimitRepositoryInterface $blRepository; private Collection $budgets; private TransactionCurrency $currency; private Carbon $end; - private NoBudgetRepositoryInterface $nbRepository; - private OperationsRepositoryInterface $opsRepository; + private readonly NoBudgetRepositoryInterface $nbRepository; + private readonly OperationsRepositoryInterface $opsRepository; private array $report; - private BudgetRepositoryInterface $repository; + private readonly BudgetRepositoryInterface $repository; private Carbon $start; /** @@ -124,7 +124,7 @@ class BudgetReportGenerator ??= '0'; $this->report[$sourceAccountId]['currencies'][$currencyId]['budgets'][$budgetId] - = bcadd($this->report[$sourceAccountId]['currencies'][$currencyId]['budgets'][$budgetId], $journal['amount']); + = bcadd($this->report[$sourceAccountId]['currencies'][$currencyId]['budgets'][$budgetId], (string) $journal['amount']); } } @@ -223,10 +223,10 @@ class BudgetReportGenerator 'currency_symbol' => $limitCurrency->symbol, 'currency_decimal_places' => $limitCurrency->decimal_places, ]; - $this->report['sums'][$currencyId]['budgeted'] = bcadd($this->report['sums'][$currencyId]['budgeted'], $limit->amount); - $this->report['sums'][$currencyId]['spent'] = bcadd($this->report['sums'][$currencyId]['spent'], $spent); - $this->report['sums'][$currencyId]['left'] = bcadd($this->report['sums'][$currencyId]['left'], bcadd($limit->amount, $spent)); - $this->report['sums'][$currencyId]['overspent'] = bcadd($this->report['sums'][$currencyId]['overspent'], $overspent); + $this->report['sums'][$currencyId]['budgeted'] = bcadd((string) $this->report['sums'][$currencyId]['budgeted'], $limit->amount); + $this->report['sums'][$currencyId]['spent'] = bcadd((string) $this->report['sums'][$currencyId]['spent'], $spent); + $this->report['sums'][$currencyId]['left'] = bcadd((string) $this->report['sums'][$currencyId]['left'], bcadd($limit->amount, $spent)); + $this->report['sums'][$currencyId]['overspent'] = bcadd((string) $this->report['sums'][$currencyId]['overspent'], $overspent); } /** @@ -267,7 +267,7 @@ class BudgetReportGenerator 'currency_symbol' => $nbCurrencySymbol, 'currency_decimal_places' => $nbCurrencyDp, ]; - $this->report['sums'][$nbCurrencyId]['spent'] = bcadd($this->report['sums'][$nbCurrencyId]['spent'] ?? '0', $noBudgetEntry['sum']); + $this->report['sums'][$nbCurrencyId]['spent'] = bcadd($this->report['sums'][$nbCurrencyId]['spent'] ?? '0', (string) $noBudgetEntry['sum']); // append currency info because it may be missing: $this->report['sums'][$nbCurrencyId]['currency_id'] = $nbCurrencyId; $this->report['sums'][$nbCurrencyId]['currency_code'] = $nbCurrencyCode; @@ -300,11 +300,11 @@ class BudgetReportGenerator $totalBudgeted = $this->report['sums'][$currencyId]['budgeted'] ?? '0'; $budgetedPct = '0'; - if (0 !== bccomp($spent, '0') && 0 !== bccomp($totalSpent, '0')) { - $spentPct = round((float) bcmul(bcdiv($spent, $totalSpent), '100')); + if (0 !== bccomp((string) $spent, '0') && 0 !== bccomp($totalSpent, '0')) { + $spentPct = round((float) bcmul(bcdiv((string) $spent, $totalSpent), '100')); } - if (0 !== bccomp($budgeted, '0') && 0 !== bccomp($totalBudgeted, '0')) { - $budgetedPct = round((float) bcmul(bcdiv($budgeted, $totalBudgeted), '100')); + if (0 !== bccomp((string) $budgeted, '0') && 0 !== bccomp($totalBudgeted, '0')) { + $budgetedPct = round((float) bcmul(bcdiv((string) $budgeted, $totalBudgeted), '100')); } $this->report['sums'][$currencyId]['budgeted'] ??= '0'; $this->report['budgets'][$budgetId]['budget_limits'][$limitId]['spent_pct'] = $spentPct; diff --git a/app/Support/Report/Category/CategoryReportGenerator.php b/app/Support/Report/Category/CategoryReportGenerator.php index 0e0a83f500..e5947180b3 100644 --- a/app/Support/Report/Category/CategoryReportGenerator.php +++ b/app/Support/Report/Category/CategoryReportGenerator.php @@ -37,8 +37,8 @@ class CategoryReportGenerator { private Collection $accounts; private Carbon $end; - private NoCategoryRepositoryInterface $noCatRepository; - private OperationsRepositoryInterface $opsRepository; + private readonly NoCategoryRepositoryInterface $noCatRepository; + private readonly OperationsRepositoryInterface $opsRepository; private array $report; private Carbon $start; @@ -137,29 +137,29 @@ class CategoryReportGenerator // loop journals: foreach ($categoryRow['transaction_journals'] as $journal) { // sum of sums - $this->report['sums'][$currencyId]['sum'] = bcadd($this->report['sums'][$currencyId]['sum'], $journal['amount']); + $this->report['sums'][$currencyId]['sum'] = bcadd((string) $this->report['sums'][$currencyId]['sum'], (string) $journal['amount']); // sum of spent: - $this->report['sums'][$currencyId]['spent'] = -1 === bccomp($journal['amount'], '0') ? bcadd( - $this->report['sums'][$currencyId]['spent'], - $journal['amount'] + $this->report['sums'][$currencyId]['spent'] = -1 === bccomp((string) $journal['amount'], '0') ? bcadd( + (string) $this->report['sums'][$currencyId]['spent'], + (string) $journal['amount'] ) : $this->report['sums'][$currencyId]['spent']; // sum of earned - $this->report['sums'][$currencyId]['earned'] = 1 === bccomp($journal['amount'], '0') ? bcadd( - $this->report['sums'][$currencyId]['earned'], - $journal['amount'] + $this->report['sums'][$currencyId]['earned'] = 1 === bccomp((string) $journal['amount'], '0') ? bcadd( + (string) $this->report['sums'][$currencyId]['earned'], + (string) $journal['amount'] ) : $this->report['sums'][$currencyId]['earned']; // sum of category - $this->report['categories'][$key]['sum'] = bcadd($this->report['categories'][$key]['sum'], $journal['amount']); + $this->report['categories'][$key]['sum'] = bcadd((string) $this->report['categories'][$key]['sum'], (string) $journal['amount']); // total spent in category - $this->report['categories'][$key]['spent'] = -1 === bccomp($journal['amount'], '0') ? bcadd( - $this->report['categories'][$key]['spent'], - $journal['amount'] + $this->report['categories'][$key]['spent'] = -1 === bccomp((string) $journal['amount'], '0') ? bcadd( + (string) $this->report['categories'][$key]['spent'], + (string) $journal['amount'] ) : $this->report['categories'][$key]['spent']; // total earned in category - $this->report['categories'][$key]['earned'] = 1 === bccomp($journal['amount'], '0') ? bcadd( - $this->report['categories'][$key]['earned'], - $journal['amount'] + $this->report['categories'][$key]['earned'] = 1 === bccomp((string) $journal['amount'], '0') ? bcadd( + (string) $this->report['categories'][$key]['earned'], + (string) $journal['amount'] ) : $this->report['categories'][$key]['earned']; } } diff --git a/app/Support/Report/Summarizer/TransactionSummarizer.php b/app/Support/Report/Summarizer/TransactionSummarizer.php index 541740348c..070723a779 100644 --- a/app/Support/Report/Summarizer/TransactionSummarizer.php +++ b/app/Support/Report/Summarizer/TransactionSummarizer.php @@ -119,10 +119,10 @@ class TransactionSummarizer ]; if ('positive' === $method) { - $array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], app('steam')->positive($amount)); + $array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], (string) app('steam')->positive($amount)); } if ('negative' === $method) { - $array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], app('steam')->negative($amount)); + $array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], (string) app('steam')->negative($amount)); } // then process foreign amount, if it exists. @@ -138,10 +138,10 @@ class TransactionSummarizer ]; if ('positive' === $method) { - $array[$foreignCurrencyId]['sum'] = bcadd($array[$foreignCurrencyId]['sum'], app('steam')->positive($amount)); + $array[$foreignCurrencyId]['sum'] = bcadd($array[$foreignCurrencyId]['sum'], (string) app('steam')->positive($amount)); } if ('negative' === $method) { - $array[$foreignCurrencyId]['sum'] = bcadd($array[$foreignCurrencyId]['sum'], app('steam')->negative($amount)); + $array[$foreignCurrencyId]['sum'] = bcadd($array[$foreignCurrencyId]['sum'], (string) app('steam')->negative($amount)); } } @@ -202,7 +202,7 @@ class TransactionSummarizer ]; // add the data from the $field to the array. - $array[$key]['sum'] = bcadd($array[$key]['sum'], app('steam')->{$method}((string) ($journal[$field] ?? '0'))); // @phpstan-ignore-line + $array[$key]['sum'] = bcadd($array[$key]['sum'], (string) app('steam')->{$method}((string) ($journal[$field] ?? '0'))); // @phpstan-ignore-line Log::debug(sprintf('Field for transaction #%d is "%s" (%s). Sum: %s', $journal['transaction_group_id'], $currencyCode, $field, $array[$key]['sum'])); // also do foreign amount, but only when convertToNative is false (otherwise we have it already) @@ -220,7 +220,7 @@ class TransactionSummarizer 'currency_code' => $journal['foreign_currency_code'], 'currency_decimal_places' => $journal['foreign_currency_decimal_places'], ]; - $array[$key]['sum'] = bcadd($array[$key]['sum'], app('steam')->{$method}((string) $journal['foreign_amount'])); // @phpstan-ignore-line + $array[$key]['sum'] = bcadd($array[$key]['sum'], (string) app('steam')->{$method}((string) $journal['foreign_amount'])); // @phpstan-ignore-line } } diff --git a/app/Support/Repositories/UserGroup/UserGroupTrait.php b/app/Support/Repositories/UserGroup/UserGroupTrait.php index 6511748619..e6de102771 100644 --- a/app/Support/Repositories/UserGroup/UserGroupTrait.php +++ b/app/Support/Repositories/UserGroup/UserGroupTrait.php @@ -89,7 +89,7 @@ trait UserGroupTrait return; } - throw new FireflyException(sprintf('Object is of class %s, not User.', get_class($user))); + throw new FireflyException(sprintf('Object is of class %s, not User.', $user::class)); } /** diff --git a/app/Support/Request/ConvertsDataTypes.php b/app/Support/Request/ConvertsDataTypes.php index d8792fdc79..2116abe1f7 100644 --- a/app/Support/Request/ConvertsDataTypes.php +++ b/app/Support/Request/ConvertsDataTypes.php @@ -250,7 +250,7 @@ trait ConvertsDataTypes if ('' === $value) { return null; } - if (10 === strlen($value)) { + if (10 === strlen((string) $value)) { // probably a date format. try { $carbon = Carbon::createFromFormat('Y-m-d', $value); @@ -313,7 +313,7 @@ trait ConvertsDataTypes try { $carbon = new Carbon($string, config('app.timezone')); - } catch (InvalidFormatException $e) { + } catch (InvalidFormatException) { // @ignoreException } if (null === $carbon) { @@ -364,7 +364,7 @@ trait ConvertsDataTypes try { $result = '' !== (string) $this->get($field) ? new Carbon((string) $this->get($field), config('app.timezone')) : null; - } catch (InvalidFormatException $e) { + } catch (InvalidFormatException) { // @ignoreException Log::debug(sprintf('Exception when parsing date "%s".', $this->get($field))); } diff --git a/app/Support/Steam.php b/app/Support/Steam.php index 7e14c580c9..060f204ec1 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -139,7 +139,7 @@ class Steam $carbon = new Carbon($entry->date, $entry->date_tz); $carbonKey = $carbon->format('Y-m-d'); // make sure sum is a string: - $sumOfDay = (string) (null === $entry->sum_of_day ? '0' : $entry->sum_of_day); + $sumOfDay = (string) ($entry->sum_of_day ?? '0'); // find currency of this entry, does not have to exist. $currencies[$entry->transaction_currency_id] ??= TransactionCurrency::find($entry->transaction_currency_id); @@ -152,19 +152,19 @@ class Steam // add amount to current balance in currency code. $currentBalance[$entryCurrency->code] ??= '0'; - $currentBalance[$entryCurrency->code] = bcadd($sumOfDay, $currentBalance[$entryCurrency->code]); + $currentBalance[$entryCurrency->code] = bcadd($sumOfDay, (string) $currentBalance[$entryCurrency->code]); // if not convert to native, add the amount to "balance", do nothing else. if (!$convertToNative) { - $currentBalance['balance'] = bcadd($currentBalance['balance'], $sumOfDay); + $currentBalance['balance'] = bcadd((string) $currentBalance['balance'], $sumOfDay); } // if convert to native add the converted amount to "native_balance". // if there is a request to convert, convert to "native_balance" and use "balance" for whichever amount is in the native currency. if ($convertToNative) { $nativeSumOfDay = $converter->convert($entryCurrency, $nativeCurrency, $carbon, $sumOfDay); - $currentBalance['native_balance'] = bcadd($currentBalance['native_balance'], $nativeSumOfDay); + $currentBalance['native_balance'] = bcadd((string) $currentBalance['native_balance'], $nativeSumOfDay); if ($currency->id === $entryCurrency->id) { - $currentBalance['balance'] = bcadd($currentBalance['balance'], $sumOfDay); + $currentBalance['balance'] = bcadd((string) $currentBalance['balance'], $sumOfDay); } } @@ -434,7 +434,7 @@ class Steam foreach ($array as $item) { $groupKey = $item[$group] ?? 'unknown'; - $return[$groupKey] = bcadd($return[$groupKey] ?? '0', $item[$field]); + $return[$groupKey] = bcadd($return[$groupKey] ?? '0', (string) $item[$field]); } return $return; From 194d22ad90f2e5c2b69c648647dcc1ec1b43149d Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 May 2025 13:50:20 +0200 Subject: [PATCH 25/87] Final set of php8.4 changes. --- .../V1/Controllers/Chart/BudgetController.php | 8 ++--- .../Controllers/Chart/CategoryController.php | 4 +-- .../Data/Export/ExportController.php | 2 +- .../Insight/Expense/TagController.php | 4 +-- .../Insight/Income/PeriodController.php | 2 +- .../Insight/Income/TagController.php | 8 ++--- .../Insight/Transfer/PeriodController.php | 2 +- .../Insight/Transfer/TagController.php | 8 ++--- .../Controllers/Summary/BasicController.php | 24 ++++++------- .../V2/Controllers/Chart/BudgetController.php | 16 ++++----- .../Controllers/Chart/CategoryController.php | 6 ++-- .../Controllers/Summary/BasicController.php | 12 +++---- .../Correction/CorrectsLongDescriptions.php | 6 ++-- .../CorrectsRecurringTransactions.php | 2 +- .../Correction/CorrectsUnevenAmount.php | 6 ++-- .../Commands/Upgrade/UpgradesRuleActions.php | 4 +-- .../Commands/Upgrade/UpgradesToGroups.php | 2 +- app/Exceptions/GracefulNotFoundHandler.php | 2 +- app/Factory/AttachmentFactory.php | 2 +- app/Factory/RecurrenceFactory.php | 2 +- app/Factory/TagFactory.php | 2 +- app/Factory/TransactionGroupFactory.php | 2 +- .../Report/Audit/MonthReportGenerator.php | 2 +- .../Events/Model/BudgetLimitHandler.php | 4 +-- .../Extensions/AccountCollection.php | 2 +- .../Extensions/AttachmentCollection.php | 24 ++++++------- .../Collector/Extensions/MetaCollection.php | 14 ++++---- app/Helpers/Collector/GroupCollector.php | 8 ++--- app/Http/Controllers/HomeController.php | 2 +- app/Support/Search/OperatorQuerySearch.php | 34 +++++++++---------- .../Engine/SearchRuleEngine.php | 4 +-- app/Transformers/AccountTransformer.php | 2 +- .../TransactionGroupTransformer.php | 8 ++--- app/Transformers/V2/AccountTransformer.php | 8 ++--- app/Transformers/V2/PiggyBankTransformer.php | 4 +-- .../V2/TransactionGroupTransformer.php | 4 +-- app/Validation/FireflyValidator.php | 2 +- app/Validation/TransactionValidation.php | 2 +- config/broadcasting.php | 2 +- config/mail.php | 2 +- routes/breadcrumbs.php | 8 ++--- .../Api/About/AboutControllerTest.php | 1 + .../Api/Autocomplete/BillControllerTest.php | 5 +-- .../Api/Autocomplete/BudgetControllerTest.php | 1 + .../Autocomplete/CategoryControllerTest.php | 1 + .../Autocomplete/CurrencyControllerTest.php | 1 + .../ObjectGroupControllerTest.php | 1 + .../Support/Models/BillDateCalculatorTest.php | 2 +- .../Support/Calendar/CalculatorProvider.php | 10 ++---- .../Calendar/Periodicity/IntervalProvider.php | 8 ++--- .../unit/Support/NavigationAddPeriodTest.php | 2 +- .../Support/NavigationEndOfPeriodTest.php | 2 +- ...ationPreferredCarbonFormatByPeriodTest.php | 2 +- .../NavigationPreferredCarbonFormatTest.php | 2 +- .../NavigationPreferredEndOfPeriodTest.php | 2 +- .../NavigationPreferredRangeFormatTest.php | 2 +- .../NavigationPreferredSqlFormatTest.php | 2 +- .../Support/NavigationStartOfPeriodTest.php | 2 +- 58 files changed, 151 insertions(+), 157 deletions(-) diff --git a/app/Api/V1/Controllers/Chart/BudgetController.php b/app/Api/V1/Controllers/Chart/BudgetController.php index 573f90be51..61315e2b59 100644 --- a/app/Api/V1/Controllers/Chart/BudgetController.php +++ b/app/Api/V1/Controllers/Chart/BudgetController.php @@ -193,7 +193,7 @@ class BudgetController extends Controller // var_dump($return); /** @var array $journal */ foreach ($currentBudgetArray['transaction_journals'] as $journal) { - $return[$currencyId]['spent'] = bcadd($return[$currencyId]['spent'], $journal['amount']); + $return[$currencyId]['spent'] = bcadd($return[$currencyId]['spent'], (string) $journal['amount']); } } @@ -245,13 +245,13 @@ class BudgetController extends Controller } $result = $this->processExpenses($budget->id, $filtered, $limit->start_date, $end); if (1 === count($result)) { - $compare = bccomp($limit->amount, app('steam')->positive($result[$limitCurrencyId]['spent'])); + $compare = bccomp($limit->amount, (string) app('steam')->positive($result[$limitCurrencyId]['spent'])); if (1 === $compare) { // convert this amount into the native currency: - $result[$limitCurrencyId]['left'] = bcadd($limit->amount, $result[$limitCurrencyId]['spent']); + $result[$limitCurrencyId]['left'] = bcadd($limit->amount, (string) $result[$limitCurrencyId]['spent']); } if ($compare <= 0) { - $result[$limitCurrencyId]['overspent'] = app('steam')->positive(bcadd($limit->amount, $result[$limitCurrencyId]['spent'])); + $result[$limitCurrencyId]['overspent'] = app('steam')->positive(bcadd($limit->amount, (string) $result[$limitCurrencyId]['spent'])); } } diff --git a/app/Api/V1/Controllers/Chart/CategoryController.php b/app/Api/V1/Controllers/Chart/CategoryController.php index 8053d5c122..e833e0cfce 100644 --- a/app/Api/V1/Controllers/Chart/CategoryController.php +++ b/app/Api/V1/Controllers/Chart/CategoryController.php @@ -96,7 +96,7 @@ class CategoryController extends Controller $currencyId = (int) $journal['currency_id']; $currency = $currencies[$currencyId] ?? $this->currencyRepos->find($currencyId); $currencies[$currencyId] = $currency; - $categoryName = null === $journal['category_name'] ? (string) trans('firefly.no_category') : $journal['category_name']; + $categoryName = $journal['category_name'] ?? (string) trans('firefly.no_category'); $amount = app('steam')->positive($journal['amount']); $key = sprintf('%s-%s', $categoryName, $currency->code); // create arrays @@ -114,7 +114,7 @@ class CategoryController extends Controller ]; // add monies - $return[$key]['amount'] = bcadd($return[$key]['amount'], $amount); + $return[$key]['amount'] = bcadd($return[$key]['amount'], (string) $amount); } $return = array_values($return); diff --git a/app/Api/V1/Controllers/Data/Export/ExportController.php b/app/Api/V1/Controllers/Data/Export/ExportController.php index ad578e6f42..e88fda1226 100644 --- a/app/Api/V1/Controllers/Data/Export/ExportController.php +++ b/app/Api/V1/Controllers/Data/Export/ExportController.php @@ -89,7 +89,7 @@ class ExportController extends Controller ->header('Expires', '0') ->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0') ->header('Pragma', 'public') - ->header('Content-Length', (string) strlen($data[$key])) + ->header('Content-Length', (string) strlen((string) $data[$key])) ; return $response; diff --git a/app/Api/V1/Controllers/Insight/Expense/TagController.php b/app/Api/V1/Controllers/Insight/Expense/TagController.php index ce58076857..2e140656fe 100644 --- a/app/Api/V1/Controllers/Insight/Expense/TagController.php +++ b/app/Api/V1/Controllers/Insight/Expense/TagController.php @@ -160,7 +160,7 @@ class TagController extends Controller 'currency_id' => (string) $currencyId, 'currency_code' => $journal['currency_code'], ]; - $response[$key]['difference'] = bcadd($response[$key]['difference'], $journal['amount']); + $response[$key]['difference'] = bcadd((string) $response[$key]['difference'], (string) $journal['amount']); $response[$key]['difference_float'] = (float) $response[$key]['difference']; // float but on purpose. } @@ -172,7 +172,7 @@ class TagController extends Controller 'currency_id' => (string) $foreignCurrencyId, 'currency_code' => $journal['foreign_currency_code'], ]; - $response[$foreignKey]['difference'] = bcadd($response[$foreignKey]['difference'], $journal['foreign_amount']); + $response[$foreignKey]['difference'] = bcadd((string) $response[$foreignKey]['difference'], (string) $journal['foreign_amount']); $response[$foreignKey]['difference_float'] = (float) $response[$foreignKey]['difference']; // float but on purpose. } } diff --git a/app/Api/V1/Controllers/Insight/Income/PeriodController.php b/app/Api/V1/Controllers/Insight/Income/PeriodController.php index 6c720700a3..d11e93829b 100644 --- a/app/Api/V1/Controllers/Insight/Income/PeriodController.php +++ b/app/Api/V1/Controllers/Insight/Income/PeriodController.php @@ -75,7 +75,7 @@ class PeriodController extends Controller 'currency_id' => (string) $currencyId, 'currency_code' => $currencyCode, ]; - $response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], app('steam')->positive($journal[$field])); + $response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], (string) app('steam')->positive($journal[$field])); $response[$currencyId]['difference_float'] = (float) $response[$currencyId]['difference']; // float but on purpose. } diff --git a/app/Api/V1/Controllers/Insight/Income/TagController.php b/app/Api/V1/Controllers/Insight/Income/TagController.php index f7cffd7f3a..1f127f298d 100644 --- a/app/Api/V1/Controllers/Insight/Income/TagController.php +++ b/app/Api/V1/Controllers/Insight/Income/TagController.php @@ -100,7 +100,7 @@ class TagController extends Controller 'currency_id' => (string) $currencyId, 'currency_code' => $currencyCode, ]; - $response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], app('steam')->positive($journal[$field])); + $response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], (string) app('steam')->positive($journal[$field])); $response[$currencyId]['difference_float'] = (float) $response[$currencyId]['difference']; } @@ -154,7 +154,7 @@ class TagController extends Controller 'currency_id' => (string) $currencyId, 'currency_code' => $journal['currency_code'], ]; - $response[$key]['difference'] = bcadd($response[$key]['difference'], app('steam')->positive($journal['amount'])); + $response[$key]['difference'] = bcadd((string) $response[$key]['difference'], (string) app('steam')->positive($journal['amount'])); $response[$key]['difference_float'] = (float) $response[$key]['difference']; } @@ -167,8 +167,8 @@ class TagController extends Controller 'currency_code' => $journal['foreign_currency_code'], ]; $response[$foreignKey]['difference'] = bcadd( - $response[$foreignKey]['difference'], - app('steam')->positive($journal['foreign_amount']) + (string) $response[$foreignKey]['difference'], + (string) app('steam')->positive($journal['foreign_amount']) ); $response[$foreignKey]['difference_float'] = (float) $response[$foreignKey]['difference']; } diff --git a/app/Api/V1/Controllers/Insight/Transfer/PeriodController.php b/app/Api/V1/Controllers/Insight/Transfer/PeriodController.php index 31a8b0886a..d35c2b74df 100644 --- a/app/Api/V1/Controllers/Insight/Transfer/PeriodController.php +++ b/app/Api/V1/Controllers/Insight/Transfer/PeriodController.php @@ -75,7 +75,7 @@ class PeriodController extends Controller 'currency_id' => (string) $currencyId, 'currency_code' => $currencyCode, ]; - $response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], app('steam')->positive($journal[$field])); + $response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], (string) app('steam')->positive($journal[$field])); $response[$currencyId]['difference_float'] = (float) $response[$currencyId]['difference']; } diff --git a/app/Api/V1/Controllers/Insight/Transfer/TagController.php b/app/Api/V1/Controllers/Insight/Transfer/TagController.php index 6950f513e2..f0c02a2df5 100644 --- a/app/Api/V1/Controllers/Insight/Transfer/TagController.php +++ b/app/Api/V1/Controllers/Insight/Transfer/TagController.php @@ -99,7 +99,7 @@ class TagController extends Controller 'currency_id' => (string) $currencyId, 'currency_code' => $currencyCode, ]; - $response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], app('steam')->positive($journal[$field])); + $response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], (string) app('steam')->positive($journal[$field])); $response[$currencyId]['difference_float'] = (float) $response[$currencyId]['difference']; } @@ -153,7 +153,7 @@ class TagController extends Controller 'currency_id' => (string) $currencyId, 'currency_code' => $journal['currency_code'], ]; - $response[$key]['difference'] = bcadd($response[$key]['difference'], app('steam')->positive($journal['amount'])); + $response[$key]['difference'] = bcadd((string) $response[$key]['difference'], (string) app('steam')->positive($journal['amount'])); $response[$key]['difference_float'] = (float) $response[$key]['difference']; } @@ -166,8 +166,8 @@ class TagController extends Controller 'currency_code' => $journal['foreign_currency_code'], ]; $response[$foreignKey]['difference'] = bcadd( - $response[$foreignKey]['difference'], - app('steam')->positive($journal['foreign_amount']) + (string) $response[$foreignKey]['difference'], + (string) app('steam')->positive($journal['foreign_amount']) ); $response[$foreignKey]['difference_float'] = (float) $response[$foreignKey]['difference']; // intentional float } diff --git a/app/Api/V1/Controllers/Summary/BasicController.php b/app/Api/V1/Controllers/Summary/BasicController.php index 76c6029f8d..f974df4c1b 100644 --- a/app/Api/V1/Controllers/Summary/BasicController.php +++ b/app/Api/V1/Controllers/Summary/BasicController.php @@ -191,14 +191,14 @@ class BasicController extends Controller // if it is the native currency already. if ($entry['currency_id'] === $default->id) { - $sums[$default->id]['sum'] = bcadd($entry['sum'], $sums[$default->id]['sum']); + $sums[$default->id]['sum'] = bcadd((string) $entry['sum'], $sums[$default->id]['sum']); // don't forget to add it to newExpenses and newIncome if (0 === $index) { - $newExpenses[$default->id]['sum'] = bcadd($newExpenses[$default->id]['sum'], $entry['sum']); + $newExpenses[$default->id]['sum'] = bcadd($newExpenses[$default->id]['sum'], (string) $entry['sum']); } if (1 === $index) { - $newIncomes[$default->id]['sum'] = bcadd($newIncomes[$default->id]['sum'], $entry['sum']); + $newIncomes[$default->id]['sum'] = bcadd($newIncomes[$default->id]['sum'], (string) $entry['sum']); } continue; @@ -229,7 +229,7 @@ class BasicController extends Controller 'currency_decimal_places' => $entry['currency_decimal_places'], 'sum' => '0', ]; - $sums[$currencyId]['sum'] = bcadd($sums[$currencyId]['sum'], $entry['sum']); + $sums[$currencyId]['sum'] = bcadd($sums[$currencyId]['sum'], (string) $entry['sum']); } } } @@ -362,7 +362,7 @@ class BasicController extends Controller if (0 === $index) { // paid amount if ($currencyId === $this->nativeCurrency->id) { - $newPaidAmount[0]['sum'] = bcadd($newPaidAmount[0]['sum'], $item['sum']); + $newPaidAmount[0]['sum'] = bcadd($newPaidAmount[0]['sum'], (string) $item['sum']); continue; } @@ -374,7 +374,7 @@ class BasicController extends Controller } // unpaid amount if ($currencyId === $this->nativeCurrency->id) { - $newUnpaidAmount[0]['sum'] = bcadd($newUnpaidAmount[0]['sum'], $item['sum']); + $newUnpaidAmount[0]['sum'] = bcadd($newUnpaidAmount[0]['sum'], (string) $item['sum']); continue; } @@ -397,7 +397,7 @@ class BasicController extends Controller * @var array $info */ foreach ($paidAmount as $info) { - $amount = bcmul($info['sum'], '-1'); + $amount = bcmul((string) $info['sum'], '-1'); $return[] = [ 'key' => sprintf('bills-paid-in-%s', $info['code']), 'title' => trans('firefly.box_bill_paid_in_currency', ['currency' => $info['symbol']]), @@ -416,7 +416,7 @@ class BasicController extends Controller * @var array $info */ foreach ($unpaidAmount as $info) { - $amount = bcmul($info['sum'], '-1'); + $amount = bcmul((string) $info['sum'], '-1'); $return[] = [ 'key' => sprintf('bills-unpaid-in-%s', $info['code']), 'title' => trans('firefly.box_bill_unpaid_in_currency', ['currency' => $info['symbol']]), @@ -513,7 +513,7 @@ class BasicController extends Controller continue; } $spentInCurrency = $row['sum']; - $leftToSpend = bcadd($amount, $spentInCurrency); + $leftToSpend = bcadd($amount, (string) $spentInCurrency); $perDay = '0'; if (0 !== $days && bccomp($leftToSpend, '0') > -1) { $perDay = bcdiv($leftToSpend, (string) $days); @@ -549,8 +549,8 @@ class BasicController extends Controller $currencyId = (int) $row['currency_id']; $spentInCurrency = $row['sum']; $perDay = '0'; - if (0 !== $days && -1 === bccomp($spentInCurrency, '0')) { - $perDay = bcdiv($spentInCurrency, (string) $days); + if (0 !== $days && -1 === bccomp((string) $spentInCurrency, '0')) { + $perDay = bcdiv((string) $spentInCurrency, (string) $days); } Log::debug(sprintf('Spent %s %s', $row['currency_code'], $row['sum'])); @@ -631,7 +631,7 @@ class BasicController extends Controller continue; } $amount = $data['balance']; - if (0 === bccomp($amount, '0')) { + if (0 === bccomp((string) $amount, '0')) { continue; } // return stuff diff --git a/app/Api/V2/Controllers/Chart/BudgetController.php b/app/Api/V2/Controllers/Chart/BudgetController.php index 424ef0a02e..9ef001cc77 100644 --- a/app/Api/V2/Controllers/Chart/BudgetController.php +++ b/app/Api/V2/Controllers/Chart/BudgetController.php @@ -212,13 +212,13 @@ class BudgetController extends Controller foreach ($currentBudgetArray['transaction_journals'] as $journal) { // convert the amount to the native currency. $rate = $converter->getCurrencyRate($this->currencies[$currencyId], $this->currency, $journal['date']); - $convertedAmount = bcmul($journal['amount'], $rate); + $convertedAmount = bcmul((string) $journal['amount'], $rate); if ($journal['foreign_currency_id'] === $this->currency->id) { $convertedAmount = $journal['foreign_amount']; } - $return[$currencyId]['spent'] = bcadd($return[$currencyId]['spent'], $journal['amount']); - $return[$currencyId]['native_spent'] = bcadd($return[$currencyId]['native_spent'], $convertedAmount); + $return[$currencyId]['spent'] = bcadd($return[$currencyId]['spent'], (string) $journal['amount']); + $return[$currencyId]['native_spent'] = bcadd($return[$currencyId]['native_spent'], (string) $convertedAmount); } } $converter->summarize(); @@ -275,15 +275,15 @@ class BudgetController extends Controller } $result = $this->processExpenses($budget->id, $filtered, $limit->start_date, $end); if (1 === count($result)) { - $compare = bccomp($limit->amount, app('steam')->positive($result[$limitCurrencyId]['spent'])); + $compare = bccomp($limit->amount, (string) app('steam')->positive($result[$limitCurrencyId]['spent'])); if (1 === $compare) { // convert this amount into the native currency: - $result[$limitCurrencyId]['left'] = bcadd($limit->amount, $result[$limitCurrencyId]['spent']); - $result[$limitCurrencyId]['native_left'] = bcadd($convertedLimitAmount, $result[$limitCurrencyId]['native_spent']); + $result[$limitCurrencyId]['left'] = bcadd($limit->amount, (string) $result[$limitCurrencyId]['spent']); + $result[$limitCurrencyId]['native_left'] = bcadd($convertedLimitAmount, (string) $result[$limitCurrencyId]['native_spent']); } if ($compare <= 0) { - $result[$limitCurrencyId]['overspent'] = app('steam')->positive(bcadd($limit->amount, $result[$limitCurrencyId]['spent'])); - $result[$limitCurrencyId]['native_overspent'] = app('steam')->positive(bcadd($convertedLimitAmount, $result[$limitCurrencyId]['native_spent'])); + $result[$limitCurrencyId]['overspent'] = app('steam')->positive(bcadd($limit->amount, (string) $result[$limitCurrencyId]['spent'])); + $result[$limitCurrencyId]['native_overspent'] = app('steam')->positive(bcadd($convertedLimitAmount, (string) $result[$limitCurrencyId]['native_spent'])); } } $converter->summarize(); diff --git a/app/Api/V2/Controllers/Chart/CategoryController.php b/app/Api/V2/Controllers/Chart/CategoryController.php index 7d66f5080b..ed0dcebd59 100644 --- a/app/Api/V2/Controllers/Chart/CategoryController.php +++ b/app/Api/V2/Controllers/Chart/CategoryController.php @@ -100,7 +100,7 @@ class CategoryController extends Controller $currencyId = (int) $journal['currency_id']; $currency = $currencies[$currencyId] ?? $this->currencyRepos->find($currencyId); $currencies[$currencyId] = $currency; - $categoryName = null === $journal['category_name'] ? (string) trans('firefly.no_category') : $journal['category_name']; + $categoryName = $journal['category_name'] ?? (string) trans('firefly.no_category'); $amount = app('steam')->positive($journal['amount']); $nativeAmount = $converter->convert($default, $currency, $journal['date'], $amount); $key = sprintf('%s-%s', $categoryName, $currency->code); @@ -128,8 +128,8 @@ class CategoryController extends Controller ]; // add monies - $return[$key]['amount'] = bcadd($return[$key]['amount'], $amount); - $return[$key]['native_amount'] = bcadd($return[$key]['native_amount'], $nativeAmount); + $return[$key]['amount'] = bcadd($return[$key]['amount'], (string) $amount); + $return[$key]['native_amount'] = bcadd($return[$key]['native_amount'], (string) $nativeAmount); } $return = array_values($return); diff --git a/app/Api/V2/Controllers/Summary/BasicController.php b/app/Api/V2/Controllers/Summary/BasicController.php index 80e83f48d7..079f7f7305 100644 --- a/app/Api/V2/Controllers/Summary/BasicController.php +++ b/app/Api/V2/Controllers/Summary/BasicController.php @@ -174,8 +174,8 @@ class BasicController extends Controller * @var array $info */ foreach ($paidAmount as $info) { - $amount = bcmul($info['sum'], '-1'); - $nativeAmount = bcmul($info['native_sum'], '-1'); + $amount = bcmul((string) $info['sum'], '-1'); + $nativeAmount = bcmul((string) $info['native_sum'], '-1'); $return[] = [ 'key' => sprintf('bills-paid-in-%s', $info['currency_code']), 'value' => $amount, @@ -198,8 +198,8 @@ class BasicController extends Controller * @var array $info */ foreach ($unpaidAmount as $info) { - $amount = bcmul($info['sum'], '-1'); - $nativeAmount = bcmul($info['native_sum'], '-1'); + $amount = bcmul((string) $info['sum'], '-1'); + $nativeAmount = bcmul((string) $info['native_sum'], '-1'); $return[] = [ 'key' => sprintf('bills-unpaid-in-%s', $info['currency_code']), 'value' => $amount, @@ -279,8 +279,8 @@ class BasicController extends Controller if ((int) $journal['foreign_currency_id'] === $default->id) { $amountNative = $journal['foreign_amount']; } - $spent = bcadd($spent, $amount); - $spentNative = bcadd($spentNative, $amountNative); + $spent = bcadd($spent, (string) $amount); + $spentNative = bcadd($spentNative, (string) $amountNative); } app('log')->debug(sprintf('Total spent in budget "%s" is %s', $budget['name'], $spent)); } diff --git a/app/Console/Commands/Correction/CorrectsLongDescriptions.php b/app/Console/Commands/Correction/CorrectsLongDescriptions.php index 36dae29fc3..a5b98a3cf4 100644 --- a/app/Console/Commands/Correction/CorrectsLongDescriptions.php +++ b/app/Console/Commands/Correction/CorrectsLongDescriptions.php @@ -48,8 +48,8 @@ class CorrectsLongDescriptions extends Command /** @var TransactionJournal $journal */ foreach ($journals as $journal) { - if (strlen($journal->description) > self::MAX_LENGTH) { - $journal->description = substr($journal->description, 0, self::MAX_LENGTH); + if (strlen((string) $journal->description) > self::MAX_LENGTH) { + $journal->description = substr((string) $journal->description, 0, self::MAX_LENGTH); $journal->save(); $this->friendlyWarning(sprintf('Truncated description of transaction journal #%d', $journal->id)); ++$count; @@ -61,7 +61,7 @@ class CorrectsLongDescriptions extends Command /** @var TransactionGroup $group */ foreach ($groups as $group) { if (strlen((string) $group->title) > self::MAX_LENGTH) { - $group->title = substr($group->title, 0, self::MAX_LENGTH); + $group->title = substr((string) $group->title, 0, self::MAX_LENGTH); $group->save(); $this->friendlyWarning(sprintf('Truncated description of transaction group #%d', $group->id)); ++$count; diff --git a/app/Console/Commands/Correction/CorrectsRecurringTransactions.php b/app/Console/Commands/Correction/CorrectsRecurringTransactions.php index e7d302dff2..e47dad7236 100644 --- a/app/Console/Commands/Correction/CorrectsRecurringTransactions.php +++ b/app/Console/Commands/Correction/CorrectsRecurringTransactions.php @@ -100,7 +100,7 @@ class CorrectsRecurringTransactions extends Command $destination = $transaction->destinationAccount; $type = $recurrence->transactionType; $link = config(sprintf('firefly.account_to_transaction.%s.%s', $source->accountType->type, $destination->accountType->type)); - if (null !== $link && strtolower($type->type) !== strtolower($link)) { + if (null !== $link && strtolower((string) $type->type) !== strtolower($link)) { $this->friendlyWarning( sprintf('Recurring transaction #%d should be a "%s" but is a "%s" and will be corrected.', $recurrence->id, $link, $type->type) ); diff --git a/app/Console/Commands/Correction/CorrectsUnevenAmount.php b/app/Console/Commands/Correction/CorrectsUnevenAmount.php index d2b2e9e364..895eb45b4d 100644 --- a/app/Console/Commands/Correction/CorrectsUnevenAmount.php +++ b/app/Console/Commands/Correction/CorrectsUnevenAmount.php @@ -184,7 +184,7 @@ class CorrectsUnevenAmount extends Command return; } - $amount = bcmul('-1', $source->amount); + $amount = bcmul('-1', (string) $source->amount); // fix amount of destination: /** @var null|Transaction $destination */ @@ -249,9 +249,9 @@ class CorrectsUnevenAmount extends Command // Log::debug(sprintf('[c] %s', var_export($source->transaction_currency_id === $destination->foreign_currency_id,true))); // Log::debug(sprintf('[d] %s', var_export((int) $destination->transaction_currency_id ===(int) $source->foreign_currency_id, true))); - if (0 === bccomp(app('steam')->positive($source->amount), app('steam')->positive($destination->foreign_amount)) + if (0 === bccomp((string) app('steam')->positive($source->amount), (string) app('steam')->positive($destination->foreign_amount)) && $source->transaction_currency_id === $destination->foreign_currency_id - && 0 === bccomp(app('steam')->positive($destination->amount), app('steam')->positive($source->foreign_amount)) + && 0 === bccomp((string) app('steam')->positive($destination->amount), (string) app('steam')->positive($source->foreign_amount)) && (int) $destination->transaction_currency_id === (int) $source->foreign_currency_id ) { return true; diff --git a/app/Console/Commands/Upgrade/UpgradesRuleActions.php b/app/Console/Commands/Upgrade/UpgradesRuleActions.php index 18d1141fe5..c3619be8f9 100644 --- a/app/Console/Commands/Upgrade/UpgradesRuleActions.php +++ b/app/Console/Commands/Upgrade/UpgradesRuleActions.php @@ -78,8 +78,8 @@ class UpgradesRuleActions extends Command /** @var RuleAction $action */ foreach ($actions as $action) { - if (str_starts_with($action->action_value, '=')) { - $action->action_value = sprintf('%s%s', '\=', substr($action->action_value, 1)); + if (str_starts_with((string) $action->action_value, '=')) { + $action->action_value = sprintf('%s%s', '\=', substr((string) $action->action_value, 1)); $action->save(); ++$count; } diff --git a/app/Console/Commands/Upgrade/UpgradesToGroups.php b/app/Console/Commands/Upgrade/UpgradesToGroups.php index 07b92e00a4..cb6b95a637 100644 --- a/app/Console/Commands/Upgrade/UpgradesToGroups.php +++ b/app/Console/Commands/Upgrade/UpgradesToGroups.php @@ -234,7 +234,7 @@ class UpgradesToGroups extends Command $categoryId = $this->getTransactionCategory($transaction, $opposingTr) ?? $categoryId; return [ - 'type' => strtolower($journal->transactionType->type), + 'type' => strtolower((string) $journal->transactionType->type), 'date' => $journal->date, 'user' => $journal->user, 'user_group' => $journal->user->userGroup, diff --git a/app/Exceptions/GracefulNotFoundHandler.php b/app/Exceptions/GracefulNotFoundHandler.php index 46bef0b640..7faa9e03e2 100644 --- a/app/Exceptions/GracefulNotFoundHandler.php +++ b/app/Exceptions/GracefulNotFoundHandler.php @@ -218,7 +218,7 @@ class GracefulNotFoundHandler extends ExceptionHandler return redirect(route('accounts.index', ['asset'])); } - return redirect(route('transactions.index', [strtolower($type)])); + return redirect(route('transactions.index', [strtolower((string) $type)])); } /** diff --git a/app/Factory/AttachmentFactory.php b/app/Factory/AttachmentFactory.php index bd64ea57a8..421af6dca2 100644 --- a/app/Factory/AttachmentFactory.php +++ b/app/Factory/AttachmentFactory.php @@ -44,7 +44,7 @@ class AttachmentFactory public function create(array $data): ?Attachment { // append if necessary. - $model = !str_contains($data['attachable_type'], 'FireflyIII') ? sprintf('FireflyIII\Models\%s', $data['attachable_type']) + $model = !str_contains((string) $data['attachable_type'], 'FireflyIII') ? sprintf('FireflyIII\Models\%s', $data['attachable_type']) : $data['attachable_type']; // get journal instead of transaction. diff --git a/app/Factory/RecurrenceFactory.php b/app/Factory/RecurrenceFactory.php index 8df3357b9b..8254a8a4ec 100644 --- a/app/Factory/RecurrenceFactory.php +++ b/app/Factory/RecurrenceFactory.php @@ -59,7 +59,7 @@ class RecurrenceFactory public function create(array $data): Recurrence { try { - $type = $this->findTransactionType(ucfirst($data['recurrence']['type'])); + $type = $this->findTransactionType(ucfirst((string) $data['recurrence']['type'])); } catch (FireflyException $e) { $message = sprintf('Cannot make a recurring transaction of type "%s"', $data['recurrence']['type']); app('log')->error($message); diff --git a/app/Factory/TagFactory.php b/app/Factory/TagFactory.php index 302624004c..2a8b29a037 100644 --- a/app/Factory/TagFactory.php +++ b/app/Factory/TagFactory.php @@ -77,7 +77,7 @@ class TagFactory $array = [ 'user_id' => $this->user->id, 'user_group_id' => $this->userGroup->id, - 'tag' => trim($data['tag']), + 'tag' => trim((string) $data['tag']), 'tagMode' => 'nothing', 'date' => $data['date'], 'description' => $data['description'], diff --git a/app/Factory/TransactionGroupFactory.php b/app/Factory/TransactionGroupFactory.php index f28153f4e6..3d347e4b20 100644 --- a/app/Factory/TransactionGroupFactory.php +++ b/app/Factory/TransactionGroupFactory.php @@ -71,7 +71,7 @@ class TransactionGroupFactory $title = '' === $title ? null : $title; if (null !== $title) { - $title = substr($title, 0, 1000); + $title = substr((string) $title, 0, 1000); } if (0 === $collection->count()) { throw new FireflyException('Created zero transaction journals.'); diff --git a/app/Generator/Report/Audit/MonthReportGenerator.php b/app/Generator/Report/Audit/MonthReportGenerator.php index b5af328497..5d6767a6db 100644 --- a/app/Generator/Report/Audit/MonthReportGenerator.php +++ b/app/Generator/Report/Audit/MonthReportGenerator.php @@ -159,7 +159,7 @@ class MonthReportGenerator implements ReportGeneratorInterface } } - $newBalance = bcadd($startBalance, $transactionAmount); + $newBalance = bcadd((string) $startBalance, (string) $transactionAmount); $journals[$index]['balance_after'] = $newBalance; $startBalance = $newBalance; diff --git a/app/Handlers/Events/Model/BudgetLimitHandler.php b/app/Handlers/Events/Model/BudgetLimitHandler.php index 1942c5459b..b36bbad397 100644 --- a/app/Handlers/Events/Model/BudgetLimitHandler.php +++ b/app/Handlers/Events/Model/BudgetLimitHandler.php @@ -194,12 +194,12 @@ class BudgetLimitHandler // if both equal each other, amount from this BL must be added to the AB if ($limitPeriod->equals($abPeriod)) { Log::debug('This budget limit is equal to the available budget period.'); - $newAmount = bcadd($newAmount, $budgetLimit->amount); + $newAmount = bcadd($newAmount, (string) $budgetLimit->amount); } // if budget limit period is inside AB period, it can be added in full. if (!$limitPeriod->equals($abPeriod) && $abPeriod->contains($limitPeriod)) { Log::debug('This budget limit is smaller than the available budget period.'); - $newAmount = bcadd($newAmount, $budgetLimit->amount); + $newAmount = bcadd($newAmount, (string) $budgetLimit->amount); } if (!$limitPeriod->equals($abPeriod) && !$abPeriod->contains($limitPeriod) && $abPeriod->overlapsWith($limitPeriod)) { Log::debug('This budget limit is something else entirely!'); diff --git a/app/Helpers/Collector/Extensions/AccountCollection.php b/app/Helpers/Collector/Extensions/AccountCollection.php index 2a755dba2e..38d6a96622 100644 --- a/app/Helpers/Collector/Extensions/AccountCollection.php +++ b/app/Helpers/Collector/Extensions/AccountCollection.php @@ -264,7 +264,7 @@ trait AccountCollection $date->subSecond(); Log::debug(sprintf('accountBalanceIs: Call finalAccountBalance with date/time "%s"', $date->toIso8601String())); $balance = Steam::finalAccountBalance($account, $date); - $result = bccomp($balance['balance'], $value); + $result = bccomp((string) $balance['balance'], $value); Log::debug(sprintf('"%s" vs "%s" is %d', $balance['balance'], $value, $result)); switch ($operator) { diff --git a/app/Helpers/Collector/Extensions/AttachmentCollection.php b/app/Helpers/Collector/Extensions/AttachmentCollection.php index 2217b40c83..7738fd305f 100644 --- a/app/Helpers/Collector/Extensions/AttachmentCollection.php +++ b/app/Helpers/Collector/Extensions/AttachmentCollection.php @@ -51,8 +51,8 @@ trait AttachmentCollection foreach ($object['transactions'] as $transaction) { /** @var array $attachment */ foreach ($transaction['attachments'] as $attachment) { - $result = str_contains(strtolower($attachment['filename']), strtolower($name)) || str_contains( - strtolower($attachment['title']), + $result = str_contains(strtolower((string) $attachment['filename']), strtolower($name)) || str_contains( + strtolower((string) $attachment['title']), strtolower($name) ); if (true === $result) { @@ -131,8 +131,8 @@ trait AttachmentCollection foreach ($object['transactions'] as $transaction) { /** @var array $attachment */ foreach ($transaction['attachments'] as $attachment) { - $result = !str_contains(strtolower($attachment['filename']), strtolower($name)) && !str_contains( - strtolower($attachment['title']), + $result = !str_contains(strtolower((string) $attachment['filename']), strtolower($name)) && !str_contains( + strtolower((string) $attachment['title']), strtolower($name) ); if (true === $result) { @@ -166,8 +166,8 @@ trait AttachmentCollection foreach ($object['transactions'] as $transaction) { /** @var array $attachment */ foreach ($transaction['attachments'] as $attachment) { - $result = !str_ends_with(strtolower($attachment['filename']), strtolower($name)) && !str_ends_with( - strtolower($attachment['title']), + $result = !str_ends_with(strtolower((string) $attachment['filename']), strtolower($name)) && !str_ends_with( + strtolower((string) $attachment['title']), strtolower($name) ); if (true === $result) { @@ -201,8 +201,8 @@ trait AttachmentCollection foreach ($object['transactions'] as $transaction) { /** @var array $attachment */ foreach ($transaction['attachments'] as $attachment) { - $result = !str_starts_with(strtolower($attachment['filename']), strtolower($name)) && !str_starts_with( - strtolower($attachment['title']), + $result = !str_starts_with(strtolower((string) $attachment['filename']), strtolower($name)) && !str_starts_with( + strtolower((string) $attachment['title']), strtolower($name) ); if (true === $result) { @@ -227,8 +227,8 @@ trait AttachmentCollection foreach ($object['transactions'] as $transaction) { /** @var array $attachment */ foreach ($transaction['attachments'] as $attachment) { - $result = str_ends_with(strtolower($attachment['filename']), strtolower($name)) || str_ends_with( - strtolower($attachment['title']), + $result = str_ends_with(strtolower((string) $attachment['filename']), strtolower($name)) || str_ends_with( + strtolower((string) $attachment['title']), strtolower($name) ); if (true === $result) { @@ -299,8 +299,8 @@ trait AttachmentCollection foreach ($object['transactions'] as $transaction) { /** @var array $attachment */ foreach ($transaction['attachments'] as $attachment) { - $result = str_starts_with(strtolower($attachment['filename']), strtolower($name)) || str_starts_with( - strtolower($attachment['title']), + $result = str_starts_with(strtolower((string) $attachment['filename']), strtolower($name)) || str_starts_with( + strtolower((string) $attachment['title']), strtolower($name) ); if (true === $result) { diff --git a/app/Helpers/Collector/Extensions/MetaCollection.php b/app/Helpers/Collector/Extensions/MetaCollection.php index f1cad62f17..ab6c37bccb 100644 --- a/app/Helpers/Collector/Extensions/MetaCollection.php +++ b/app/Helpers/Collector/Extensions/MetaCollection.php @@ -492,7 +492,7 @@ trait MetaCollection 'notes', static function (JoinClause $join): void { $join->on('notes.noteable_id', '=', 'transaction_journals.id'); - $join->where('notes.noteable_type', '=', 'FireflyIII\Models\TransactionJournal'); + $join->where('notes.noteable_type', '=', \FireflyIII\Models\TransactionJournal::class); $join->whereNull('notes.deleted_at'); } ); @@ -601,8 +601,8 @@ trait MetaCollection return false; } foreach ($transaction['tags'] as $tag) { - Log::debug(sprintf('"%s" versus', strtolower($tag['name'])), $list); - if (in_array(strtolower($tag['name']), $list, true)) { + Log::debug(sprintf('"%s" versus', strtolower((string) $tag['name'])), $list); + if (in_array(strtolower((string) $tag['name']), $list, true)) { app('log')->debug(sprintf('Transaction has tag "%s" so count++.', $tag['name'])); ++$foundTagCount; $journalId = $transaction['transaction_journal_id']; @@ -779,8 +779,8 @@ trait MetaCollection Log::debug(sprintf('Now in setTags(%s) filter', implode(', ', $list))); foreach ($object['transactions'] as $transaction) { foreach ($transaction['tags'] as $tag) { - Log::debug(sprintf('"%s" versus', strtolower($tag['name'])), $list); - if (in_array(strtolower($tag['name']), $list, true)) { + Log::debug(sprintf('"%s" versus', strtolower((string) $tag['name'])), $list); + if (in_array(strtolower((string) $tag['name']), $list, true)) { app('log')->debug(sprintf('Transaction has tag "%s" so return true.', $tag['name'])); return true; @@ -811,8 +811,8 @@ trait MetaCollection foreach ($object['transactions'] as $transaction) { app('log')->debug(sprintf('Transaction has %d tag(s)', count($transaction['tags']))); foreach ($transaction['tags'] as $tag) { - Log::debug(sprintf('"%s" versus', strtolower($tag['name'])), $list); - if (in_array(strtolower($tag['name']), $list, true)) { + Log::debug(sprintf('"%s" versus', strtolower((string) $tag['name'])), $list); + if (in_array(strtolower((string) $tag['name']), $list, true)) { app('log')->debug(sprintf('Transaction has tag "%s", but should not have it, return false.', $tag['name'])); return false; diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index 828da5f3a3..d47ac0d155 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -593,7 +593,7 @@ class GroupCollector implements GroupCollectorInterface if (array_key_exists('meta_name', $result) && in_array($result['meta_name'], $dates, true)) { $name = $result['meta_name']; if (array_key_exists('meta_data', $result) && '' !== (string) $result['meta_data']) { - $result[$name] = Carbon::createFromFormat('!Y-m-d', substr(\Safe\json_decode($result['meta_data']), 0, 10)); + $result[$name] = Carbon::createFromFormat('!Y-m-d', substr((string) \Safe\json_decode($result['meta_data']), 0, 10)); } } @@ -743,8 +743,8 @@ class GroupCollector implements GroupCollectorInterface $groups[$groudId]['sums'][$currencyId]['amount'] = '0'; $groups[$groudId]['sums'][$currencyId]['native_amount'] = '0'; } - $groups[$groudId]['sums'][$currencyId]['amount'] = bcadd($groups[$groudId]['sums'][$currencyId]['amount'], $transaction['amount']); - $groups[$groudId]['sums'][$currencyId]['native_amount'] = bcadd($groups[$groudId]['sums'][$currencyId]['native_amount'], $nativeAmount); + $groups[$groudId]['sums'][$currencyId]['amount'] = bcadd((string) $groups[$groudId]['sums'][$currencyId]['amount'], $transaction['amount']); + $groups[$groudId]['sums'][$currencyId]['native_amount'] = bcadd((string) $groups[$groudId]['sums'][$currencyId]['native_amount'], $nativeAmount); if (null !== $transaction['foreign_amount'] && null !== $transaction['foreign_currency_id']) { $currencyId = (int) $transaction['foreign_currency_id']; @@ -758,7 +758,7 @@ class GroupCollector implements GroupCollectorInterface $groups[$groudId]['sums'][$currencyId]['amount'] = '0'; $groups[$groudId]['sums'][$currencyId]['native_amount'] = '0'; } - $groups[$groudId]['sums'][$currencyId]['amount'] = bcadd($groups[$groudId]['sums'][$currencyId]['amount'], $foreignAmount); + $groups[$groudId]['sums'][$currencyId]['amount'] = bcadd((string) $groups[$groudId]['sums'][$currencyId]['amount'], $foreignAmount); $groups[$groudId]['sums'][$currencyId]['native_amount'] = bcadd($groups[$groudId]['sums'][$currencyId]['amount'], $nativeForeignAmount); } } diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 48d41acc0f..4f300d8924 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -67,7 +67,7 @@ class HomeController extends Controller try { $stringStart = e((string) $request->get('start')); $start = Carbon::createFromFormat('Y-m-d', $stringStart); - } catch (InvalidFormatException $e) { + } catch (InvalidFormatException) { app('log')->error(sprintf('Start: could not parse date string "%s" so ignore it.', $stringStart)); $start = Carbon::now()->startOfMonth(); } diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php index 96cfbcd422..79794d85e3 100644 --- a/app/Support/Search/OperatorQuerySearch.php +++ b/app/Support/Search/OperatorQuerySearch.php @@ -57,24 +57,24 @@ use Illuminate\Support\Collection; class OperatorQuerySearch implements SearchInterface { protected Carbon $date; - private AccountRepositoryInterface $accountRepository; - private BillRepositoryInterface $billRepository; - private BudgetRepositoryInterface $budgetRepository; - private CategoryRepositoryInterface $categoryRepository; + private readonly AccountRepositoryInterface $accountRepository; + private readonly BillRepositoryInterface $billRepository; + private readonly BudgetRepositoryInterface $budgetRepository; + private readonly CategoryRepositoryInterface $categoryRepository; private GroupCollectorInterface $collector; - private CurrencyRepositoryInterface $currencyRepository; + private readonly CurrencyRepositoryInterface $currencyRepository; private array $excludeTags; private array $includeAnyTags; // added to fix #8632 private array $includeTags; private array $invalidOperators; private int $limit; - private Collection $operators; + private readonly Collection $operators; private int $page; private array $prohibitedWords; - private float $startTime; - private TagRepositoryInterface $tagRepository; - private array $validOperators; + private readonly float $startTime; + private readonly TagRepositoryInterface $tagRepository; + private readonly array $validOperators; private array $words; /** @@ -149,7 +149,7 @@ class OperatorQuerySearch implements SearchInterface /** @var QueryParserInterface $parser */ $parser = app(QueryParserInterface::class); - app('log')->debug(sprintf('Using %s as implementation for QueryParserInterface', get_class($parser))); + app('log')->debug(sprintf('Using %s as implementation for QueryParserInterface', $parser::class)); try { $parsedQuery = $parser->parse($query); @@ -177,7 +177,7 @@ class OperatorQuerySearch implements SearchInterface */ private function handleSearchNode(Node $node, bool $flipProhibitedFlag): void { - app('log')->debug(sprintf('Now in handleSearchNode(%s)', get_class($node))); + app('log')->debug(sprintf('Now in handleSearchNode(%s)', $node::class)); switch (true) { case $node instanceof StringNode: @@ -196,9 +196,9 @@ class OperatorQuerySearch implements SearchInterface break; default: - app('log')->error(sprintf('Cannot handle node %s', get_class($node))); + app('log')->error(sprintf('Cannot handle node %s', $node::class)); - throw new FireflyException(sprintf('Firefly III search can\'t handle "%s"-nodes', get_class($node))); + throw new FireflyException(sprintf('Firefly III search can\'t handle "%s"-nodes', $node::class)); } } @@ -2009,9 +2009,7 @@ class OperatorQuerySearch implements SearchInterface } app('log')->debug(sprintf('Found %d accounts, will filter.', $accounts->count())); $filtered = $accounts->filter( - static function (Account $account) use ($value, $stringMethod) { - return $stringMethod(strtolower($account->name), strtolower($value)); - } + static fn(Account $account) => $stringMethod(strtolower($account->name), strtolower($value)) ); if (0 === $filtered->count()) { @@ -2095,7 +2093,7 @@ class OperatorQuerySearch implements SearchInterface /** @var AccountMeta $meta */ foreach ($account->accountMeta as $meta) { - if ('account_number' === $meta->name && $stringMethod(strtolower($meta->data), strtolower($value))) { + if ('account_number' === $meta->name && $stringMethod(strtolower((string) $meta->data), strtolower($value))) { $accountNrMatch = true; } } @@ -2146,7 +2144,7 @@ class OperatorQuerySearch implements SearchInterface try { $parsedDate = $parser->parseDate($value); - } catch (FireflyException $e) { + } catch (FireflyException) { app('log')->debug(sprintf('Could not parse date "%s", will return empty array.', $value)); $this->invalidOperators[] = [ 'type' => $type, diff --git a/app/TransactionRules/Engine/SearchRuleEngine.php b/app/TransactionRules/Engine/SearchRuleEngine.php index fc5b1749d6..ce1398b3fc 100644 --- a/app/TransactionRules/Engine/SearchRuleEngine.php +++ b/app/TransactionRules/Engine/SearchRuleEngine.php @@ -109,8 +109,8 @@ class SearchRuleEngine implements RuleEngineInterface continue; } $contextSearch = $ruleTrigger->trigger_type; - if (str_starts_with($ruleTrigger->trigger_type, '-')) { - $contextSearch = substr($ruleTrigger->trigger_type, 1); + if (str_starts_with((string) $ruleTrigger->trigger_type, '-')) { + $contextSearch = substr((string) $ruleTrigger->trigger_type, 1); } // if the trigger needs no context, value is different: diff --git a/app/Transformers/AccountTransformer.php b/app/Transformers/AccountTransformer.php index e48f0205b4..935bc3104d 100644 --- a/app/Transformers/AccountTransformer.php +++ b/app/Transformers/AccountTransformer.php @@ -201,7 +201,7 @@ class AccountTransformer extends AbstractTransformer } $monthlyPaymentDate = $object->toAtomString(); } - if (10 !== strlen($monthlyPaymentDate)) { + if (10 !== strlen((string) $monthlyPaymentDate)) { $monthlyPaymentDate = Carbon::parse($monthlyPaymentDate, config('app.timezone'))->toAtomString(); } } diff --git a/app/Transformers/TransactionGroupTransformer.php b/app/Transformers/TransactionGroupTransformer.php index e8239ac828..af5bf4815f 100644 --- a/app/Transformers/TransactionGroupTransformer.php +++ b/app/Transformers/TransactionGroupTransformer.php @@ -118,7 +118,7 @@ class TransactionGroupTransformer extends AbstractTransformer // amount: $amount = app('steam')->positive((string) ($transaction['amount'] ?? '0')); $foreignAmount = null; - if (null !== $transaction['foreign_amount'] && '' !== $transaction['foreign_amount'] && 0 !== bccomp('0', $transaction['foreign_amount'])) { + if (null !== $transaction['foreign_amount'] && '' !== $transaction['foreign_amount'] && 0 !== bccomp('0', (string) $transaction['foreign_amount'])) { $foreignAmount = app('steam')->positive($transaction['foreign_amount']); } $type = $this->stringFromArray($transaction, 'transaction_type_type', TransactionTypeEnum::WITHDRAWAL->value); @@ -132,7 +132,7 @@ class TransactionGroupTransformer extends AbstractTransformer return [ 'user' => (string) $transaction['user_id'], 'transaction_journal_id' => (string) $transaction['transaction_journal_id'], - 'type' => strtolower($type), + 'type' => strtolower((string) $type), 'date' => $transaction['date']->toAtomString(), 'order' => $transaction['order'], @@ -296,7 +296,7 @@ class TransactionGroupTransformer extends AbstractTransformer $type = $journal->transactionType->type; $currency = $source->transactionCurrency; $amount = app('steam')->bcround($this->getAmount($source->amount), $currency->decimal_places ?? 0); - $foreignAmount = $this->getForeignAmount(null === $source->foreign_amount ? null : $source->foreign_amount); + $foreignAmount = $this->getForeignAmount($source->foreign_amount ?? null); $metaFieldData = $this->groupRepos->getMetaFields($journal->id, $this->metaFields); $metaDates = $this->getDates($this->groupRepos->getMetaDateFields($journal->id, $this->metaDateFields)); $foreignCurrency = $this->getForeignCurrency($source->foreignCurrency); @@ -321,7 +321,7 @@ class TransactionGroupTransformer extends AbstractTransformer return [ 'user' => $journal->user_id, 'transaction_journal_id' => (string) $journal->id, - 'type' => strtolower($type), + 'type' => strtolower((string) $type), 'date' => $journal->date->toAtomString(), 'order' => $journal->order, diff --git a/app/Transformers/V2/AccountTransformer.php b/app/Transformers/V2/AccountTransformer.php index 175a6121c1..c416a83ecc 100644 --- a/app/Transformers/V2/AccountTransformer.php +++ b/app/Transformers/V2/AccountTransformer.php @@ -198,8 +198,8 @@ class AccountTransformer extends AbstractTransformer $id = $account->id; if (array_key_exists($id, $bStart) && array_key_exists($id, $bEnd)) { $this->balanceDifferences[$id] = [ - 'balance' => bcsub($bEnd[$id]['balance'], $bStart[$id]['balance']), - 'native_balance' => bcsub($bEnd[$id]['native_balance'], $bStart[$id]['native_balance']), + 'balance' => bcsub((string) $bEnd[$id]['balance'], (string) $bStart[$id]['balance']), + 'native_balance' => bcsub((string) $bEnd[$id]['native_balance'], (string) $bStart[$id]['native_balance']), ]; } } @@ -351,7 +351,7 @@ class AccountTransformer extends AbstractTransformer $nativeBalance = $this->convertedBalances[$id]['native_balance'] ?? null; // no order for some accounts: - if (!in_array(strtolower($accountType), ['liability', 'liabilities', 'asset'], true)) { + if (!in_array(strtolower((string) $accountType), ['liability', 'liabilities', 'asset'], true)) { $order = null; } @@ -381,7 +381,7 @@ class AccountTransformer extends AbstractTransformer 'name' => $account->name, 'iban' => '' === (string) $account->iban ? null : $account->iban, 'account_number' => $this->accountMeta[$id]['account_number'] ?? null, - 'type' => strtolower($accountType), + 'type' => strtolower((string) $accountType), 'account_role' => $accountRole, 'currency_id' => (string) $currency->id, 'currency_code' => $currency->code, diff --git a/app/Transformers/V2/PiggyBankTransformer.php b/app/Transformers/V2/PiggyBankTransformer.php index 7d0b5a3287..7f9befb640 100644 --- a/app/Transformers/V2/PiggyBankTransformer.php +++ b/app/Transformers/V2/PiggyBankTransformer.php @@ -196,9 +196,9 @@ class PiggyBankTransformer extends AbstractTransformer $group = $this->groups[$piggyBank->id] ?? null; if (0 !== bccomp($targetAmount, '0')) { // target amount is not 0.00 - $leftToSave = bcsub($targetAmount, $currentAmount); + $leftToSave = bcsub($targetAmount, (string) $currentAmount); $nativeLeftToSave = $this->converter->convert($this->default, $currency, today(), $leftToSave); - $percentage = (int) bcmul(bcdiv($currentAmount, $targetAmount), '100'); + $percentage = (int) bcmul(bcdiv((string) $currentAmount, $targetAmount), '100'); $savePerMonth = $this->getSuggestedMonthlyAmount($currentAmount, $targetAmount, $piggyBank->start_date, $piggyBank->target_date); $nativeSavePerMonth = $this->converter->convert($this->default, $currency, today(), $savePerMonth); } diff --git a/app/Transformers/V2/TransactionGroupTransformer.php b/app/Transformers/V2/TransactionGroupTransformer.php index 2c3625e57c..1a30321466 100644 --- a/app/Transformers/V2/TransactionGroupTransformer.php +++ b/app/Transformers/V2/TransactionGroupTransformer.php @@ -219,7 +219,7 @@ class TransactionGroupTransformer extends AbstractTransformer /** @var Transaction $transaction */ foreach ($journal->transactions as $transaction) { - if (-1 === bccomp($transaction->amount, '0')) { + if (-1 === bccomp((string) $transaction->amount, '0')) { // only collect source account info $account = $transaction->account; $this->accountTypes[$account->account_type_id] ??= $account->accountType->type; @@ -349,7 +349,7 @@ class TransactionGroupTransformer extends AbstractTransformer 'user' => (string) $transaction['user_id'], 'user_group' => (string) $transaction['user_group_id'], 'transaction_journal_id' => (string) $transaction['transaction_journal_id'], - 'type' => strtolower($type), + 'type' => strtolower((string) $type), 'date' => $transaction['date']->toAtomString(), 'order' => $transaction['order'], 'amount' => $amount, diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index 7faa885731..6f9ae81c09 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -418,7 +418,7 @@ class FireflyValidator extends Validator // check transaction type. // TODO create a helper to automatically return these. if ('transaction_type' === $triggerType) { - $count = TransactionType::where('type', ucfirst($value))->count(); + $count = TransactionType::where('type', ucfirst((string) $value))->count(); return 1 === $count; } diff --git a/app/Validation/TransactionValidation.php b/app/Validation/TransactionValidation.php index 26cf199834..5b5a01a525 100644 --- a/app/Validation/TransactionValidation.php +++ b/app/Validation/TransactionValidation.php @@ -593,7 +593,7 @@ trait TransactionValidation /** @var null|TransactionJournal $journal */ $journal = TransactionJournal::with(['transactionType'])->find($journalId); if (null !== $journal) { - return strtolower($journal->transactionType->type); + return strtolower((string) $journal->transactionType->type); } return 'invalid'; diff --git a/config/broadcasting.php b/config/broadcasting.php index a7949f03ad..b735673ab4 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -57,7 +57,7 @@ return [ 'app_id' => env('PUSHER_APP_ID'), 'options' => [ 'cluster' => env('PUSHER_APP_CLUSTER'), - 'host' => null !== env('PUSHER_HOST') ? env('PUSHER_HOST') : 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', + 'host' => env('PUSHER_HOST') ?? 'api-' . env('PUSHER_APP_CLUSTER', 'mt1') . '.pusher.com', 'port' => env('PUSHER_PORT', 443), 'scheme' => env('PUSHER_SCHEME', 'https'), 'encrypted' => true, diff --git a/config/mail.php b/config/mail.php index 08356c7a3a..7558f4f936 100644 --- a/config/mail.php +++ b/config/mail.php @@ -46,7 +46,7 @@ return [ 'timeout' => null, 'scheme' => env('MAIL_SCHEME'), 'url' => env('MAIL_URL'), - 'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)), + 'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url((string) env('APP_URL', 'http://localhost'), PHP_URL_HOST)), 'verify_peer' => env('MAIL_VERIFY_PEER', true), 'allow_self_signed' => env('MAIL_ALLOW_SELF_SIGNED', false), 'verify_peer_name' => env('MAIL_VERIFY_PEER_NAME', true), diff --git a/routes/breadcrumbs.php b/routes/breadcrumbs.php index 46682f8ba3..2ea63de4d2 100644 --- a/routes/breadcrumbs.php +++ b/routes/breadcrumbs.php @@ -1202,7 +1202,7 @@ Breadcrumbs::for( static function (Generator $breadcrumbs, TransactionGroup $group): void { /** @var TransactionJournal $first */ $first = $group->transactionJournals()->first(); - $type = strtolower($first->transactionType->type); + $type = strtolower((string) $first->transactionType->type); $title = limitStringLength($first->description); if ($group->transactionJournals()->count() > 1) { $title = limitStringLength((string)$group->title); @@ -1241,7 +1241,7 @@ Breadcrumbs::for( 'transactions.mass.edit', static function (Generator $breadcrumbs, array $journals): void { if (0 !== count($journals)) { - $objectType = strtolower(reset($journals)['transaction_type_type']); + $objectType = strtolower((string) reset($journals)['transaction_type_type']); $breadcrumbs->parent('transactions.index', $objectType); $breadcrumbs->push(trans('firefly.mass_edit_journals'), route('transactions.mass.edit', [''])); @@ -1254,7 +1254,7 @@ Breadcrumbs::for( Breadcrumbs::for( 'transactions.mass.delete', static function (Generator $breadcrumbs, array $journals): void { - $objectType = strtolower(reset($journals)['transaction_type_type']); + $objectType = strtolower((string) reset($journals)['transaction_type_type']); $breadcrumbs->parent('transactions.index', $objectType); $breadcrumbs->push(trans('firefly.mass_edit_journals'), route('transactions.mass.delete', [''])); } @@ -1267,7 +1267,7 @@ Breadcrumbs::for( if (0 !== count($journals)) { $ids = Arr::pluck($journals, 'transaction_journal_id'); $first = reset($journals); - $breadcrumbs->parent('transactions.index', strtolower($first['transaction_type_type'])); + $breadcrumbs->parent('transactions.index', strtolower((string) $first['transaction_type_type'])); $breadcrumbs->push(trans('firefly.mass_bulk_journals'), route('transactions.bulk.edit', $ids)); return; diff --git a/tests/integration/Api/About/AboutControllerTest.php b/tests/integration/Api/About/AboutControllerTest.php index 55bd769e52..77f0402c87 100644 --- a/tests/integration/Api/About/AboutControllerTest.php +++ b/tests/integration/Api/About/AboutControllerTest.php @@ -40,6 +40,7 @@ final class AboutControllerTest extends TestCase use RefreshDatabase; private $user; + #[\Override] protected function setUp(): void { parent::setUp(); diff --git a/tests/integration/Api/Autocomplete/BillControllerTest.php b/tests/integration/Api/Autocomplete/BillControllerTest.php index 134f3517e4..41ca56d6ef 100644 --- a/tests/integration/Api/Autocomplete/BillControllerTest.php +++ b/tests/integration/Api/Autocomplete/BillControllerTest.php @@ -44,6 +44,7 @@ final class BillControllerTest extends TestCase */ use RefreshDatabase; + #[\Override] protected function createAuthenticatedUser(): User { $userGroup = UserGroup::create(['title' => 'Test Group']); @@ -65,8 +66,8 @@ final class BillControllerTest extends TestCase 'user_id' => $user->id, 'name' => 'Bill '.$i, 'user_group_id' => $user->user_group_id, - 'amount_min' => rand(1, 100), // random amount - 'amount_max' => rand(101, 200), // random amount + 'amount_min' => random_int(1, 100), // random amount + 'amount_max' => random_int(101, 200), // random amount 'match' => 'MIGRATED_TO_RULES', 'date' => '2024-01-01', 'repeat_freq' => 'monthly', diff --git a/tests/integration/Api/Autocomplete/BudgetControllerTest.php b/tests/integration/Api/Autocomplete/BudgetControllerTest.php index 542cc4fc70..fe247ddd5b 100644 --- a/tests/integration/Api/Autocomplete/BudgetControllerTest.php +++ b/tests/integration/Api/Autocomplete/BudgetControllerTest.php @@ -44,6 +44,7 @@ final class BudgetControllerTest extends TestCase */ use RefreshDatabase; + #[\Override] protected function createAuthenticatedUser(): User { $userGroup = UserGroup::create(['title' => 'Test Group']); diff --git a/tests/integration/Api/Autocomplete/CategoryControllerTest.php b/tests/integration/Api/Autocomplete/CategoryControllerTest.php index 7cdc632c9d..66eccc7bf7 100644 --- a/tests/integration/Api/Autocomplete/CategoryControllerTest.php +++ b/tests/integration/Api/Autocomplete/CategoryControllerTest.php @@ -44,6 +44,7 @@ final class CategoryControllerTest extends TestCase */ use RefreshDatabase; + #[\Override] protected function createAuthenticatedUser(): User { $userGroup = UserGroup::create(['title' => 'Test Group']); diff --git a/tests/integration/Api/Autocomplete/CurrencyControllerTest.php b/tests/integration/Api/Autocomplete/CurrencyControllerTest.php index 6b61462192..1122503bb9 100644 --- a/tests/integration/Api/Autocomplete/CurrencyControllerTest.php +++ b/tests/integration/Api/Autocomplete/CurrencyControllerTest.php @@ -44,6 +44,7 @@ final class CurrencyControllerTest extends TestCase */ use RefreshDatabase; + #[\Override] protected function createAuthenticatedUser(): User { $userGroup = UserGroup::create(['title' => 'Test Group']); diff --git a/tests/integration/Api/Autocomplete/ObjectGroupControllerTest.php b/tests/integration/Api/Autocomplete/ObjectGroupControllerTest.php index 189290e319..74ad04420f 100644 --- a/tests/integration/Api/Autocomplete/ObjectGroupControllerTest.php +++ b/tests/integration/Api/Autocomplete/ObjectGroupControllerTest.php @@ -44,6 +44,7 @@ final class ObjectGroupControllerTest extends TestCase */ use RefreshDatabase; + #[\Override] protected function createAuthenticatedUser(): User { $userGroup = UserGroup::create(['title' => 'Test Group']); diff --git a/tests/integration/Support/Models/BillDateCalculatorTest.php b/tests/integration/Support/Models/BillDateCalculatorTest.php index bb65b1d0ac..0120555ba5 100644 --- a/tests/integration/Support/Models/BillDateCalculatorTest.php +++ b/tests/integration/Support/Models/BillDateCalculatorTest.php @@ -37,7 +37,7 @@ use Tests\integration\TestCase; */ final class BillDateCalculatorTest extends TestCase { - private BillDateCalculator $calculator; + private readonly BillDateCalculator $calculator; public function __construct(string $name) { diff --git a/tests/unit/Support/Calendar/CalculatorProvider.php b/tests/unit/Support/Calendar/CalculatorProvider.php index 3a7337f65c..0c18c63360 100644 --- a/tests/unit/Support/Calendar/CalculatorProvider.php +++ b/tests/unit/Support/Calendar/CalculatorProvider.php @@ -30,17 +30,11 @@ use Tests\unit\Support\Calendar\Periodicity\IntervalProvider; readonly class CalculatorProvider { - public IntervalProvider $intervalProvider; public string $label; - public Periodicity $periodicity; - public int $skip; - private function __construct(IntervalProvider $intervalProvider, Periodicity $periodicity, int $skip = 0) + private function __construct(public IntervalProvider $intervalProvider, public Periodicity $periodicity, public int $skip = 0) { - $this->skip = $skip; - $this->intervalProvider = $intervalProvider; - $this->periodicity = $periodicity; - $this->label = "{$periodicity->name} {$intervalProvider->label}"; + $this->label = "{$this->periodicity->name} {$this->intervalProvider->label}"; } public static function providePeriodicityWithSkippedIntervals(): \Generator diff --git a/tests/unit/Support/Calendar/Periodicity/IntervalProvider.php b/tests/unit/Support/Calendar/Periodicity/IntervalProvider.php index efd14eb627..b095ea6680 100644 --- a/tests/unit/Support/Calendar/Periodicity/IntervalProvider.php +++ b/tests/unit/Support/Calendar/Periodicity/IntervalProvider.php @@ -28,14 +28,10 @@ use Carbon\Carbon; readonly class IntervalProvider { - public Carbon $epoch; - public Carbon $expected; public string $label; - public function __construct(Carbon $epoch, Carbon $expected) + public function __construct(public Carbon $epoch, public Carbon $expected) { - $this->epoch = $epoch; - $this->expected = $expected; - $this->label = "given {$epoch->toDateString()} expects {$expected->toDateString()}"; + $this->label = "given {$this->epoch->toDateString()} expects {$this->expected->toDateString()}"; } } diff --git a/tests/unit/Support/NavigationAddPeriodTest.php b/tests/unit/Support/NavigationAddPeriodTest.php index 018258d2bf..4b1f301e64 100644 --- a/tests/unit/Support/NavigationAddPeriodTest.php +++ b/tests/unit/Support/NavigationAddPeriodTest.php @@ -40,7 +40,7 @@ use Tests\integration\TestCase; */ final class NavigationAddPeriodTest extends TestCase { - private Navigation $navigation; + private readonly Navigation $navigation; public function __construct(string $name) { diff --git a/tests/unit/Support/NavigationEndOfPeriodTest.php b/tests/unit/Support/NavigationEndOfPeriodTest.php index 278b2e7897..e58b78061d 100644 --- a/tests/unit/Support/NavigationEndOfPeriodTest.php +++ b/tests/unit/Support/NavigationEndOfPeriodTest.php @@ -39,7 +39,7 @@ use Tests\integration\TestCase; */ final class NavigationEndOfPeriodTest extends TestCase { - private Navigation $navigation; + private readonly Navigation $navigation; public function __construct(string $name) { diff --git a/tests/unit/Support/NavigationPreferredCarbonFormatByPeriodTest.php b/tests/unit/Support/NavigationPreferredCarbonFormatByPeriodTest.php index 1a6007870d..34f20b66e1 100644 --- a/tests/unit/Support/NavigationPreferredCarbonFormatByPeriodTest.php +++ b/tests/unit/Support/NavigationPreferredCarbonFormatByPeriodTest.php @@ -38,7 +38,7 @@ use Tests\integration\TestCase; */ final class NavigationPreferredCarbonFormatByPeriodTest extends TestCase { - private Navigation $navigation; + private readonly Navigation $navigation; public function __construct(string $name) { diff --git a/tests/unit/Support/NavigationPreferredCarbonFormatTest.php b/tests/unit/Support/NavigationPreferredCarbonFormatTest.php index 2cb4e0d074..4c8dcef46f 100644 --- a/tests/unit/Support/NavigationPreferredCarbonFormatTest.php +++ b/tests/unit/Support/NavigationPreferredCarbonFormatTest.php @@ -39,7 +39,7 @@ use Tests\integration\TestCase; */ final class NavigationPreferredCarbonFormatTest extends TestCase { - private Navigation $navigation; + private readonly Navigation $navigation; public function __construct(string $name) { diff --git a/tests/unit/Support/NavigationPreferredEndOfPeriodTest.php b/tests/unit/Support/NavigationPreferredEndOfPeriodTest.php index f951a9a6a2..ba3d68d90a 100644 --- a/tests/unit/Support/NavigationPreferredEndOfPeriodTest.php +++ b/tests/unit/Support/NavigationPreferredEndOfPeriodTest.php @@ -39,7 +39,7 @@ use Tests\integration\TestCase; */ final class NavigationPreferredEndOfPeriodTest extends TestCase { - private Navigation $navigation; + private readonly Navigation $navigation; public function __construct(string $name) { diff --git a/tests/unit/Support/NavigationPreferredRangeFormatTest.php b/tests/unit/Support/NavigationPreferredRangeFormatTest.php index 21c2dea91d..48941ef4de 100644 --- a/tests/unit/Support/NavigationPreferredRangeFormatTest.php +++ b/tests/unit/Support/NavigationPreferredRangeFormatTest.php @@ -39,7 +39,7 @@ use Tests\integration\TestCase; */ final class NavigationPreferredRangeFormatTest extends TestCase { - private Navigation $navigation; + private readonly Navigation $navigation; public function __construct(string $name) { diff --git a/tests/unit/Support/NavigationPreferredSqlFormatTest.php b/tests/unit/Support/NavigationPreferredSqlFormatTest.php index 9dce8d5d33..a2127f9d14 100644 --- a/tests/unit/Support/NavigationPreferredSqlFormatTest.php +++ b/tests/unit/Support/NavigationPreferredSqlFormatTest.php @@ -39,7 +39,7 @@ use Tests\integration\TestCase; */ final class NavigationPreferredSqlFormatTest extends TestCase { - private Navigation $navigation; + private readonly Navigation $navigation; public function __construct(string $name) { diff --git a/tests/unit/Support/NavigationStartOfPeriodTest.php b/tests/unit/Support/NavigationStartOfPeriodTest.php index fe9f5117b0..a1c060003c 100644 --- a/tests/unit/Support/NavigationStartOfPeriodTest.php +++ b/tests/unit/Support/NavigationStartOfPeriodTest.php @@ -40,7 +40,7 @@ use Tests\integration\TestCase; */ final class NavigationStartOfPeriodTest extends TestCase { - private Navigation $navigation; + private readonly Navigation $navigation; public function __construct(string $name) { From 1001e04b63df3a4b0d01bbd34e1a68d581f9f5fc Mon Sep 17 00:00:00 2001 From: JC5 Date: Sun, 4 May 2025 13:55:42 +0200 Subject: [PATCH 26/87] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-05-04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .ci/php-cs-fixer/composer.lock | 65 +- .../Autocomplete/BillController.php | 2 +- .../Autocomplete/BudgetController.php | 2 +- .../Autocomplete/CategoryController.php | 2 +- .../Controllers/Chart/CategoryController.php | 2 +- .../Data/Export/ExportController.php | 1 + .../TransactionCurrency/ListController.php | 2 +- .../Models/Attachment/StoreRequest.php | 2 +- .../Models/Attachment/UpdateRequest.php | 2 +- .../Autocomplete/CategoryController.php | 2 +- .../Autocomplete/TagController.php | 2 +- .../Controllers/Chart/CategoryController.php | 2 +- .../Correction/CorrectsCurrencies.php | 2 +- .../Correction/CorrectsNativeAmounts.php | 2 +- .../Correction/CorrectsTransactionTypes.php | 4 +- .../Commands/Upgrade/UpgradesToGroups.php | 2 +- .../Upgrade/UpgradesTransferCurrencies.php | 16 +- app/Events/Admin/InvitationCreated.php | 4 +- app/Events/DestroyedTransactionLink.php | 4 +- app/Events/DetectedNewIPAddress.php | 4 +- app/Events/Model/Account/Updated.php | 4 +- app/Events/Model/BudgetLimit/Created.php | 4 +- app/Events/Model/BudgetLimit/Deleted.php | 4 +- app/Events/Model/BudgetLimit/Updated.php | 4 +- app/Events/Model/PiggyBank/ChangedAmount.php | 4 +- app/Events/RegisteredUser.php | 4 +- app/Events/RequestedVersionCheckStatus.php | 4 +- .../Security/UnknownUserAttemptedLogin.php | 4 +- app/Events/StoredAccount.php | 4 +- app/Events/StoredTransactionGroup.php | 4 +- app/Events/TriggeredAuditLog.php | 4 +- app/Events/UpdatedAccount.php | 4 +- app/Events/UpdatedTransactionGroup.php | 4 +- app/Events/UserChangedEmail.php | 4 +- app/Events/WarnUserAboutBill.php | 4 +- app/Exceptions/Handler.php | 2 +- .../Events/DestroyedGroupEventHandler.php | 1 - .../Events/UpdatedGroupEventHandler.php | 43 +- app/Handlers/Events/WebhookEventHandler.php | 2 +- .../Collector/Extensions/MetaCollection.php | 3 +- app/Http/Controllers/Bill/ShowController.php | 2 +- .../Controllers/Chart/PiggyBankController.php | 4 +- .../Controllers/Json/FrontpageController.php | 2 +- app/Http/Controllers/Json/IntroController.php | 14 +- .../Controllers/Recurring/EditController.php | 2 +- app/Http/Middleware/Authenticate.php | 4 +- app/Http/Middleware/SecureHeaders.php | 2 +- app/Jobs/CreateRecurringTransactions.php | 2 +- app/Jobs/MailError.php | 2 +- app/Jobs/SendWebhookMessage.php | 4 +- app/Mail/BillWarningMail.php | 4 +- app/Mail/ConfirmEmailChangeMail.php | 4 +- app/Mail/InvitationMail.php | 2 +- app/Mail/NewIPAddressWarningMail.php | 4 +- app/Mail/OAuthTokenCreatedMail.php | 4 +- app/Mail/RegisteredUser.php | 4 +- app/Mail/ReportNewJournalsMail.php | 4 +- app/Mail/RequestedNewPassword.php | 4 +- app/Mail/UndoEmailChangeMail.php | 4 +- .../Admin/UnknownUserLoginAttempt.php | 4 +- app/Notifications/Admin/UserInvitation.php | 4 +- app/Notifications/Admin/UserRegistration.php | 4 +- .../Admin/VersionCheckResult.php | 4 +- .../Security/DisabledMFANotification.php | 4 +- .../Security/EnabledMFANotification.php | 4 +- .../Security/MFABackupFewLeftNotification.php | 4 +- .../Security/MFABackupNoLeftNotification.php | 4 +- .../MFAManyFailedAttemptsNotification.php | 4 +- .../MFAUsedBackupCodeNotification.php | 4 +- .../Security/NewBackupCodesNotification.php | 4 +- .../Security/UserFailedLoginAttempt.php | 4 +- app/Notifications/User/BillReminder.php | 4 +- .../User/TransactionCreation.php | 4 +- app/Notifications/User/UserNewPassword.php | 4 +- app/Providers/AuthServiceProvider.php | 4 +- app/Providers/FireflyServiceProvider.php | 24 +- app/Providers/FireflySessionProvider.php | 6 +- .../Account/AccountRepository.php | 2 +- .../Budget/BudgetLimitRepository.php | 2 +- .../Currency/CurrencyRepository.php | 4 +- .../LinkType/LinkTypeRepository.php | 2 +- .../UserGroups/Account/AccountRepository.php | 2 +- .../Currency/CurrencyRepository.php | 4 +- .../Webhook/WebhookRepository.php | 4 +- app/Rules/BelongsUserGroup.php | 4 +- app/Rules/IsDefaultUserGroupName.php | 4 +- app/Rules/IsFilterValueIn.php | 4 +- app/Rules/IsValidZeroOrMoreAmount.php | 4 +- .../Internal/Update/GroupCloneService.php | 2 +- app/Support/CacheProperties.php | 2 +- .../Chart/Budget/FrontpageChartGenerator.php | 2 +- .../Models/AccountBalanceCalculator.php | 48 +- app/Support/Models/BillDateCalculator.php | 2 +- app/Support/Search/OperatorQuerySearch.php | 2 +- app/Support/Twig/General.php | 8 +- app/Support/Twig/Rule.php | 2 +- app/Support/Twig/Translation.php | 2 +- app/TransactionRules/Actions/AddTag.php | 4 +- .../Actions/AppendDescription.php | 4 +- .../Actions/AppendDescriptionToNotes.php | 4 +- app/TransactionRules/Actions/AppendNotes.php | 4 +- .../Actions/AppendNotesToDescription.php | 4 +- app/TransactionRules/Actions/ClearBudget.php | 4 +- .../Actions/ClearCategory.php | 4 +- app/TransactionRules/Actions/ClearNotes.php | 4 +- .../Actions/ConvertToDeposit.php | 4 +- .../Actions/ConvertToTransfer.php | 4 +- .../Actions/ConvertToWithdrawal.php | 4 +- .../Actions/DeleteTransaction.php | 4 +- app/TransactionRules/Actions/LinkToBill.php | 4 +- .../Actions/MoveDescriptionToNotes.php | 4 +- .../Actions/MoveNotesToDescription.php | 4 +- .../Actions/PrependDescription.php | 4 +- app/TransactionRules/Actions/PrependNotes.php | 4 +- .../Actions/RemoveAllTags.php | 4 +- app/TransactionRules/Actions/RemoveTag.php | 4 +- app/TransactionRules/Actions/SetAmount.php | 4 +- app/TransactionRules/Actions/SetBudget.php | 4 +- app/TransactionRules/Actions/SetCategory.php | 4 +- .../Actions/SetDescription.php | 4 +- .../Actions/SetDestinationAccount.php | 4 +- .../Actions/SetDestinationToCashAccount.php | 4 +- app/TransactionRules/Actions/SetNotes.php | 4 +- .../Actions/SetSourceAccount.php | 4 +- .../Actions/SetSourceToCashAccount.php | 4 +- .../Actions/SwitchAccounts.php | 4 +- .../Actions/UpdatePiggyBank.php | 4 +- .../ActionExpressionLanguageProvider.php | 4 +- app/Transformers/V2/BillTransformer.php | 2 +- config/broadcasting.php | 2 +- config/firefly.php | 2 +- config/ide-helper.php | 6 +- package-lock.json | 1487 ++++++++--------- routes/channels.php | 2 +- .../Support/Calendar/CalculatorProvider.php | 2 +- .../Calendar/Periodicity/IntervalProvider.php | 2 +- 136 files changed, 987 insertions(+), 1149 deletions(-) diff --git a/.ci/php-cs-fixer/composer.lock b/.ci/php-cs-fixer/composer.lock index 138b0f636d..e2c47b9813 100644 --- a/.ci/php-cs-fixer/composer.lock +++ b/.ci/php-cs-fixer/composer.lock @@ -1256,16 +1256,16 @@ }, { "name": "symfony/console", - "version": "v7.2.5", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "e51498ea18570c062e7df29d05a7003585b19b88" + "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/e51498ea18570c062e7df29d05a7003585b19b88", - "reference": "e51498ea18570c062e7df29d05a7003585b19b88", + "url": "https://api.github.com/repos/symfony/console/zipball/0e2e3f38c192e93e622e41ec37f4ca70cfedf218", + "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218", "shasum": "" }, "require": { @@ -1329,7 +1329,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.2.5" + "source": "https://github.com/symfony/console/tree/v7.2.6" }, "funding": [ { @@ -1345,7 +1345,7 @@ "type": "tidelift" } ], - "time": "2025-03-12T08:11:12+00:00" + "time": "2025-04-07T19:09:28+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1769,7 +1769,7 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -1828,7 +1828,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" }, "funding": [ { @@ -1848,7 +1848,7 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", @@ -1906,7 +1906,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0" }, "funding": [ { @@ -1926,7 +1926,7 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -1987,7 +1987,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" }, "funding": [ { @@ -2007,19 +2007,20 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", "shasum": "" }, "require": { + "ext-iconv": "*", "php": ">=7.2" }, "provide": { @@ -2067,7 +2068,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" }, "funding": [ { @@ -2083,20 +2084,20 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-12-23T08:48:59+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", "shasum": "" }, "require": { @@ -2147,7 +2148,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0" }, "funding": [ { @@ -2163,11 +2164,11 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2025-01-02T08:10:11+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", @@ -2223,7 +2224,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.32.0" }, "funding": [ { @@ -2449,16 +2450,16 @@ }, { "name": "symfony/string", - "version": "v7.2.0", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" + "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", - "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", + "url": "https://api.github.com/repos/symfony/string/zipball/a214fe7d62bd4df2a76447c67c6b26e1d5e74931", + "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931", "shasum": "" }, "require": { @@ -2516,7 +2517,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.2.0" + "source": "https://github.com/symfony/string/tree/v7.2.6" }, "funding": [ { @@ -2532,7 +2533,7 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:31:26+00:00" + "time": "2025-04-20T20:18:16+00:00" } ], "packages-dev": [], diff --git a/app/Api/V1/Controllers/Autocomplete/BillController.php b/app/Api/V1/Controllers/Autocomplete/BillController.php index 2c158c6ea5..d95e1ee108 100644 --- a/app/Api/V1/Controllers/Autocomplete/BillController.php +++ b/app/Api/V1/Controllers/Autocomplete/BillController.php @@ -65,7 +65,7 @@ class BillController extends Controller $data = $request->getData(); $result = $this->repository->searchBill($data['query'], $this->parameters->get('limit')); $filtered = $result->map( - static fn(Bill $item) => [ + static fn (Bill $item) => [ 'id' => (string) $item->id, 'name' => $item->name, 'active' => $item->active, diff --git a/app/Api/V1/Controllers/Autocomplete/BudgetController.php b/app/Api/V1/Controllers/Autocomplete/BudgetController.php index 5f9aea4988..dec3e5961c 100644 --- a/app/Api/V1/Controllers/Autocomplete/BudgetController.php +++ b/app/Api/V1/Controllers/Autocomplete/BudgetController.php @@ -65,7 +65,7 @@ class BudgetController extends Controller $data = $request->getData(); $result = $this->repository->searchBudget($data['query'], $this->parameters->get('limit')); $filtered = $result->map( - static fn(Budget $item) => [ + static fn (Budget $item) => [ 'id' => (string) $item->id, 'name' => $item->name, ] diff --git a/app/Api/V1/Controllers/Autocomplete/CategoryController.php b/app/Api/V1/Controllers/Autocomplete/CategoryController.php index 09dfd0797a..ea4032bc6f 100644 --- a/app/Api/V1/Controllers/Autocomplete/CategoryController.php +++ b/app/Api/V1/Controllers/Autocomplete/CategoryController.php @@ -65,7 +65,7 @@ class CategoryController extends Controller $data = $request->getData(); $result = $this->repository->searchCategory($data['query'], $this->parameters->get('limit')); $filtered = $result->map( - static fn(Category $item) => [ + static fn (Category $item) => [ 'id' => (string) $item->id, 'name' => $item->name, ] diff --git a/app/Api/V1/Controllers/Chart/CategoryController.php b/app/Api/V1/Controllers/Chart/CategoryController.php index e833e0cfce..7790880de0 100644 --- a/app/Api/V1/Controllers/Chart/CategoryController.php +++ b/app/Api/V1/Controllers/Chart/CategoryController.php @@ -119,7 +119,7 @@ class CategoryController extends Controller $return = array_values($return); // order by amount - usort($return, static fn(array $a, array $b) => (float) $a['amount'] < (float) $b['amount'] ? 1 : -1); + usort($return, static fn (array $a, array $b) => (float) $a['amount'] < (float) $b['amount'] ? 1 : -1); return response()->json($this->clean($return)); } diff --git a/app/Api/V1/Controllers/Data/Export/ExportController.php b/app/Api/V1/Controllers/Data/Export/ExportController.php index e88fda1226..ac316e9930 100644 --- a/app/Api/V1/Controllers/Data/Export/ExportController.php +++ b/app/Api/V1/Controllers/Data/Export/ExportController.php @@ -29,6 +29,7 @@ use FireflyIII\Api\V1\Requests\Data\Export\ExportRequest; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Support\Export\ExportDataGenerator; use Illuminate\Http\Response as LaravelResponse; + use function Safe\date; /** diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php index 0c9883e1e6..20362f6e6d 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php @@ -177,7 +177,7 @@ class ListController extends Controller // filter and paginate list: $collection = $unfiltered->filter( - static fn(Bill $bill) => $bill->transaction_currency_id === $currency->id + static fn (Bill $bill) => $bill->transaction_currency_id === $currency->id ); $count = $collection->count(); $bills = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize); diff --git a/app/Api/V1/Requests/Models/Attachment/StoreRequest.php b/app/Api/V1/Requests/Models/Attachment/StoreRequest.php index b50b77c141..2c8f572843 100644 --- a/app/Api/V1/Requests/Models/Attachment/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Attachment/StoreRequest.php @@ -58,7 +58,7 @@ class StoreRequest extends FormRequest { $models = config('firefly.valid_attachment_models'); $models = array_map( - static fn(string $className) => str_replace('FireflyIII\Models\\', '', $className), + static fn (string $className) => str_replace('FireflyIII\Models\\', '', $className), $models ); $models = implode(',', $models); diff --git a/app/Api/V1/Requests/Models/Attachment/UpdateRequest.php b/app/Api/V1/Requests/Models/Attachment/UpdateRequest.php index be3e13aad9..c84cd6a9d9 100644 --- a/app/Api/V1/Requests/Models/Attachment/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Attachment/UpdateRequest.php @@ -60,7 +60,7 @@ class UpdateRequest extends FormRequest { $models = config('firefly.valid_attachment_models'); $models = array_map( - static fn(string $className) => str_replace('FireflyIII\Models\\', '', $className), + static fn (string $className) => str_replace('FireflyIII\Models\\', '', $className), $models ); $models = implode(',', $models); diff --git a/app/Api/V2/Controllers/Autocomplete/CategoryController.php b/app/Api/V2/Controllers/Autocomplete/CategoryController.php index 1c0abe3db9..ea3635be5f 100644 --- a/app/Api/V2/Controllers/Autocomplete/CategoryController.php +++ b/app/Api/V2/Controllers/Autocomplete/CategoryController.php @@ -61,7 +61,7 @@ class CategoryController extends Controller $queryParameters = $request->getParameters(); $result = $this->repository->searchCategory($queryParameters['query'], $queryParameters['size']); $filtered = $result->map( - static fn(Category $item) => [ + static fn (Category $item) => [ 'id' => (string) $item->id, 'title' => $item->name, 'meta' => [], diff --git a/app/Api/V2/Controllers/Autocomplete/TagController.php b/app/Api/V2/Controllers/Autocomplete/TagController.php index dc296da528..92a620bcdd 100644 --- a/app/Api/V2/Controllers/Autocomplete/TagController.php +++ b/app/Api/V2/Controllers/Autocomplete/TagController.php @@ -61,7 +61,7 @@ class TagController extends Controller $queryParameters = $request->getParameters(); $result = $this->repository->searchTag($queryParameters['query']); $filtered = $result->map( - static fn(Tag $item) => [ + static fn (Tag $item) => [ 'id' => (string) $item->id, 'title' => $item->tag, 'value' => (string) $item->id, diff --git a/app/Api/V2/Controllers/Chart/CategoryController.php b/app/Api/V2/Controllers/Chart/CategoryController.php index ed0dcebd59..e259739805 100644 --- a/app/Api/V2/Controllers/Chart/CategoryController.php +++ b/app/Api/V2/Controllers/Chart/CategoryController.php @@ -134,7 +134,7 @@ class CategoryController extends Controller $return = array_values($return); // order by native amount - usort($return, static fn(array $a, array $b) => (float) $a['native_amount'] < (float) $b['native_amount'] ? 1 : -1); + usort($return, static fn (array $a, array $b) => (float) $a['native_amount'] < (float) $b['native_amount'] ? 1 : -1); $converter->summarize(); return response()->json($this->clean($return)); diff --git a/app/Console/Commands/Correction/CorrectsCurrencies.php b/app/Console/Commands/Correction/CorrectsCurrencies.php index 8d7623ea18..e96a15523d 100644 --- a/app/Console/Commands/Correction/CorrectsCurrencies.php +++ b/app/Console/Commands/Correction/CorrectsCurrencies.php @@ -115,7 +115,7 @@ class CorrectsCurrencies extends Command $found = array_values( array_filter( $found, - static fn(int $currencyId) => 0 !== $currencyId + static fn (int $currencyId) => 0 !== $currencyId ) ); diff --git a/app/Console/Commands/Correction/CorrectsNativeAmounts.php b/app/Console/Commands/Correction/CorrectsNativeAmounts.php index 5bfce8187e..6e6935c049 100644 --- a/app/Console/Commands/Correction/CorrectsNativeAmounts.php +++ b/app/Console/Commands/Correction/CorrectsNativeAmounts.php @@ -128,7 +128,7 @@ class CorrectsNativeAmounts extends Command $repository->setUserGroup($userGroup); $set = $repository->getPiggyBanks(); $set = $set->filter( - static fn(PiggyBank $piggyBank) => $currency->id !== $piggyBank->transaction_currency_id + static fn (PiggyBank $piggyBank) => $currency->id !== $piggyBank->transaction_currency_id ); foreach ($set as $piggyBank) { $piggyBank->encrypted = false; diff --git a/app/Console/Commands/Correction/CorrectsTransactionTypes.php b/app/Console/Commands/Correction/CorrectsTransactionTypes.php index e88c0f7db8..3663917ef5 100644 --- a/app/Console/Commands/Correction/CorrectsTransactionTypes.php +++ b/app/Console/Commands/Correction/CorrectsTransactionTypes.php @@ -115,7 +115,7 @@ class CorrectsTransactionTypes extends Command private function getSourceAccount(TransactionJournal $journal): Account { $collection = $journal->transactions->filter( - static fn(Transaction $transaction) => $transaction->amount < 0 + static fn (Transaction $transaction) => $transaction->amount < 0 ); if (0 === $collection->count()) { throw new FireflyException(sprintf('300001: Journal #%d has no source transaction.', $journal->id)); @@ -142,7 +142,7 @@ class CorrectsTransactionTypes extends Command private function getDestinationAccount(TransactionJournal $journal): Account { $collection = $journal->transactions->filter( - static fn(Transaction $transaction) => $transaction->amount > 0 + static fn (Transaction $transaction) => $transaction->amount > 0 ); if (0 === $collection->count()) { throw new FireflyException(sprintf('300004: Journal #%d has no destination transaction.', $journal->id)); diff --git a/app/Console/Commands/Upgrade/UpgradesToGroups.php b/app/Console/Commands/Upgrade/UpgradesToGroups.php index cb6b95a637..ee5b35aa71 100644 --- a/app/Console/Commands/Upgrade/UpgradesToGroups.php +++ b/app/Console/Commands/Upgrade/UpgradesToGroups.php @@ -179,7 +179,7 @@ class UpgradesToGroups extends Command private function getDestinationTransactions(TransactionJournal $journal): Collection { return $journal->transactions->filter( - static fn(Transaction $transaction) => $transaction->amount > 0 + static fn (Transaction $transaction) => $transaction->amount > 0 ); } diff --git a/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php b/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php index a06b63a69e..90f6affb97 100644 --- a/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php +++ b/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php @@ -38,20 +38,20 @@ class UpgradesTransferCurrencies extends Command { use ShowsFriendlyMessages; - public const string CONFIG_NAME = '480_transfer_currencies'; - protected $description = 'Updates transfer currency information.'; - protected $signature = 'upgrade:480-transfer-currencies {--F|force : Force the execution of this command.}'; + public const string CONFIG_NAME = '480_transfer_currencies'; + protected $description = 'Updates transfer currency information.'; + protected $signature = 'upgrade:480-transfer-currencies {--F|force : Force the execution of this command.}'; private array $accountCurrencies; private AccountRepositoryInterface $accountRepos; private JournalCLIRepositoryInterface $cliRepos; private int $count; - private ?Account $destinationAccount = null; - private ?TransactionCurrency $destinationCurrency = null; + private ?Account $destinationAccount = null; + private ?TransactionCurrency $destinationCurrency = null; private ?Transaction $destinationTransaction = null; - private ?Account $sourceAccount = null; - private ?TransactionCurrency $sourceCurrency = null; - private ?Transaction $sourceTransaction = null; + private ?Account $sourceAccount = null; + private ?TransactionCurrency $sourceCurrency = null; + private ?Transaction $sourceTransaction = null; /** * Execute the console command. diff --git a/app/Events/Admin/InvitationCreated.php b/app/Events/Admin/InvitationCreated.php index 7d6ae6af9c..dcd7cf86d3 100644 --- a/app/Events/Admin/InvitationCreated.php +++ b/app/Events/Admin/InvitationCreated.php @@ -41,7 +41,5 @@ class InvitationCreated extends Event /** * Create a new event instance. */ - public function __construct(public InvitedUser $invitee) - { - } + public function __construct(public InvitedUser $invitee) {} } diff --git a/app/Events/DestroyedTransactionLink.php b/app/Events/DestroyedTransactionLink.php index 374f870465..e0d128bc6e 100644 --- a/app/Events/DestroyedTransactionLink.php +++ b/app/Events/DestroyedTransactionLink.php @@ -37,7 +37,5 @@ class DestroyedTransactionLink extends Event /** * DestroyedTransactionLink constructor. */ - public function __construct(private TransactionJournalLink $link) - { - } + public function __construct(private TransactionJournalLink $link) {} } diff --git a/app/Events/DetectedNewIPAddress.php b/app/Events/DetectedNewIPAddress.php index 189c8a379d..3298a7e164 100644 --- a/app/Events/DetectedNewIPAddress.php +++ b/app/Events/DetectedNewIPAddress.php @@ -37,7 +37,5 @@ class DetectedNewIPAddress extends Event /** * Create a new event instance. This event is triggered when a new user registers. */ - public function __construct(public User $user) - { - } + public function __construct(public User $user) {} } diff --git a/app/Events/Model/Account/Updated.php b/app/Events/Model/Account/Updated.php index 5edbde05d0..fe765e1d08 100644 --- a/app/Events/Model/Account/Updated.php +++ b/app/Events/Model/Account/Updated.php @@ -31,7 +31,5 @@ class Updated { use SerializesModels; - public function __construct(public Account $account) - { - } + public function __construct(public Account $account) {} } diff --git a/app/Events/Model/BudgetLimit/Created.php b/app/Events/Model/BudgetLimit/Created.php index 96158fe3f3..4f8dd98430 100644 --- a/app/Events/Model/BudgetLimit/Created.php +++ b/app/Events/Model/BudgetLimit/Created.php @@ -35,7 +35,5 @@ class Created extends Event { use SerializesModels; - public function __construct(public BudgetLimit $budgetLimit) - { - } + public function __construct(public BudgetLimit $budgetLimit) {} } diff --git a/app/Events/Model/BudgetLimit/Deleted.php b/app/Events/Model/BudgetLimit/Deleted.php index dd3f4c44e1..080ca56510 100644 --- a/app/Events/Model/BudgetLimit/Deleted.php +++ b/app/Events/Model/BudgetLimit/Deleted.php @@ -35,7 +35,5 @@ class Deleted extends Event { use SerializesModels; - public function __construct(public BudgetLimit $budgetLimit) - { - } + public function __construct(public BudgetLimit $budgetLimit) {} } diff --git a/app/Events/Model/BudgetLimit/Updated.php b/app/Events/Model/BudgetLimit/Updated.php index c043387013..a1d99a081e 100644 --- a/app/Events/Model/BudgetLimit/Updated.php +++ b/app/Events/Model/BudgetLimit/Updated.php @@ -35,7 +35,5 @@ class Updated extends Event { use SerializesModels; - public function __construct(public BudgetLimit $budgetLimit) - { - } + public function __construct(public BudgetLimit $budgetLimit) {} } diff --git a/app/Events/Model/PiggyBank/ChangedAmount.php b/app/Events/Model/PiggyBank/ChangedAmount.php index 24bb9b36e9..d08f93e584 100644 --- a/app/Events/Model/PiggyBank/ChangedAmount.php +++ b/app/Events/Model/PiggyBank/ChangedAmount.php @@ -46,7 +46,7 @@ class ChangedAmount extends Event public function __construct(PiggyBank $piggyBank, string $amount, public ?TransactionJournal $transactionJournal, public ?TransactionGroup $transactionGroup) { app('log')->debug(sprintf('Created piggy bank event for piggy bank #%d with amount %s', $piggyBank->id, $amount)); - $this->piggyBank = $piggyBank; - $this->amount = $amount; + $this->piggyBank = $piggyBank; + $this->amount = $amount; } } diff --git a/app/Events/RegisteredUser.php b/app/Events/RegisteredUser.php index 4dd01adc72..160844b0ec 100644 --- a/app/Events/RegisteredUser.php +++ b/app/Events/RegisteredUser.php @@ -38,7 +38,5 @@ class RegisteredUser extends Event /** * Create a new event instance. This event is triggered when a new user registers. */ - public function __construct(public OwnerNotifiable $owner, public User $user) - { - } + public function __construct(public OwnerNotifiable $owner, public User $user) {} } diff --git a/app/Events/RequestedVersionCheckStatus.php b/app/Events/RequestedVersionCheckStatus.php index 27e6bf24eb..63ac4df6ca 100644 --- a/app/Events/RequestedVersionCheckStatus.php +++ b/app/Events/RequestedVersionCheckStatus.php @@ -38,7 +38,5 @@ class RequestedVersionCheckStatus extends Event * Create a new event instance. This event is triggered when Firefly III wants to know * what the deal is with the version checker. */ - public function __construct(public User $user) - { - } + public function __construct(public User $user) {} } diff --git a/app/Events/Security/UnknownUserAttemptedLogin.php b/app/Events/Security/UnknownUserAttemptedLogin.php index 641e26e06d..6482316711 100644 --- a/app/Events/Security/UnknownUserAttemptedLogin.php +++ b/app/Events/Security/UnknownUserAttemptedLogin.php @@ -30,7 +30,5 @@ class UnknownUserAttemptedLogin { use SerializesModels; - public function __construct(public string $address) - { - } + public function __construct(public string $address) {} } diff --git a/app/Events/StoredAccount.php b/app/Events/StoredAccount.php index 2c6e783660..6dc34379ae 100644 --- a/app/Events/StoredAccount.php +++ b/app/Events/StoredAccount.php @@ -37,7 +37,5 @@ class StoredAccount extends Event /** * Create a new event instance. */ - public function __construct(public Account $account) - { - } + public function __construct(public Account $account) {} } diff --git a/app/Events/StoredTransactionGroup.php b/app/Events/StoredTransactionGroup.php index d7559d3741..15c0d42b7b 100644 --- a/app/Events/StoredTransactionGroup.php +++ b/app/Events/StoredTransactionGroup.php @@ -37,7 +37,5 @@ class StoredTransactionGroup extends Event /** * Create a new event instance. */ - public function __construct(public TransactionGroup $transactionGroup, public bool $applyRules, public bool $fireWebhooks) - { - } + public function __construct(public TransactionGroup $transactionGroup, public bool $applyRules, public bool $fireWebhooks) {} } diff --git a/app/Events/TriggeredAuditLog.php b/app/Events/TriggeredAuditLog.php index eb758cd594..e0472815c0 100644 --- a/app/Events/TriggeredAuditLog.php +++ b/app/Events/TriggeredAuditLog.php @@ -39,7 +39,5 @@ class TriggeredAuditLog extends Event * * @SuppressWarnings("PHPMD.ExcessiveParameterList") */ - public function __construct(public Model $changer, public Model $auditable, public string $field, public mixed $before, public mixed $after) - { - } + public function __construct(public Model $changer, public Model $auditable, public string $field, public mixed $before, public mixed $after) {} } diff --git a/app/Events/UpdatedAccount.php b/app/Events/UpdatedAccount.php index c4a317c4a7..bf34c61348 100644 --- a/app/Events/UpdatedAccount.php +++ b/app/Events/UpdatedAccount.php @@ -37,7 +37,5 @@ class UpdatedAccount extends Event /** * Create a new event instance. */ - public function __construct(public Account $account) - { - } + public function __construct(public Account $account) {} } diff --git a/app/Events/UpdatedTransactionGroup.php b/app/Events/UpdatedTransactionGroup.php index c5d41e7860..39754e23b5 100644 --- a/app/Events/UpdatedTransactionGroup.php +++ b/app/Events/UpdatedTransactionGroup.php @@ -37,7 +37,5 @@ class UpdatedTransactionGroup extends Event /** * Create a new event instance. */ - public function __construct(public TransactionGroup $transactionGroup, public bool $applyRules, public bool $fireWebhooks) - { - } + public function __construct(public TransactionGroup $transactionGroup, public bool $applyRules, public bool $fireWebhooks) {} } diff --git a/app/Events/UserChangedEmail.php b/app/Events/UserChangedEmail.php index f69c5ed238..afdd422d52 100644 --- a/app/Events/UserChangedEmail.php +++ b/app/Events/UserChangedEmail.php @@ -37,7 +37,5 @@ class UserChangedEmail extends Event /** * UserChangedEmail constructor. */ - public function __construct(public User $user, public string $newEmail, public string $oldEmail) - { - } + public function __construct(public User $user, public string $newEmail, public string $oldEmail) {} } diff --git a/app/Events/WarnUserAboutBill.php b/app/Events/WarnUserAboutBill.php index 968d2f95d9..92be173dc0 100644 --- a/app/Events/WarnUserAboutBill.php +++ b/app/Events/WarnUserAboutBill.php @@ -34,7 +34,5 @@ class WarnUserAboutBill extends Event { use SerializesModels; - public function __construct(public Bill $bill, public string $field, public int $diff) - { - } + public function __construct(public Bill $bill, public string $field, public int $diff) {} } diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index b2cd742b2f..704233fdfc 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -253,7 +253,7 @@ class Handler extends ExceptionHandler { return null !== Arr::first( $this->dontReport, - static fn($type) => $e instanceof $type + static fn ($type) => $e instanceof $type ); } diff --git a/app/Handlers/Events/DestroyedGroupEventHandler.php b/app/Handlers/Events/DestroyedGroupEventHandler.php index 5b55bcd66b..90a7feb0be 100644 --- a/app/Handlers/Events/DestroyedGroupEventHandler.php +++ b/app/Handlers/Events/DestroyedGroupEventHandler.php @@ -27,7 +27,6 @@ namespace FireflyIII\Handlers\Events; use FireflyIII\Enums\WebhookTrigger; use FireflyIII\Events\DestroyedTransactionGroup; use FireflyIII\Events\RequestedSendWebhookMessages; -use FireflyIII\Events\UpdatedTransactionGroup; use FireflyIII\Generator\Webhook\MessageGeneratorInterface; use FireflyIII\Support\Models\AccountBalanceCalculator; use Illuminate\Support\Collection; diff --git a/app/Handlers/Events/UpdatedGroupEventHandler.php b/app/Handlers/Events/UpdatedGroupEventHandler.php index 88198aa520..1c86ba9106 100644 --- a/app/Handlers/Events/UpdatedGroupEventHandler.php +++ b/app/Handlers/Events/UpdatedGroupEventHandler.php @@ -64,24 +64,24 @@ class UpdatedGroupEventHandler return; } - $journals = $updatedGroupEvent->transactionGroup->transactionJournals; - $array = []; + $journals = $updatedGroupEvent->transactionGroup->transactionJournals; + $array = []; /** @var TransactionJournal $journal */ foreach ($journals as $journal) { $array[] = $journal->id; } - $journalIds = implode(',', $array); + $journalIds = implode(',', $array); Log::debug(sprintf('Add local operator for journal(s): %s', $journalIds)); // collect rules: $ruleGroupRepository = app(RuleGroupRepositoryInterface::class); $ruleGroupRepository->setUser($updatedGroupEvent->transactionGroup->user); - $groups = $ruleGroupRepository->getRuleGroupsWithRules('update-journal'); + $groups = $ruleGroupRepository->getRuleGroupsWithRules('update-journal'); // file rule engine. - $newRuleEngine = app(RuleEngineInterface::class); + $newRuleEngine = app(RuleEngineInterface::class); $newRuleEngine->setUser($updatedGroupEvent->transactionGroup->user); $newRuleEngine->addOperator(['type' => 'journal_id', 'value' => $journalIds]); $newRuleEngine->setRuleGroups($groups); @@ -90,7 +90,7 @@ class UpdatedGroupEventHandler private function recalculateCredit(UpdatedTransactionGroup $event): void { - $group = $event->transactionGroup; + $group = $event->transactionGroup; /** @var CreditRecalculateService $object */ $object = app(CreditRecalculateService::class); @@ -101,13 +101,13 @@ class UpdatedGroupEventHandler private function triggerWebhooks(UpdatedTransactionGroup $updatedGroupEvent): void { Log::debug(__METHOD__); - $group = $updatedGroupEvent->transactionGroup; + $group = $updatedGroupEvent->transactionGroup; if (false === $updatedGroupEvent->fireWebhooks) { Log::info(sprintf('Will not fire webhooks for transaction group #%d', $group->id)); return; } - $user = $group->user; + $user = $group->user; /** @var MessageGeneratorInterface $engine */ $engine = app(MessageGeneratorInterface::class); @@ -124,19 +124,20 @@ class UpdatedGroupEventHandler */ public function unifyAccounts(UpdatedTransactionGroup $updatedGroupEvent): void { - $group = $updatedGroupEvent->transactionGroup; + $group = $updatedGroupEvent->transactionGroup; if (1 === $group->transactionJournals->count()) { return; } // first journal: /** @var null|TransactionJournal $first */ - $first = $group->transactionJournals() - ->orderBy('transaction_journals.date', 'DESC') - ->orderBy('transaction_journals.order', 'ASC') - ->orderBy('transaction_journals.id', 'DESC') - ->orderBy('transaction_journals.description', 'DESC') - ->first(); + $first = $group->transactionJournals() + ->orderBy('transaction_journals.date', 'DESC') + ->orderBy('transaction_journals.order', 'ASC') + ->orderBy('transaction_journals.id', 'DESC') + ->orderBy('transaction_journals.description', 'DESC') + ->first() + ; if (null === $first) { Log::warning(sprintf('Group #%d has no transaction journals.', $group->id)); @@ -144,24 +145,26 @@ class UpdatedGroupEventHandler return; } - $all = $group->transactionJournals()->get()->pluck('id')->toArray(); + $all = $group->transactionJournals()->get()->pluck('id')->toArray(); /** @var Account $sourceAccount */ $sourceAccount = $first->transactions()->where('amount', '<', '0')->first()->account; /** @var Account $destAccount */ - $destAccount = $first->transactions()->where('amount', '>', '0')->first()->account; + $destAccount = $first->transactions()->where('amount', '>', '0')->first()->account; - $type = $first->transactionType->type; + $type = $first->transactionType->type; if (TransactionTypeEnum::TRANSFER->value === $type || TransactionTypeEnum::WITHDRAWAL->value === $type) { // set all source transactions to source account: Transaction::whereIn('transaction_journal_id', $all) - ->where('amount', '<', 0)->update(['account_id' => $sourceAccount->id]); + ->where('amount', '<', 0)->update(['account_id' => $sourceAccount->id]) + ; } if (TransactionTypeEnum::TRANSFER->value === $type || TransactionTypeEnum::DEPOSIT->value === $type) { // set all destination transactions to destination account: Transaction::whereIn('transaction_journal_id', $all) - ->where('amount', '>', 0)->update(['account_id' => $destAccount->id]); + ->where('amount', '>', 0)->update(['account_id' => $destAccount->id]) + ; } } diff --git a/app/Handlers/Events/WebhookEventHandler.php b/app/Handlers/Events/WebhookEventHandler.php index 679863e43c..3d0f12a2e3 100644 --- a/app/Handlers/Events/WebhookEventHandler.php +++ b/app/Handlers/Events/WebhookEventHandler.php @@ -42,7 +42,7 @@ class WebhookEventHandler $messages = WebhookMessage::where('webhook_messages.sent', false) ->get(['webhook_messages.*']) ->filter( - static fn(WebhookMessage $message) => $message->webhookAttempts()->count() <= 2 + static fn (WebhookMessage $message) => $message->webhookAttempts()->count() <= 2 )->splice(0, 5) ; app('log')->debug(sprintf('Found %d webhook message(s) ready to be send.', $messages->count())); diff --git a/app/Helpers/Collector/Extensions/MetaCollection.php b/app/Helpers/Collector/Extensions/MetaCollection.php index ab6c37bccb..310b9ef320 100644 --- a/app/Helpers/Collector/Extensions/MetaCollection.php +++ b/app/Helpers/Collector/Extensions/MetaCollection.php @@ -34,6 +34,7 @@ use Illuminate\Database\Eloquent\Builder as EloquentBuilder; use Illuminate\Database\Query\JoinClause; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; +use FireflyIII\Models\TransactionJournal; /** * Trait MetaCollection @@ -492,7 +493,7 @@ trait MetaCollection 'notes', static function (JoinClause $join): void { $join->on('notes.noteable_id', '=', 'transaction_journals.id'); - $join->where('notes.noteable_type', '=', \FireflyIII\Models\TransactionJournal::class); + $join->where('notes.noteable_type', '=', TransactionJournal::class); $join->whereNull('notes.deleted_at'); } ); diff --git a/app/Http/Controllers/Bill/ShowController.php b/app/Http/Controllers/Bill/ShowController.php index 81130d1f77..812ea5149e 100644 --- a/app/Http/Controllers/Bill/ShowController.php +++ b/app/Http/Controllers/Bill/ShowController.php @@ -166,7 +166,7 @@ class ShowController extends Controller /** @var AttachmentTransformer $transformer */ $transformer = app(AttachmentTransformer::class); $attachments = $collection->each( - static fn(Attachment $attachment) => $transformer->transform($attachment) + static fn (Attachment $attachment) => $transformer->transform($attachment) ); } diff --git a/app/Http/Controllers/Chart/PiggyBankController.php b/app/Http/Controllers/Chart/PiggyBankController.php index 9aa4004a8b..920c3a9301 100644 --- a/app/Http/Controllers/Chart/PiggyBankController.php +++ b/app/Http/Controllers/Chart/PiggyBankController.php @@ -90,7 +90,7 @@ class PiggyBankController extends Controller $chartData = []; while ($oldest <= $today) { $filtered = $set->filter( - static fn(PiggyBankEvent $event) => $event->date->lte($oldest) + static fn (PiggyBankEvent $event) => $event->date->lte($oldest) ); $currentSum = $filtered->sum('amount'); $label = $oldest->isoFormat((string) trans('config.month_and_day_js', [], $locale)); @@ -98,7 +98,7 @@ class PiggyBankController extends Controller $oldest = app('navigation')->addPeriod($oldest, $step, 0); } $finalFiltered = $set->filter( - static fn(PiggyBankEvent $event) => $event->date->lte($today) + static fn (PiggyBankEvent $event) => $event->date->lte($today) ); $finalSum = $finalFiltered->sum('amount'); $finalLabel = $today->isoFormat((string) trans('config.month_and_day_js', [], $locale)); diff --git a/app/Http/Controllers/Json/FrontpageController.php b/app/Http/Controllers/Json/FrontpageController.php index 9cda94934f..08ed98cd53 100644 --- a/app/Http/Controllers/Json/FrontpageController.php +++ b/app/Http/Controllers/Json/FrontpageController.php @@ -82,7 +82,7 @@ class FrontpageController extends Controller // sort by current percentage (lowest at the top) uasort( $info, - static fn(array $a, array $b) => $a['percentage'] <=> $b['percentage'] + static fn (array $a, array $b) => $a['percentage'] <=> $b['percentage'] ); $html = ''; diff --git a/app/Http/Controllers/Json/IntroController.php b/app/Http/Controllers/Json/IntroController.php index 620660c5ba..f3bd44b660 100644 --- a/app/Http/Controllers/Json/IntroController.php +++ b/app/Http/Controllers/Json/IntroController.php @@ -41,7 +41,7 @@ class IntroController extends Controller public function getIntroSteps(string $route, ?string $specificPage = null): JsonResponse { app('log')->debug(sprintf('getIntroSteps for route "%s" and page "%s"', $route, $specificPage)); - $specificPage ??= ''; + $specificPage ??= ''; $steps = $this->getBasicSteps($route); $specificSteps = $this->getSpecificSteps($route, $specificPage); if (0 === count($specificSteps)) { @@ -55,8 +55,8 @@ class IntroController extends Controller // remove last step: array_pop($steps); // merge arrays and add last step again - $steps = array_merge($steps, $specificSteps); - $steps[] = $lastStep; + $steps = array_merge($steps, $specificSteps); + $steps[] = $lastStep; } if (!$this->hasOutroStep($route)) { $steps = array_merge($steps, $specificSteps); @@ -77,7 +77,7 @@ class IntroController extends Controller return false; } - $hasStep = array_key_exists('outro', $elements); + $hasStep = array_key_exists('outro', $elements); app('log')->debug('Elements is array', $elements); app('log')->debug('Keys is', array_keys($elements)); @@ -94,8 +94,8 @@ class IntroController extends Controller public function postEnable(string $route, ?string $specialPage = null): JsonResponse { $specialPage ??= ''; - $route = str_replace('.', '_', $route); - $key = sprintf('shown_demo_%s', $route); + $route = str_replace('.', '_', $route); + $key = sprintf('shown_demo_%s', $route); if ('' !== $specialPage) { $key = sprintf('%s_%s', $key, $specialPage); } @@ -114,7 +114,7 @@ class IntroController extends Controller public function postFinished(string $route, ?string $specialPage = null): JsonResponse { $specialPage ??= ''; - $key = sprintf('shown_demo_%s', $route); + $key = sprintf('shown_demo_%s', $route); if ('' !== $specialPage) { $key = sprintf('%s_%s', $key, $specialPage); } diff --git a/app/Http/Controllers/Recurring/EditController.php b/app/Http/Controllers/Recurring/EditController.php index 00fdac8243..f6d203b0e8 100644 --- a/app/Http/Controllers/Recurring/EditController.php +++ b/app/Http/Controllers/Recurring/EditController.php @@ -104,7 +104,7 @@ class EditController extends Controller $repetition = $recurrence->recurrenceRepetitions()->first(); $currentRepType = $repetition->repetition_type; if ('' !== $repetition->repetition_moment) { - $currentRepType = sprintf('%s,%s', $currentRepType,$repetition->repetition_moment); + $currentRepType = sprintf('%s,%s', $currentRepType, $repetition->repetition_moment); } // put previous url in session if not redirect from store (not "return_to_edit"). diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 358b9b71c2..5184abdbf8 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -43,9 +43,7 @@ class Authenticate * The authentication factory instance. */ protected Auth $auth - ) - { - } + ) {} /** * Handle an incoming request. diff --git a/app/Http/Middleware/SecureHeaders.php b/app/Http/Middleware/SecureHeaders.php index d316e8a677..4ae071b11f 100644 --- a/app/Http/Middleware/SecureHeaders.php +++ b/app/Http/Middleware/SecureHeaders.php @@ -45,7 +45,7 @@ class SecureHeaders // generate and share nonce. $nonce = base64_encode(random_bytes(16)); Vite::useCspNonce($nonce); - if (class_exists(\Barryvdh\Debugbar\Facades\Debugbar::class)) { + if (class_exists(Debugbar::class)) { Debugbar::getJavascriptRenderer()->setCspNonce($nonce); } app('view')->share('JS_NONCE', $nonce); diff --git a/app/Jobs/CreateRecurringTransactions.php b/app/Jobs/CreateRecurringTransactions.php index 0eb0ef76ba..19fe3c7d97 100644 --- a/app/Jobs/CreateRecurringTransactions.php +++ b/app/Jobs/CreateRecurringTransactions.php @@ -156,7 +156,7 @@ class CreateRecurringTransactions implements ShouldQueue private function filterRecurrences(Collection $recurrences): Collection { return $recurrences->filter( - fn(Recurrence $recurrence) => $this->validRecurrence($recurrence) + fn (Recurrence $recurrence) => $this->validRecurrence($recurrence) ); } diff --git a/app/Jobs/MailError.php b/app/Jobs/MailError.php index 192a17359c..7b906b93a6 100644 --- a/app/Jobs/MailError.php +++ b/app/Jobs/MailError.php @@ -43,7 +43,7 @@ class MailError extends Job implements ShouldQueue */ public function __construct(protected array $userData, protected string $destination, protected string $ipAddress, protected array $exception) { - $debug = $this->exception; + $debug = $this->exception; unset($debug['stackTrace'], $debug['headers']); app('log')->error(sprintf('Exception is: %s', \Safe\json_encode($debug))); diff --git a/app/Jobs/SendWebhookMessage.php b/app/Jobs/SendWebhookMessage.php index 267183deaa..dbaab99fe3 100644 --- a/app/Jobs/SendWebhookMessage.php +++ b/app/Jobs/SendWebhookMessage.php @@ -45,9 +45,7 @@ class SendWebhookMessage implements ShouldQueue /** * Create a new job instance. */ - public function __construct(private WebhookMessage $message) - { - } + public function __construct(private WebhookMessage $message) {} /** * Execute the job. diff --git a/app/Mail/BillWarningMail.php b/app/Mail/BillWarningMail.php index 654cfe34b9..8b438091d5 100644 --- a/app/Mail/BillWarningMail.php +++ b/app/Mail/BillWarningMail.php @@ -40,9 +40,7 @@ class BillWarningMail extends Mailable /** * ConfirmEmailChangeMail constructor. */ - public function __construct(public Bill $bill, public string $field, public int $diff) - { - } + public function __construct(public Bill $bill, public string $field, public int $diff) {} /** * Build the message. diff --git a/app/Mail/ConfirmEmailChangeMail.php b/app/Mail/ConfirmEmailChangeMail.php index 7d872ea523..de4153e21c 100644 --- a/app/Mail/ConfirmEmailChangeMail.php +++ b/app/Mail/ConfirmEmailChangeMail.php @@ -40,9 +40,7 @@ class ConfirmEmailChangeMail extends Mailable /** * ConfirmEmailChangeMail constructor. */ - public function __construct(public string $newEmail, public string $oldEmail, public string $url) - { - } + public function __construct(public string $newEmail, public string $oldEmail, public string $url) {} /** * Build the message. diff --git a/app/Mail/InvitationMail.php b/app/Mail/InvitationMail.php index 96b3493242..416aef6432 100644 --- a/app/Mail/InvitationMail.php +++ b/app/Mail/InvitationMail.php @@ -42,7 +42,7 @@ class InvitationMail extends Mailable */ public function __construct(public string $invitee, public string $admin, public string $url) { - $this->host = (string) \Safe\parse_url($this->url, PHP_URL_HOST); + $this->host = (string) \Safe\parse_url($this->url, PHP_URL_HOST); } /** diff --git a/app/Mail/NewIPAddressWarningMail.php b/app/Mail/NewIPAddressWarningMail.php index 18497eb97e..8afba582a9 100644 --- a/app/Mail/NewIPAddressWarningMail.php +++ b/app/Mail/NewIPAddressWarningMail.php @@ -43,9 +43,7 @@ class NewIPAddressWarningMail extends Mailable /** * OAuthTokenCreatedMail constructor. */ - public function __construct(public string $ipAddress) - { - } + public function __construct(public string $ipAddress) {} /** * Build the message. diff --git a/app/Mail/OAuthTokenCreatedMail.php b/app/Mail/OAuthTokenCreatedMail.php index 9f14cfebe1..4f68259546 100644 --- a/app/Mail/OAuthTokenCreatedMail.php +++ b/app/Mail/OAuthTokenCreatedMail.php @@ -40,9 +40,7 @@ class OAuthTokenCreatedMail extends Mailable /** * OAuthTokenCreatedMail constructor. */ - public function __construct(public Client $client) - { - } + public function __construct(public Client $client) {} /** * Build the message. diff --git a/app/Mail/RegisteredUser.php b/app/Mail/RegisteredUser.php index f688c14452..991d64d26f 100644 --- a/app/Mail/RegisteredUser.php +++ b/app/Mail/RegisteredUser.php @@ -40,9 +40,7 @@ class RegisteredUser extends Mailable /** * Create a new message instance. */ - public function __construct(public string $address) - { - } + public function __construct(public string $address) {} /** * Build the message. diff --git a/app/Mail/ReportNewJournalsMail.php b/app/Mail/ReportNewJournalsMail.php index 77ae45f62d..cb166b886d 100644 --- a/app/Mail/ReportNewJournalsMail.php +++ b/app/Mail/ReportNewJournalsMail.php @@ -45,9 +45,7 @@ class ReportNewJournalsMail extends Mailable /** * ConfirmEmailChangeMail constructor. */ - public function __construct(public Collection $groups) - { - } + public function __construct(public Collection $groups) {} /** * Build the message. diff --git a/app/Mail/RequestedNewPassword.php b/app/Mail/RequestedNewPassword.php index f8d1e3dfb4..fb5202d6f2 100644 --- a/app/Mail/RequestedNewPassword.php +++ b/app/Mail/RequestedNewPassword.php @@ -39,9 +39,7 @@ class RequestedNewPassword extends Mailable /** * RequestedNewPassword constructor. */ - public function __construct(public string $url) - { - } + public function __construct(public string $url) {} /** * Build the message. diff --git a/app/Mail/UndoEmailChangeMail.php b/app/Mail/UndoEmailChangeMail.php index abb9ed85b7..98c55721e7 100644 --- a/app/Mail/UndoEmailChangeMail.php +++ b/app/Mail/UndoEmailChangeMail.php @@ -38,9 +38,7 @@ class UndoEmailChangeMail extends Mailable /** * UndoEmailChangeMail constructor. */ - public function __construct(public string $newEmail, public string $oldEmail, public string $url) - { - } + public function __construct(public string $newEmail, public string $oldEmail, public string $url) {} /** * Build the message. diff --git a/app/Notifications/Admin/UnknownUserLoginAttempt.php b/app/Notifications/Admin/UnknownUserLoginAttempt.php index a36ef56ae9..b72b0b9324 100644 --- a/app/Notifications/Admin/UnknownUserLoginAttempt.php +++ b/app/Notifications/Admin/UnknownUserLoginAttempt.php @@ -41,9 +41,7 @@ class UnknownUserLoginAttempt extends Notification { use Queueable; - public function __construct(private string $address) - { - } + public function __construct(private string $address) {} /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") diff --git a/app/Notifications/Admin/UserInvitation.php b/app/Notifications/Admin/UserInvitation.php index 6ca16535d8..613bfa1f93 100644 --- a/app/Notifications/Admin/UserInvitation.php +++ b/app/Notifications/Admin/UserInvitation.php @@ -45,9 +45,7 @@ class UserInvitation extends Notification { use Queueable; - public function __construct(private InvitedUser $invitee) - { - } + public function __construct(private InvitedUser $invitee) {} /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") diff --git a/app/Notifications/Admin/UserRegistration.php b/app/Notifications/Admin/UserRegistration.php index faefc8dd2e..4d6fcf9b29 100644 --- a/app/Notifications/Admin/UserRegistration.php +++ b/app/Notifications/Admin/UserRegistration.php @@ -45,9 +45,7 @@ class UserRegistration extends Notification { use Queueable; - public function __construct(private User $user) - { - } + public function __construct(private User $user) {} /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") diff --git a/app/Notifications/Admin/VersionCheckResult.php b/app/Notifications/Admin/VersionCheckResult.php index bff0d12a8c..deb2f5b4cb 100644 --- a/app/Notifications/Admin/VersionCheckResult.php +++ b/app/Notifications/Admin/VersionCheckResult.php @@ -42,9 +42,7 @@ class VersionCheckResult extends Notification { use Queueable; - public function __construct(private string $message) - { - } + public function __construct(private string $message) {} /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") diff --git a/app/Notifications/Security/DisabledMFANotification.php b/app/Notifications/Security/DisabledMFANotification.php index 6d4fde6fba..511b5cecab 100644 --- a/app/Notifications/Security/DisabledMFANotification.php +++ b/app/Notifications/Security/DisabledMFANotification.php @@ -40,9 +40,7 @@ class DisabledMFANotification extends Notification { use Queueable; - public function __construct(private User $user) - { - } + public function __construct(private User $user) {} /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") diff --git a/app/Notifications/Security/EnabledMFANotification.php b/app/Notifications/Security/EnabledMFANotification.php index 871f424a55..e3863aee9e 100644 --- a/app/Notifications/Security/EnabledMFANotification.php +++ b/app/Notifications/Security/EnabledMFANotification.php @@ -40,9 +40,7 @@ class EnabledMFANotification extends Notification { use Queueable; - public function __construct(private User $user) - { - } + public function __construct(private User $user) {} /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") diff --git a/app/Notifications/Security/MFABackupFewLeftNotification.php b/app/Notifications/Security/MFABackupFewLeftNotification.php index 4ae483eaca..4302d10c46 100644 --- a/app/Notifications/Security/MFABackupFewLeftNotification.php +++ b/app/Notifications/Security/MFABackupFewLeftNotification.php @@ -40,9 +40,7 @@ class MFABackupFewLeftNotification extends Notification { use Queueable; - public function __construct(private User $user, private int $count) - { - } + public function __construct(private User $user, private int $count) {} /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") diff --git a/app/Notifications/Security/MFABackupNoLeftNotification.php b/app/Notifications/Security/MFABackupNoLeftNotification.php index e521bdacd7..246119e901 100644 --- a/app/Notifications/Security/MFABackupNoLeftNotification.php +++ b/app/Notifications/Security/MFABackupNoLeftNotification.php @@ -40,9 +40,7 @@ class MFABackupNoLeftNotification extends Notification { use Queueable; - public function __construct(private User $user) - { - } + public function __construct(private User $user) {} /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") diff --git a/app/Notifications/Security/MFAManyFailedAttemptsNotification.php b/app/Notifications/Security/MFAManyFailedAttemptsNotification.php index c28c7b9eb4..400cee87e7 100644 --- a/app/Notifications/Security/MFAManyFailedAttemptsNotification.php +++ b/app/Notifications/Security/MFAManyFailedAttemptsNotification.php @@ -40,9 +40,7 @@ class MFAManyFailedAttemptsNotification extends Notification { use Queueable; - public function __construct(private User $user, private int $count) - { - } + public function __construct(private User $user, private int $count) {} public function toArray(User $notifiable): array { diff --git a/app/Notifications/Security/MFAUsedBackupCodeNotification.php b/app/Notifications/Security/MFAUsedBackupCodeNotification.php index 264d6c153c..01a3aac01c 100644 --- a/app/Notifications/Security/MFAUsedBackupCodeNotification.php +++ b/app/Notifications/Security/MFAUsedBackupCodeNotification.php @@ -40,9 +40,7 @@ class MFAUsedBackupCodeNotification extends Notification { use Queueable; - public function __construct(private User $user) - { - } + public function __construct(private User $user) {} /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") diff --git a/app/Notifications/Security/NewBackupCodesNotification.php b/app/Notifications/Security/NewBackupCodesNotification.php index d7f25e805c..ede672e96b 100644 --- a/app/Notifications/Security/NewBackupCodesNotification.php +++ b/app/Notifications/Security/NewBackupCodesNotification.php @@ -40,9 +40,7 @@ class NewBackupCodesNotification extends Notification { use Queueable; - public function __construct(private User $user) - { - } + public function __construct(private User $user) {} /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") diff --git a/app/Notifications/Security/UserFailedLoginAttempt.php b/app/Notifications/Security/UserFailedLoginAttempt.php index e1c97f7559..c4ac85a2c6 100644 --- a/app/Notifications/Security/UserFailedLoginAttempt.php +++ b/app/Notifications/Security/UserFailedLoginAttempt.php @@ -41,9 +41,7 @@ class UserFailedLoginAttempt extends Notification { use Queueable; - public function __construct(private User $user) - { - } + public function __construct(private User $user) {} public function toArray(User $notifiable): array { diff --git a/app/Notifications/User/BillReminder.php b/app/Notifications/User/BillReminder.php index a8a353d219..f30a158ead 100644 --- a/app/Notifications/User/BillReminder.php +++ b/app/Notifications/User/BillReminder.php @@ -42,9 +42,7 @@ class BillReminder extends Notification { use Queueable; - public function __construct(private Bill $bill, private string $field, private int $diff) - { - } + public function __construct(private Bill $bill, private string $field, private int $diff) {} /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") diff --git a/app/Notifications/User/TransactionCreation.php b/app/Notifications/User/TransactionCreation.php index 96a09725ff..9a09d82a6c 100644 --- a/app/Notifications/User/TransactionCreation.php +++ b/app/Notifications/User/TransactionCreation.php @@ -36,9 +36,7 @@ class TransactionCreation extends Notification { use Queueable; - public function __construct(private array $collection) - { - } + public function __construct(private array $collection) {} /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") diff --git a/app/Notifications/User/UserNewPassword.php b/app/Notifications/User/UserNewPassword.php index cb9bcf93d7..16ffb0b31a 100644 --- a/app/Notifications/User/UserNewPassword.php +++ b/app/Notifications/User/UserNewPassword.php @@ -43,9 +43,7 @@ class UserNewPassword extends Notification { use Queueable; - public function __construct(private string $url) - { - } + public function __construct(private string $url) {} /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 4c119ca3ef..9f39f3d8a8 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -48,12 +48,12 @@ class AuthServiceProvider extends ServiceProvider { Auth::provider( 'remote_user_provider', - static fn($app, array $config) => new RemoteUserProvider() + static fn ($app, array $config) => new RemoteUserProvider() ); Auth::extend( 'remote_user_guard', - static fn($app, string $name, array $config) => new RemoteUserGuard(Auth::createUserProvider($config['provider']), $app) + static fn ($app, string $name, array $config) => new RemoteUserGuard(Auth::createUserProvider($config['provider']), $app) ); Passport::tokensExpireIn(now()->addDays(14)); diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php index 6e88e96041..2b9360f85a 100644 --- a/app/Providers/FireflyServiceProvider.php +++ b/app/Providers/FireflyServiceProvider.php @@ -90,7 +90,7 @@ class FireflyServiceProvider extends ServiceProvider public function boot(): void { Validator::resolver( - static fn($translator, $data, $rules, $messages) => new FireflyValidator($translator, $data, $rules, $messages) + static fn ($translator, $data, $rules, $messages) => new FireflyValidator($translator, $data, $rules, $messages) ); } @@ -104,52 +104,52 @@ class FireflyServiceProvider extends ServiceProvider { $this->app->bind( 'preferences', - static fn() => new Preferences() + static fn () => new Preferences() ); $this->app->bind( 'fireflyconfig', - static fn() => new FireflyConfig() + static fn () => new FireflyConfig() ); $this->app->bind( 'navigation', - static fn() => new Navigation() + static fn () => new Navigation() ); $this->app->bind( 'amount', - static fn() => new Amount() + static fn () => new Amount() ); $this->app->bind( 'steam', - static fn() => new Steam() + static fn () => new Steam() ); $this->app->bind( 'balance', - static fn() => new Balance() + static fn () => new Balance() ); $this->app->bind( 'expandedform', - static fn() => new ExpandedForm() + static fn () => new ExpandedForm() ); $this->app->bind( 'accountform', - static fn() => new AccountForm() + static fn () => new AccountForm() ); $this->app->bind( 'currencyform', - static fn() => new CurrencyForm() + static fn () => new CurrencyForm() ); $this->app->bind( 'piggybankform', - static fn() => new PiggyBankForm() + static fn () => new PiggyBankForm() ); $this->app->bind( 'ruleform', - static fn() => new RuleForm() + static fn () => new RuleForm() ); // chart generator: diff --git a/app/Providers/FireflySessionProvider.php b/app/Providers/FireflySessionProvider.php index 1817ab280b..9fb080ea35 100644 --- a/app/Providers/FireflySessionProvider.php +++ b/app/Providers/FireflySessionProvider.php @@ -52,7 +52,7 @@ class FireflySessionProvider extends ServiceProvider { $this->app->singleton( 'session', - static fn($app) => new SessionManager($app) + static fn ($app) => new SessionManager($app) ); } @@ -63,11 +63,11 @@ class FireflySessionProvider extends ServiceProvider { $this->app->singleton( 'session.store', - static fn($app) => + static fn ($app) // First, we will create the session manager which is responsible for the // creation of the various session drivers when they are needed by the // application instance, and will resolve them on a lazy load basis. - $app->make('session')->driver() + => $app->make('session')->driver() ); } } diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index e4a71d69ac..d7834bcf9f 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -409,7 +409,7 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac public function getMetaValue(Account $account, string $field): ?string { $result = $account->accountMeta->filter( - static fn(AccountMeta $meta) => strtolower($meta->name) === strtolower($field) + static fn (AccountMeta $meta) => strtolower($meta->name) === strtolower($field) ); if (0 === $result->count()) { return null; diff --git a/app/Repositories/Budget/BudgetLimitRepository.php b/app/Repositories/Budget/BudgetLimitRepository.php index 1db1310429..456e8197f6 100644 --- a/app/Repositories/Budget/BudgetLimitRepository.php +++ b/app/Repositories/Budget/BudgetLimitRepository.php @@ -127,7 +127,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface, UserGroup public function getAllBudgetLimitsByCurrency(TransactionCurrency $currency, ?Carbon $start = null, ?Carbon $end = null): Collection { return $this->getAllBudgetLimits($start, $end)->filter( - static fn(BudgetLimit $budgetLimit) => $budgetLimit->transaction_currency_id === $currency->id + static fn (BudgetLimit $budgetLimit) => $budgetLimit->transaction_currency_id === $currency->id ); } diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index 2738577563..c6262f2b04 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -179,8 +179,8 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf $local = $this->get(); return $all->map(static function (TransactionCurrency $current) use ($local) { - $hasId = $local->contains(static fn(TransactionCurrency $entry) => $entry->id === $current->id); - $isNative = $local->contains(static fn(TransactionCurrency $entry) => 1 === (int) $entry->pivot->group_default && $entry->id === $current->id); + $hasId = $local->contains(static fn (TransactionCurrency $entry) => $entry->id === $current->id); + $isNative = $local->contains(static fn (TransactionCurrency $entry) => 1 === (int) $entry->pivot->group_default && $entry->id === $current->id); $current->userGroupEnabled = $hasId; $current->userGroupNative = $isNative; diff --git a/app/Repositories/LinkType/LinkTypeRepository.php b/app/Repositories/LinkType/LinkTypeRepository.php index 3485e9560f..08a346db38 100644 --- a/app/Repositories/LinkType/LinkTypeRepository.php +++ b/app/Repositories/LinkType/LinkTypeRepository.php @@ -151,7 +151,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface, UserGroupInterf $merged = $outward->merge($inward); return $merged->filter( - static fn(TransactionJournalLink $link) => null !== $link->source && null !== $link->destination + static fn (TransactionJournalLink $link) => null !== $link->source && null !== $link->destination ); } diff --git a/app/Repositories/UserGroups/Account/AccountRepository.php b/app/Repositories/UserGroups/Account/AccountRepository.php index f9d5ad6f90..f7aae4dfce 100644 --- a/app/Repositories/UserGroups/Account/AccountRepository.php +++ b/app/Repositories/UserGroups/Account/AccountRepository.php @@ -149,7 +149,7 @@ class AccountRepository implements AccountRepositoryInterface public function getMetaValue(Account $account, string $field): ?string { $result = $account->accountMeta->filter( - static fn(AccountMeta $meta) => strtolower($meta->name) === strtolower($field) + static fn (AccountMeta $meta) => strtolower($meta->name) === strtolower($field) ); if (0 === $result->count()) { return null; diff --git a/app/Repositories/UserGroups/Currency/CurrencyRepository.php b/app/Repositories/UserGroups/Currency/CurrencyRepository.php index 73098d5b0f..813bdad772 100644 --- a/app/Repositories/UserGroups/Currency/CurrencyRepository.php +++ b/app/Repositories/UserGroups/Currency/CurrencyRepository.php @@ -179,8 +179,8 @@ class CurrencyRepository implements CurrencyRepositoryInterface $local = $this->get(); return $all->map(static function (TransactionCurrency $current) use ($local) { - $hasId = $local->contains(static fn(TransactionCurrency $entry) => $entry->id === $current->id); - $isNative = $local->contains(static fn(TransactionCurrency $entry) => 1 === (int) $entry->pivot->group_default && $entry->id === $current->id); + $hasId = $local->contains(static fn (TransactionCurrency $entry) => $entry->id === $current->id); + $isNative = $local->contains(static fn (TransactionCurrency $entry) => 1 === (int) $entry->pivot->group_default && $entry->id === $current->id); $current->userGroupEnabled = $hasId; $current->userGroupNative = $isNative; diff --git a/app/Repositories/Webhook/WebhookRepository.php b/app/Repositories/Webhook/WebhookRepository.php index c6a7827856..256d0d34e7 100644 --- a/app/Repositories/Webhook/WebhookRepository.php +++ b/app/Repositories/Webhook/WebhookRepository.php @@ -79,9 +79,9 @@ class WebhookRepository implements WebhookRepositoryInterface, UserGroupInterfac ->where('webhook_messages.errored', 0) ->get(['webhook_messages.*']) ->filter( - static fn(WebhookMessage $message) => + static fn (WebhookMessage $message) // @phpstan-ignore-line - $message->webhookAttempts()->count() <= 2 + => $message->webhookAttempts()->count() <= 2 )->splice(0, 3) ; } diff --git a/app/Rules/BelongsUserGroup.php b/app/Rules/BelongsUserGroup.php index ac67b72e95..8a4f1519c5 100644 --- a/app/Rules/BelongsUserGroup.php +++ b/app/Rules/BelongsUserGroup.php @@ -45,9 +45,7 @@ class BelongsUserGroup implements ValidationRule /** * Create a new rule instance. */ - public function __construct(private readonly UserGroup $userGroup) - { - } + public function __construct(private readonly UserGroup $userGroup) {} public function validate(string $attribute, mixed $value, \Closure $fail): void { diff --git a/app/Rules/IsDefaultUserGroupName.php b/app/Rules/IsDefaultUserGroupName.php index 70972a980a..6f314e8dff 100644 --- a/app/Rules/IsDefaultUserGroupName.php +++ b/app/Rules/IsDefaultUserGroupName.php @@ -34,9 +34,7 @@ use Illuminate\Contracts\Validation\ValidationRule; */ class IsDefaultUserGroupName implements ValidationRule { - public function __construct(private readonly UserGroup $userGroup) - { - } + public function __construct(private readonly UserGroup $userGroup) {} /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") diff --git a/app/Rules/IsFilterValueIn.php b/app/Rules/IsFilterValueIn.php index c540748a53..dddd247fa9 100644 --- a/app/Rules/IsFilterValueIn.php +++ b/app/Rules/IsFilterValueIn.php @@ -28,9 +28,7 @@ use Illuminate\Contracts\Validation\ValidationRule; class IsFilterValueIn implements ValidationRule { - public function __construct(private readonly string $key, private readonly array $values) - { - } + public function __construct(private readonly string $key, private readonly array $values) {} /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") diff --git a/app/Rules/IsValidZeroOrMoreAmount.php b/app/Rules/IsValidZeroOrMoreAmount.php index be6e61e8d9..263691ff8a 100644 --- a/app/Rules/IsValidZeroOrMoreAmount.php +++ b/app/Rules/IsValidZeroOrMoreAmount.php @@ -33,9 +33,7 @@ class IsValidZeroOrMoreAmount implements ValidationRule { use ValidatesAmountsTrait; - public function __construct(private bool $nullable = false) - { - } + public function __construct(private bool $nullable = false) {} /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") diff --git a/app/Services/Internal/Update/GroupCloneService.php b/app/Services/Internal/Update/GroupCloneService.php index 4bb92e31d0..db78b5092b 100644 --- a/app/Services/Internal/Update/GroupCloneService.php +++ b/app/Services/Internal/Update/GroupCloneService.php @@ -117,7 +117,7 @@ class GroupCloneService private function cloneNote(Note $note, TransactionJournal $newJournal, int $oldGroupId): void { $newNote = $note->replicate(); - $newNote->text = sprintf("%s\n\n%s",$newNote->text, trans('firefly.clones_journal_x', ['description' => $newJournal->description, 'id' => $oldGroupId])); + $newNote->text = sprintf("%s\n\n%s", $newNote->text, trans('firefly.clones_journal_x', ['description' => $newJournal->description, 'id' => $oldGroupId])); $newNote->noteable_id = $newJournal->id; $newNote->save(); } diff --git a/app/Support/CacheProperties.php b/app/Support/CacheProperties.php index a79633497f..2a95210a8c 100644 --- a/app/Support/CacheProperties.php +++ b/app/Support/CacheProperties.php @@ -76,7 +76,7 @@ class CacheProperties private function hash(): void { - $content = ''; + $content = ''; foreach ($this->properties as $property) { try { $content = sprintf('%s%s', $content, \Safe\json_encode($property, JSON_THROW_ON_ERROR)); diff --git a/app/Support/Chart/Budget/FrontpageChartGenerator.php b/app/Support/Chart/Budget/FrontpageChartGenerator.php index 4ce9d137f9..edcc4f260a 100644 --- a/app/Support/Chart/Budget/FrontpageChartGenerator.php +++ b/app/Support/Chart/Budget/FrontpageChartGenerator.php @@ -203,7 +203,7 @@ class FrontpageChartGenerator $amount = $limit->native_amount; Log::debug(sprintf('Amount is now "%s".', $amount)); } - $amount ??= '0'; + $amount ??= '0'; $sumSpent = bcmul((string) $entry['sum'], '-1'); // spent $data[0]['entries'][$title] ??= '0'; $data[1]['entries'][$title] ??= '0'; diff --git a/app/Support/Models/AccountBalanceCalculator.php b/app/Support/Models/AccountBalanceCalculator.php index ce1e9874aa..21e9e8dc7f 100644 --- a/app/Support/Models/AccountBalanceCalculator.php +++ b/app/Support/Models/AccountBalanceCalculator.php @@ -71,14 +71,15 @@ class AccountBalanceCalculator $balances = []; $count = 0; $query = Transaction::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') - ->whereNull('transactions.deleted_at') - ->whereNull('transaction_journals.deleted_at') + ->whereNull('transactions.deleted_at') + ->whereNull('transaction_journals.deleted_at') // this order is the same as GroupCollector, but in the exact reverse. - ->orderBy('transaction_journals.date', 'asc') - ->orderBy('transaction_journals.order', 'desc') - ->orderBy('transaction_journals.id', 'asc') - ->orderBy('transaction_journals.description', 'asc') - ->orderBy('transactions.amount', 'asc'); + ->orderBy('transaction_journals.date', 'asc') + ->orderBy('transaction_journals.order', 'desc') + ->orderBy('transaction_journals.id', 'asc') + ->orderBy('transaction_journals.description', 'asc') + ->orderBy('transactions.amount', 'asc') + ; if ($accounts->count() > 0) { $query->whereIn('transactions.account_id', $accounts->pluck('id')->toArray()); } @@ -87,7 +88,7 @@ class AccountBalanceCalculator $query->where('transaction_journals.date', '>=', $notBefore); } - $set = $query->get(['transactions.id', 'transactions.balance_dirty', 'transactions.transaction_currency_id', 'transaction_journals.date', 'transactions.account_id', 'transactions.amount']); + $set = $query->get(['transactions.id', 'transactions.balance_dirty', 'transactions.transaction_currency_id', 'transaction_journals.date', 'transactions.account_id', 'transactions.amount']); Log::debug(sprintf('Counted %d transaction(s)', $set->count())); // the balance value is an array. @@ -100,8 +101,8 @@ class AccountBalanceCalculator $balances[$entry->account_id][$entry->transaction_currency_id] ??= [$this->getLatestBalance($entry->account_id, $entry->transaction_currency_id, $notBefore), null]; // before and after are easy: - $before = $balances[$entry->account_id][$entry->transaction_currency_id][0]; - $after = bcadd($before, (string) $entry->amount); + $before = $balances[$entry->account_id][$entry->transaction_currency_id][0]; + $after = bcadd($before, (string) $entry->amount); if (true === $entry->balance_dirty || $accounts->count() > 0) { // update the transaction: $entry->balance_before = $before; @@ -127,17 +128,18 @@ class AccountBalanceCalculator return '0'; } Log::debug(sprintf('getLatestBalance: notBefore date is "%s", calculating', $notBefore->format('Y-m-d'))); - $query = Transaction::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') - ->whereNull('transactions.deleted_at') - ->where('transaction_journals.transaction_currency_id', $currencyId) - ->whereNull('transaction_journals.deleted_at') + $query = Transaction::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->whereNull('transactions.deleted_at') + ->where('transaction_journals.transaction_currency_id', $currencyId) + ->whereNull('transaction_journals.deleted_at') // this order is the same as GroupCollector - ->orderBy('transaction_journals.date', 'DESC') - ->orderBy('transaction_journals.order', 'ASC') - ->orderBy('transaction_journals.id', 'DESC') - ->orderBy('transaction_journals.description', 'DESC') - ->orderBy('transactions.amount', 'DESC') - ->where('transactions.account_id', $accountId); + ->orderBy('transaction_journals.date', 'DESC') + ->orderBy('transaction_journals.order', 'ASC') + ->orderBy('transaction_journals.id', 'DESC') + ->orderBy('transaction_journals.description', 'DESC') + ->orderBy('transactions.amount', 'DESC') + ->where('transactions.account_id', $accountId) + ; $notBefore->startOfDay(); $query->where('transaction_journals.date', '<', $notBefore); @@ -169,7 +171,7 @@ class AccountBalanceCalculator */ foreach ($currencies as $currencyId => $balance) { /** @var null|TransactionCurrency $currency */ - $currency = TransactionCurrency::find($currencyId); + $currency = TransactionCurrency::find($currencyId); if (null === $currency) { Log::error(sprintf('Could not find currency #%d, will not save account balance.', $currencyId)); @@ -197,9 +199,9 @@ class AccountBalanceCalculator public static function recalculateForJournal(TransactionJournal $transactionJournal): void { Log::debug(__METHOD__); - $object = new self(); + $object = new self(); - $set = []; + $set = []; foreach ($transactionJournal->transactions as $transaction) { $set[$transaction->account_id] = $transaction->account; } diff --git a/app/Support/Models/BillDateCalculator.php b/app/Support/Models/BillDateCalculator.php index ffda4ef355..e20993de38 100644 --- a/app/Support/Models/BillDateCalculator.php +++ b/app/Support/Models/BillDateCalculator.php @@ -118,7 +118,7 @@ class BillDateCalculator } Log::debug('end of loop'); $simple = $set->map( // @phpstan-ignore-line - static fn(Carbon $date) => $date->format('Y-m-d') + static fn (Carbon $date) => $date->format('Y-m-d') ); Log::debug(sprintf('Found %d pay dates', $set->count()), $simple->toArray()); diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php index 79794d85e3..90c039913e 100644 --- a/app/Support/Search/OperatorQuerySearch.php +++ b/app/Support/Search/OperatorQuerySearch.php @@ -2009,7 +2009,7 @@ class OperatorQuerySearch implements SearchInterface } app('log')->debug(sprintf('Found %d accounts, will filter.', $accounts->count())); $filtered = $accounts->filter( - static fn(Account $account) => $stringMethod(strtolower($account->name), strtolower($value)) + static fn (Account $account) => $stringMethod(strtolower($account->name), strtolower($value)) ); if (0 === $filtered->count()) { diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index 8d3ac12203..80b4e1b482 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -138,7 +138,7 @@ class General extends AbstractExtension { return new TwigFilter( 'mimeIcon', - static fn(string $string): string => match ($string) { + static fn (string $string): string => match ($string) { 'application/pdf' => 'fa-file-pdf-o', 'image/png', 'image/jpeg', 'image/svg+xml', 'image/heic', 'image/heic-sequence', 'application/vnd.oasis.opendocument.image' => 'fa-file-image-o', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'application/x-iwork-pages-sffpages', 'application/vnd.sun.xml.writer', 'application/vnd.sun.xml.writer.template', 'application/vnd.sun.xml.writer.global', 'application/vnd.stardivision.writer', 'application/vnd.stardivision.writer-global', 'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.text-template', 'application/vnd.oasis.opendocument.text-web', 'application/vnd.oasis.opendocument.text-master' => 'fa-file-word-o', @@ -146,7 +146,7 @@ class General extends AbstractExtension 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.openxmlformats-officedocument.presentationml.template', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'application/vnd.sun.xml.impress', 'application/vnd.sun.xml.impress.template', 'application/vnd.stardivision.impress', 'application/vnd.oasis.opendocument.presentation', 'application/vnd.oasis.opendocument.presentation-template' => 'fa-file-powerpoint-o', 'application/vnd.sun.xml.draw', 'application/vnd.sun.xml.draw.template', 'application/vnd.stardivision.draw', 'application/vnd.oasis.opendocument.chart' => 'fa-paint-brush', 'application/vnd.oasis.opendocument.graphics', 'application/vnd.oasis.opendocument.graphics-template', 'application/vnd.sun.xml.math', 'application/vnd.stardivision.math', 'application/vnd.oasis.opendocument.formula', 'application/vnd.oasis.opendocument.database' => 'fa-calculator', - default => 'fa-file-o', + default => 'fa-file-o', }, ['is_safe' => ['html']] ); @@ -211,7 +211,7 @@ class General extends AbstractExtension { return new TwigFunction( 'phpdate', - static fn(string $str): string => \Safe\date($str) + static fn (string $str): string => \Safe\date($str) ); } @@ -373,7 +373,7 @@ class General extends AbstractExtension { return new TwigFunction( 'carbonize', - static fn(string $date): Carbon => new Carbon($date, config('app.timezone')) + static fn (string $date): Carbon => new Carbon($date, config('app.timezone')) ); } } diff --git a/app/Support/Twig/Rule.php b/app/Support/Twig/Rule.php index 1bc13eb461..45e763da1b 100644 --- a/app/Support/Twig/Rule.php +++ b/app/Support/Twig/Rule.php @@ -45,7 +45,7 @@ class Rule extends AbstractExtension { return new TwigFunction( 'allJournalTriggers', - static fn() => [ + static fn () => [ 'store-journal' => (string) trans('firefly.rule_trigger_store_journal'), 'update-journal' => (string) trans('firefly.rule_trigger_update_journal'), 'manual-activation' => (string) trans('firefly.rule_trigger_manual'), diff --git a/app/Support/Twig/Translation.php b/app/Support/Twig/Translation.php index 78781936ca..7167ebb3a4 100644 --- a/app/Support/Twig/Translation.php +++ b/app/Support/Twig/Translation.php @@ -38,7 +38,7 @@ class Translation extends AbstractExtension return [ new TwigFilter( '_', - static fn($name) => (string) trans(sprintf('firefly.%s', $name)), + static fn ($name) => (string) trans(sprintf('firefly.%s', $name)), ['is_safe' => ['html']] ), ]; diff --git a/app/TransactionRules/Actions/AddTag.php b/app/TransactionRules/Actions/AddTag.php index a7fa14473a..3823f7721f 100644 --- a/app/TransactionRules/Actions/AddTag.php +++ b/app/TransactionRules/Actions/AddTag.php @@ -39,9 +39,7 @@ class AddTag implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/AppendDescription.php b/app/TransactionRules/Actions/AppendDescription.php index 120ddc591c..946c4c5def 100644 --- a/app/TransactionRules/Actions/AppendDescription.php +++ b/app/TransactionRules/Actions/AppendDescription.php @@ -40,9 +40,7 @@ class AppendDescription implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private RuleAction $action) - { - } + public function __construct(private RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/AppendDescriptionToNotes.php b/app/TransactionRules/Actions/AppendDescriptionToNotes.php index 47ecc75a78..952d27fd3a 100644 --- a/app/TransactionRules/Actions/AppendDescriptionToNotes.php +++ b/app/TransactionRules/Actions/AppendDescriptionToNotes.php @@ -42,9 +42,7 @@ class AppendDescriptionToNotes implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private RuleAction $action) - { - } + public function __construct(private RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/AppendNotes.php b/app/TransactionRules/Actions/AppendNotes.php index d5d1737a05..c27853d8ed 100644 --- a/app/TransactionRules/Actions/AppendNotes.php +++ b/app/TransactionRules/Actions/AppendNotes.php @@ -40,9 +40,7 @@ class AppendNotes implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private RuleAction $action) - { - } + public function __construct(private RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/AppendNotesToDescription.php b/app/TransactionRules/Actions/AppendNotesToDescription.php index 441b63878a..86c46891b3 100644 --- a/app/TransactionRules/Actions/AppendNotesToDescription.php +++ b/app/TransactionRules/Actions/AppendNotesToDescription.php @@ -44,9 +44,7 @@ class AppendNotesToDescription implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private RuleAction $action) - { - } + public function __construct(private RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/ClearBudget.php b/app/TransactionRules/Actions/ClearBudget.php index 8b227d8252..08e7dce7fa 100644 --- a/app/TransactionRules/Actions/ClearBudget.php +++ b/app/TransactionRules/Actions/ClearBudget.php @@ -37,9 +37,7 @@ class ClearBudget implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/ClearCategory.php b/app/TransactionRules/Actions/ClearCategory.php index bd0e206ef0..73fa40b3f0 100644 --- a/app/TransactionRules/Actions/ClearCategory.php +++ b/app/TransactionRules/Actions/ClearCategory.php @@ -37,9 +37,7 @@ class ClearCategory implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/ClearNotes.php b/app/TransactionRules/Actions/ClearNotes.php index 0ceeb84128..48e770012b 100644 --- a/app/TransactionRules/Actions/ClearNotes.php +++ b/app/TransactionRules/Actions/ClearNotes.php @@ -38,9 +38,7 @@ class ClearNotes implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/ConvertToDeposit.php b/app/TransactionRules/Actions/ConvertToDeposit.php index 221aa4dac4..b61599190d 100644 --- a/app/TransactionRules/Actions/ConvertToDeposit.php +++ b/app/TransactionRules/Actions/ConvertToDeposit.php @@ -46,9 +46,7 @@ class ConvertToDeposit implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/ConvertToTransfer.php b/app/TransactionRules/Actions/ConvertToTransfer.php index 1b49d0ea20..ba613d795f 100644 --- a/app/TransactionRules/Actions/ConvertToTransfer.php +++ b/app/TransactionRules/Actions/ConvertToTransfer.php @@ -45,9 +45,7 @@ class ConvertToTransfer implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} /** * @SuppressWarnings("PHPMD.ExcessiveMethodLength") diff --git a/app/TransactionRules/Actions/ConvertToWithdrawal.php b/app/TransactionRules/Actions/ConvertToWithdrawal.php index adcf28b6d1..61fba99de4 100644 --- a/app/TransactionRules/Actions/ConvertToWithdrawal.php +++ b/app/TransactionRules/Actions/ConvertToWithdrawal.php @@ -46,9 +46,7 @@ class ConvertToWithdrawal implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/DeleteTransaction.php b/app/TransactionRules/Actions/DeleteTransaction.php index ed6d8efbda..fec4cb3ad4 100644 --- a/app/TransactionRules/Actions/DeleteTransaction.php +++ b/app/TransactionRules/Actions/DeleteTransaction.php @@ -38,9 +38,7 @@ class DeleteTransaction implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/LinkToBill.php b/app/TransactionRules/Actions/LinkToBill.php index 3266d31a6a..b52f278442 100644 --- a/app/TransactionRules/Actions/LinkToBill.php +++ b/app/TransactionRules/Actions/LinkToBill.php @@ -40,9 +40,7 @@ class LinkToBill implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/MoveDescriptionToNotes.php b/app/TransactionRules/Actions/MoveDescriptionToNotes.php index 4da820269b..62711bf5e6 100644 --- a/app/TransactionRules/Actions/MoveDescriptionToNotes.php +++ b/app/TransactionRules/Actions/MoveDescriptionToNotes.php @@ -39,9 +39,7 @@ class MoveDescriptionToNotes implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/MoveNotesToDescription.php b/app/TransactionRules/Actions/MoveNotesToDescription.php index 0732fb2fe2..6852f5644b 100644 --- a/app/TransactionRules/Actions/MoveNotesToDescription.php +++ b/app/TransactionRules/Actions/MoveNotesToDescription.php @@ -45,9 +45,7 @@ class MoveNotesToDescription implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private RuleAction $action) - { - } + public function __construct(private RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/PrependDescription.php b/app/TransactionRules/Actions/PrependDescription.php index 9dba455757..37e888ca34 100644 --- a/app/TransactionRules/Actions/PrependDescription.php +++ b/app/TransactionRules/Actions/PrependDescription.php @@ -37,9 +37,7 @@ class PrependDescription implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/PrependNotes.php b/app/TransactionRules/Actions/PrependNotes.php index b59230e02a..e4e8249c8b 100644 --- a/app/TransactionRules/Actions/PrependNotes.php +++ b/app/TransactionRules/Actions/PrependNotes.php @@ -37,9 +37,7 @@ class PrependNotes implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/RemoveAllTags.php b/app/TransactionRules/Actions/RemoveAllTags.php index 40a032354a..cf5d7ee783 100644 --- a/app/TransactionRules/Actions/RemoveAllTags.php +++ b/app/TransactionRules/Actions/RemoveAllTags.php @@ -37,9 +37,7 @@ class RemoveAllTags implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/RemoveTag.php b/app/TransactionRules/Actions/RemoveTag.php index 528a786d29..956835b2e3 100644 --- a/app/TransactionRules/Actions/RemoveTag.php +++ b/app/TransactionRules/Actions/RemoveTag.php @@ -38,9 +38,7 @@ class RemoveTag implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/SetAmount.php b/app/TransactionRules/Actions/SetAmount.php index db36221472..c7c2e47518 100644 --- a/app/TransactionRules/Actions/SetAmount.php +++ b/app/TransactionRules/Actions/SetAmount.php @@ -38,9 +38,7 @@ class SetAmount implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private RuleAction $action) - { - } + public function __construct(private RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/SetBudget.php b/app/TransactionRules/Actions/SetBudget.php index 74b7640a8e..54bb75902b 100644 --- a/app/TransactionRules/Actions/SetBudget.php +++ b/app/TransactionRules/Actions/SetBudget.php @@ -39,9 +39,7 @@ class SetBudget implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/SetCategory.php b/app/TransactionRules/Actions/SetCategory.php index b6f8e5b2d5..c546dcad1a 100644 --- a/app/TransactionRules/Actions/SetCategory.php +++ b/app/TransactionRules/Actions/SetCategory.php @@ -39,9 +39,7 @@ class SetCategory implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/SetDescription.php b/app/TransactionRules/Actions/SetDescription.php index 8897eb0cb1..cec857fc5a 100644 --- a/app/TransactionRules/Actions/SetDescription.php +++ b/app/TransactionRules/Actions/SetDescription.php @@ -39,9 +39,7 @@ class SetDescription implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private RuleAction $action) - { - } + public function __construct(private RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/SetDestinationAccount.php b/app/TransactionRules/Actions/SetDestinationAccount.php index 6dc903564e..f3b37b6f46 100644 --- a/app/TransactionRules/Actions/SetDestinationAccount.php +++ b/app/TransactionRules/Actions/SetDestinationAccount.php @@ -44,9 +44,7 @@ class SetDestinationAccount implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/SetDestinationToCashAccount.php b/app/TransactionRules/Actions/SetDestinationToCashAccount.php index 350a097b67..967e07928d 100644 --- a/app/TransactionRules/Actions/SetDestinationToCashAccount.php +++ b/app/TransactionRules/Actions/SetDestinationToCashAccount.php @@ -42,9 +42,7 @@ class SetDestinationToCashAccount implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/SetNotes.php b/app/TransactionRules/Actions/SetNotes.php index 4962649241..a3c144fa11 100644 --- a/app/TransactionRules/Actions/SetNotes.php +++ b/app/TransactionRules/Actions/SetNotes.php @@ -36,9 +36,7 @@ class SetNotes implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/SetSourceAccount.php b/app/TransactionRules/Actions/SetSourceAccount.php index e2f9420b2d..340741cc81 100644 --- a/app/TransactionRules/Actions/SetSourceAccount.php +++ b/app/TransactionRules/Actions/SetSourceAccount.php @@ -44,9 +44,7 @@ class SetSourceAccount implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/SetSourceToCashAccount.php b/app/TransactionRules/Actions/SetSourceToCashAccount.php index ebc8525005..bb83c36908 100644 --- a/app/TransactionRules/Actions/SetSourceToCashAccount.php +++ b/app/TransactionRules/Actions/SetSourceToCashAccount.php @@ -42,9 +42,7 @@ class SetSourceToCashAccount implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/SwitchAccounts.php b/app/TransactionRules/Actions/SwitchAccounts.php index 7cd0579948..e49ea4a19d 100644 --- a/app/TransactionRules/Actions/SwitchAccounts.php +++ b/app/TransactionRules/Actions/SwitchAccounts.php @@ -39,9 +39,7 @@ class SwitchAccounts implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Actions/UpdatePiggyBank.php b/app/TransactionRules/Actions/UpdatePiggyBank.php index d0dc413a30..5633ba6b83 100644 --- a/app/TransactionRules/Actions/UpdatePiggyBank.php +++ b/app/TransactionRules/Actions/UpdatePiggyBank.php @@ -40,9 +40,7 @@ class UpdatePiggyBank implements ActionInterface /** * TriggerInterface constructor. */ - public function __construct(private readonly RuleAction $action) - { - } + public function __construct(private readonly RuleAction $action) {} public function actOnArray(array $journal): bool { diff --git a/app/TransactionRules/Expressions/ActionExpressionLanguageProvider.php b/app/TransactionRules/Expressions/ActionExpressionLanguageProvider.php index f215c6097f..f1e2758d9f 100644 --- a/app/TransactionRules/Expressions/ActionExpressionLanguageProvider.php +++ b/app/TransactionRules/Expressions/ActionExpressionLanguageProvider.php @@ -45,12 +45,12 @@ class ActionExpressionLanguageProvider implements ExpressionFunctionProviderInte return [ new ExpressionFunction( 'constant2', - static fn($str): string => sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!'), + static fn ($str): string => sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!'), $function ), new ExpressionFunction( 'constant', - static fn($str): string => sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!'), + static fn ($str): string => sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!'), $function ), diff --git a/app/Transformers/V2/BillTransformer.php b/app/Transformers/V2/BillTransformer.php index b19da5f420..34d9afe5e1 100644 --- a/app/Transformers/V2/BillTransformer.php +++ b/app/Transformers/V2/BillTransformer.php @@ -325,7 +325,7 @@ class BillTransformer extends AbstractTransformer } } $simple = $set->map( // @phpstan-ignore-line - static fn(Carbon $date) => $date->toAtomString() + static fn (Carbon $date) => $date->toAtomString() ); return $simple->toArray(); diff --git a/config/broadcasting.php b/config/broadcasting.php index b735673ab4..ead84c744b 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -57,7 +57,7 @@ return [ 'app_id' => env('PUSHER_APP_ID'), 'options' => [ 'cluster' => env('PUSHER_APP_CLUSTER'), - 'host' => env('PUSHER_HOST') ?? 'api-' . env('PUSHER_APP_CLUSTER', 'mt1') . '.pusher.com', + 'host' => env('PUSHER_HOST') ?? 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', 'port' => env('PUSHER_PORT', 443), 'scheme' => env('PUSHER_SCHEME', 'https'), 'encrypted' => true, diff --git a/config/firefly.php b/config/firefly.php index c087c8a4d2..ff7827f861 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -78,7 +78,7 @@ return [ 'running_balance_column' => env('USE_RUNNING_BALANCE', false), // see cer.php for exchange rates feature flag. ], - 'version' => 'develop/2025-04-28', + 'version' => 'develop/2025-05-04', 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 25, diff --git a/config/ide-helper.php b/config/ide-helper.php index 1e110ae779..6a932bff82 100644 --- a/config/ide-helper.php +++ b/config/ide-helper.php @@ -21,6 +21,8 @@ */ declare(strict_types=1); +use Illuminate\Database\Eloquent\Builder; +use Illuminate\Session\Store; return [ /* @@ -114,8 +116,8 @@ return [ */ 'extra' => [ - 'Eloquent' => [\Illuminate\Database\Eloquent\Builder::class, \Illuminate\Database\Query\Builder::class], - 'Session' => [\Illuminate\Session\Store::class], + 'Eloquent' => [Builder::class, Illuminate\Database\Query\Builder::class], + 'Session' => [Store::class], ], 'magic' => [ diff --git a/package-lock.json b/package-lock.json index ad049fa676..5ba613d7ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,24 +28,24 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", - "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.25.9", + "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { - "version": "7.26.8", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz", - "integrity": "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.27.1.tgz", + "integrity": "sha512-Q+E+rd/yBzNQhXkG+zQnF58e4zoZfBedaxwzPmicKsiK3nt8iJYrSrDbjwFFDGC4f+rPafqRaPH6TsDoSvMf7A==", "dev": true, "license": "MIT", "engines": { @@ -53,22 +53,22 @@ } }, "node_modules/@babel/core": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.10.tgz", - "integrity": "sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.27.1.tgz", + "integrity": "sha512-IaaGWsQqfsQWVLqMn9OB92MNN7zukfVA4s7KKAI0KfrrDsZ0yhi5uV4baBuLuN7n3vsZpwP8asPPcVwApxvjBQ==", "dev": true, "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.26.2", - "@babel/generator": "^7.26.10", - "@babel/helper-compilation-targets": "^7.26.5", - "@babel/helper-module-transforms": "^7.26.0", - "@babel/helpers": "^7.26.10", - "@babel/parser": "^7.26.10", - "@babel/template": "^7.26.9", - "@babel/traverse": "^7.26.10", - "@babel/types": "^7.26.10", + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.27.1", + "@babel/helper-compilation-targets": "^7.27.1", + "@babel/helper-module-transforms": "^7.27.1", + "@babel/helpers": "^7.27.1", + "@babel/parser": "^7.27.1", + "@babel/template": "^7.27.1", + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -94,14 +94,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.0.tgz", - "integrity": "sha512-VybsKvpiN1gU1sdMZIp7FcqphVVKEwcuj02x73uvcHE0PTihx1nlBcowYWhDwjpoAXRv43+gDzyggGnn1XZhVw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.1.tgz", + "integrity": "sha512-UnJfnIpc/+JO0/+KRVQNGU+y5taA5vCbwN8+azkX6beii/ZF+enZJSOKo11ZSzGJjlNfJHfQtmQT8H+9TXPG2w==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.27.0", - "@babel/types": "^7.27.0", + "@babel/parser": "^7.27.1", + "@babel/types": "^7.27.1", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -111,27 +111,27 @@ } }, "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz", - "integrity": "sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.27.1.tgz", + "integrity": "sha512-WnuuDILl9oOBbKnb4L+DyODx7iC47XfzmNCpTttFsSp6hTG7XZxu60+4IO+2/hPfcGOoKbFiwoI/+zwARbNQow==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.25.9" + "@babel/types": "^7.27.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.0.tgz", - "integrity": "sha512-LVk7fbXml0H2xH34dFzKQ7TDZ2G4/rVTOrq9V+icbbadjbVxxeFeDsNHv2SrZeWoA+6ZiTyWYWtScEIW07EAcA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.1.tgz", + "integrity": "sha512-2YaDd/Rd9E598B5+WIc8wJPmWETiiJXFYVE60oX8FDohv7rAUU3CQj+A1MgeEmcsk2+dQuEjIe/GDvig0SqL4g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.26.8", - "@babel/helper-validator-option": "^7.25.9", + "@babel/compat-data": "^7.27.1", + "@babel/helper-validator-option": "^7.27.1", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" @@ -151,18 +151,18 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.27.0.tgz", - "integrity": "sha512-vSGCvMecvFCd/BdpGlhpXYNhhC4ccxyvQWpbGL4CWbvfEoLFWUZuSuf7s9Aw70flgQF+6vptvgK2IfOnKlRmBg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.27.1.tgz", + "integrity": "sha512-QwGAmuvM17btKU5VqXfb+Giw4JcN0hjuufz3DYnpeVDvZLAObloM77bhMXiqry3Iio+Ai4phVRDwl6WU10+r5A==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.9", - "@babel/helper-member-expression-to-functions": "^7.25.9", - "@babel/helper-optimise-call-expression": "^7.25.9", - "@babel/helper-replace-supers": "^7.26.5", - "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", - "@babel/traverse": "^7.27.0", + "@babel/helper-annotate-as-pure": "^7.27.1", + "@babel/helper-member-expression-to-functions": "^7.27.1", + "@babel/helper-optimise-call-expression": "^7.27.1", + "@babel/helper-replace-supers": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1", + "@babel/traverse": "^7.27.1", "semver": "^6.3.1" }, "engines": { @@ -183,13 +183,13 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.27.0.tgz", - "integrity": "sha512-fO8l08T76v48BhpNRW/nQ0MxfnSdoSKUJBMjubOAYffsVuGG5qOfMq7N6Es7UJvi7Y8goXXo07EfcHZXDPuELQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.27.1.tgz", + "integrity": "sha512-uVDC72XVf8UbrH5qQTc18Agb8emwjTiZrQE11Nv3CuBEZmVvTwwE9CBUEvHku06gQCAyYf8Nv6ja1IN+6LMbxQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-annotate-as-pure": "^7.27.1", "regexpu-core": "^6.2.0", "semver": "^6.3.1" }, @@ -228,43 +228,43 @@ } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz", - "integrity": "sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.27.1.tgz", + "integrity": "sha512-E5chM8eWjTp/aNoVpcbfM7mLxu9XGLWYise2eBKGQomAk/Mb4XoxyqXTZbuTohbsl8EKqdlMhnDI2CCLfcs9wA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.25.9" + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", - "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", + "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", "dev": true, "license": "MIT", "dependencies": { - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.25.9" + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", - "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.27.1.tgz", + "integrity": "sha512-9yHn519/8KvTU5BjTVEEeIM3w9/2yXNKoD82JifINImhpKkARMJKPP59kLo+BafpdN5zgNeIcS4jsGDmd3l58g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.25.9", - "@babel/helper-validator-identifier": "^7.25.9", - "@babel/traverse": "^7.25.9" + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -274,22 +274,22 @@ } }, "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz", - "integrity": "sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.27.1.tgz", + "integrity": "sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.25.9" + "@babel/types": "^7.27.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.26.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz", - "integrity": "sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", + "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", "dev": true, "license": "MIT", "engines": { @@ -297,15 +297,15 @@ } }, "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.9.tgz", - "integrity": "sha512-IZtukuUeBbhgOcaW2s06OXTzVNJR0ybm4W5xC1opWFFJMZbwRj5LCk+ByYH7WdZPZTt8KnFwA8pvjN2yqcPlgw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.27.1.tgz", + "integrity": "sha512-7fiA521aVw8lSPeI4ZOD3vRFkoqkJcS+z4hFo82bFSH/2tNd6eJ5qCVMS5OzDmZh/kaHQeBaeyxK6wljcPtveA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.9", - "@babel/helper-wrap-function": "^7.25.9", - "@babel/traverse": "^7.25.9" + "@babel/helper-annotate-as-pure": "^7.27.1", + "@babel/helper-wrap-function": "^7.27.1", + "@babel/traverse": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -315,15 +315,15 @@ } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.26.5", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.26.5.tgz", - "integrity": "sha512-bJ6iIVdYX1YooY2X7w1q6VITt+LnUILtNk7zT78ykuwStx8BauCzxvFqFaHjOpW1bVnSUM1PN1f0p5P21wHxvg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.27.1.tgz", + "integrity": "sha512-7EHz6qDZc8RYS5ElPoShMheWvEgERonFCs7IAonWLLUTXW59DP14bCZt89/GKyreYn8g3S83m21FelHKbeDCKA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.25.9", - "@babel/helper-optimise-call-expression": "^7.25.9", - "@babel/traverse": "^7.26.5" + "@babel/helper-member-expression-to-functions": "^7.27.1", + "@babel/helper-optimise-call-expression": "^7.27.1", + "@babel/traverse": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -333,23 +333,23 @@ } }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz", - "integrity": "sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.27.1.tgz", + "integrity": "sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.25.9" + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", - "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", "dev": true, "license": "MIT", "engines": { @@ -357,9 +357,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", "dev": true, "license": "MIT", "engines": { @@ -367,9 +367,9 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", - "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", "dev": true, "license": "MIT", "engines": { @@ -377,42 +377,42 @@ } }, "node_modules/@babel/helper-wrap-function": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.9.tgz", - "integrity": "sha512-ETzz9UTjQSTmw39GboatdymDq4XIQbR8ySgVrylRhPOFpsd+JrKHIuF0de7GCWmem+T4uC5z7EZguod7Wj4A4g==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.27.1.tgz", + "integrity": "sha512-NFJK2sHUvrjo8wAU/nQTWU890/zB2jj0qBcCbZbbf+005cAsv6tMjXz31fBign6M5ov1o0Bllu+9nbqkfsjjJQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/template": "^7.25.9", - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.25.9" + "@babel/template": "^7.27.1", + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.0.tgz", - "integrity": "sha512-U5eyP/CTFPuNE3qk+WZMxFkp/4zUzdceQlfzf7DdGdhp+Fezd7HD+i8Y24ZuTMKX3wQBld449jijbGq6OdGNQg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.1.tgz", + "integrity": "sha512-FCvFTm0sWV8Fxhpp2McP5/W53GPllQ9QeQ7SiqGWjMf/LVG07lFa5+pgK05IRhVwtvafT22KF+ZSnM9I545CvQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/template": "^7.27.0", - "@babel/types": "^7.27.0" + "@babel/template": "^7.27.1", + "@babel/types": "^7.27.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.0.tgz", - "integrity": "sha512-iaepho73/2Pz7w2eMS0Q5f83+0RKI7i4xmiYeBmDzfRVbQtTOG7Ts0S4HzJVsTMGI9keU8rNfuZr8DKfSt7Yyg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.1.tgz", + "integrity": "sha512-I0dZ3ZpCrJ1c04OqlNsQcKiZlsrXf/kkE4FXzID9rIOYICsAbA8mMDzhW/luRNAHdCNt7os/u8wenklZDlUVUQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.27.0" + "@babel/types": "^7.27.1" }, "bin": { "parser": "bin/babel-parser.js" @@ -422,14 +422,14 @@ } }, "node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz", - "integrity": "sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.27.1.tgz", + "integrity": "sha512-QPG3C9cCVRQLxAVwmefEmwdTanECuUBMQZ/ym5kiw3XKCGA7qkuQLcjWWHcrD/GKbn/WmJwaezfuuAOcyKlRPA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/traverse": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/traverse": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -439,13 +439,13 @@ } }, "node_modules/@babel/plugin-bugfix-safari-class-field-initializer-scope": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.9.tgz", - "integrity": "sha512-MrGRLZxLD/Zjj0gdU15dfs+HH/OXvnw/U4jJD8vpcP2CJQapPEv1IWwjc/qMg7ItBlPwSv1hRBbb7LeuANdcnw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.27.1.tgz", + "integrity": "sha512-qNeq3bCKnGgLkEXUuFry6dPlGfCdQNZbn7yUAPCInwAJHMU7THJfrBSozkcWq5sNM6RcF3S8XyQL2A52KNR9IA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -455,13 +455,13 @@ } }, "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.9.tgz", - "integrity": "sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.27.1.tgz", + "integrity": "sha512-g4L7OYun04N1WyqMNjldFwlfPCLVkgB54A/YCXICZYBsvJJE3kByKv9c9+R/nAfmIfjl2rKYLNyMHboYbZaWaA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -471,15 +471,15 @@ } }, "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.25.9.tgz", - "integrity": "sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.27.1.tgz", + "integrity": "sha512-oO02gcONcD5O1iTLi/6frMJBIwWEHceWGSGqrpCmEL8nogiS6J9PBlE48CaK20/Jx1LuRml9aDftLgdjXT8+Cw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", - "@babel/plugin-transform-optional-chaining": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1", + "@babel/plugin-transform-optional-chaining": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -489,14 +489,14 @@ } }, "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.9.tgz", - "integrity": "sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.27.1.tgz", + "integrity": "sha512-6BpaYGDavZqkI6yT+KSPdpZFfpnd68UKXbcjI9pJ13pvHhPrCKWOOLp+ysvMeA+DxnhuPpgIaRpxRxo5A9t5jw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/traverse": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/traverse": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -553,13 +553,13 @@ } }, "node_modules/@babel/plugin-syntax-import-assertions": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.26.0.tgz", - "integrity": "sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.27.1.tgz", + "integrity": "sha512-UT/Jrhw57xg4ILHLFnzFpPDlMbcdEicaAtjPQpbj9wa8T4r5KVWCimHcL/460g8Ht0DMxDyjsLgiWSkVjnwPFg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -569,13 +569,13 @@ } }, "node_modules/@babel/plugin-syntax-import-attributes": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz", - "integrity": "sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.27.1.tgz", + "integrity": "sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -615,13 +615,13 @@ } }, "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.25.9.tgz", - "integrity": "sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.27.1.tgz", + "integrity": "sha512-8Z4TGic6xW70FKThA5HYEKKyBpOOsucTOD1DjU3fZxDg+K3zBJcXMFnt/4yQiZnf5+MiOMSXQ9PaEK/Ilh1DeA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -631,15 +631,15 @@ } }, "node_modules/@babel/plugin-transform-async-generator-functions": { - "version": "7.26.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.26.8.tgz", - "integrity": "sha512-He9Ej2X7tNf2zdKMAGOsmg2MrFc+hfoAhd3po4cWfo/NWjzEAKa0oQruj1ROVUdl0e6fb6/kE/G3SSxE0lRJOg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.27.1.tgz", + "integrity": "sha512-eST9RrwlpaoJBDHShc+DS2SG4ATTi2MYNb4OxYkf3n+7eb49LWpnS+HSpVfW4x927qQwgk8A2hGNVaajAEw0EA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.26.5", - "@babel/helper-remap-async-to-generator": "^7.25.9", - "@babel/traverse": "^7.26.8" + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-remap-async-to-generator": "^7.27.1", + "@babel/traverse": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -649,15 +649,15 @@ } }, "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.25.9.tgz", - "integrity": "sha512-NT7Ejn7Z/LjUH0Gv5KsBCxh7BH3fbLTV0ptHvpeMvrt3cPThHfJfst9Wrb7S8EvJ7vRTFI7z+VAvFVEQn/m5zQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.27.1.tgz", + "integrity": "sha512-NREkZsZVJS4xmTr8qzE5y8AfIPqsdQfRuUiLRTEzb7Qii8iFWCyDKaUV2c0rCuh4ljDZ98ALHP/PetiBV2nddA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-remap-async-to-generator": "^7.25.9" + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-remap-async-to-generator": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -667,13 +667,13 @@ } }, "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.26.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.26.5.tgz", - "integrity": "sha512-chuTSY+hq09+/f5lMj8ZSYgCFpppV2CbYrhNFJ1BFoXpiWPnnAb7R0MqrafCpN8E1+YRrtM1MXZHJdIx8B6rMQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.27.1.tgz", + "integrity": "sha512-cnqkuOtZLapWYZUYM5rVIdv1nXYuFVIltZ6ZJ7nIj585QsjKM5dhL2Fu/lICXZ1OyIAFc7Qy+bvDAtTXqGrlhg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.26.5" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -683,13 +683,13 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.27.0.tgz", - "integrity": "sha512-u1jGphZ8uDI2Pj/HJj6YQ6XQLZCNjOlprjxB5SVz6rq2T6SwAR+CdrWK0CP7F+9rDVMXdB0+r6Am5G5aobOjAQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.27.1.tgz", + "integrity": "sha512-QEcFlMl9nGTgh1rn2nIeU5bkfb9BAjaQcWbiP4LvKxUot52ABcTkpcyJ7f2Q2U2RuQ84BNLgts3jRme2dTx6Fw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.26.5" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -699,14 +699,14 @@ } }, "node_modules/@babel/plugin-transform-class-properties": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.9.tgz", - "integrity": "sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.27.1.tgz", + "integrity": "sha512-D0VcalChDMtuRvJIu3U/fwWjf8ZMykz5iZsg77Nuj821vCKI3zCyRLwRdWbsuJ/uRwZhZ002QtCqIkwC/ZkvbA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-create-class-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -716,14 +716,14 @@ } }, "node_modules/@babel/plugin-transform-class-static-block": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.26.0.tgz", - "integrity": "sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.27.1.tgz", + "integrity": "sha512-s734HmYU78MVzZ++joYM+NkJusItbdRcbm+AGRgJCt3iA+yux0QpD9cBVdz3tKyrjVYWRl7j0mHSmv4lhV0aoA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-create-class-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -733,17 +733,17 @@ } }, "node_modules/@babel/plugin-transform-classes": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.9.tgz", - "integrity": "sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.27.1.tgz", + "integrity": "sha512-7iLhfFAubmpeJe/Wo2TVuDrykh/zlWXLzPNdL0Jqn/Xu8R3QQ8h9ff8FQoISZOsw74/HFqFI7NX63HN7QFIHKA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.9", - "@babel/helper-compilation-targets": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-replace-supers": "^7.25.9", - "@babel/traverse": "^7.25.9", + "@babel/helper-annotate-as-pure": "^7.27.1", + "@babel/helper-compilation-targets": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-replace-supers": "^7.27.1", + "@babel/traverse": "^7.27.1", "globals": "^11.1.0" }, "engines": { @@ -754,14 +754,14 @@ } }, "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.25.9.tgz", - "integrity": "sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.27.1.tgz", + "integrity": "sha512-lj9PGWvMTVksbWiDT2tW68zGS/cyo4AkZ/QTp0sQT0mjPopCmrSkzxeXkznjqBxzDI6TclZhOJbBmbBLjuOZUw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/template": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/template": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -771,13 +771,13 @@ } }, "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.25.9.tgz", - "integrity": "sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.27.1.tgz", + "integrity": "sha512-ttDCqhfvpE9emVkXbPD8vyxxh4TWYACVybGkDj+oReOGwnp066ITEivDlLwe0b1R0+evJ13IXQuLNB5w1fhC5Q==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -787,14 +787,14 @@ } }, "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.25.9.tgz", - "integrity": "sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.27.1.tgz", + "integrity": "sha512-gEbkDVGRvjj7+T1ivxrfgygpT7GUd4vmODtYpbs0gZATdkX8/iSnOtZSxiZnsgm1YjTgjI6VKBGSJJevkrclzw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -804,13 +804,13 @@ } }, "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.25.9.tgz", - "integrity": "sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.27.1.tgz", + "integrity": "sha512-MTyJk98sHvSs+cvZ4nOauwTTG1JeonDjSGvGGUNHreGQns+Mpt6WX/dVzWBHgg+dYZhkC4X+zTDfkTU+Vy9y7Q==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -820,14 +820,14 @@ } }, "node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.9.tgz", - "integrity": "sha512-0UfuJS0EsXbRvKnwcLjFtJy/Sxc5J5jhLHnFhy7u4zih97Hz6tJkLU+O+FMMrNZrosUPxDi6sYxJ/EA8jDiAog==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.27.1.tgz", + "integrity": "sha512-hkGcueTEzuhB30B3eJCbCYeCaaEQOmQR0AdvzpD4LoN0GXMWzzGSuRrxR2xTnCrvNbVwK9N6/jQ92GSLfiZWoQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -837,13 +837,13 @@ } }, "node_modules/@babel/plugin-transform-dynamic-import": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.9.tgz", - "integrity": "sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.27.1.tgz", + "integrity": "sha512-MHzkWQcEmjzzVW9j2q8LGjwGWpG2mjwaaB0BNQwst3FIjqsg8Ct/mIZlvSPJvfi9y2AC8mi/ktxbFVL9pZ1I4A==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -853,13 +853,13 @@ } }, "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.26.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.26.3.tgz", - "integrity": "sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.27.1.tgz", + "integrity": "sha512-uspvXnhHvGKf2r4VVtBpeFnuDWsJLQ6MF6lGJLC89jBR1uoVeqM416AZtTuhTezOfgHicpJQmoD5YUakO/YmXQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -869,13 +869,13 @@ } }, "node_modules/@babel/plugin-transform-export-namespace-from": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.9.tgz", - "integrity": "sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.27.1.tgz", + "integrity": "sha512-tQvHWSZ3/jH2xuq/vZDy0jNn+ZdXJeM8gHvX4lnJmsc3+50yPlWdZXIc5ay+umX+2/tJIqHqiEqcJvxlmIvRvQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -885,14 +885,14 @@ } }, "node_modules/@babel/plugin-transform-for-of": { - "version": "7.26.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.26.9.tgz", - "integrity": "sha512-Hry8AusVm8LW5BVFgiyUReuoGzPUpdHQQqJY5bZnbbf+ngOHWuCuYFKw/BqaaWlvEUrF91HMhDtEaI1hZzNbLg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.27.1.tgz", + "integrity": "sha512-BfbWFFEJFQzLCQ5N8VocnCtA8J1CLkNTe2Ms2wocj75dd6VpiqS5Z5quTYcUoo4Yq+DN0rtikODccuv7RU81sw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.26.5", - "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -902,15 +902,15 @@ } }, "node_modules/@babel/plugin-transform-function-name": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.9.tgz", - "integrity": "sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.27.1.tgz", + "integrity": "sha512-1bQeydJF9Nr1eBCMMbC+hdwmRlsv5XYOMu03YSWFwNs0HsAmtSxxF1fyuYPqemVldVyFmlCU7w8UE14LupUSZQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-compilation-targets": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/traverse": "^7.25.9" + "@babel/helper-compilation-targets": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/traverse": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -920,13 +920,13 @@ } }, "node_modules/@babel/plugin-transform-json-strings": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.9.tgz", - "integrity": "sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.27.1.tgz", + "integrity": "sha512-6WVLVJiTjqcQauBhn1LkICsR2H+zm62I3h9faTDKt1qP4jn2o72tSvqMwtGFKGTpojce0gJs+76eZ2uCHRZh0Q==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -936,13 +936,13 @@ } }, "node_modules/@babel/plugin-transform-literals": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.9.tgz", - "integrity": "sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.27.1.tgz", + "integrity": "sha512-0HCFSepIpLTkLcsi86GG3mTUzxV5jpmbv97hTETW3yzrAij8aqlD36toB1D0daVFJM8NK6GvKO0gslVQmm+zZA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -952,13 +952,13 @@ } }, "node_modules/@babel/plugin-transform-logical-assignment-operators": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.9.tgz", - "integrity": "sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.27.1.tgz", + "integrity": "sha512-SJvDs5dXxiae4FbSL1aBJlG4wvl594N6YEVVn9e3JGulwioy6z3oPjx/sQBO3Y4NwUu5HNix6KJ3wBZoewcdbw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -968,13 +968,13 @@ } }, "node_modules/@babel/plugin-transform-member-expression-literals": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.25.9.tgz", - "integrity": "sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.27.1.tgz", + "integrity": "sha512-hqoBX4dcZ1I33jCSWcXrP+1Ku7kdqXf1oeah7ooKOIiAdKQ+uqftgCFNOSzA5AMS2XIHEYeGFg4cKRCdpxzVOQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -984,14 +984,14 @@ } }, "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.25.9.tgz", - "integrity": "sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.27.1.tgz", + "integrity": "sha512-iCsytMg/N9/oFq6n+gFTvUYDZQOMK5kEdeYxmxt91fcJGycfxVP9CnrxoliM0oumFERba2i8ZtwRUCMhvP1LnA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-module-transforms": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1001,14 +1001,14 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.26.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.26.3.tgz", - "integrity": "sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.27.1.tgz", + "integrity": "sha512-OJguuwlTYlN0gBZFRPqwOGNWssZjfIUdS7HMYtN8c1KmwpwHFBwTeFZrg9XZa+DFTitWOW5iTAG7tyCUPsCCyw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.26.0", - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-module-transforms": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1018,16 +1018,16 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz", - "integrity": "sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.27.1.tgz", + "integrity": "sha512-w5N1XzsRbc0PQStASMksmUeqECuzKuTJer7kFagK8AXgpCMkeDMO5S+aaFb7A51ZYDF7XI34qsTX+fkHiIm5yA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-validator-identifier": "^7.25.9", - "@babel/traverse": "^7.25.9" + "@babel/helper-module-transforms": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1037,14 +1037,14 @@ } }, "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.25.9.tgz", - "integrity": "sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.27.1.tgz", + "integrity": "sha512-iQBE/xC5BV1OxJbp6WG7jq9IWiD+xxlZhLrdwpPkTX3ydmXdvoCpyfJN7acaIBZaOqTfr76pgzqBJflNbeRK+w==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-module-transforms": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1054,14 +1054,14 @@ } }, "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.25.9.tgz", - "integrity": "sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.27.1.tgz", + "integrity": "sha512-SstR5JYy8ddZvD6MhV0tM/j16Qds4mIpJTOd1Yu9J9pJjH93bxHECF7pgtc28XvkzTD6Pxcm/0Z73Hvk7kb3Ng==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1071,13 +1071,13 @@ } }, "node_modules/@babel/plugin-transform-new-target": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.25.9.tgz", - "integrity": "sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.27.1.tgz", + "integrity": "sha512-f6PiYeqXQ05lYq3TIfIDu/MtliKUbNwkGApPUvyo6+tc7uaR4cPjPe7DFPr15Uyycg2lZU6btZ575CuQoYh7MQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1087,13 +1087,13 @@ } }, "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { - "version": "7.26.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.26.6.tgz", - "integrity": "sha512-CKW8Vu+uUZneQCPtXmSBUC6NCAUdya26hWCElAWh5mVSlSRsmiCPUUDKb3Z0szng1hiAJa098Hkhg9o4SE35Qw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.27.1.tgz", + "integrity": "sha512-aGZh6xMo6q9vq1JGcw58lZ1Z0+i0xB2x0XaauNIUXd6O1xXc3RwoWEBlsTQrY4KQ9Jf0s5rgD6SiNkaUdJegTA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.26.5" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1103,13 +1103,13 @@ } }, "node_modules/@babel/plugin-transform-numeric-separator": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.9.tgz", - "integrity": "sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.27.1.tgz", + "integrity": "sha512-fdPKAcujuvEChxDBJ5c+0BTaS6revLV7CJL08e4m3de8qJfNIuCc2nc7XJYOjBoTMJeqSmwXJ0ypE14RCjLwaw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1119,15 +1119,15 @@ } }, "node_modules/@babel/plugin-transform-object-rest-spread": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.25.9.tgz", - "integrity": "sha512-fSaXafEE9CVHPweLYw4J0emp1t8zYTXyzN3UuG+lylqkvYd7RMrsOQ8TYx5RF231be0vqtFC6jnx3UmpJmKBYg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.27.1.tgz", + "integrity": "sha512-/sSliVc9gHE20/7D5qsdGlq7RG5NCDTWsAhyqzGuq174EtWJoGzIu1BQ7G56eDsTcy1jseBZwv50olSdXOlGuA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-compilation-targets": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/plugin-transform-parameters": "^7.25.9" + "@babel/helper-compilation-targets": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/plugin-transform-parameters": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1137,14 +1137,14 @@ } }, "node_modules/@babel/plugin-transform-object-super": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.25.9.tgz", - "integrity": "sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.27.1.tgz", + "integrity": "sha512-SFy8S9plRPbIcxlJ8A6mT/CxFdJx/c04JEctz4jf8YZaVS2px34j7NXRrlGlHkN/M2gnpL37ZpGRGVFLd3l8Ng==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-replace-supers": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-replace-supers": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1154,13 +1154,13 @@ } }, "node_modules/@babel/plugin-transform-optional-catch-binding": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.9.tgz", - "integrity": "sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.27.1.tgz", + "integrity": "sha512-txEAEKzYrHEX4xSZN4kJ+OfKXFVSWKB2ZxM9dpcE3wT7smwkNmXo5ORRlVzMVdJbD+Q8ILTgSD7959uj+3Dm3Q==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1170,14 +1170,14 @@ } }, "node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.9.tgz", - "integrity": "sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.27.1.tgz", + "integrity": "sha512-BQmKPPIuc8EkZgNKsv0X4bPmOoayeu4F1YCwx2/CfmDSXDbp7GnzlUH+/ul5VGfRg1AoFPsrIThlEBj2xb4CAg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1187,13 +1187,13 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.25.9.tgz", - "integrity": "sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.27.1.tgz", + "integrity": "sha512-018KRk76HWKeZ5l4oTj2zPpSh+NbGdt0st5S6x0pga6HgrjBOJb24mMDHorFopOOd6YHkLgOZ+zaCjZGPO4aKg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1203,14 +1203,14 @@ } }, "node_modules/@babel/plugin-transform-private-methods": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.9.tgz", - "integrity": "sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.27.1.tgz", + "integrity": "sha512-10FVt+X55AjRAYI9BrdISN9/AQWHqldOeZDUoLyif1Kn05a56xVBXb8ZouL8pZ9jem8QpXaOt8TS7RHUIS+GPA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-create-class-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1220,15 +1220,15 @@ } }, "node_modules/@babel/plugin-transform-private-property-in-object": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.9.tgz", - "integrity": "sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.27.1.tgz", + "integrity": "sha512-5J+IhqTi1XPa0DXF83jYOaARrX+41gOewWbkPyjMNRDqgOCqdffGh8L3f/Ek5utaEBZExjSAzcyjmV9SSAWObQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.9", - "@babel/helper-create-class-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-annotate-as-pure": "^7.27.1", + "@babel/helper-create-class-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1238,13 +1238,13 @@ } }, "node_modules/@babel/plugin-transform-property-literals": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.25.9.tgz", - "integrity": "sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.27.1.tgz", + "integrity": "sha512-oThy3BCuCha8kDZ8ZkgOg2exvPYUlprMukKQXI1r1pJ47NCvxfkEy8vK+r/hT9nF0Aa4H1WUPZZjHTFtAhGfmQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1254,14 +1254,13 @@ } }, "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.27.0.tgz", - "integrity": "sha512-LX/vCajUJQDqE7Aum/ELUMZAY19+cDpghxrnyt5I1tV6X5PyC86AOoWXWFYFeIvauyeSA6/ktn4tQVn/3ZifsA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.27.1.tgz", + "integrity": "sha512-B19lbbL7PMrKr52BNPjCqg1IyNUIjTcxKj8uX9zHO+PmWN93s19NDr/f69mIkEp2x9nmDJ08a7lgHaTTzvW7mw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.26.5", - "regenerator-transform": "^0.15.2" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1271,14 +1270,14 @@ } }, "node_modules/@babel/plugin-transform-regexp-modifiers": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.26.0.tgz", - "integrity": "sha512-vN6saax7lrA2yA/Pak3sCxuD6F5InBjn9IcrIKQPjpsLvuHYLVroTxjdlVRHjjBWxKOqIwpTXDkOssYT4BFdRw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.27.1.tgz", + "integrity": "sha512-TtEciroaiODtXvLZv4rmfMhkCv8jx3wgKpL68PuiPh2M4fvz5jhsA7697N1gMvkvr/JTF13DrFYyEbY9U7cVPA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1288,13 +1287,13 @@ } }, "node_modules/@babel/plugin-transform-reserved-words": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.25.9.tgz", - "integrity": "sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.27.1.tgz", + "integrity": "sha512-V2ABPHIJX4kC7HegLkYoDpfg9PVmuWy/i6vUM5eGK22bx4YVFD3M5F0QQnWQoDs6AGsUWTVOopBiMFQgHaSkVw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1304,14 +1303,14 @@ } }, "node_modules/@babel/plugin-transform-runtime": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.26.10.tgz", - "integrity": "sha512-NWaL2qG6HRpONTnj4JvDU6th4jYeZOJgu3QhmFTCihib0ermtOJqktA5BduGm3suhhVe9EMP9c9+mfJ/I9slqw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.27.1.tgz", + "integrity": "sha512-TqGF3desVsTcp3WrJGj4HfKokfCXCLcHpt4PJF0D8/iT6LPd9RS82Upw3KPeyr6B22Lfd3DO8MVrmp0oRkUDdw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.25.9", - "@babel/helper-plugin-utils": "^7.26.5", + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", "babel-plugin-polyfill-corejs2": "^0.4.10", "babel-plugin-polyfill-corejs3": "^0.11.0", "babel-plugin-polyfill-regenerator": "^0.6.1", @@ -1335,13 +1334,13 @@ } }, "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.25.9.tgz", - "integrity": "sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.27.1.tgz", + "integrity": "sha512-N/wH1vcn4oYawbJ13Y/FxcQrWk63jhfNa7jef0ih7PHSIHX2LB7GWE1rkPrOnka9kwMxb6hMl19p7lidA+EHmQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1351,14 +1350,14 @@ } }, "node_modules/@babel/plugin-transform-spread": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.25.9.tgz", - "integrity": "sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.27.1.tgz", + "integrity": "sha512-kpb3HUqaILBJcRFVhFUs6Trdd4mkrzcGXss+6/mxUd273PfbWqSDHRzMT2234gIg2QYfAjvXLSquP1xECSg09Q==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1368,13 +1367,13 @@ } }, "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.25.9.tgz", - "integrity": "sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.27.1.tgz", + "integrity": "sha512-lhInBO5bi/Kowe2/aLdBAawijx+q1pQzicSgnkB6dUPc1+RC8QmJHKf2OjvU+NZWitguJHEaEmbV6VWEouT58g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1384,13 +1383,13 @@ } }, "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.26.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.26.8.tgz", - "integrity": "sha512-OmGDL5/J0CJPJZTHZbi2XpO0tyT2Ia7fzpW5GURwdtp2X3fMmN8au/ej6peC/T33/+CRiIpA8Krse8hFGVmT5Q==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.27.1.tgz", + "integrity": "sha512-fBJKiV7F2DxZUkg5EtHKXQdbsbURW3DZKQUWphDum0uRP6eHGGa/He9mc0mypL680pb+e/lDIthRohlv8NCHkg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.26.5" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1400,13 +1399,13 @@ } }, "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.27.0.tgz", - "integrity": "sha512-+LLkxA9rKJpNoGsbLnAgOCdESl73vwYn+V6b+5wHbrE7OGKVDPHIQvbFSzqE6rwqaCw2RE+zdJrlLkcf8YOA0w==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.27.1.tgz", + "integrity": "sha512-RiSILC+nRJM7FY5srIyc4/fGIwUhyDuuBSdWn4y6yT6gm652DpCHZjIipgn6B7MQ1ITOUnAKWixEUjQRIBIcLw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.26.5" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1416,13 +1415,13 @@ } }, "node_modules/@babel/plugin-transform-unicode-escapes": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.25.9.tgz", - "integrity": "sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.27.1.tgz", + "integrity": "sha512-Ysg4v6AmF26k9vpfFuTZg8HRfVWzsh1kVfowA23y9j/Gu6dOuahdUVhkLqpObp3JIv27MLSii6noRnuKN8H0Mg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1432,14 +1431,14 @@ } }, "node_modules/@babel/plugin-transform-unicode-property-regex": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.25.9.tgz", - "integrity": "sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.27.1.tgz", + "integrity": "sha512-uW20S39PnaTImxp39O5qFlHLS9LJEmANjMG7SxIhap8rCHqu0Ik+tLEPX5DKmHn6CsWQ7j3lix2tFOa5YtL12Q==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1449,14 +1448,14 @@ } }, "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.25.9.tgz", - "integrity": "sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.27.1.tgz", + "integrity": "sha512-xvINq24TRojDuyt6JGtHmkVkrfVV3FPT16uytxImLeBZqW3/H52yN+kM1MGuyPkIQxrzKwPHs5U/MP3qKyzkGw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1466,14 +1465,14 @@ } }, "node_modules/@babel/plugin-transform-unicode-sets-regex": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.9.tgz", - "integrity": "sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.27.1.tgz", + "integrity": "sha512-EtkOujbc4cgvb0mlpQefi4NTPBzhSIevblFevACNLUspmrALgmEBdL/XfnyyITfd8fKBZrZys92zOWcik7j9Tw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1483,75 +1482,75 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.26.9", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.9.tgz", - "integrity": "sha512-vX3qPGE8sEKEAZCWk05k3cpTAE3/nOYca++JA+Rd0z2NCNzabmYvEiSShKzm10zdquOIAVXsy2Ei/DTW34KlKQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.27.1.tgz", + "integrity": "sha512-TZ5USxFpLgKDpdEt8YWBR7p6g+bZo6sHaXLqP2BY/U0acaoI8FTVflcYCr/v94twM1C5IWFdZ/hscq9WjUeLXA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.26.8", - "@babel/helper-compilation-targets": "^7.26.5", - "@babel/helper-plugin-utils": "^7.26.5", - "@babel/helper-validator-option": "^7.25.9", - "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.25.9", - "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.25.9", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.25.9", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.25.9", - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.25.9", + "@babel/compat-data": "^7.27.1", + "@babel/helper-compilation-targets": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-validator-option": "^7.27.1", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.27.1", + "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.27.1", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.27.1", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.27.1", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.27.1", "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", - "@babel/plugin-syntax-import-assertions": "^7.26.0", - "@babel/plugin-syntax-import-attributes": "^7.26.0", + "@babel/plugin-syntax-import-assertions": "^7.27.1", + "@babel/plugin-syntax-import-attributes": "^7.27.1", "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", - "@babel/plugin-transform-arrow-functions": "^7.25.9", - "@babel/plugin-transform-async-generator-functions": "^7.26.8", - "@babel/plugin-transform-async-to-generator": "^7.25.9", - "@babel/plugin-transform-block-scoped-functions": "^7.26.5", - "@babel/plugin-transform-block-scoping": "^7.25.9", - "@babel/plugin-transform-class-properties": "^7.25.9", - "@babel/plugin-transform-class-static-block": "^7.26.0", - "@babel/plugin-transform-classes": "^7.25.9", - "@babel/plugin-transform-computed-properties": "^7.25.9", - "@babel/plugin-transform-destructuring": "^7.25.9", - "@babel/plugin-transform-dotall-regex": "^7.25.9", - "@babel/plugin-transform-duplicate-keys": "^7.25.9", - "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.25.9", - "@babel/plugin-transform-dynamic-import": "^7.25.9", - "@babel/plugin-transform-exponentiation-operator": "^7.26.3", - "@babel/plugin-transform-export-namespace-from": "^7.25.9", - "@babel/plugin-transform-for-of": "^7.26.9", - "@babel/plugin-transform-function-name": "^7.25.9", - "@babel/plugin-transform-json-strings": "^7.25.9", - "@babel/plugin-transform-literals": "^7.25.9", - "@babel/plugin-transform-logical-assignment-operators": "^7.25.9", - "@babel/plugin-transform-member-expression-literals": "^7.25.9", - "@babel/plugin-transform-modules-amd": "^7.25.9", - "@babel/plugin-transform-modules-commonjs": "^7.26.3", - "@babel/plugin-transform-modules-systemjs": "^7.25.9", - "@babel/plugin-transform-modules-umd": "^7.25.9", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.25.9", - "@babel/plugin-transform-new-target": "^7.25.9", - "@babel/plugin-transform-nullish-coalescing-operator": "^7.26.6", - "@babel/plugin-transform-numeric-separator": "^7.25.9", - "@babel/plugin-transform-object-rest-spread": "^7.25.9", - "@babel/plugin-transform-object-super": "^7.25.9", - "@babel/plugin-transform-optional-catch-binding": "^7.25.9", - "@babel/plugin-transform-optional-chaining": "^7.25.9", - "@babel/plugin-transform-parameters": "^7.25.9", - "@babel/plugin-transform-private-methods": "^7.25.9", - "@babel/plugin-transform-private-property-in-object": "^7.25.9", - "@babel/plugin-transform-property-literals": "^7.25.9", - "@babel/plugin-transform-regenerator": "^7.25.9", - "@babel/plugin-transform-regexp-modifiers": "^7.26.0", - "@babel/plugin-transform-reserved-words": "^7.25.9", - "@babel/plugin-transform-shorthand-properties": "^7.25.9", - "@babel/plugin-transform-spread": "^7.25.9", - "@babel/plugin-transform-sticky-regex": "^7.25.9", - "@babel/plugin-transform-template-literals": "^7.26.8", - "@babel/plugin-transform-typeof-symbol": "^7.26.7", - "@babel/plugin-transform-unicode-escapes": "^7.25.9", - "@babel/plugin-transform-unicode-property-regex": "^7.25.9", - "@babel/plugin-transform-unicode-regex": "^7.25.9", - "@babel/plugin-transform-unicode-sets-regex": "^7.25.9", + "@babel/plugin-transform-arrow-functions": "^7.27.1", + "@babel/plugin-transform-async-generator-functions": "^7.27.1", + "@babel/plugin-transform-async-to-generator": "^7.27.1", + "@babel/plugin-transform-block-scoped-functions": "^7.27.1", + "@babel/plugin-transform-block-scoping": "^7.27.1", + "@babel/plugin-transform-class-properties": "^7.27.1", + "@babel/plugin-transform-class-static-block": "^7.27.1", + "@babel/plugin-transform-classes": "^7.27.1", + "@babel/plugin-transform-computed-properties": "^7.27.1", + "@babel/plugin-transform-destructuring": "^7.27.1", + "@babel/plugin-transform-dotall-regex": "^7.27.1", + "@babel/plugin-transform-duplicate-keys": "^7.27.1", + "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.27.1", + "@babel/plugin-transform-dynamic-import": "^7.27.1", + "@babel/plugin-transform-exponentiation-operator": "^7.27.1", + "@babel/plugin-transform-export-namespace-from": "^7.27.1", + "@babel/plugin-transform-for-of": "^7.27.1", + "@babel/plugin-transform-function-name": "^7.27.1", + "@babel/plugin-transform-json-strings": "^7.27.1", + "@babel/plugin-transform-literals": "^7.27.1", + "@babel/plugin-transform-logical-assignment-operators": "^7.27.1", + "@babel/plugin-transform-member-expression-literals": "^7.27.1", + "@babel/plugin-transform-modules-amd": "^7.27.1", + "@babel/plugin-transform-modules-commonjs": "^7.27.1", + "@babel/plugin-transform-modules-systemjs": "^7.27.1", + "@babel/plugin-transform-modules-umd": "^7.27.1", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.27.1", + "@babel/plugin-transform-new-target": "^7.27.1", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.27.1", + "@babel/plugin-transform-numeric-separator": "^7.27.1", + "@babel/plugin-transform-object-rest-spread": "^7.27.1", + "@babel/plugin-transform-object-super": "^7.27.1", + "@babel/plugin-transform-optional-catch-binding": "^7.27.1", + "@babel/plugin-transform-optional-chaining": "^7.27.1", + "@babel/plugin-transform-parameters": "^7.27.1", + "@babel/plugin-transform-private-methods": "^7.27.1", + "@babel/plugin-transform-private-property-in-object": "^7.27.1", + "@babel/plugin-transform-property-literals": "^7.27.1", + "@babel/plugin-transform-regenerator": "^7.27.1", + "@babel/plugin-transform-regexp-modifiers": "^7.27.1", + "@babel/plugin-transform-reserved-words": "^7.27.1", + "@babel/plugin-transform-shorthand-properties": "^7.27.1", + "@babel/plugin-transform-spread": "^7.27.1", + "@babel/plugin-transform-sticky-regex": "^7.27.1", + "@babel/plugin-transform-template-literals": "^7.27.1", + "@babel/plugin-transform-typeof-symbol": "^7.27.1", + "@babel/plugin-transform-unicode-escapes": "^7.27.1", + "@babel/plugin-transform-unicode-property-regex": "^7.27.1", + "@babel/plugin-transform-unicode-regex": "^7.27.1", + "@babel/plugin-transform-unicode-sets-regex": "^7.27.1", "@babel/preset-modules": "0.1.6-no-external-plugins", "babel-plugin-polyfill-corejs2": "^0.4.10", "babel-plugin-polyfill-corejs3": "^0.11.0", @@ -1592,44 +1591,41 @@ } }, "node_modules/@babel/runtime": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.0.tgz", - "integrity": "sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.1.tgz", + "integrity": "sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==", "license": "MIT", - "dependencies": { - "regenerator-runtime": "^0.14.0" - }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/template": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.0.tgz", - "integrity": "sha512-2ncevenBqXI6qRMukPlXwHKHchC7RyMuu4xv5JBXRfOGVcTy1mXCD12qrp7Jsoxll1EV3+9sE4GugBVRjT2jFA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.1.tgz", + "integrity": "sha512-Fyo3ghWMqkHHpHQCoBs2VnYjR4iWFFjguTDEqA5WgZDOrFesVjMhMM2FSqTKSoUSDO1VQtavj8NFpdRBEvJTtg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.26.2", - "@babel/parser": "^7.27.0", - "@babel/types": "^7.27.0" + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.1", + "@babel/types": "^7.27.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.0.tgz", - "integrity": "sha512-19lYZFzYVQkkHkl4Cy4WrAVcqBkgvV2YM2TU3xG6DIwO7O3ecbDPfW3yM3bjAGcqcQHi+CCtjMR3dIEHxsd6bA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.1.tgz", + "integrity": "sha512-ZCYtZciz1IWJB4U61UPu4KEaqyfj+r5T1Q5mqPo+IBpcG9kHv30Z0aD8LXPgC1trYa6rK0orRyAhqUgk4MjmEg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.26.2", - "@babel/generator": "^7.27.0", - "@babel/parser": "^7.27.0", - "@babel/template": "^7.27.0", - "@babel/types": "^7.27.0", + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.27.1", + "@babel/parser": "^7.27.1", + "@babel/template": "^7.27.1", + "@babel/types": "^7.27.1", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -1638,14 +1634,14 @@ } }, "node_modules/@babel/types": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.0.tgz", - "integrity": "sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", + "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.25.9", - "@babel/helper-validator-identifier": "^7.25.9" + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1673,9 +1669,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.2.tgz", - "integrity": "sha512-wCIboOL2yXZym2cgm6mlA742s9QeJ8DjGVaL39dLN4rRwrOgOyYSnOaFPhKZGLb2ngj4EyfAFjsNJwPXZvseag==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.3.tgz", + "integrity": "sha512-W8bFfPA8DowP8l//sxjJLSLkD8iEjMc7cBVyP+u4cEv9sM7mdUCkgsj+t0n/BWPFtv7WWCN5Yzj0N6FJNUUqBQ==", "cpu": [ "ppc64" ], @@ -1690,9 +1686,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.2.tgz", - "integrity": "sha512-NQhH7jFstVY5x8CKbcfa166GoV0EFkaPkCKBQkdPJFvo5u+nGXLEH/ooniLb3QI8Fk58YAx7nsPLozUWfCBOJA==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.3.tgz", + "integrity": "sha512-PuwVXbnP87Tcff5I9ngV0lmiSu40xw1At6i3GsU77U7cjDDB4s0X2cyFuBiDa1SBk9DnvWwnGvVaGBqoFWPb7A==", "cpu": [ "arm" ], @@ -1707,9 +1703,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.2.tgz", - "integrity": "sha512-5ZAX5xOmTligeBaeNEPnPaeEuah53Id2tX4c2CVP3JaROTH+j4fnfHCkr1PjXMd78hMst+TlkfKcW/DlTq0i4w==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.3.tgz", + "integrity": "sha512-XelR6MzjlZuBM4f5z2IQHK6LkK34Cvv6Rj2EntER3lwCBFdg6h2lKbtRjpTTsdEjD/WSe1q8UyPBXP1x3i/wYQ==", "cpu": [ "arm64" ], @@ -1724,9 +1720,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.2.tgz", - "integrity": "sha512-Ffcx+nnma8Sge4jzddPHCZVRvIfQ0kMsUsCMcJRHkGJ1cDmhe4SsrYIjLUKn1xpHZybmOqCWwB0zQvsjdEHtkg==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.3.tgz", + "integrity": "sha512-ogtTpYHT/g1GWS/zKM0cc/tIebFjm1F9Aw1boQ2Y0eUQ+J89d0jFY//s9ei9jVIlkYi8AfOjiixcLJSGNSOAdQ==", "cpu": [ "x64" ], @@ -1741,9 +1737,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.2.tgz", - "integrity": "sha512-MpM6LUVTXAzOvN4KbjzU/q5smzryuoNjlriAIx+06RpecwCkL9JpenNzpKd2YMzLJFOdPqBpuub6eVRP5IgiSA==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.3.tgz", + "integrity": "sha512-eESK5yfPNTqpAmDfFWNsOhmIOaQA59tAcF/EfYvo5/QWQCzXn5iUSOnqt3ra3UdzBv073ykTtmeLJZGt3HhA+w==", "cpu": [ "arm64" ], @@ -1758,9 +1754,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.2.tgz", - "integrity": "sha512-5eRPrTX7wFyuWe8FqEFPG2cU0+butQQVNcT4sVipqjLYQjjh8a8+vUTfgBKM88ObB85ahsnTwF7PSIt6PG+QkA==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.3.tgz", + "integrity": "sha512-Kd8glo7sIZtwOLcPbW0yLpKmBNWMANZhrC1r6K++uDR2zyzb6AeOYtI6udbtabmQpFaxJ8uduXMAo1gs5ozz8A==", "cpu": [ "x64" ], @@ -1775,9 +1771,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.2.tgz", - "integrity": "sha512-mLwm4vXKiQ2UTSX4+ImyiPdiHjiZhIaE9QvC7sw0tZ6HoNMjYAqQpGyui5VRIi5sGd+uWq940gdCbY3VLvsO1w==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.3.tgz", + "integrity": "sha512-EJiyS70BYybOBpJth3M0KLOus0n+RRMKTYzhYhFeMwp7e/RaajXvP+BWlmEXNk6uk+KAu46j/kaQzr6au+JcIw==", "cpu": [ "arm64" ], @@ -1792,9 +1788,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.2.tgz", - "integrity": "sha512-6qyyn6TjayJSwGpm8J9QYYGQcRgc90nmfdUb0O7pp1s4lTY+9D0H9O02v5JqGApUyiHOtkz6+1hZNvNtEhbwRQ==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.3.tgz", + "integrity": "sha512-Q+wSjaLpGxYf7zC0kL0nDlhsfuFkoN+EXrx2KSB33RhinWzejOd6AvgmP5JbkgXKmjhmpfgKZq24pneodYqE8Q==", "cpu": [ "x64" ], @@ -1809,9 +1805,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.2.tgz", - "integrity": "sha512-UHBRgJcmjJv5oeQF8EpTRZs/1knq6loLxTsjc3nxO9eXAPDLcWW55flrMVc97qFPbmZP31ta1AZVUKQzKTzb0g==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.3.tgz", + "integrity": "sha512-dUOVmAUzuHy2ZOKIHIKHCm58HKzFqd+puLaS424h6I85GlSDRZIA5ycBixb3mFgM0Jdh+ZOSB6KptX30DD8YOQ==", "cpu": [ "arm" ], @@ -1826,9 +1822,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.2.tgz", - "integrity": "sha512-gq/sjLsOyMT19I8obBISvhoYiZIAaGF8JpeXu1u8yPv8BE5HlWYobmlsfijFIZ9hIVGYkbdFhEqC0NvM4kNO0g==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.3.tgz", + "integrity": "sha512-xCUgnNYhRD5bb1C1nqrDV1PfkwgbswTTBRbAd8aH5PhYzikdf/ddtsYyMXFfGSsb/6t6QaPSzxtbfAZr9uox4A==", "cpu": [ "arm64" ], @@ -1843,9 +1839,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.2.tgz", - "integrity": "sha512-bBYCv9obgW2cBP+2ZWfjYTU+f5cxRoGGQ5SeDbYdFCAZpYWrfjjfYwvUpP8MlKbP0nwZ5gyOU/0aUzZ5HWPuvQ==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.3.tgz", + "integrity": "sha512-yplPOpczHOO4jTYKmuYuANI3WhvIPSVANGcNUeMlxH4twz/TeXuzEP41tGKNGWJjuMhotpGabeFYGAOU2ummBw==", "cpu": [ "ia32" ], @@ -1860,9 +1856,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.2.tgz", - "integrity": "sha512-SHNGiKtvnU2dBlM5D8CXRFdd+6etgZ9dXfaPCeJtz+37PIUlixvlIhI23L5khKXs3DIzAn9V8v+qb1TRKrgT5w==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.3.tgz", + "integrity": "sha512-P4BLP5/fjyihmXCELRGrLd793q/lBtKMQl8ARGpDxgzgIKJDRJ/u4r1A/HgpBpKpKZelGct2PGI4T+axcedf6g==", "cpu": [ "loong64" ], @@ -1877,9 +1873,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.2.tgz", - "integrity": "sha512-hDDRlzE6rPeoj+5fsADqdUZl1OzqDYow4TB4Y/3PlKBD0ph1e6uPHzIQcv2Z65u2K0kpeByIyAjCmjn1hJgG0Q==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.3.tgz", + "integrity": "sha512-eRAOV2ODpu6P5divMEMa26RRqb2yUoYsuQQOuFUexUoQndm4MdpXXDBbUoKIc0iPa4aCO7gIhtnYomkn2x+bag==", "cpu": [ "mips64el" ], @@ -1894,9 +1890,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.2.tgz", - "integrity": "sha512-tsHu2RRSWzipmUi9UBDEzc0nLc4HtpZEI5Ba+Omms5456x5WaNuiG3u7xh5AO6sipnJ9r4cRWQB2tUjPyIkc6g==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.3.tgz", + "integrity": "sha512-ZC4jV2p7VbzTlnl8nZKLcBkfzIf4Yad1SJM4ZMKYnJqZFD4rTI+pBG65u8ev4jk3/MPwY9DvGn50wi3uhdaghg==", "cpu": [ "ppc64" ], @@ -1911,9 +1907,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.2.tgz", - "integrity": "sha512-k4LtpgV7NJQOml/10uPU0s4SAXGnowi5qBSjaLWMojNCUICNu7TshqHLAEbkBdAszL5TabfvQ48kK84hyFzjnw==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.3.tgz", + "integrity": "sha512-LDDODcFzNtECTrUUbVCs6j9/bDVqy7DDRsuIXJg6so+mFksgwG7ZVnTruYi5V+z3eE5y+BJZw7VvUadkbfg7QA==", "cpu": [ "riscv64" ], @@ -1928,9 +1924,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.2.tgz", - "integrity": "sha512-GRa4IshOdvKY7M/rDpRR3gkiTNp34M0eLTaC1a08gNrh4u488aPhuZOCpkF6+2wl3zAN7L7XIpOFBhnaE3/Q8Q==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.3.tgz", + "integrity": "sha512-s+w/NOY2k0yC2p9SLen+ymflgcpRkvwwa02fqmAwhBRI3SC12uiS10edHHXlVWwfAagYSY5UpmT/zISXPMW3tQ==", "cpu": [ "s390x" ], @@ -1945,9 +1941,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.2.tgz", - "integrity": "sha512-QInHERlqpTTZ4FRB0fROQWXcYRD64lAoiegezDunLpalZMjcUcld3YzZmVJ2H/Cp0wJRZ8Xtjtj0cEHhYc/uUg==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.3.tgz", + "integrity": "sha512-nQHDz4pXjSDC6UfOE1Fw9Q8d6GCAd9KdvMZpfVGWSJztYCarRgSDfOVBY5xwhQXseiyxapkiSJi/5/ja8mRFFA==", "cpu": [ "x64" ], @@ -1962,9 +1958,9 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.2.tgz", - "integrity": "sha512-talAIBoY5M8vHc6EeI2WW9d/CkiO9MQJ0IOWX8hrLhxGbro/vBXJvaQXefW2cP0z0nQVTdQ/eNyGFV1GSKrxfw==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.3.tgz", + "integrity": "sha512-1QaLtOWq0mzK6tzzp0jRN3eccmN3hezey7mhLnzC6oNlJoUJz4nym5ZD7mDnS/LZQgkrhEbEiTn515lPeLpgWA==", "cpu": [ "arm64" ], @@ -1979,9 +1975,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.2.tgz", - "integrity": "sha512-voZT9Z+tpOxrvfKFyfDYPc4DO4rk06qamv1a/fkuzHpiVBMOhpjK+vBmWM8J1eiB3OLSMFYNaOaBNLXGChf5tg==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.3.tgz", + "integrity": "sha512-i5Hm68HXHdgv8wkrt+10Bc50zM0/eonPb/a/OFVfB6Qvpiirco5gBA5bz7S2SHuU+Y4LWn/zehzNX14Sp4r27g==", "cpu": [ "x64" ], @@ -1996,9 +1992,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.2.tgz", - "integrity": "sha512-dcXYOC6NXOqcykeDlwId9kB6OkPUxOEqU+rkrYVqJbK2hagWOMrsTGsMr8+rW02M+d5Op5NNlgMmjzecaRf7Tg==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.3.tgz", + "integrity": "sha512-zGAVApJEYTbOC6H/3QBr2mq3upG/LBEXr85/pTtKiv2IXcgKV0RT0QA/hSXZqSvLEpXeIxah7LczB4lkiYhTAQ==", "cpu": [ "arm64" ], @@ -2013,9 +2009,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.2.tgz", - "integrity": "sha512-t/TkWwahkH0Tsgoq1Ju7QfgGhArkGLkF1uYz8nQS/PPFlXbP5YgRpqQR3ARRiC2iXoLTWFxc6DJMSK10dVXluw==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.3.tgz", + "integrity": "sha512-fpqctI45NnCIDKBH5AXQBsD0NDPbEFczK98hk/aa6HJxbl+UtLkJV2+Bvy5hLSLk3LHmqt0NTkKNso1A9y1a4w==", "cpu": [ "x64" ], @@ -2030,9 +2026,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.2.tgz", - "integrity": "sha512-cfZH1co2+imVdWCjd+D1gf9NjkchVhhdpgb1q5y6Hcv9TP6Zi9ZG/beI3ig8TvwT9lH9dlxLq5MQBBgwuj4xvA==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.3.tgz", + "integrity": "sha512-ROJhm7d8bk9dMCUZjkS8fgzsPAZEjtRJqCAmVgB0gMrvG7hfmPmz9k1rwO4jSiblFjYmNvbECL9uhaPzONMfgA==", "cpu": [ "x64" ], @@ -2047,9 +2043,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.2.tgz", - "integrity": "sha512-7Loyjh+D/Nx/sOTzV8vfbB3GJuHdOQyrOryFdZvPHLf42Tk9ivBU5Aedi7iyX+x6rbn2Mh68T4qq1SDqJBQO5Q==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.3.tgz", + "integrity": "sha512-YWcow8peiHpNBiIXHwaswPnAXLsLVygFwCB3A7Bh5jRkIBFWHGmNQ48AlX4xDvQNoMZlPYzjVOQDYEzWCqufMQ==", "cpu": [ "arm64" ], @@ -2064,9 +2060,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.2.tgz", - "integrity": "sha512-WRJgsz9un0nqZJ4MfhabxaD9Ft8KioqU3JMinOTvobbX6MOSUigSBlogP8QB3uxpJDsFS6yN+3FDBdqE5lg9kg==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.3.tgz", + "integrity": "sha512-qspTZOIGoXVS4DpNqUYUs9UxVb04khS1Degaw/MnfMe7goQ3lTfQ13Vw4qY/Nj0979BGvMRpAYbs/BAxEvU8ew==", "cpu": [ "ia32" ], @@ -2081,9 +2077,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.2.tgz", - "integrity": "sha512-kM3HKb16VIXZyIeVrM1ygYmZBKybX8N4p754bw390wGO3Tf2j4L2/WYL+4suWujpgf6GBYs3jv7TyUivdd05JA==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.3.tgz", + "integrity": "sha512-ICgUR+kPimx0vvRzf+N/7L7tVSQeE3BYY+NhHRHXS1kBuPO7z2+7ea2HbhDyZdTephgvNvKrlDDKUexuCVBVvg==", "cpu": [ "x64" ], @@ -2555,9 +2551,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.40.0.tgz", - "integrity": "sha512-+Fbls/diZ0RDerhE8kyC6hjADCXA1K4yVNlH0EYfd2XjyH0UGgzaQ8MlT0pCXAThfxv3QUAczHaL+qSv1E4/Cg==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.40.1.tgz", + "integrity": "sha512-kxz0YeeCrRUHz3zyqvd7n+TVRlNyTifBsmnmNPtk3hQURUyG9eAB+usz6DAwagMusjx/zb3AjvDUvhFGDAexGw==", "cpu": [ "arm" ], @@ -2569,9 +2565,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.40.0.tgz", - "integrity": "sha512-PPA6aEEsTPRz+/4xxAmaoWDqh67N7wFbgFUJGMnanCFs0TV99M0M8QhhaSCks+n6EbQoFvLQgYOGXxlMGQe/6w==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.40.1.tgz", + "integrity": "sha512-PPkxTOisoNC6TpnDKatjKkjRMsdaWIhyuMkA4UsBXT9WEZY4uHezBTjs6Vl4PbqQQeu6oION1w2voYZv9yquCw==", "cpu": [ "arm64" ], @@ -2583,9 +2579,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.40.0.tgz", - "integrity": "sha512-GwYOcOakYHdfnjjKwqpTGgn5a6cUX7+Ra2HeNj/GdXvO2VJOOXCiYYlRFU4CubFM67EhbmzLOmACKEfvp3J1kQ==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.40.1.tgz", + "integrity": "sha512-VWXGISWFY18v/0JyNUy4A46KCFCb9NVsH+1100XP31lud+TzlezBbz24CYzbnA4x6w4hx+NYCXDfnvDVO6lcAA==", "cpu": [ "arm64" ], @@ -2597,9 +2593,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.40.0.tgz", - "integrity": "sha512-CoLEGJ+2eheqD9KBSxmma6ld01czS52Iw0e2qMZNpPDlf7Z9mj8xmMemxEucinev4LgHalDPczMyxzbq+Q+EtA==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.40.1.tgz", + "integrity": "sha512-nIwkXafAI1/QCS7pxSpv/ZtFW6TXcNUEHAIA9EIyw5OzxJZQ1YDrX+CL6JAIQgZ33CInl1R6mHet9Y/UZTg2Bw==", "cpu": [ "x64" ], @@ -2611,9 +2607,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.40.0.tgz", - "integrity": "sha512-r7yGiS4HN/kibvESzmrOB/PxKMhPTlz+FcGvoUIKYoTyGd5toHp48g1uZy1o1xQvybwwpqpe010JrcGG2s5nkg==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.40.1.tgz", + "integrity": "sha512-BdrLJ2mHTrIYdaS2I99mriyJfGGenSaP+UwGi1kB9BLOCu9SR8ZpbkmmalKIALnRw24kM7qCN0IOm6L0S44iWw==", "cpu": [ "arm64" ], @@ -2625,9 +2621,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.40.0.tgz", - "integrity": "sha512-mVDxzlf0oLzV3oZOr0SMJ0lSDd3xC4CmnWJ8Val8isp9jRGl5Dq//LLDSPFrasS7pSm6m5xAcKaw3sHXhBjoRw==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.40.1.tgz", + "integrity": "sha512-VXeo/puqvCG8JBPNZXZf5Dqq7BzElNJzHRRw3vjBE27WujdzuOPecDPc/+1DcdcTptNBep3861jNq0mYkT8Z6Q==", "cpu": [ "x64" ], @@ -2639,9 +2635,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.40.0.tgz", - "integrity": "sha512-y/qUMOpJxBMy8xCXD++jeu8t7kzjlOCkoxxajL58G62PJGBZVl/Gwpm7JK9+YvlB701rcQTzjUZ1JgUoPTnoQA==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.40.1.tgz", + "integrity": "sha512-ehSKrewwsESPt1TgSE/na9nIhWCosfGSFqv7vwEtjyAqZcvbGIg4JAcV7ZEh2tfj/IlfBeZjgOXm35iOOjadcg==", "cpu": [ "arm" ], @@ -2653,9 +2649,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.40.0.tgz", - "integrity": "sha512-GoCsPibtVdJFPv/BOIvBKO/XmwZLwaNWdyD8TKlXuqp0veo2sHE+A/vpMQ5iSArRUz/uaoj4h5S6Pn0+PdhRjg==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.40.1.tgz", + "integrity": "sha512-m39iO/aaurh5FVIu/F4/Zsl8xppd76S4qoID8E+dSRQvTyZTOI2gVk3T4oqzfq1PtcvOfAVlwLMK3KRQMaR8lg==", "cpu": [ "arm" ], @@ -2667,9 +2663,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.40.0.tgz", - "integrity": "sha512-L5ZLphTjjAD9leJzSLI7rr8fNqJMlGDKlazW2tX4IUF9P7R5TMQPElpH82Q7eNIDQnQlAyiNVfRPfP2vM5Avvg==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.40.1.tgz", + "integrity": "sha512-Y+GHnGaku4aVLSgrT0uWe2o2Rq8te9hi+MwqGF9r9ORgXhmHK5Q71N757u0F8yU1OIwUIFy6YiJtKjtyktk5hg==", "cpu": [ "arm64" ], @@ -2681,9 +2677,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.40.0.tgz", - "integrity": "sha512-ATZvCRGCDtv1Y4gpDIXsS+wfFeFuLwVxyUBSLawjgXK2tRE6fnsQEkE4csQQYWlBlsFztRzCnBvWVfcae/1qxQ==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.40.1.tgz", + "integrity": "sha512-jEwjn3jCA+tQGswK3aEWcD09/7M5wGwc6+flhva7dsQNRZZTe30vkalgIzV4tjkopsTS9Jd7Y1Bsj6a4lzz8gQ==", "cpu": [ "arm64" ], @@ -2695,9 +2691,9 @@ ] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.40.0.tgz", - "integrity": "sha512-wG9e2XtIhd++QugU5MD9i7OnpaVb08ji3P1y/hNbxrQ3sYEelKJOq1UJ5dXczeo6Hj2rfDEL5GdtkMSVLa/AOg==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.40.1.tgz", + "integrity": "sha512-ySyWikVhNzv+BV/IDCsrraOAZ3UaC8SZB67FZlqVwXwnFhPihOso9rPOxzZbjp81suB1O2Topw+6Ug3JNegejQ==", "cpu": [ "loong64" ], @@ -2709,9 +2705,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.40.0.tgz", - "integrity": "sha512-vgXfWmj0f3jAUvC7TZSU/m/cOE558ILWDzS7jBhiCAFpY2WEBn5jqgbqvmzlMjtp8KlLcBlXVD2mkTSEQE6Ixw==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.40.1.tgz", + "integrity": "sha512-BvvA64QxZlh7WZWqDPPdt0GH4bznuL6uOO1pmgPnnv86rpUpc8ZxgZwcEgXvo02GRIZX1hQ0j0pAnhwkhwPqWg==", "cpu": [ "ppc64" ], @@ -2723,9 +2719,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.40.0.tgz", - "integrity": "sha512-uJkYTugqtPZBS3Z136arevt/FsKTF/J9dEMTX/cwR7lsAW4bShzI2R0pJVw+hcBTWF4dxVckYh72Hk3/hWNKvA==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.40.1.tgz", + "integrity": "sha512-EQSP+8+1VuSulm9RKSMKitTav89fKbHymTf25n5+Yr6gAPZxYWpj3DzAsQqoaHAk9YX2lwEyAf9S4W8F4l3VBQ==", "cpu": [ "riscv64" ], @@ -2737,9 +2733,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.40.0.tgz", - "integrity": "sha512-rKmSj6EXQRnhSkE22+WvrqOqRtk733x3p5sWpZilhmjnkHkpeCgWsFFo0dGnUGeA+OZjRl3+VYq+HyCOEuwcxQ==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.40.1.tgz", + "integrity": "sha512-n/vQ4xRZXKuIpqukkMXZt9RWdl+2zgGNx7Uda8NtmLJ06NL8jiHxUawbwC+hdSq1rrw/9CghCpEONor+l1e2gA==", "cpu": [ "riscv64" ], @@ -2751,9 +2747,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.40.0.tgz", - "integrity": "sha512-SpnYlAfKPOoVsQqmTFJ0usx0z84bzGOS9anAC0AZ3rdSo3snecihbhFTlJZ8XMwzqAcodjFU4+/SM311dqE5Sw==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.40.1.tgz", + "integrity": "sha512-h8d28xzYb98fMQKUz0w2fMc1XuGzLLjdyxVIbhbil4ELfk5/orZlSTpF/xdI9C8K0I8lCkq+1En2RJsawZekkg==", "cpu": [ "s390x" ], @@ -2765,9 +2761,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.40.0.tgz", - "integrity": "sha512-RcDGMtqF9EFN8i2RYN2W+64CdHruJ5rPqrlYw+cgM3uOVPSsnAQps7cpjXe9be/yDp8UC7VLoCoKC8J3Kn2FkQ==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.40.1.tgz", + "integrity": "sha512-XiK5z70PEFEFqcNj3/zRSz/qX4bp4QIraTy9QjwJAb/Z8GM7kVUsD0Uk8maIPeTyPCP03ChdI+VVmJriKYbRHQ==", "cpu": [ "x64" ], @@ -2779,9 +2775,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.40.0.tgz", - "integrity": "sha512-HZvjpiUmSNx5zFgwtQAV1GaGazT2RWvqeDi0hV+AtC8unqqDSsaFjPxfsO6qPtKRRg25SisACWnJ37Yio8ttaw==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.40.1.tgz", + "integrity": "sha512-2BRORitq5rQ4Da9blVovzNCMaUlyKrzMSvkVR0D4qPuOy/+pMCrh1d7o01RATwVy+6Fa1WBw+da7QPeLWU/1mQ==", "cpu": [ "x64" ], @@ -2793,9 +2789,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.40.0.tgz", - "integrity": "sha512-UtZQQI5k/b8d7d3i9AZmA/t+Q4tk3hOC0tMOMSq2GlMYOfxbesxG4mJSeDp0EHs30N9bsfwUvs3zF4v/RzOeTQ==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.40.1.tgz", + "integrity": "sha512-b2bcNm9Kbde03H+q+Jjw9tSfhYkzrDUf2d5MAd1bOJuVplXvFhWz7tRtWvD8/ORZi7qSCy0idW6tf2HgxSXQSg==", "cpu": [ "arm64" ], @@ -2807,9 +2803,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.40.0.tgz", - "integrity": "sha512-+m03kvI2f5syIqHXCZLPVYplP8pQch9JHyXKZ3AGMKlg8dCyr2PKHjwRLiW53LTrN/Nc3EqHOKxUxzoSPdKddA==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.40.1.tgz", + "integrity": "sha512-DfcogW8N7Zg7llVEfpqWMZcaErKfsj9VvmfSyRjCyo4BI3wPEfrzTtJkZG6gKP/Z92wFm6rz2aDO7/JfiR/whA==", "cpu": [ "ia32" ], @@ -2821,9 +2817,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.40.0.tgz", - "integrity": "sha512-lpPE1cLfP5oPzVjKMx10pgBmKELQnFJXHgvtHCtuJWOv8MxqdEIMNtgHgBFf7Ea2/7EuVwa9fodWUfXAlXZLZQ==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.40.1.tgz", + "integrity": "sha512-ECyOuDeH3C1I8jH2MK1RtBJW+YPMvSfT0a5NN0nHfQYnDSJ6tUiZH3gzwVP5/Kfh/+Tt7tpWVF9LXNTnhTJ3kA==", "cpu": [ "x64" ], @@ -3111,9 +3107,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.14.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.14.1.tgz", - "integrity": "sha512-u0HuPQwe/dHrItgHHpmw3N2fYCR6x4ivMNbPHRkBVP4CvN+kiRrKHWk3i8tXiO/joPwXLMYvF9TTF0eqgHIuOw==", + "version": "22.15.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.3.tgz", + "integrity": "sha512-lX7HFZeHf4QG/J7tBZqrCAXwz9J5RD56Y6MpP0eJkka8p+K0RY/yBTW7CYFJ4VGCclxqOLKmiGP5juQc6MKgcw==", "dev": true, "license": "MIT", "dependencies": { @@ -3782,9 +3778,9 @@ } }, "node_modules/asn1.js/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", "dev": true, "license": "MIT" }, @@ -3872,9 +3868,9 @@ } }, "node_modules/axios": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz", - "integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.9.0.tgz", + "integrity": "sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg==", "dev": true, "license": "MIT", "dependencies": { @@ -4021,9 +4017,9 @@ "license": "MIT" }, "node_modules/bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.2.tgz", + "integrity": "sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw==", "dev": true, "license": "MIT" }, @@ -4136,9 +4132,9 @@ "license": "MIT" }, "node_modules/bootstrap5-tags": { - "version": "1.7.10", - "resolved": "https://registry.npmjs.org/bootstrap5-tags/-/bootstrap5-tags-1.7.10.tgz", - "integrity": "sha512-affAvDcyny6/YU/oZD4U61m9KKIP3pE33041lLrH7oDEKRZN7oWi2TeA0QwWzIyPH0AgsBWET0+ILb04CKyqNw==", + "version": "1.7.13", + "resolved": "https://registry.npmjs.org/bootstrap5-tags/-/bootstrap5-tags-1.7.13.tgz", + "integrity": "sha512-b9N7yVTSz8zzDMLONPcB9oesF9JtxXlksFOc7BtX/3P1iMlIAXHWnSQ5Qm/5mzuCWEvY43hLpdilySpPf7rvOQ==", "license": "MIT" }, "node_modules/brace-expansion": { @@ -4260,9 +4256,9 @@ } }, "node_modules/browserslist": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", - "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "version": "4.24.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.5.tgz", + "integrity": "sha512-FDToo4Wo82hIdgc1CQ+NQD0hEhmpPjrZ3hiUgwgOG6IuTdlpr8jdjyG24P6cNP1yJpTLzS5OcGgSw0xmDU1/Tw==", "dev": true, "funding": [ { @@ -4280,10 +4276,10 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001688", - "electron-to-chromium": "^1.5.73", + "caniuse-lite": "^1.0.30001716", + "electron-to-chromium": "^1.5.149", "node-releases": "^2.0.19", - "update-browserslist-db": "^1.1.1" + "update-browserslist-db": "^1.1.3" }, "bin": { "browserslist": "cli.js" @@ -4420,9 +4416,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001715", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001715.tgz", - "integrity": "sha512-7ptkFGMm2OAOgvZpwgA4yjQ5SQbrNVGdRjzH0pBdy1Fasvcr+KAeECmbCAECzTuDuoX0FCY8KzUxjf9+9kfZEw==", + "version": "1.0.30001716", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001716.tgz", + "integrity": "sha512-49/c1+x3Kwz7ZIWt+4DvK3aMJy9oYXXG6/97JKsnjdCk/6n9vVyWL8NAwVt95Lwt9eigI10Hl782kDfZUUlRXw==", "dev": true, "funding": [ { @@ -4864,9 +4860,9 @@ "license": "MIT" }, "node_modules/core-js-compat": { - "version": "3.41.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.41.0.tgz", - "integrity": "sha512-RFsU9LySVue9RTwdDVX/T0e2Y6jRYWXERKElIjpuEOEnxaXffI0X7RUwVzfYLfzuLXSNJDYoRYUAmRUcyln20A==", + "version": "3.42.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.42.0.tgz", + "integrity": "sha512-bQasjMfyDGyaeWKBIu33lHh9qlSR0MFE/Nmc6nMjf/iU9b3rSMdAYz1Baxrv4lPdGUsTqZudHA4jIGSJy0SWZQ==", "dev": true, "license": "MIT", "dependencies": { @@ -4923,9 +4919,9 @@ } }, "node_modules/create-ecdh/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", "dev": true, "license": "MIT" }, @@ -5440,9 +5436,9 @@ } }, "node_modules/diffie-hellman/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", "dev": true, "license": "MIT" }, @@ -5635,9 +5631,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.139", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.139.tgz", - "integrity": "sha512-GGnRYOTdN5LYpwbIr0rwP/ZHOQSvAF6TG0LSzp28uCBb9JiXHJGmaaKw29qjNJc5bGnnp6kXJqRnGMQoELwi5w==", + "version": "1.5.149", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.149.tgz", + "integrity": "sha512-UyiO82eb9dVOx8YO3ajDf9jz2kKyt98DEITRdeLPstOEuTlLzDA4Gyq5K9he71TQziU5jUVu2OAu5N48HmQiyQ==", "dev": true, "license": "ISC" }, @@ -5658,9 +5654,9 @@ } }, "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", "dev": true, "license": "MIT" }, @@ -5762,9 +5758,9 @@ } }, "node_modules/es-module-lexer": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz", - "integrity": "sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", "dev": true, "license": "MIT" }, @@ -5798,9 +5794,9 @@ } }, "node_modules/esbuild": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.2.tgz", - "integrity": "sha512-16854zccKPnC+toMywC+uKNeYSv+/eXkevRAfwRD/G9Cleq66m8XFIrigkbvauLLlCfDL45Q2cWegSg53gGBnQ==", + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.3.tgz", + "integrity": "sha512-qKA6Pvai73+M2FtftpNKRxJ78GIjmFXFxd/1DVBqGo/qNhLSfv+G12n9pNoWdytJC8U00TrViOwpjT0zgqQS8Q==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -5811,31 +5807,31 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.2", - "@esbuild/android-arm": "0.25.2", - "@esbuild/android-arm64": "0.25.2", - "@esbuild/android-x64": "0.25.2", - "@esbuild/darwin-arm64": "0.25.2", - "@esbuild/darwin-x64": "0.25.2", - "@esbuild/freebsd-arm64": "0.25.2", - "@esbuild/freebsd-x64": "0.25.2", - "@esbuild/linux-arm": "0.25.2", - "@esbuild/linux-arm64": "0.25.2", - "@esbuild/linux-ia32": "0.25.2", - "@esbuild/linux-loong64": "0.25.2", - "@esbuild/linux-mips64el": "0.25.2", - "@esbuild/linux-ppc64": "0.25.2", - "@esbuild/linux-riscv64": "0.25.2", - "@esbuild/linux-s390x": "0.25.2", - "@esbuild/linux-x64": "0.25.2", - "@esbuild/netbsd-arm64": "0.25.2", - "@esbuild/netbsd-x64": "0.25.2", - "@esbuild/openbsd-arm64": "0.25.2", - "@esbuild/openbsd-x64": "0.25.2", - "@esbuild/sunos-x64": "0.25.2", - "@esbuild/win32-arm64": "0.25.2", - "@esbuild/win32-ia32": "0.25.2", - "@esbuild/win32-x64": "0.25.2" + "@esbuild/aix-ppc64": "0.25.3", + "@esbuild/android-arm": "0.25.3", + "@esbuild/android-arm64": "0.25.3", + "@esbuild/android-x64": "0.25.3", + "@esbuild/darwin-arm64": "0.25.3", + "@esbuild/darwin-x64": "0.25.3", + "@esbuild/freebsd-arm64": "0.25.3", + "@esbuild/freebsd-x64": "0.25.3", + "@esbuild/linux-arm": "0.25.3", + "@esbuild/linux-arm64": "0.25.3", + "@esbuild/linux-ia32": "0.25.3", + "@esbuild/linux-loong64": "0.25.3", + "@esbuild/linux-mips64el": "0.25.3", + "@esbuild/linux-ppc64": "0.25.3", + "@esbuild/linux-riscv64": "0.25.3", + "@esbuild/linux-s390x": "0.25.3", + "@esbuild/linux-x64": "0.25.3", + "@esbuild/netbsd-arm64": "0.25.3", + "@esbuild/netbsd-x64": "0.25.3", + "@esbuild/openbsd-arm64": "0.25.3", + "@esbuild/openbsd-x64": "0.25.3", + "@esbuild/sunos-x64": "0.25.3", + "@esbuild/win32-arm64": "0.25.3", + "@esbuild/win32-ia32": "0.25.3", + "@esbuild/win32-x64": "0.25.3" } }, "node_modules/escalade": { @@ -6979,9 +6975,9 @@ } }, "node_modules/i18next": { - "version": "24.2.3", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-24.2.3.tgz", - "integrity": "sha512-lfbf80OzkocvX7nmZtu7nSTNbrTYR52sLWxPtlXX1zAhVw8WEnFk4puUkCR4B1dNQwbSpEHHHemcZu//7EcB7A==", + "version": "25.0.2", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.0.2.tgz", + "integrity": "sha512-xWxgK8GAaPYkV9ia2tdgbtdM+qiC+ysVTBPvXhpCORU/+QkeQe3BSI7Crr+c4ZXULN1PfnXG/HY2n7HGx4KKBg==", "funding": [ { "type": "individual", @@ -7489,14 +7485,14 @@ "license": "MIT" }, "node_modules/json-stable-stringify": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.2.1.tgz", - "integrity": "sha512-Lp6HbbBgosLmJbjx0pBLbgvx68FaFU1sdkmBuckmhhJ88kL13OA51CDtR2yJB50eCNMH9wRqtQNNiAqQH4YXnA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.3.0.tgz", + "integrity": "sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", - "call-bound": "^1.0.3", + "call-bound": "^1.0.4", "isarray": "^2.0.5", "jsonify": "^0.0.1", "object-keys": "^1.1.1" @@ -8031,9 +8027,9 @@ } }, "node_modules/miller-rabin/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", "dev": true, "license": "MIT" }, @@ -9592,9 +9588,9 @@ } }, "node_modules/public-encrypt/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", "dev": true, "license": "MIT" }, @@ -9777,22 +9773,6 @@ "node": ">=4" } }, - "node_modules/regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "license": "MIT" - }, - "node_modules/regenerator-transform": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz", - "integrity": "sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.8.4" - } - }, "node_modules/regexpu-core": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.2.0.tgz", @@ -9992,9 +9972,9 @@ } }, "node_modules/rollup": { - "version": "4.40.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.40.0.tgz", - "integrity": "sha512-Noe455xmA96nnqH5piFtLobsGbCij7Tu+tb3c1vYjNbTkfzGqXqQXG3wJaYXkRZuQ0vEYN4bhwg7QnIrqB5B+w==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.40.1.tgz", + "integrity": "sha512-C5VvvgCCyfyotVITIAv+4efVytl5F7wt+/I2i9q9GZcEXW9BP52YYOXC58igUi+LFZVHukErIIqQSWwv/M3WRw==", "dev": true, "license": "MIT", "dependencies": { @@ -10008,26 +9988,26 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.40.0", - "@rollup/rollup-android-arm64": "4.40.0", - "@rollup/rollup-darwin-arm64": "4.40.0", - "@rollup/rollup-darwin-x64": "4.40.0", - "@rollup/rollup-freebsd-arm64": "4.40.0", - "@rollup/rollup-freebsd-x64": "4.40.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.40.0", - "@rollup/rollup-linux-arm-musleabihf": "4.40.0", - "@rollup/rollup-linux-arm64-gnu": "4.40.0", - "@rollup/rollup-linux-arm64-musl": "4.40.0", - "@rollup/rollup-linux-loongarch64-gnu": "4.40.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.40.0", - "@rollup/rollup-linux-riscv64-gnu": "4.40.0", - "@rollup/rollup-linux-riscv64-musl": "4.40.0", - "@rollup/rollup-linux-s390x-gnu": "4.40.0", - "@rollup/rollup-linux-x64-gnu": "4.40.0", - "@rollup/rollup-linux-x64-musl": "4.40.0", - "@rollup/rollup-win32-arm64-msvc": "4.40.0", - "@rollup/rollup-win32-ia32-msvc": "4.40.0", - "@rollup/rollup-win32-x64-msvc": "4.40.0", + "@rollup/rollup-android-arm-eabi": "4.40.1", + "@rollup/rollup-android-arm64": "4.40.1", + "@rollup/rollup-darwin-arm64": "4.40.1", + "@rollup/rollup-darwin-x64": "4.40.1", + "@rollup/rollup-freebsd-arm64": "4.40.1", + "@rollup/rollup-freebsd-x64": "4.40.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.40.1", + "@rollup/rollup-linux-arm-musleabihf": "4.40.1", + "@rollup/rollup-linux-arm64-gnu": "4.40.1", + "@rollup/rollup-linux-arm64-musl": "4.40.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.40.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.40.1", + "@rollup/rollup-linux-riscv64-gnu": "4.40.1", + "@rollup/rollup-linux-riscv64-musl": "4.40.1", + "@rollup/rollup-linux-s390x-gnu": "4.40.1", + "@rollup/rollup-linux-x64-gnu": "4.40.1", + "@rollup/rollup-linux-x64-musl": "4.40.1", + "@rollup/rollup-win32-arm64-msvc": "4.40.1", + "@rollup/rollup-win32-ia32-msvc": "4.40.1", + "@rollup/rollup-win32-x64-msvc": "4.40.1", "fsevents": "~2.3.2" } }, @@ -10083,9 +10063,9 @@ "license": "MIT" }, "node_modules/sass": { - "version": "1.86.3", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.86.3.tgz", - "integrity": "sha512-iGtg8kus4GrsGLRDLRBRHY9dNVA78ZaS7xr01cWnS7PEMQyFtTqBiyCrfpTYTZXRWM94akzckYjh8oADfFNTzw==", + "version": "1.87.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.87.0.tgz", + "integrity": "sha512-d0NoFH4v6SjEK7BoX810Jsrhj7IQSYHAHLi/iSpgqKc7LaIDshFRlSg5LOymf9FqQhxEHs2W5ZQXlvy0KD45Uw==", "dev": true, "license": "MIT", "dependencies": { @@ -10968,9 +10948,9 @@ "license": "MIT" }, "node_modules/terser-webpack-plugin/node_modules/schema-utils": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz", - "integrity": "sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.2.tgz", + "integrity": "sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==", "dev": true, "license": "MIT", "dependencies": { @@ -11669,14 +11649,15 @@ "license": "BSD-2-Clause" }, "node_modules/webpack": { - "version": "5.99.6", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.99.6.tgz", - "integrity": "sha512-TJOLrJ6oeccsGWPl7ujCYuc0pIq2cNsuD6GZDma8i5o5Npvcco/z+NKvZSFsP0/x6SShVb0+X2JK/JHUjKY9dQ==", + "version": "5.99.7", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.99.7.tgz", + "integrity": "sha512-CNqKBRMQjwcmKR0idID5va1qlhrqVUKpovi+Ec79ksW8ux7iS1+A6VqzfZXgVYCFRKl7XL5ap3ZoMpwBJxcg0w==", "dev": true, "license": "MIT", "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "@webassemblyjs/ast": "^1.14.1", "@webassemblyjs/wasm-edit": "^1.14.1", "@webassemblyjs/wasm-parser": "^1.14.1", @@ -11693,7 +11674,7 @@ "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^4.3.0", + "schema-utils": "^4.3.2", "tapable": "^2.1.1", "terser-webpack-plugin": "^5.3.11", "watchpack": "^2.4.1", @@ -11825,9 +11806,9 @@ "license": "MIT" }, "node_modules/webpack-dev-middleware/node_modules/schema-utils": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz", - "integrity": "sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.2.tgz", + "integrity": "sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==", "dev": true, "license": "MIT", "dependencies": { @@ -11977,9 +11958,9 @@ } }, "node_modules/webpack-dev-server/node_modules/schema-utils": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz", - "integrity": "sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.2.tgz", + "integrity": "sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==", "dev": true, "license": "MIT", "dependencies": { @@ -12079,9 +12060,9 @@ "license": "MIT" }, "node_modules/webpack/node_modules/schema-utils": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz", - "integrity": "sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.2.tgz", + "integrity": "sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==", "dev": true, "license": "MIT", "dependencies": { @@ -12211,9 +12192,9 @@ "license": "ISC" }, "node_modules/ws": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz", - "integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.2.tgz", + "integrity": "sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==", "dev": true, "license": "MIT", "engines": { @@ -12337,7 +12318,7 @@ "chartjs-adapter-date-fns": "^3.0.0", "chartjs-chart-sankey": "^0.14.0", "date-fns": "^4.0.0", - "i18next": "^24.2.0", + "i18next": "^25.0.1", "i18next-chained-backend": "^4.6.2", "i18next-http-backend": "^3.0.1", "i18next-localstorage-backend": "^4.2.0", diff --git a/routes/channels.php b/routes/channels.php index 8fee79356b..702805feed 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -35,5 +35,5 @@ declare(strict_types=1); Broadcast::channel( 'App.User.{id}', - static fn($user, $id) => (int)$user->id === (int)$id + static fn ($user, $id) => (int)$user->id === (int)$id ); diff --git a/tests/unit/Support/Calendar/CalculatorProvider.php b/tests/unit/Support/Calendar/CalculatorProvider.php index 0c18c63360..839f422957 100644 --- a/tests/unit/Support/Calendar/CalculatorProvider.php +++ b/tests/unit/Support/Calendar/CalculatorProvider.php @@ -34,7 +34,7 @@ readonly class CalculatorProvider private function __construct(public IntervalProvider $intervalProvider, public Periodicity $periodicity, public int $skip = 0) { - $this->label = "{$this->periodicity->name} {$this->intervalProvider->label}"; + $this->label = "{$this->periodicity->name} {$this->intervalProvider->label}"; } public static function providePeriodicityWithSkippedIntervals(): \Generator diff --git a/tests/unit/Support/Calendar/Periodicity/IntervalProvider.php b/tests/unit/Support/Calendar/Periodicity/IntervalProvider.php index b095ea6680..ec3ed1d784 100644 --- a/tests/unit/Support/Calendar/Periodicity/IntervalProvider.php +++ b/tests/unit/Support/Calendar/Periodicity/IntervalProvider.php @@ -32,6 +32,6 @@ readonly class IntervalProvider public function __construct(public Carbon $epoch, public Carbon $expected) { - $this->label = "given {$this->epoch->toDateString()} expects {$this->expected->toDateString()}"; + $this->label = "given {$this->epoch->toDateString()} expects {$this->expected->toDateString()}"; } } From 6b086c9bff87fe11f12e2429ea88d7f84e2f92c0 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 May 2025 16:57:38 +0200 Subject: [PATCH 27/87] Add config for rector. --- .ci/rector.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .ci/rector.php diff --git a/.ci/rector.php b/.ci/rector.php new file mode 100644 index 0000000000..f758a43a09 --- /dev/null +++ b/.ci/rector.php @@ -0,0 +1,21 @@ +withPaths([ + __DIR__ . '/../app', + __DIR__ . '/../bootstrap', + __DIR__ . '/../config', + __DIR__ . '/../public', + __DIR__ . '/../resources', + __DIR__ . '/../routes', + __DIR__ . '/../tests', + ]) + // uncomment to reach your current PHP version + ->withPhpSets() + ->withTypeCoverageLevel(0) + ->withDeadCodeLevel(0) + ->withCodeQualityLevel(0); From 12b8ba68b3ac9d84bb3db34b3fd7c02ce14709ea Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 May 2025 17:01:04 +0200 Subject: [PATCH 28/87] Add script to run rector.sh --- .ci/rector.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 .ci/rector.sh diff --git a/.ci/rector.sh b/.ci/rector.sh new file mode 100755 index 0000000000..3bd4f802b9 --- /dev/null +++ b/.ci/rector.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# +# phpstan.sh +# Copyright (c) 2021 james@firefly-iii.org +# +# This file is part of Firefly III (https://github.com/firefly-iii). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# Install composer packages +#composer install --no-scripts --no-ansi + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" + +$SCRIPT_DIR/../vendor/bin/rector --config $SCRIPT_DIR/rector.php From 9ea8709835dda396805bd439de0df267346159bd Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 May 2025 17:08:42 +0200 Subject: [PATCH 29/87] Fix nullpointers. --- app/Http/Controllers/Auth/LoginController.php | 2 +- app/Http/Controllers/Auth/RegisterController.php | 2 +- resources/views/partials/menu-sidebar.twig | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 0ba8369ee8..9ea25e154a 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -220,7 +220,7 @@ class LoginController extends Controller * * @throws FireflyException */ - public function showLoginForm(?Request $request = null) + public function showLoginForm(Request $request) { Log::channel('audit')->info('Show login form (1.1).'); diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index d15c6c0d59..d058c527ae 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -175,7 +175,7 @@ class RegisterController extends Controller * * @throws FireflyException */ - public function showRegistrationForm(?Request $request = null) + public function showRegistrationForm(Request $request) { $isDemoSite = app('fireflyconfig')->get('is_demo_site', config('firefly.configuration.is_demo_site'))->data; $pageTitle = (string) trans('firefly.register_page_title'); diff --git a/resources/views/partials/menu-sidebar.twig b/resources/views/partials/menu-sidebar.twig index f90624f178..a4f8aaf0ec 100644 --- a/resources/views/partials/menu-sidebar.twig +++ b/resources/views/partials/menu-sidebar.twig @@ -15,10 +15,10 @@ -
  • +
  • - {{ 'bills'|_ }} + {{ 'subscriptions'|_ }}
  • From 3c67175e68ff78f667d4ae3d3247bbbfe91c54f1 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 May 2025 17:16:07 +0200 Subject: [PATCH 30/87] Import function. --- app/Api/V1/Requests/Data/Bulk/TransactionRequest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php index 544d65b1f6..18a6814464 100644 --- a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php +++ b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php @@ -32,6 +32,7 @@ use FireflyIII\Validation\Api\Data\Bulk\ValidatesBulkTransactionQuery; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; use Illuminate\Validation\Validator; +use function Safe\json_decode; /** * Class TransactionRequest @@ -48,7 +49,7 @@ class TransactionRequest extends FormRequest try { $data = [ - 'query' => \Safe\json_decode($this->get('query'), true, 8, JSON_THROW_ON_ERROR), + 'query' => json_decode($this->get('query'), true, 8, JSON_THROW_ON_ERROR), ]; } catch (\JsonException $e) { // dont really care. the validation should catch invalid json. From 6f8f17589045110564d1bf00479bb381a81c6ad3 Mon Sep 17 00:00:00 2001 From: JC5 Date: Sun, 4 May 2025 17:20:29 +0200 Subject: [PATCH 31/87] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-05-04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Api/V1/Requests/Data/Bulk/TransactionRequest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php index 18a6814464..b9319e0240 100644 --- a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php +++ b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php @@ -32,6 +32,7 @@ use FireflyIII\Validation\Api\Data\Bulk\ValidatesBulkTransactionQuery; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; use Illuminate\Validation\Validator; + use function Safe\json_decode; /** From 0573bf24027066bbb0ba1c08086f2a9def65716b Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 May 2025 17:41:26 +0200 Subject: [PATCH 32/87] Clean up code. --- .ci/php-cs-fixer/.php-cs-fixer.php | 2 +- .ci/rector.php | 26 +- .../Autocomplete/AccountController.php | 1 + .../Autocomplete/TransactionController.php | 3 +- .../Controllers/Chart/AccountController.php | 86 ++-- app/Api/V1/Controllers/Controller.php | 13 +- .../DestroyController.php | 4 +- .../Models/Transaction/StoreController.php | 3 +- .../TransactionCurrency/DestroyController.php | 2 +- .../Controllers/Summary/BasicController.php | 2 +- .../CurrencyExchangeRate/DestroyRequest.php | 2 +- .../CurrencyExchangeRate/StoreRequest.php | 10 +- .../CurrencyExchangeRate/UpdateRequest.php | 4 +- .../Models/Transaction/StoreRequest.php | 108 +++--- app/Api/V2/Controllers/Controller.php | 3 +- .../List/TransactionController.php | 3 +- .../Commands/Correction/CorrectsAmounts.php | 118 +++--- .../Correction/CorrectsNativeAmounts.php | 2 +- .../Correction/RemovesEmptyGroups.php | 2 +- .../ValidatesEnvironmentVariables.php | 14 +- .../Commands/System/OutputsInstructions.php | 14 +- .../System/RecalculatesRunningBalance.php | 14 +- app/Console/Commands/Tools/Cron.php | 34 +- .../Upgrade/UpgradesNativeAmounts.php | 3 +- app/Events/DestroyedTransactionLink.php | 4 +- app/Events/Model/PiggyBank/ChangedAmount.php | 4 +- app/Events/Security/MFABackupFewLeft.php | 1 + app/Events/Security/MFAManyFailedAttempts.php | 1 + .../Test/OwnerTestNotificationChannel.php | 2 +- app/Factory/TagFactory.php | 2 +- app/Factory/TransactionGroupFactory.php | 4 +- app/Factory/TransactionJournalFactory.php | 28 +- .../Events/UpdatedGroupEventHandler.php | 98 ++--- app/Handlers/Observer/AccountObserver.php | 2 +- app/Handlers/Observer/AutoBudgetObserver.php | 12 +- .../Observer/AvailableBudgetObserver.php | 12 +- app/Handlers/Observer/BillObserver.php | 38 +- app/Handlers/Observer/BudgetLimitObserver.php | 12 +- .../Observer/PiggyBankEventObserver.php | 12 +- app/Handlers/Observer/PiggyBankObserver.php | 40 +- app/Handlers/Observer/TransactionObserver.php | 36 +- .../Extensions/AccountCollection.php | 166 ++++---- .../Extensions/CollectorProperties.php | 2 +- .../Collector/Extensions/MetaCollection.php | 2 +- app/Helpers/Collector/GroupCollector.php | 23 +- .../Collector/GroupCollectorInterface.php | 14 +- app/Helpers/Report/NetWorth.php | 2 +- app/Helpers/Report/PopupReport.php | 2 +- .../Controllers/Account/IndexController.php | 20 +- .../Account/ReconcileController.php | 8 +- .../Controllers/Account/ShowController.php | 1 - .../Controllers/Budget/IndexController.php | 10 +- .../Controllers/Chart/AccountController.php | 23 +- .../Controllers/Chart/BudgetController.php | 1 - .../Controllers/Chart/CategoryController.php | 10 +- app/Http/Controllers/Controller.php | 31 +- app/Http/Controllers/DebugController.php | 234 +++++------ app/Http/Controllers/JavascriptController.php | 3 +- .../TransactionCurrency/CreateController.php | 2 +- .../TransactionCurrency/DeleteController.php | 2 +- .../TransactionCurrency/EditController.php | 2 +- .../TransactionCurrency/IndexController.php | 2 +- app/Http/Middleware/InterestingMessage.php | 26 +- app/Http/Middleware/TrustProxies.php | 3 +- app/Jobs/CreateRecurringTransactions.php | 8 +- app/Mail/InvitationMail.php | 1 + app/Mail/ReportNewJournalsMail.php | 3 +- app/Models/Account.php | 18 +- app/Models/Attachment.php | 12 +- app/Models/AutoBudget.php | 7 +- app/Models/AvailableBudget.php | 30 +- app/Models/Bill.php | 30 +- app/Models/Budget.php | 14 +- app/Models/BudgetLimit.php | 14 +- app/Models/Category.php | 12 +- app/Models/CurrencyExchangeRate.php | 18 +- app/Models/GroupMembership.php | 13 +- app/Models/InvitedUser.php | 8 +- app/Models/ObjectGroup.php | 10 +- app/Models/Preference.php | 10 +- app/Models/Recurrence.php | 28 +- app/Models/RecurrenceRepetition.php | 9 +- app/Models/Rule.php | 20 +- app/Models/RuleGroup.php | 16 +- app/Models/Tag.php | 18 +- app/Models/Transaction.php | 30 +- app/Models/TransactionCurrency.php | 2 +- app/Models/TransactionGroup.php | 16 +- app/Models/TransactionJournal.php | 36 +- app/Models/TransactionType.php | 15 +- app/Models/Webhook.php | 12 +- app/Policies/AccountPolicy.php | 16 +- app/Providers/CurrencyServiceProvider.php | 2 +- app/Providers/FireflySessionProvider.php | 2 +- app/Providers/SearchServiceProvider.php | 2 +- .../Account/AccountRepository.php | 64 +-- .../Account/AccountRepositoryInterface.php | 4 +- .../Category/NoCategoryRepository.php | 12 +- .../Webhook/WebhookRepository.php | 5 +- app/Rules/BelongsUser.php | 54 ++- app/Rules/IsAllowedGroupAction.php | 2 +- app/Rules/UniqueIban.php | 10 +- .../Internal/Support/AccountServiceTrait.php | 8 +- .../Internal/Support/JournalServiceTrait.php | 1 - app/Support/Amount.php | 144 +++---- .../Authentication/RemoteUserGuard.php | 4 +- .../Chart/Budget/FrontpageChartGenerator.php | 22 +- .../Category/FrontpageChartGenerator.php | 4 +- app/Support/Export/ExportDataGenerator.php | 16 +- .../Http/Api/AccountBalanceGrouped.php | 18 +- .../Http/Api/ExchangeRateConverter.php | 10 +- .../Http/Api/SummaryBalanceGrouped.php | 10 +- .../Http/Controllers/PeriodOverview.php | 173 ++++----- .../JsonApi/Enrichments/AccountEnrichment.php | 214 +++++----- .../Enrichments/EnrichmentInterface.php | 4 +- .../TransactionGroupEnrichment.php | 70 ++-- app/Support/Navigation.php | 8 +- .../Report/Budget/BudgetReportGenerator.php | 32 +- .../Category/CategoryReportGenerator.php | 8 +- .../Summarizer/TransactionSummarizer.php | 7 +- .../UserGroup/UserGroupInterface.php | 8 +- .../Repositories/UserGroup/UserGroupTrait.php | 36 +- app/Support/Request/ConvertsDataTypes.php | 52 +-- app/Support/Search/OperatorQuerySearch.php | 70 ++-- .../Search/QueryParser/GdbotsQueryParser.php | 4 +- app/Support/Search/QueryParser/Node.php | 44 +-- .../Search/QueryParser/QueryParser.php | 2 +- app/Support/Search/SearchInterface.php | 4 +- app/Support/Steam.php | 366 +++++++++--------- app/Support/Twig/AmountFormat.php | 50 +-- app/Support/Twig/General.php | 14 +- .../Actions/UpdatePiggyBank.php | 46 +-- .../Engine/SearchRuleEngine.php | 8 +- .../Expressions/ActionExpression.php | 2 +- app/Transformers/AccountTransformer.php | 2 +- app/Transformers/AttachmentTransformer.php | 30 +- .../AvailableBudgetTransformer.php | 4 +- app/Transformers/BillTransformer.php | 4 +- app/Transformers/BudgetLimitTransformer.php | 3 +- app/Transformers/BudgetTransformer.php | 4 +- app/Transformers/CategoryTransformer.php | 4 +- .../TransactionGroupTransformer.php | 28 +- app/Transformers/V2/AccountTransformer.php | 2 +- app/Transformers/V2/BillTransformer.php | 6 +- .../V2/TransactionGroupTransformer.php | 8 +- app/Validation/AccountValidator.php | 16 +- app/Validation/FireflyValidator.php | 5 +- 147 files changed, 1758 insertions(+), 1770 deletions(-) diff --git a/.ci/php-cs-fixer/.php-cs-fixer.php b/.ci/php-cs-fixer/.php-cs-fixer.php index 6262b878f4..9ecec0fc77 100644 --- a/.ci/php-cs-fixer/.php-cs-fixer.php +++ b/.ci/php-cs-fixer/.php-cs-fixer.php @@ -61,7 +61,7 @@ return $config->setRules( 'comment_to_phpdoc' => false, // breaks phpstan lines in combination with PHPStorm. 'type_declaration_spaces' => false, 'cast_spaces' => false, - 'phpdoc_to_comment' => false, // do not overrule single line comment style, breaks phpstan. + 'phpdoc_to_comment' => false, // do not overrule single line comment style, breaks phpstan. // complex rules 'array_syntax' => ['syntax' => 'short'], diff --git a/.ci/rector.php b/.ci/rector.php index f758a43a09..ab39659e37 100644 --- a/.ci/rector.php +++ b/.ci/rector.php @@ -5,17 +5,17 @@ declare(strict_types=1); use Rector\Config\RectorConfig; return RectorConfig::configure() - ->withPaths([ - __DIR__ . '/../app', - __DIR__ . '/../bootstrap', - __DIR__ . '/../config', - __DIR__ . '/../public', - __DIR__ . '/../resources', - __DIR__ . '/../routes', - __DIR__ . '/../tests', - ]) + ->withPaths([ + __DIR__ . '/../app', + __DIR__ . '/../bootstrap', + __DIR__ . '/../config', + __DIR__ . '/../public', + __DIR__ . '/../resources', + __DIR__ . '/../routes', + __DIR__ . '/../tests', + ]) // uncomment to reach your current PHP version - ->withPhpSets() - ->withTypeCoverageLevel(0) - ->withDeadCodeLevel(0) - ->withCodeQualityLevel(0); + ->withPhpSets() + ->withTypeCoverageLevel(0) + ->withDeadCodeLevel(0) + ->withCodeQualityLevel(0); diff --git a/app/Api/V1/Controllers/Autocomplete/AccountController.php b/app/Api/V1/Controllers/Autocomplete/AccountController.php index 86b2a6f362..3cecdb08a0 100644 --- a/app/Api/V1/Controllers/Autocomplete/AccountController.php +++ b/app/Api/V1/Controllers/Autocomplete/AccountController.php @@ -43,6 +43,7 @@ use Illuminate\Support\Facades\Log; class AccountController extends Controller { use AccountFilter; + // this array only exists to test if the constructor will use it properly. protected array $accepts = ['application/json', 'application/vnd.api+json']; diff --git a/app/Api/V1/Controllers/Autocomplete/TransactionController.php b/app/Api/V1/Controllers/Autocomplete/TransactionController.php index 79b0687100..3cba382e52 100644 --- a/app/Api/V1/Controllers/Autocomplete/TransactionController.php +++ b/app/Api/V1/Controllers/Autocomplete/TransactionController.php @@ -39,11 +39,10 @@ use Illuminate\Support\Collection; */ class TransactionController extends Controller { + protected array $acceptedRoles = [UserRoleEnum::READ_ONLY]; private TransactionGroupRepositoryInterface $groupRepository; private JournalRepositoryInterface $repository; - protected array $acceptedRoles = [UserRoleEnum::READ_ONLY]; - /** * TransactionController constructor. */ diff --git a/app/Api/V1/Controllers/Chart/AccountController.php b/app/Api/V1/Controllers/Chart/AccountController.php index a7dbc10541..21150047c0 100644 --- a/app/Api/V1/Controllers/Chart/AccountController.php +++ b/app/Api/V1/Controllers/Chart/AccountController.php @@ -26,8 +26,8 @@ namespace FireflyIII\Api\V1\Controllers\Chart; use Carbon\Carbon; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Api\V1\Requests\Data\DateRequest; use FireflyIII\Api\V1\Requests\Chart\ChartRequest; +use FireflyIII\Api\V1\Requests\Data\DateRequest; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; @@ -48,8 +48,8 @@ class AccountController extends Controller use ApiSupport; use CollectsAccountsFromFilter; - private AccountRepositoryInterface $repository; private ChartData $chartData; + private AccountRepositoryInterface $repository; /** * AccountController constructor. @@ -93,6 +93,47 @@ class AccountController extends Controller return response()->json($this->chartData->render()); } + /** + * @throws FireflyException + */ + private function renderAccountData(array $params, Account $account): void + { + $currency = $this->repository->getAccountCurrency($account); + if (null === $currency) { + $currency = $this->default; + } + $currentSet = [ + 'label' => $account->name, + + // the currency that belongs to the account. + 'currency_id' => (string) $currency->id, + 'currency_code' => $currency->code, + 'currency_symbol' => $currency->symbol, + 'currency_decimal_places' => $currency->decimal_places, + + // the default currency of the user (could be the same!) + 'date' => $params['start']->toAtomString(), + 'start' => $params['start']->toAtomString(), + 'end' => $params['end']->toAtomString(), + 'period' => '1D', + 'entries' => [], + ]; + $currentStart = clone $params['start']; + $range = Steam::finalAccountBalanceInRange($account, $params['start'], clone $params['end'], $this->convertToNative); + + $previous = array_values($range)[0]['balance']; + while ($currentStart <= $params['end']) { + $format = $currentStart->format('Y-m-d'); + $label = $currentStart->toAtomString(); + $balance = array_key_exists($format, $range) ? $range[$format]['balance'] : $previous; + $previous = $balance; + + $currentStart->addDay(); + $currentSet['entries'][$label] = $balance; + } + $this->chartData->add($currentSet); + } + /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/charts/getChartAccountOverview @@ -162,45 +203,4 @@ class AccountController extends Controller return response()->json($chartData); } - - /** - * @throws FireflyException - */ - private function renderAccountData(array $params, Account $account): void - { - $currency = $this->repository->getAccountCurrency($account); - if (null === $currency) { - $currency = $this->default; - } - $currentSet = [ - 'label' => $account->name, - - // the currency that belongs to the account. - 'currency_id' => (string) $currency->id, - 'currency_code' => $currency->code, - 'currency_symbol' => $currency->symbol, - 'currency_decimal_places' => $currency->decimal_places, - - // the default currency of the user (could be the same!) - 'date' => $params['start']->toAtomString(), - 'start' => $params['start']->toAtomString(), - 'end' => $params['end']->toAtomString(), - 'period' => '1D', - 'entries' => [], - ]; - $currentStart = clone $params['start']; - $range = Steam::finalAccountBalanceInRange($account, $params['start'], clone $params['end'], $this->convertToNative); - - $previous = array_values($range)[0]['balance']; - while ($currentStart <= $params['end']) { - $format = $currentStart->format('Y-m-d'); - $label = $currentStart->toAtomString(); - $balance = array_key_exists($format, $range) ? $range[$format]['balance'] : $previous; - $previous = $balance; - - $currentStart->addDay(); - $currentSet['entries'][$label] = $balance; - } - $this->chartData->add($currentSet); - } } diff --git a/app/Api/V1/Controllers/Controller.php b/app/Api/V1/Controllers/Controller.php index a4b9bd297f..2566ddbe58 100644 --- a/app/Api/V1/Controllers/Controller.php +++ b/app/Api/V1/Controllers/Controller.php @@ -40,7 +40,6 @@ use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Routing\Controller as BaseController; -use Illuminate\Support\Collection; use League\Fractal\Manager; use League\Fractal\Pagination\IlluminatePaginatorAdapter; use League\Fractal\Resource\Collection as FractalCollection; @@ -62,15 +61,15 @@ abstract class Controller extends BaseController use ValidatesRequests; use ValidatesUserGroupTrait; - protected const string CONTENT_TYPE = 'application/vnd.api+json'; - protected const string JSON_CONTENT_TYPE = 'application/json'; + protected const string CONTENT_TYPE = 'application/vnd.api+json'; + protected const string JSON_CONTENT_TYPE = 'application/json'; + protected array $accepts = ['application/json', 'application/vnd.api+json']; /** @var array */ - protected array $allowedSort; - protected ParameterBag $parameters; - protected bool $convertToNative = false; - protected array $accepts = ['application/json', 'application/vnd.api+json']; + protected array $allowedSort; + protected bool $convertToNative = false; protected TransactionCurrency $nativeCurrency; + protected ParameterBag $parameters; /** * Controller constructor. diff --git a/app/Api/V1/Controllers/Models/CurrencyExchangeRate/DestroyController.php b/app/Api/V1/Controllers/Models/CurrencyExchangeRate/DestroyController.php index ec6aa38ee9..9deedea808 100644 --- a/app/Api/V1/Controllers/Models/CurrencyExchangeRate/DestroyController.php +++ b/app/Api/V1/Controllers/Models/CurrencyExchangeRate/DestroyController.php @@ -39,10 +39,8 @@ class DestroyController extends Controller { use ValidatesUserGroupTrait; - protected array $acceptedRoles = [UserRoleEnum::OWNER]; - public const string RESOURCE_KEY = 'exchange-rates'; - + protected array $acceptedRoles = [UserRoleEnum::OWNER]; private ExchangeRateRepositoryInterface $repository; public function __construct() diff --git a/app/Api/V1/Controllers/Models/Transaction/StoreController.php b/app/Api/V1/Controllers/Models/Transaction/StoreController.php index 03cbd54dab..4491656f51 100644 --- a/app/Api/V1/Controllers/Models/Transaction/StoreController.php +++ b/app/Api/V1/Controllers/Models/Transaction/StoreController.php @@ -50,9 +50,8 @@ class StoreController extends Controller { use TransactionFilter; - private TransactionGroupRepositoryInterface $groupRepository; - protected array $acceptedRoles = [UserRoleEnum::MANAGE_TRANSACTIONS]; + private TransactionGroupRepositoryInterface $groupRepository; /** * TransactionController constructor. diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php index 2ce47e432e..7da589703f 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php @@ -27,8 +27,8 @@ namespace FireflyIII\Api\V1\Controllers\Models\TransactionCurrency; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionCurrency; -use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; +use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Http\JsonResponse; diff --git a/app/Api/V1/Controllers/Summary/BasicController.php b/app/Api/V1/Controllers/Summary/BasicController.php index f974df4c1b..25d2346ea2 100644 --- a/app/Api/V1/Controllers/Summary/BasicController.php +++ b/app/Api/V1/Controllers/Summary/BasicController.php @@ -483,7 +483,7 @@ class BasicController extends Controller // first, create an entry for each entry in the "available" array. /** @var array $availableBudget */ - foreach ($available as $currencyId => $availableBudget) { + foreach ($available as $currencyId => $availableBudget) { $currencies[$currencyId] ??= $this->currencyRepos->find($currencyId); $return[$currencyId] = [ 'key' => sprintf('left-to-spend-in-%s', $currencies[$currencyId]->code), diff --git a/app/Api/V1/Requests/Models/CurrencyExchangeRate/DestroyRequest.php b/app/Api/V1/Requests/Models/CurrencyExchangeRate/DestroyRequest.php index eba660ab2b..451cf53126 100644 --- a/app/Api/V1/Requests/Models/CurrencyExchangeRate/DestroyRequest.php +++ b/app/Api/V1/Requests/Models/CurrencyExchangeRate/DestroyRequest.php @@ -45,7 +45,7 @@ class DestroyRequest extends FormRequest public function rules(): array { return [ - 'date' => 'required|date|after:1900-01-01|before:2099-12-31', + 'date' => 'required|date|after:1900-01-01|before:2099-12-31', ]; } } diff --git a/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreRequest.php b/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreRequest.php index 97b777518b..f29dd31fa2 100644 --- a/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreRequest.php +++ b/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreRequest.php @@ -40,16 +40,16 @@ class StoreRequest extends FormRequest return $this->getCarbonDate('date'); } - public function getRate(): string - { - return (string) $this->get('rate'); - } - public function getFromCurrency(): TransactionCurrency { return TransactionCurrency::where('code', $this->get('from'))->first(); } + public function getRate(): string + { + return (string) $this->get('rate'); + } + public function getToCurrency(): TransactionCurrency { return TransactionCurrency::where('code', $this->get('to'))->first(); diff --git a/app/Api/V1/Requests/Models/CurrencyExchangeRate/UpdateRequest.php b/app/Api/V1/Requests/Models/CurrencyExchangeRate/UpdateRequest.php index 14b9ff138c..e244895daa 100644 --- a/app/Api/V1/Requests/Models/CurrencyExchangeRate/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/CurrencyExchangeRate/UpdateRequest.php @@ -50,8 +50,8 @@ class UpdateRequest extends FormRequest public function rules(): array { return [ - 'date' => 'date|after:1900-01-01|before:2099-12-31', - 'rate' => 'required|numeric|gt:0', + 'date' => 'date|after:1900-01-01|before:2099-12-31', + 'rate' => 'required|numeric|gt:0', ]; } } diff --git a/app/Api/V1/Requests/Models/Transaction/StoreRequest.php b/app/Api/V1/Requests/Models/Transaction/StoreRequest.php index e651e5a1d6..c9a99f88eb 100644 --- a/app/Api/V1/Requests/Models/Transaction/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Transaction/StoreRequest.php @@ -83,87 +83,87 @@ class StoreRequest extends FormRequest foreach ($this->get('transactions') as $transaction) { $object = new NullArrayObject($transaction); $return[] = [ - 'type' => $this->clearString($object['type']), - 'date' => $this->dateFromValue($object['date']), - 'order' => $this->integerFromValue((string) $object['order']), + 'type' => $this->clearString($object['type']), + 'date' => $this->dateFromValue($object['date']), + 'order' => $this->integerFromValue((string) $object['order']), - 'currency_id' => $this->integerFromValue((string) $object['currency_id']), - 'currency_code' => $this->clearString((string) $object['currency_code']), + 'currency_id' => $this->integerFromValue((string) $object['currency_id']), + 'currency_code' => $this->clearString((string) $object['currency_code']), // location - 'latitude' => $this->floatFromValue((string) $object['latitude']), - 'longitude' => $this->floatFromValue((string) $object['longitude']), - 'zoom_level' => $this->integerFromValue((string) $object['zoom_level']), + 'latitude' => $this->floatFromValue((string) $object['latitude']), + 'longitude' => $this->floatFromValue((string) $object['longitude']), + 'zoom_level' => $this->integerFromValue((string) $object['zoom_level']), // foreign currency info: - 'foreign_currency_id' => $this->integerFromValue((string) $object['foreign_currency_id']), - 'foreign_currency_code' => $this->clearString((string) $object['foreign_currency_code']), + 'foreign_currency_id' => $this->integerFromValue((string) $object['foreign_currency_id']), + 'foreign_currency_code' => $this->clearString((string) $object['foreign_currency_code']), // amount and foreign amount. Cannot be 0. - 'amount' => $this->clearString((string) $object['amount']), - 'foreign_amount' => $this->clearString((string) $object['foreign_amount']), + 'amount' => $this->clearString((string) $object['amount']), + 'foreign_amount' => $this->clearString((string) $object['foreign_amount']), // description. - 'description' => $this->clearString($object['description']), + 'description' => $this->clearString($object['description']), // source of transaction. If everything is null, assume cash account. - 'source_id' => $this->integerFromValue((string) $object['source_id']), - 'source_name' => $this->clearString((string) $object['source_name']), - 'source_iban' => $this->clearIban((string) $object['source_iban']), - 'source_number' => $this->clearString((string) $object['source_number']), - 'source_bic' => $this->clearString((string) $object['source_bic']), + 'source_id' => $this->integerFromValue((string) $object['source_id']), + 'source_name' => $this->clearString((string) $object['source_name']), + 'source_iban' => $this->clearIban((string) $object['source_iban']), + 'source_number' => $this->clearString((string) $object['source_number']), + 'source_bic' => $this->clearString((string) $object['source_bic']), // destination of transaction. If everything is null, assume cash account. - 'destination_id' => $this->integerFromValue((string) $object['destination_id']), - 'destination_name' => $this->clearString((string) $object['destination_name']), - 'destination_iban' => $this->clearIban((string) $object['destination_iban']), - 'destination_number' => $this->clearString((string) $object['destination_number']), - 'destination_bic' => $this->clearString((string) $object['destination_bic']), + 'destination_id' => $this->integerFromValue((string) $object['destination_id']), + 'destination_name' => $this->clearString((string) $object['destination_name']), + 'destination_iban' => $this->clearIban((string) $object['destination_iban']), + 'destination_number' => $this->clearString((string) $object['destination_number']), + 'destination_bic' => $this->clearString((string) $object['destination_bic']), // budget info - 'budget_id' => $this->integerFromValue((string) $object['budget_id']), - 'budget_name' => $this->clearString((string) $object['budget_name']), + 'budget_id' => $this->integerFromValue((string) $object['budget_id']), + 'budget_name' => $this->clearString((string) $object['budget_name']), // category info - 'category_id' => $this->integerFromValue((string) $object['category_id']), - 'category_name' => $this->clearString((string) $object['category_name']), + 'category_id' => $this->integerFromValue((string) $object['category_id']), + 'category_name' => $this->clearString((string) $object['category_name']), // journal bill reference. Optional. Will only work for withdrawals - 'bill_id' => $this->integerFromValue((string) $object['bill_id']), - 'bill_name' => $this->clearString((string) $object['bill_name']), + 'bill_id' => $this->integerFromValue((string) $object['bill_id']), + 'bill_name' => $this->clearString((string) $object['bill_name']), // piggy bank reference. Optional. Will only work for transfers - 'piggy_bank_id' => $this->integerFromValue((string) $object['piggy_bank_id']), - 'piggy_bank_name' => $this->clearString((string) $object['piggy_bank_name']), + 'piggy_bank_id' => $this->integerFromValue((string) $object['piggy_bank_id']), + 'piggy_bank_name' => $this->clearString((string) $object['piggy_bank_name']), // some other interesting properties - 'reconciled' => $this->convertBoolean((string) $object['reconciled']), - 'notes' => $this->clearStringKeepNewlines((string) $object['notes']), - 'tags' => $this->arrayFromValue($object['tags']), + 'reconciled' => $this->convertBoolean((string) $object['reconciled']), + 'notes' => $this->clearStringKeepNewlines((string) $object['notes']), + 'tags' => $this->arrayFromValue($object['tags']), // all custom fields: - 'internal_reference' => $this->clearString((string) $object['internal_reference']), - 'external_id' => $this->clearString((string) $object['external_id']), - 'original_source' => sprintf('ff3-v%s', config('firefly.version')), - 'recurrence_id' => $this->integerFromValue($object['recurrence_id']), - 'bunq_payment_id' => $this->clearString((string) $object['bunq_payment_id']), - 'external_url' => $this->clearString((string) $object['external_url']), + 'internal_reference' => $this->clearString((string) $object['internal_reference']), + 'external_id' => $this->clearString((string) $object['external_id']), + 'original_source' => sprintf('ff3-v%s', config('firefly.version')), + 'recurrence_id' => $this->integerFromValue($object['recurrence_id']), + 'bunq_payment_id' => $this->clearString((string) $object['bunq_payment_id']), + 'external_url' => $this->clearString((string) $object['external_url']), - 'sepa_cc' => $this->clearString((string) $object['sepa_cc']), - 'sepa_ct_op' => $this->clearString((string) $object['sepa_ct_op']), - 'sepa_ct_id' => $this->clearString((string) $object['sepa_ct_id']), - 'sepa_db' => $this->clearString((string) $object['sepa_db']), - 'sepa_country' => $this->clearString((string) $object['sepa_country']), - 'sepa_ep' => $this->clearString((string) $object['sepa_ep']), - 'sepa_ci' => $this->clearString((string) $object['sepa_ci']), - 'sepa_batch_id' => $this->clearString((string) $object['sepa_batch_id']), + 'sepa_cc' => $this->clearString((string) $object['sepa_cc']), + 'sepa_ct_op' => $this->clearString((string) $object['sepa_ct_op']), + 'sepa_ct_id' => $this->clearString((string) $object['sepa_ct_id']), + 'sepa_db' => $this->clearString((string) $object['sepa_db']), + 'sepa_country' => $this->clearString((string) $object['sepa_country']), + 'sepa_ep' => $this->clearString((string) $object['sepa_ep']), + 'sepa_ci' => $this->clearString((string) $object['sepa_ci']), + 'sepa_batch_id' => $this->clearString((string) $object['sepa_batch_id']), // custom date fields. Must be Carbon objects. Presence is optional. - 'interest_date' => $this->dateFromValue($object['interest_date']), - 'book_date' => $this->dateFromValue($object['book_date']), - 'process_date' => $this->dateFromValue($object['process_date']), - 'due_date' => $this->dateFromValue($object['due_date']), - 'payment_date' => $this->dateFromValue($object['payment_date']), - 'invoice_date' => $this->dateFromValue($object['invoice_date']), + 'interest_date' => $this->dateFromValue($object['interest_date']), + 'book_date' => $this->dateFromValue($object['book_date']), + 'process_date' => $this->dateFromValue($object['process_date']), + 'due_date' => $this->dateFromValue($object['due_date']), + 'payment_date' => $this->dateFromValue($object['payment_date']), + 'invoice_date' => $this->dateFromValue($object['invoice_date']), ]; } diff --git a/app/Api/V2/Controllers/Controller.php b/app/Api/V2/Controllers/Controller.php index 5431e1af50..d3c5207fe2 100644 --- a/app/Api/V2/Controllers/Controller.php +++ b/app/Api/V2/Controllers/Controller.php @@ -33,7 +33,6 @@ use FireflyIII\Transformers\AbstractTransformer; use Illuminate\Database\Eloquent\Model; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Routing\Controller as BaseController; -use Illuminate\Support\Collection; use League\Fractal\Manager; use League\Fractal\Pagination\IlluminatePaginatorAdapter; use League\Fractal\Resource\Collection as FractalCollection; @@ -56,8 +55,8 @@ class Controller extends BaseController protected const string CONTENT_TYPE = 'application/vnd.api+json'; protected array $acceptedRoles = [UserRoleEnum::READ_ONLY]; - protected ParameterBag $parameters; protected bool $convertToNative = false; + protected ParameterBag $parameters; public function __construct() { diff --git a/app/Api/V2/Controllers/Transaction/List/TransactionController.php b/app/Api/V2/Controllers/Transaction/List/TransactionController.php index 0e630d7444..0de0879812 100644 --- a/app/Api/V2/Controllers/Transaction/List/TransactionController.php +++ b/app/Api/V2/Controllers/Transaction/List/TransactionController.php @@ -114,7 +114,6 @@ class TransactionController extends Controller return response() ->json($this->jsonApiList('transactions', $paginator, new TransactionGroupTransformer())) - ->header('Content-Type', self::CONTENT_TYPE) - ; + ->header('Content-Type', self::CONTENT_TYPE); } } diff --git a/app/Console/Commands/Correction/CorrectsAmounts.php b/app/Console/Commands/Correction/CorrectsAmounts.php index 3dc797dbb7..fdc206cf80 100644 --- a/app/Console/Commands/Correction/CorrectsAmounts.php +++ b/app/Console/Commands/Correction/CorrectsAmounts.php @@ -75,6 +75,65 @@ class CorrectsAmounts extends Command return 0; } + private function correctTransfers(): void + { + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class); + $type = TransactionType::where('type', TransactionTypeEnum::TRANSFER->value)->first(); + $journals = TransactionJournal::where('transaction_type_id', $type->id)->get(); + + /** @var TransactionJournal $journal */ + foreach ($journals as $journal) { + $repository->setUser($journal->user); + $native = Amount::getNativeCurrencyByUserGroup($journal->userGroup); + + /** @var null|Transaction $source */ + $source = $journal->transactions()->where('amount', '<', 0)->first(); + + /** @var null|Transaction $destination */ + $destination = $journal->transactions()->where('amount', '>', 0)->first(); + if (null === $source || null === $destination) { + continue; + } + if (null === $source->foreign_currency_id || null === $destination->foreign_currency_id) { + continue; + } + $sourceAccount = $source->account; + $destAccount = $destination->account; + if (null === $sourceAccount || null === $destAccount) { + continue; + } + $sourceCurrency = $repository->getAccountCurrency($sourceAccount) ?? $native; + $destCurrency = $repository->getAccountCurrency($destAccount) ?? $native; + + if ($sourceCurrency->id === $destCurrency->id) { + Log::debug('Both accounts have the same currency. Removing foreign currency info.'); + $source->foreign_currency_id = null; + $source->foreign_amount = null; + $source->save(); + $destination->foreign_currency_id = null; + $destination->foreign_amount = null; + $destination->save(); + + continue; + } + + // validate source + if ($destCurrency->id !== $source->foreign_currency_id) { + Log::debug(sprintf('Journal #%d: Transaction #%d refers to "%s" but should refer to "%s".', $journal->id, $source->id, $source->foreignCurrency->code, $destCurrency->code)); + $source->foreign_currency_id = $destCurrency->id; + $source->save(); + } + + // validate destination: + if ($sourceCurrency->id !== $destination->foreign_currency_id) { + Log::debug(sprintf('Journal #%d: Transaction #%d refers to "%s" but should refer to "%s".', $journal->id, $destination->id, $destination->foreignCurrency->code, $sourceCurrency->code)); + $destination->foreign_currency_id = $sourceCurrency->id; + $destination->save(); + } + } + } + private function fixAutoBudgets(): void { $count = AutoBudget::where('amount', '<', 0)->update(['amount' => DB::raw('amount * -1')]); @@ -192,63 +251,4 @@ class CorrectsAmounts extends Command return false; } - - private function correctTransfers(): void - { - /** @var AccountRepositoryInterface $repository */ - $repository = app(AccountRepositoryInterface::class); - $type = TransactionType::where('type', TransactionTypeEnum::TRANSFER->value)->first(); - $journals = TransactionJournal::where('transaction_type_id', $type->id)->get(); - - /** @var TransactionJournal $journal */ - foreach ($journals as $journal) { - $repository->setUser($journal->user); - $native = Amount::getNativeCurrencyByUserGroup($journal->userGroup); - - /** @var null|Transaction $source */ - $source = $journal->transactions()->where('amount', '<', 0)->first(); - - /** @var null|Transaction $destination */ - $destination = $journal->transactions()->where('amount', '>', 0)->first(); - if (null === $source || null === $destination) { - continue; - } - if (null === $source->foreign_currency_id || null === $destination->foreign_currency_id) { - continue; - } - $sourceAccount = $source->account; - $destAccount = $destination->account; - if (null === $sourceAccount || null === $destAccount) { - continue; - } - $sourceCurrency = $repository->getAccountCurrency($sourceAccount) ?? $native; - $destCurrency = $repository->getAccountCurrency($destAccount) ?? $native; - - if ($sourceCurrency->id === $destCurrency->id) { - Log::debug('Both accounts have the same currency. Removing foreign currency info.'); - $source->foreign_currency_id = null; - $source->foreign_amount = null; - $source->save(); - $destination->foreign_currency_id = null; - $destination->foreign_amount = null; - $destination->save(); - - continue; - } - - // validate source - if ($destCurrency->id !== $source->foreign_currency_id) { - Log::debug(sprintf('Journal #%d: Transaction #%d refers to "%s" but should refer to "%s".', $journal->id, $source->id, $source->foreignCurrency->code, $destCurrency->code)); - $source->foreign_currency_id = $destCurrency->id; - $source->save(); - } - - // validate destination: - if ($sourceCurrency->id !== $destination->foreign_currency_id) { - Log::debug(sprintf('Journal #%d: Transaction #%d refers to "%s" but should refer to "%s".', $journal->id, $destination->id, $destination->foreignCurrency->code, $sourceCurrency->code)); - $destination->foreign_currency_id = $sourceCurrency->id; - $destination->save(); - } - } - } } diff --git a/app/Console/Commands/Correction/CorrectsNativeAmounts.php b/app/Console/Commands/Correction/CorrectsNativeAmounts.php index 6e6935c049..87d84abe66 100644 --- a/app/Console/Commands/Correction/CorrectsNativeAmounts.php +++ b/app/Console/Commands/Correction/CorrectsNativeAmounts.php @@ -38,8 +38,8 @@ use FireflyIII\Models\PiggyBankEvent; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\UserGroup; -use FireflyIII\Repositories\UserGroup\UserGroupRepositoryInterface; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; +use FireflyIII\Repositories\UserGroup\UserGroupRepositoryInterface; use FireflyIII\Support\Facades\Preferences; use FireflyIII\Support\Http\Api\ExchangeRateConverter; use Illuminate\Console\Command; diff --git a/app/Console/Commands/Correction/RemovesEmptyGroups.php b/app/Console/Commands/Correction/RemovesEmptyGroups.php index 7f64fc048a..fd07c3cbb9 100644 --- a/app/Console/Commands/Correction/RemovesEmptyGroups.php +++ b/app/Console/Commands/Correction/RemovesEmptyGroups.php @@ -44,7 +44,7 @@ class RemovesEmptyGroups extends Command { $groupIds = TransactionGroup::leftJoin('transaction_journals', 'transaction_groups.id', '=', 'transaction_journals.transaction_group_id') - ->whereNull('transaction_journals.id')->get(['transaction_groups.id'])->pluck('id')->toArray() + ->whereNull('transaction_journals.id')->get(['transaction_groups.id'])->pluck('id')->toArray() ; $total = count($groupIds); diff --git a/app/Console/Commands/Integrity/ValidatesEnvironmentVariables.php b/app/Console/Commands/Integrity/ValidatesEnvironmentVariables.php index 1848770afe..aceaa211be 100644 --- a/app/Console/Commands/Integrity/ValidatesEnvironmentVariables.php +++ b/app/Console/Commands/Integrity/ValidatesEnvironmentVariables.php @@ -30,13 +30,6 @@ class ValidatesEnvironmentVariables extends Command { use ShowsFriendlyMessages; - /** - * The name and signature of the console command. - * - * @var string - */ - protected $signature = 'integrity:validates-environment-variables'; - /** * The console command description. * @@ -44,6 +37,13 @@ class ValidatesEnvironmentVariables extends Command */ protected $description = 'Makes sure you use the correct variables.'; + /** + * The name and signature of the console command. + * + * @var string + */ + protected $signature = 'integrity:validates-environment-variables'; + /** * Execute the console command. */ diff --git a/app/Console/Commands/System/OutputsInstructions.php b/app/Console/Commands/System/OutputsInstructions.php index ae703f8399..9dd17f2fff 100644 --- a/app/Console/Commands/System/OutputsInstructions.php +++ b/app/Console/Commands/System/OutputsInstructions.php @@ -172,6 +172,13 @@ class OutputsInstructions extends Command } } + private function donationText(): void + { + $this->boxed('Did you know you can support the development of Firefly III?'); + $this->boxed('You can donate in many ways, like GitHub Sponsors or Patreon.'); + $this->boxed('For more information, please visit https://bit.ly/donate-to-Firefly-III'); + } + /** * Render instructions. */ @@ -225,11 +232,4 @@ class OutputsInstructions extends Command $this->boxed(''); $this->showLine(); } - - private function donationText(): void - { - $this->boxed('Did you know you can support the development of Firefly III?'); - $this->boxed('You can donate in many ways, like GitHub Sponsors or Patreon.'); - $this->boxed('For more information, please visit https://bit.ly/donate-to-Firefly-III'); - } } diff --git a/app/Console/Commands/System/RecalculatesRunningBalance.php b/app/Console/Commands/System/RecalculatesRunningBalance.php index cd0c3874b4..5e51a4fcc6 100644 --- a/app/Console/Commands/System/RecalculatesRunningBalance.php +++ b/app/Console/Commands/System/RecalculatesRunningBalance.php @@ -31,13 +31,6 @@ class RecalculatesRunningBalance extends Command { use ShowsFriendlyMessages; - /** - * The name and signature of the console command. - * - * @var string - */ - protected $signature = 'firefly-iii:refresh-running-balance {--F|force : Force the execution of this command.}'; - /** * The console command description. * @@ -45,6 +38,13 @@ class RecalculatesRunningBalance extends Command */ protected $description = 'Refreshes all running balances. May take a long time to run if forced.'; + /** + * The name and signature of the console command. + * + * @var string + */ + protected $signature = 'firefly-iii:refresh-running-balance {--F|force : Force the execution of this command.}'; + /** * Execute the console command. */ diff --git a/app/Console/Commands/Tools/Cron.php b/app/Console/Commands/Tools/Cron.php index b7176894c0..c220ccf307 100644 --- a/app/Console/Commands/Tools/Cron.php +++ b/app/Console/Commands/Tools/Cron.php @@ -150,6 +150,23 @@ class Cron extends Command } } + private function checkForUpdates(bool $force): void + { + $updateCheck = new UpdateCheckCronjob(); + $updateCheck->setForce($force); + $updateCheck->fire(); + + if ($updateCheck->jobErrored) { + $this->friendlyError(sprintf('Error in "update check" cron: %s', $updateCheck->message)); + } + if ($updateCheck->jobFired) { + $this->friendlyInfo(sprintf('"Update check" cron fired: %s', $updateCheck->message)); + } + if ($updateCheck->jobSucceeded) { + $this->friendlyPositive(sprintf('"Update check" cron ran with success: %s', $updateCheck->message)); + } + } + /** * @throws FireflyException */ @@ -221,21 +238,4 @@ class Cron extends Command $this->friendlyPositive(sprintf('"Send bill warnings" cron ran with success: %s', $autoBudget->message)); } } - - private function checkForUpdates(bool $force): void - { - $updateCheck = new UpdateCheckCronjob(); - $updateCheck->setForce($force); - $updateCheck->fire(); - - if ($updateCheck->jobErrored) { - $this->friendlyError(sprintf('Error in "update check" cron: %s', $updateCheck->message)); - } - if ($updateCheck->jobFired) { - $this->friendlyInfo(sprintf('"Update check" cron fired: %s', $updateCheck->message)); - } - if ($updateCheck->jobSucceeded) { - $this->friendlyPositive(sprintf('"Update check" cron ran with success: %s', $updateCheck->message)); - } - } } diff --git a/app/Console/Commands/Upgrade/UpgradesNativeAmounts.php b/app/Console/Commands/Upgrade/UpgradesNativeAmounts.php index d04895c342..648237b33c 100644 --- a/app/Console/Commands/Upgrade/UpgradesNativeAmounts.php +++ b/app/Console/Commands/Upgrade/UpgradesNativeAmounts.php @@ -32,6 +32,7 @@ use Illuminate\Support\Facades\Artisan; class UpgradesNativeAmounts extends Command { use ShowsFriendlyMessages; + public const string CONFIG_NAME = '620_native_amounts'; protected $description = 'Runs the native amounts calculations.'; @@ -61,7 +62,7 @@ class UpgradesNativeAmounts extends Command { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); if (null !== $configVar) { - return (bool)$configVar->data; + return (bool) $configVar->data; } return false; diff --git a/app/Events/DestroyedTransactionLink.php b/app/Events/DestroyedTransactionLink.php index e0d128bc6e..60d43011ad 100644 --- a/app/Events/DestroyedTransactionLink.php +++ b/app/Events/DestroyedTransactionLink.php @@ -32,7 +32,9 @@ use Illuminate\Queue\SerializesModels; */ class DestroyedTransactionLink extends Event { - use SerializesModels; // @phpstan-ignore-line + use SerializesModels; + + // @phpstan-ignore-line /** * DestroyedTransactionLink constructor. diff --git a/app/Events/Model/PiggyBank/ChangedAmount.php b/app/Events/Model/PiggyBank/ChangedAmount.php index d08f93e584..f60e8a5113 100644 --- a/app/Events/Model/PiggyBank/ChangedAmount.php +++ b/app/Events/Model/PiggyBank/ChangedAmount.php @@ -37,8 +37,8 @@ class ChangedAmount extends Event { use SerializesModels; - public string $amount; - public PiggyBank $piggyBank; + public string $amount; + public PiggyBank $piggyBank; /** * Create a new event instance. diff --git a/app/Events/Security/MFABackupFewLeft.php b/app/Events/Security/MFABackupFewLeft.php index 141c6f1e69..0379afeb3e 100644 --- a/app/Events/Security/MFABackupFewLeft.php +++ b/app/Events/Security/MFABackupFewLeft.php @@ -32,6 +32,7 @@ use Illuminate\Queue\SerializesModels; class MFABackupFewLeft extends Event { use SerializesModels; + public User $user; public function __construct(null|Authenticatable|User $user, public int $count) diff --git a/app/Events/Security/MFAManyFailedAttempts.php b/app/Events/Security/MFAManyFailedAttempts.php index 0bbaf6ea08..e1b9067c5b 100644 --- a/app/Events/Security/MFAManyFailedAttempts.php +++ b/app/Events/Security/MFAManyFailedAttempts.php @@ -32,6 +32,7 @@ use Illuminate\Queue\SerializesModels; class MFAManyFailedAttempts extends Event { use SerializesModels; + public User $user; public function __construct(null|Authenticatable|User $user, public int $count) diff --git a/app/Events/Test/OwnerTestNotificationChannel.php b/app/Events/Test/OwnerTestNotificationChannel.php index 904076aac2..efce1b2a80 100644 --- a/app/Events/Test/OwnerTestNotificationChannel.php +++ b/app/Events/Test/OwnerTestNotificationChannel.php @@ -31,7 +31,7 @@ class OwnerTestNotificationChannel { use SerializesModels; - public string $channel; + public string $channel; /** * Create a new event instance. diff --git a/app/Factory/TagFactory.php b/app/Factory/TagFactory.php index 2a8b29a037..892a6cfe37 100644 --- a/app/Factory/TagFactory.php +++ b/app/Factory/TagFactory.php @@ -34,7 +34,7 @@ use FireflyIII\User; */ class TagFactory { - private User $user; + private User $user; private UserGroup $userGroup; public function findOrCreate(string $tag): ?Tag diff --git a/app/Factory/TransactionGroupFactory.php b/app/Factory/TransactionGroupFactory.php index 3d347e4b20..10ecf31b52 100644 --- a/app/Factory/TransactionGroupFactory.php +++ b/app/Factory/TransactionGroupFactory.php @@ -36,8 +36,8 @@ use FireflyIII\User; class TransactionGroupFactory { private readonly TransactionJournalFactory $journalFactory; - private User $user; - private UserGroup $userGroup; + private User $user; + private UserGroup $userGroup; /** * TransactionGroupFactory constructor. diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php index f2d716bbc4..fe17fa054d 100644 --- a/app/Factory/TransactionJournalFactory.php +++ b/app/Factory/TransactionJournalFactory.php @@ -39,9 +39,9 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface; +use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use FireflyIII\Repositories\TransactionType\TransactionTypeRepositoryInterface; -use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Services\Internal\Destroy\JournalDestroyService; use FireflyIII\Services\Internal\Support\JournalServiceTrait; use FireflyIII\Support\Facades\FireflyConfig; @@ -70,7 +70,7 @@ class TransactionJournalFactory private PiggyBankRepositoryInterface $piggyRepository; private TransactionTypeRepositoryInterface $typeRepository; private User $user; - private UserGroup $userGroup; + private UserGroup $userGroup; /** * Constructor. @@ -414,18 +414,6 @@ class TransactionJournalFactory $this->accountRepository->setUser($this->user); } - public function setUserGroup(UserGroup $userGroup): void - { - $this->userGroup = $userGroup; - $this->currencyRepository->setUserGroup($userGroup); - $this->tagFactory->setUserGroup($userGroup); - $this->billRepository->setUserGroup($userGroup); - $this->budgetRepository->setUserGroup($userGroup); - $this->categoryRepository->setUserGroup($userGroup); - $this->piggyRepository->setUserGroup($userGroup); - $this->accountRepository->setUserGroup($userGroup); - } - private function reconciliationSanityCheck(?Account $sourceAccount, ?Account $destinationAccount): array { app('log')->debug(sprintf('Now in %s', __METHOD__)); @@ -605,4 +593,16 @@ class TransactionJournalFactory app('log')->info('Will trigger duplication alert for this journal.'); } } + + public function setUserGroup(UserGroup $userGroup): void + { + $this->userGroup = $userGroup; + $this->currencyRepository->setUserGroup($userGroup); + $this->tagFactory->setUserGroup($userGroup); + $this->billRepository->setUserGroup($userGroup); + $this->budgetRepository->setUserGroup($userGroup); + $this->categoryRepository->setUserGroup($userGroup); + $this->piggyRepository->setUserGroup($userGroup); + $this->accountRepository->setUserGroup($userGroup); + } } diff --git a/app/Handlers/Events/UpdatedGroupEventHandler.php b/app/Handlers/Events/UpdatedGroupEventHandler.php index 1c86ba9106..a2e7209eb9 100644 --- a/app/Handlers/Events/UpdatedGroupEventHandler.php +++ b/app/Handlers/Events/UpdatedGroupEventHandler.php @@ -53,6 +53,55 @@ class UpdatedGroupEventHandler } + /** + * This method will make sure all source / destination accounts are the same. + */ + public function unifyAccounts(UpdatedTransactionGroup $updatedGroupEvent): void + { + $group = $updatedGroupEvent->transactionGroup; + if (1 === $group->transactionJournals->count()) { + return; + } + + // first journal: + /** @var null|TransactionJournal $first */ + $first = $group->transactionJournals() + ->orderBy('transaction_journals.date', 'DESC') + ->orderBy('transaction_journals.order', 'ASC') + ->orderBy('transaction_journals.id', 'DESC') + ->orderBy('transaction_journals.description', 'DESC') + ->first() + ; + + if (null === $first) { + Log::warning(sprintf('Group #%d has no transaction journals.', $group->id)); + + return; + } + + $all = $group->transactionJournals()->get()->pluck('id')->toArray(); + + /** @var Account $sourceAccount */ + $sourceAccount = $first->transactions()->where('amount', '<', '0')->first()->account; + + /** @var Account $destAccount */ + $destAccount = $first->transactions()->where('amount', '>', '0')->first()->account; + + $type = $first->transactionType->type; + if (TransactionTypeEnum::TRANSFER->value === $type || TransactionTypeEnum::WITHDRAWAL->value === $type) { + // set all source transactions to source account: + Transaction::whereIn('transaction_journal_id', $all) + ->where('amount', '<', 0)->update(['account_id' => $sourceAccount->id]) + ; + } + if (TransactionTypeEnum::TRANSFER->value === $type || TransactionTypeEnum::DEPOSIT->value === $type) { + // set all destination transactions to destination account: + Transaction::whereIn('transaction_journal_id', $all) + ->where('amount', '>', 0)->update(['account_id' => $destAccount->id]) + ; + } + } + /** * This method will check all the rules when a journal is updated. */ @@ -119,55 +168,6 @@ class UpdatedGroupEventHandler event(new RequestedSendWebhookMessages()); } - /** - * This method will make sure all source / destination accounts are the same. - */ - public function unifyAccounts(UpdatedTransactionGroup $updatedGroupEvent): void - { - $group = $updatedGroupEvent->transactionGroup; - if (1 === $group->transactionJournals->count()) { - return; - } - - // first journal: - /** @var null|TransactionJournal $first */ - $first = $group->transactionJournals() - ->orderBy('transaction_journals.date', 'DESC') - ->orderBy('transaction_journals.order', 'ASC') - ->orderBy('transaction_journals.id', 'DESC') - ->orderBy('transaction_journals.description', 'DESC') - ->first() - ; - - if (null === $first) { - Log::warning(sprintf('Group #%d has no transaction journals.', $group->id)); - - return; - } - - $all = $group->transactionJournals()->get()->pluck('id')->toArray(); - - /** @var Account $sourceAccount */ - $sourceAccount = $first->transactions()->where('amount', '<', '0')->first()->account; - - /** @var Account $destAccount */ - $destAccount = $first->transactions()->where('amount', '>', '0')->first()->account; - - $type = $first->transactionType->type; - if (TransactionTypeEnum::TRANSFER->value === $type || TransactionTypeEnum::WITHDRAWAL->value === $type) { - // set all source transactions to source account: - Transaction::whereIn('transaction_journal_id', $all) - ->where('amount', '<', 0)->update(['account_id' => $sourceAccount->id]) - ; - } - if (TransactionTypeEnum::TRANSFER->value === $type || TransactionTypeEnum::DEPOSIT->value === $type) { - // set all destination transactions to destination account: - Transaction::whereIn('transaction_journal_id', $all) - ->where('amount', '>', 0)->update(['account_id' => $destAccount->id]) - ; - } - } - private function updateRunningBalance(UpdatedTransactionGroup $event): void { Log::debug(__METHOD__); diff --git a/app/Handlers/Observer/AccountObserver.php b/app/Handlers/Observer/AccountObserver.php index b8f13c845d..b5f5c32443 100644 --- a/app/Handlers/Observer/AccountObserver.php +++ b/app/Handlers/Observer/AccountObserver.php @@ -29,8 +29,8 @@ use FireflyIII\Models\Attachment; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; -use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface; use FireflyIII\Repositories\Account\AccountRepositoryInterface; +use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface; use FireflyIII\Support\Facades\Amount; use FireflyIII\Support\Http\Api\ExchangeRateConverter; use Illuminate\Support\Facades\DB; diff --git a/app/Handlers/Observer/AutoBudgetObserver.php b/app/Handlers/Observer/AutoBudgetObserver.php index 15b98ef141..8ff4ff8e1f 100644 --- a/app/Handlers/Observer/AutoBudgetObserver.php +++ b/app/Handlers/Observer/AutoBudgetObserver.php @@ -37,12 +37,6 @@ class AutoBudgetObserver $this->updateNativeAmount($autoBudget); } - public function updated(AutoBudget $autoBudget): void - { - Log::debug('Observe "updated" of an auto budget.'); - $this->updateNativeAmount($autoBudget); - } - private function updateNativeAmount(AutoBudget $autoBudget): void { if (!Amount::convertToNative($autoBudget->budget->user)) { @@ -59,4 +53,10 @@ class AutoBudgetObserver $autoBudget->saveQuietly(); Log::debug('Auto budget native amount is updated.'); } + + public function updated(AutoBudget $autoBudget): void + { + Log::debug('Observe "updated" of an auto budget.'); + $this->updateNativeAmount($autoBudget); + } } diff --git a/app/Handlers/Observer/AvailableBudgetObserver.php b/app/Handlers/Observer/AvailableBudgetObserver.php index c98d44d8b6..5e1e3ef890 100644 --- a/app/Handlers/Observer/AvailableBudgetObserver.php +++ b/app/Handlers/Observer/AvailableBudgetObserver.php @@ -37,12 +37,6 @@ class AvailableBudgetObserver $this->updateNativeAmount($availableBudget); } - public function updated(AvailableBudget $availableBudget): void - { - // Log::debug('Observe "updated" of an available budget.'); - $this->updateNativeAmount($availableBudget); - } - private function updateNativeAmount(AvailableBudget $availableBudget): void { if (!Amount::convertToNative($availableBudget->user)) { @@ -61,4 +55,10 @@ class AvailableBudgetObserver $availableBudget->saveQuietly(); Log::debug('Available budget native amount is updated.'); } + + public function updated(AvailableBudget $availableBudget): void + { + // Log::debug('Observe "updated" of an available budget.'); + $this->updateNativeAmount($availableBudget); + } } diff --git a/app/Handlers/Observer/BillObserver.php b/app/Handlers/Observer/BillObserver.php index 4c3bc8441c..5ab6549a77 100644 --- a/app/Handlers/Observer/BillObserver.php +++ b/app/Handlers/Observer/BillObserver.php @@ -41,25 +41,6 @@ class BillObserver $this->updateNativeAmount($bill); } - public function deleting(Bill $bill): void - { - $repository = app(AttachmentRepositoryInterface::class); - $repository->setUser($bill->user); - - // app('log')->debug('Observe "deleting" of a bill.'); - /** @var Attachment $attachment */ - foreach ($bill->attachments()->get() as $attachment) { - $repository->destroy($attachment); - } - $bill->notes()->delete(); - } - - public function updated(Bill $bill): void - { - // Log::debug('Observe "updated" of a bill.'); - $this->updateNativeAmount($bill); - } - private function updateNativeAmount(Bill $bill): void { if (!Amount::convertToNative($bill->user)) { @@ -78,4 +59,23 @@ class BillObserver $bill->saveQuietly(); Log::debug('Bill native amounts are updated.'); } + + public function deleting(Bill $bill): void + { + $repository = app(AttachmentRepositoryInterface::class); + $repository->setUser($bill->user); + + // app('log')->debug('Observe "deleting" of a bill.'); + /** @var Attachment $attachment */ + foreach ($bill->attachments()->get() as $attachment) { + $repository->destroy($attachment); + } + $bill->notes()->delete(); + } + + public function updated(Bill $bill): void + { + // Log::debug('Observe "updated" of a bill.'); + $this->updateNativeAmount($bill); + } } diff --git a/app/Handlers/Observer/BudgetLimitObserver.php b/app/Handlers/Observer/BudgetLimitObserver.php index 3e3dc08dfe..f67e6a37e9 100644 --- a/app/Handlers/Observer/BudgetLimitObserver.php +++ b/app/Handlers/Observer/BudgetLimitObserver.php @@ -37,12 +37,6 @@ class BudgetLimitObserver $this->updateNativeAmount($budgetLimit); } - public function updated(BudgetLimit $budgetLimit): void - { - Log::debug('Observe "updated" of a budget limit.'); - $this->updateNativeAmount($budgetLimit); - } - private function updateNativeAmount(BudgetLimit $budgetLimit): void { if (!Amount::convertToNative($budgetLimit->budget->user)) { @@ -61,4 +55,10 @@ class BudgetLimitObserver $budgetLimit->saveQuietly(); Log::debug('Budget limit native amounts are updated.'); } + + public function updated(BudgetLimit $budgetLimit): void + { + Log::debug('Observe "updated" of a budget limit.'); + $this->updateNativeAmount($budgetLimit); + } } diff --git a/app/Handlers/Observer/PiggyBankEventObserver.php b/app/Handlers/Observer/PiggyBankEventObserver.php index 3238c827ce..0f62454063 100644 --- a/app/Handlers/Observer/PiggyBankEventObserver.php +++ b/app/Handlers/Observer/PiggyBankEventObserver.php @@ -37,12 +37,6 @@ class PiggyBankEventObserver $this->updateNativeAmount($event); } - public function updated(PiggyBankEvent $event): void - { - Log::debug('Observe "updated" of a piggy bank event.'); - $this->updateNativeAmount($event); - } - private function updateNativeAmount(PiggyBankEvent $event): void { $user = $event->piggyBank->accounts()->first()?->user; @@ -65,4 +59,10 @@ class PiggyBankEventObserver $event->saveQuietly(); Log::debug('Piggy bank event native amount is updated.'); } + + public function updated(PiggyBankEvent $event): void + { + Log::debug('Observe "updated" of a piggy bank event.'); + $this->updateNativeAmount($event); + } } diff --git a/app/Handlers/Observer/PiggyBankObserver.php b/app/Handlers/Observer/PiggyBankObserver.php index c1495eea3d..47f2052a84 100644 --- a/app/Handlers/Observer/PiggyBankObserver.php +++ b/app/Handlers/Observer/PiggyBankObserver.php @@ -41,6 +41,26 @@ class PiggyBankObserver $this->updateNativeAmount($piggyBank); } + private function updateNativeAmount(PiggyBank $piggyBank): void + { + $group = $piggyBank->accounts()->first()?->user->userGroup; + if (null === $group) { + Log::debug(sprintf('No account(s) yet for piggy bank #%d.', $piggyBank->id)); + + return; + } + $userCurrency = app('amount')->getNativeCurrencyByUserGroup($group); + $piggyBank->native_target_amount = null; + if ($piggyBank->transactionCurrency->id !== $userCurrency->id) { + $converter = new ExchangeRateConverter(); + $converter->setIgnoreSettings(true); + $converter->setUserGroup($group); + $piggyBank->native_target_amount = $converter->convert($piggyBank->transactionCurrency, $userCurrency, today(), $piggyBank->target_amount); + } + $piggyBank->saveQuietly(); + Log::debug('Piggy bank native target amount is updated.'); + } + /** * Also delete related objects. */ @@ -67,24 +87,4 @@ class PiggyBankObserver Log::debug('Observe "updated" of a piggy bank.'); $this->updateNativeAmount($piggyBank); } - - private function updateNativeAmount(PiggyBank $piggyBank): void - { - $group = $piggyBank->accounts()->first()?->user->userGroup; - if (null === $group) { - Log::debug(sprintf('No account(s) yet for piggy bank #%d.', $piggyBank->id)); - - return; - } - $userCurrency = app('amount')->getNativeCurrencyByUserGroup($group); - $piggyBank->native_target_amount = null; - if ($piggyBank->transactionCurrency->id !== $userCurrency->id) { - $converter = new ExchangeRateConverter(); - $converter->setIgnoreSettings(true); - $converter->setUserGroup($group); - $piggyBank->native_target_amount = $converter->convert($piggyBank->transactionCurrency, $userCurrency, today(), $piggyBank->target_amount); - } - $piggyBank->saveQuietly(); - Log::debug('Piggy bank native target amount is updated.'); - } } diff --git a/app/Handlers/Observer/TransactionObserver.php b/app/Handlers/Observer/TransactionObserver.php index 172ded4226..9869b45dd3 100644 --- a/app/Handlers/Observer/TransactionObserver.php +++ b/app/Handlers/Observer/TransactionObserver.php @@ -48,24 +48,6 @@ class TransactionObserver $this->updateNativeAmount($transaction); } - public function deleting(?Transaction $transaction): void - { - app('log')->debug('Observe "deleting" of a transaction.'); - $transaction?->transactionJournal?->delete(); - } - - public function updated(Transaction $transaction): void - { - // Log::debug('Observe "updated" of a transaction.'); - if (true === config('firefly.feature_flags.running_balance_column') && true === self::$recalculate) { - if (1 === bccomp($transaction->amount, '0')) { - Log::debug('Trigger recalculateForJournal'); - AccountBalanceCalculator::recalculateForJournal($transaction->transactionJournal); - } - } - $this->updateNativeAmount($transaction); - } - private function updateNativeAmount(Transaction $transaction): void { if (!Amount::convertToNative($transaction->transactionJournal->user)) { @@ -92,4 +74,22 @@ class TransactionObserver $transaction->saveQuietly(); Log::debug('Transaction native amounts are updated.'); } + + public function deleting(?Transaction $transaction): void + { + app('log')->debug('Observe "deleting" of a transaction.'); + $transaction?->transactionJournal?->delete(); + } + + public function updated(Transaction $transaction): void + { + // Log::debug('Observe "updated" of a transaction.'); + if (true === config('firefly.feature_flags.running_balance_column') && true === self::$recalculate) { + if (1 === bccomp($transaction->amount, '0')) { + Log::debug('Trigger recalculateForJournal'); + AccountBalanceCalculator::recalculateForJournal($transaction->transactionJournal); + } + } + $this->updateNativeAmount($transaction); + } } diff --git a/app/Helpers/Collector/Extensions/AccountCollection.php b/app/Helpers/Collector/Extensions/AccountCollection.php index 38d6a96622..a8d408a15e 100644 --- a/app/Helpers/Collector/Extensions/AccountCollection.php +++ b/app/Helpers/Collector/Extensions/AccountCollection.php @@ -36,6 +36,89 @@ use Illuminate\Support\Facades\Log; */ trait AccountCollection { + #[\Override] + public function accountBalanceIs(string $direction, string $operator, string $value): GroupCollectorInterface + { + Log::warning(sprintf('GroupCollector will be SLOW: accountBalanceIs: "%s" "%s" "%s"', $direction, $operator, $value)); + + /** + * @param int $index + * @param array $object + * + * @return bool + */ + $filter = static function (array $object) use ($direction, $operator, $value): bool { + /** @var array $transaction */ + foreach ($object['transactions'] as $transaction) { + $key = sprintf('%s_account_id', $direction); + $accountId = $transaction[$key] ?? 0; + if (0 === $accountId) { + return false; + } + + // in theory, this could lead to finding other users accounts. + /** @var null|Account $account */ + $account = Account::find($accountId); + if (null === $account) { + continue; + } + // the balance must be found BEFORE the transaction date. + // so sub one second. This is not perfect, but works well enough. + $date = clone $transaction['date']; + $date->subSecond(); + Log::debug(sprintf('accountBalanceIs: Call finalAccountBalance with date/time "%s"', $date->toIso8601String())); + $balance = Steam::finalAccountBalance($account, $date); + $result = bccomp((string) $balance['balance'], $value); + Log::debug(sprintf('"%s" vs "%s" is %d', $balance['balance'], $value, $result)); + + switch ($operator) { + default: + Log::error(sprintf('GroupCollector: accountBalanceIs: unknown operator "%s"', $operator)); + + return false; + + case '==': + Log::debug('Expect result to be 0 (equal)'); + + return 0 === $result; + + case '!=': + Log::debug('Expect result to be -1 or 1 (not equal)'); + + return 0 !== $result; + + case '>': + Log::debug('Expect result to be 1 (greater then)'); + + return 1 === $result; + + case '>=': + Log::debug('Expect result to be 0 or 1 (greater then or equal)'); + + return -1 !== $result; + + case '<': + Log::debug('Expect result to be -1 (less than)'); + + return -1 === $result; + + case '<=': + Log::debug('Expect result to be -1 or 0 (less than or equal)'); + + return 1 !== $result; + } + // if($balance['balance'] $operator $value) { + + // } + } + + return false; + }; + $this->postFilters[] = $filter; + + return $this; + } + /** * These accounts must not be included. */ @@ -231,87 +314,4 @@ trait AccountCollection return $this; } - - #[\Override] - public function accountBalanceIs(string $direction, string $operator, string $value): GroupCollectorInterface - { - Log::warning(sprintf('GroupCollector will be SLOW: accountBalanceIs: "%s" "%s" "%s"', $direction, $operator, $value)); - - /** - * @param int $index - * @param array $object - * - * @return bool - */ - $filter = static function (array $object) use ($direction, $operator, $value): bool { - /** @var array $transaction */ - foreach ($object['transactions'] as $transaction) { - $key = sprintf('%s_account_id', $direction); - $accountId = $transaction[$key] ?? 0; - if (0 === $accountId) { - return false; - } - - // in theory, this could lead to finding other users accounts. - /** @var null|Account $account */ - $account = Account::find($accountId); - if (null === $account) { - continue; - } - // the balance must be found BEFORE the transaction date. - // so sub one second. This is not perfect, but works well enough. - $date = clone $transaction['date']; - $date->subSecond(); - Log::debug(sprintf('accountBalanceIs: Call finalAccountBalance with date/time "%s"', $date->toIso8601String())); - $balance = Steam::finalAccountBalance($account, $date); - $result = bccomp((string) $balance['balance'], $value); - Log::debug(sprintf('"%s" vs "%s" is %d', $balance['balance'], $value, $result)); - - switch ($operator) { - default: - Log::error(sprintf('GroupCollector: accountBalanceIs: unknown operator "%s"', $operator)); - - return false; - - case '==': - Log::debug('Expect result to be 0 (equal)'); - - return 0 === $result; - - case '!=': - Log::debug('Expect result to be -1 or 1 (not equal)'); - - return 0 !== $result; - - case '>': - Log::debug('Expect result to be 1 (greater then)'); - - return 1 === $result; - - case '>=': - Log::debug('Expect result to be 0 or 1 (greater then or equal)'); - - return -1 !== $result; - - case '<': - Log::debug('Expect result to be -1 (less than)'); - - return -1 === $result; - - case '<=': - Log::debug('Expect result to be -1 or 0 (less than or equal)'); - - return 1 !== $result; - } - // if($balance['balance'] $operator $value) { - - // } - } - - return false; - }; - $this->postFilters[] = $filter; - - return $this; - } } diff --git a/app/Helpers/Collector/Extensions/CollectorProperties.php b/app/Helpers/Collector/Extensions/CollectorProperties.php index cfa3a5f78d..ae21d08041 100644 --- a/app/Helpers/Collector/Extensions/CollectorProperties.php +++ b/app/Helpers/Collector/Extensions/CollectorProperties.php @@ -37,6 +37,7 @@ trait CollectorProperties /** @var array */ public array $sorting; + private array $booleanFields; private ?int $endRow; private bool $expandGroupSearch; private array $fields; @@ -55,7 +56,6 @@ trait CollectorProperties private HasMany $query; private ?int $startRow; private array $stringFields; - private array $booleanFields; /* * This array is used to collect ALL tags the user may search for (using 'setTags'). * This way the user can call 'setTags' multiple times and get a joined result. diff --git a/app/Helpers/Collector/Extensions/MetaCollection.php b/app/Helpers/Collector/Extensions/MetaCollection.php index 310b9ef320..37d99ee720 100644 --- a/app/Helpers/Collector/Extensions/MetaCollection.php +++ b/app/Helpers/Collector/Extensions/MetaCollection.php @@ -29,12 +29,12 @@ use FireflyIII\Models\Bill; use FireflyIII\Models\Budget; use FireflyIII\Models\Category; use FireflyIII\Models\Tag; +use FireflyIII\Models\TransactionJournal; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder as EloquentBuilder; use Illuminate\Database\Query\JoinClause; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; -use FireflyIII\Models\TransactionJournal; /** * Trait MetaCollection diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index d47ac0d155..98f2ba1bff 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -900,16 +900,6 @@ class GroupCollector implements GroupCollectorInterface return $this; } - /** - * Limit results to a specific currency, only normal one. - */ - public function setNormalCurrency(TransactionCurrency $currency): GroupCollectorInterface - { - $this->query->where('source.transaction_currency_id', $currency->id); - - return $this; - } - public function setEndRow(int $endRow): self { $this->endRow = $endRow; @@ -957,6 +947,16 @@ class GroupCollector implements GroupCollectorInterface return $this; } + /** + * Limit results to a specific currency, only normal one. + */ + public function setNormalCurrency(TransactionCurrency $currency): GroupCollectorInterface + { + $this->query->where('source.transaction_currency_id', $currency->id); + + return $this; + } + /** * Set the page to get. */ @@ -1168,8 +1168,7 @@ class GroupCollector implements GroupCollectorInterface // include budget ID + name (if any) ->withBudgetInformation() // include bill ID + name (if any) - ->withBillInformation() - ; + ->withBillInformation(); return $this; } diff --git a/app/Helpers/Collector/GroupCollectorInterface.php b/app/Helpers/Collector/GroupCollectorInterface.php index 6ff39b81b1..8dab806e8c 100644 --- a/app/Helpers/Collector/GroupCollectorInterface.php +++ b/app/Helpers/Collector/GroupCollectorInterface.php @@ -41,6 +41,8 @@ use Illuminate\Support\Collection; */ interface GroupCollectorInterface { + public function accountBalanceIs(string $direction, string $operator, string $value): self; + /** * Get transactions with a specific amount. */ @@ -457,11 +459,6 @@ interface GroupCollectorInterface */ public function setCurrency(TransactionCurrency $currency): self; - /** - * Limit results to a specific currency, either foreign or normal one. - */ - public function setNormalCurrency(TransactionCurrency $currency): self; - /** * Set destination accounts. */ @@ -526,6 +523,11 @@ interface GroupCollectorInterface */ public function setMetaDateRange(Carbon $start, Carbon $end, string $field): self; + /** + * Limit results to a specific currency, either foreign or normal one. + */ + public function setNormalCurrency(TransactionCurrency $currency): self; + /** * Define which accounts can NOT be part of the source and destination transactions. */ @@ -737,6 +739,4 @@ interface GroupCollectorInterface public function yearIs(string $year): self; public function yearIsNot(string $year): self; - - public function accountBalanceIs(string $direction, string $operator, string $value): self; } diff --git a/app/Helpers/Report/NetWorth.php b/app/Helpers/Report/NetWorth.php index cea39dbf67..cc09678a6f 100644 --- a/app/Helpers/Report/NetWorth.php +++ b/app/Helpers/Report/NetWorth.php @@ -49,7 +49,7 @@ class NetWorth implements NetWorthInterface { private AccountRepositoryInterface $accountRepository; private CurrencyRepositoryInterface $currencyRepos; - private User $user; // @phpstan-ignore-line + private User $user; // @phpstan-ignore-line private ?UserGroup $userGroup = null; // @phpstan-ignore-line /** diff --git a/app/Helpers/Report/PopupReport.php b/app/Helpers/Report/PopupReport.php index f5e0b13757..9f0984da10 100644 --- a/app/Helpers/Report/PopupReport.php +++ b/app/Helpers/Report/PopupReport.php @@ -29,8 +29,8 @@ use FireflyIII\Models\Account; use FireflyIII\Models\Budget; use FireflyIII\Models\Category; use FireflyIII\Repositories\Account\AccountRepositoryInterface; -use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; +use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use Illuminate\Support\Collection; /** diff --git a/app/Http/Controllers/Account/IndexController.php b/app/Http/Controllers/Account/IndexController.php index 80cafd6990..99ae94aa15 100644 --- a/app/Http/Controllers/Account/IndexController.php +++ b/app/Http/Controllers/Account/IndexController.php @@ -121,6 +121,16 @@ class IndexController extends Controller return view('accounts.index', compact('objectType', 'inactivePage', 'subTitleIcon', 'subTitle', 'page', 'accounts')); } + private function subtract(array $startBalances, array $endBalances): array + { + $result = []; + foreach ($endBalances as $key => $value) { + $result[$key] = bcsub((string) $value, $startBalances[$key] ?? '0'); + } + + return $result; + } + /** * Show list of accounts. * @@ -199,14 +209,4 @@ class IndexController extends Controller return view('accounts.index', compact('objectType', 'inactiveCount', 'subTitleIcon', 'subTitle', 'page', 'accounts')); } - - private function subtract(array $startBalances, array $endBalances): array - { - $result = []; - foreach ($endBalances as $key => $value) { - $result[$key] = bcsub((string) $value, $startBalances[$key] ?? '0'); - } - - return $result; - } } diff --git a/app/Http/Controllers/Account/ReconcileController.php b/app/Http/Controllers/Account/ReconcileController.php index dccf39c835..48363ffa69 100644 --- a/app/Http/Controllers/Account/ReconcileController.php +++ b/app/Http/Controllers/Account/ReconcileController.php @@ -225,10 +225,10 @@ class ReconcileController extends Controller ] ); $submission = [ - 'user' => auth()->user(), - 'user_group' => auth()->user()->userGroup, - 'group_title' => null, - 'transactions' => [ + 'user' => auth()->user(), + 'user_group' => auth()->user()->userGroup, + 'group_title' => null, + 'transactions' => [ [ 'user' => auth()->user(), 'user_group' => auth()->user()->userGroup, diff --git a/app/Http/Controllers/Account/ShowController.php b/app/Http/Controllers/Account/ShowController.php index 7aec7bc667..b798d1a0be 100644 --- a/app/Http/Controllers/Account/ShowController.php +++ b/app/Http/Controllers/Account/ShowController.php @@ -33,7 +33,6 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Support\Debug\Timer; use FireflyIII\Support\Facades\Steam; use FireflyIII\Support\Http\Controllers\PeriodOverview; -use FireflyIII\Support\JsonApi\Enrichments\TransactionGroupEnrichment; use Illuminate\Contracts\View\Factory; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; diff --git a/app/Http/Controllers/Budget/IndexController.php b/app/Http/Controllers/Budget/IndexController.php index cbaf9d35d5..a71146878d 100644 --- a/app/Http/Controllers/Budget/IndexController.php +++ b/app/Http/Controllers/Budget/IndexController.php @@ -287,11 +287,11 @@ class IndexController extends Controller // also calculate how much left from budgeted: $sums['left'][$currencyId] ??= [ - 'amount' => '0', - 'currency_id' => $budgeted['currency_id'], - 'currency_symbol' => $budgeted['currency_symbol'], - 'currency_decimal_places' => $budgeted['currency_decimal_places'], - ]; + 'amount' => '0', + 'currency_id' => $budgeted['currency_id'], + 'currency_symbol' => $budgeted['currency_symbol'], + 'currency_decimal_places' => $budgeted['currency_decimal_places'], + ]; } } diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index a01ba3f2ed..c264db1a2c 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -35,7 +35,6 @@ use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Support\CacheProperties; -use FireflyIII\Support\Facades\Amount; use FireflyIII\Support\Facades\Steam; use FireflyIII\Support\Http\Controllers\AugumentData; use FireflyIII\Support\Http\Controllers\ChartGeneration; @@ -535,6 +534,17 @@ class AccountController extends Controller return response()->json($data); } + private function updateChartKeys(array $array, array $balances): array + { + foreach (array_keys($balances) as $key) { + $array[$key] ??= [ + 'key' => $key, + ]; + } + + return $array; + } + /** * Shows the balances for a given set of dates and accounts. * @@ -676,15 +686,4 @@ class AccountController extends Controller return response()->json($data); } - - private function updateChartKeys(array $array, array $balances): array - { - foreach (array_keys($balances) as $key) { - $array[$key] ??= [ - 'key' => $key, - ]; - } - - return $array; - } } diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index eea4e5b724..0ac831ba75 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -38,7 +38,6 @@ use FireflyIII\Repositories\Budget\NoBudgetRepositoryInterface; use FireflyIII\Repositories\Budget\OperationsRepositoryInterface; use FireflyIII\Support\CacheProperties; use FireflyIII\Support\Chart\Budget\FrontpageChartGenerator; -use FireflyIII\Support\Facades\Amount; use FireflyIII\Support\Http\Controllers\AugumentData; use FireflyIII\Support\Http\Controllers\DateCalculation; use Illuminate\Http\JsonResponse; diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index 3a88fd8f5b..b491bc06d3 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -197,11 +197,11 @@ class CategoryController extends Controller $chartData[$inKey] = [ - 'label' => sprintf('%s (%s)', (string) trans('firefly.earned'), $currencyInfo['currency_name']), - 'entries' => [], - 'type' => 'bar', - 'backgroundColor' => 'rgba(0, 141, 76, 0.5)', // green - ]; + 'label' => sprintf('%s (%s)', (string) trans('firefly.earned'), $currencyInfo['currency_name']), + 'entries' => [], + 'type' => 'bar', + 'backgroundColor' => 'rgba(0, 141, 76, 0.5)', // green + ]; // loop empty periods: foreach (array_keys($periods) as $period) { $label = $periods[$period]; diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 7bbd63c15d..2ac0db4408 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -51,13 +51,12 @@ abstract class Controller extends BaseController // fails on PHP < 8.4 public protected(set) string $name; - - protected string $dateTimeFormat; - protected string $monthAndDayFormat; - protected bool $convertToNative = false; + protected bool $convertToNative = false; + protected string $dateTimeFormat; protected ?TransactionCurrency $defaultCurrency; - protected string $monthFormat; - protected string $redirectUrl = '/'; + protected string $monthAndDayFormat; + protected string $monthFormat; + protected string $redirectUrl = '/'; /** * Controller constructor. @@ -94,8 +93,8 @@ abstract class Controller extends BaseController View::share('uploadSize', $uploadSize); // share is alpha, is beta - $isAlpha = false; - $isBeta = false; + $isAlpha = false; + $isBeta = false; $isDevelop = false; if (str_contains((string) config('firefly.version'), 'alpha')) { $isAlpha = true; @@ -120,16 +119,16 @@ abstract class Controller extends BaseController $this->monthAndDayFormat = (string) trans('config.month_and_day_js', [], $locale); $this->dateTimeFormat = (string) trans('config.date_time_js', [], $locale); $darkMode = 'browser'; - $this->defaultCurrency =null; + $this->defaultCurrency = null; // get shown-intro-preference: if (auth()->check()) { - $this->defaultCurrency = Amount::getNativeCurrency(); - $language = Steam::getLanguage(); - $locale = Steam::getLocale(); - $darkMode = app('preferences')->get('darkMode', 'browser')->data; - $this->convertToNative =Amount::convertToNative(); - $page = $this->getPageName(); - $shownDemo = $this->hasSeenDemo(); + $this->defaultCurrency = Amount::getNativeCurrency(); + $language = Steam::getLanguage(); + $locale = Steam::getLocale(); + $darkMode = app('preferences')->get('darkMode', 'browser')->data; + $this->convertToNative = Amount::convertToNative(); + $page = $this->getPageName(); + $shownDemo = $this->hasSeenDemo(); View::share('language', $language); View::share('locale', $locale); View::share('convertToNative', $this->convertToNative); diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.php index 62ba16aa7f..ece11b3d14 100644 --- a/app/Http/Controllers/DebugController.php +++ b/app/Http/Controllers/DebugController.php @@ -25,6 +25,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; use Carbon\Carbon; +use Exception; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; @@ -65,110 +66,6 @@ class DebugController extends Controller $this->middleware(IsDemoUser::class)->except(['displayError']); } - public function routes(Request $request): never - { - if (!auth()->user()->hasRole('owner')) { - throw new NotFoundHttpException(); - } - - /** @var iterable $routes */ - $routes = Route::getRoutes(); - - if ('true' === $request->get('api')) { - $collection = []; - $i = 0; - - echo 'PATHS="'; - - /** @var \Illuminate\Routing\Route $route */ - foreach ($routes as $route) { - ++$i; - // skip API and other routes. - if (!str_starts_with($route->uri(), 'api/v1') - ) { - continue; - } - // skip non GET routes - if (!in_array('GET', $route->methods(), true)) { - continue; - } - // no name route: - if (null === $route->getName()) { - var_dump($route); - - exit; - } - - echo substr($route->uri(), 3); - if (0 === $i % 5) { - echo '"
    PATHS="${PATHS},'; - } - if (0 !== $i % 5) { - echo ','; - } - } - - exit; - } - - - - $return = []; - - /** @var \Illuminate\Routing\Route $route */ - foreach ($routes as $route) { - // skip API and other routes. - if ( - str_starts_with($route->uri(), 'api') - || str_starts_with($route->uri(), '_debugbar') - || str_starts_with($route->uri(), '_ignition') - || str_starts_with($route->uri(), 'oauth') - || str_starts_with($route->uri(), 'chart') - || str_starts_with($route->uri(), 'v1/jscript') - || str_starts_with($route->uri(), 'v2/jscript') - || str_starts_with($route->uri(), 'json') - || str_starts_with($route->uri(), 'sanctum') - ) { - continue; - } - // skip non GET routes - if (!in_array('GET', $route->methods(), true)) { - continue; - } - // no name route: - if (null === $route->getName()) { - var_dump($route); - - exit; - } - if (!str_contains($route->uri(), '{')) { - - $return[$route->getName()] = route($route->getName()); - - continue; - } - $params = []; - foreach ($route->parameterNames() as $name) { - $params[] = $this->getParameter($name); - } - $return[$route->getName()] = route($route->getName(), $params); - } - $count = 0; - echo '
    '; - echo '

    Routes

    '; - echo sprintf('

    %s

    ', $count); - foreach ($return as $name => $path) { - echo sprintf('%2$s
    ', $path, $name).PHP_EOL; - ++$count; - if (0 === $count % 10) { - echo '
    '; - echo sprintf('

    %s

    ', $count); - } - } - - exit; - } - /** * Show all possible errors. * @@ -316,10 +213,10 @@ class DebugController extends Controller app('log')->debug('Could not check build date, but thats ok.'); app('log')->warning($e->getMessage()); } - if ('' !== (string) env('BASE_IMAGE_BUILD')) { // @phpstan-ignore-line + if ('' !== (string) env('BASE_IMAGE_BUILD')) { // @phpstan-ignore-line $return['base_build'] = env('BASE_IMAGE_BUILD'); // @phpstan-ignore-line } - if ('' !== (string) env('BASE_IMAGE_DATE')) { // @phpstan-ignore-line + if ('' !== (string) env('BASE_IMAGE_DATE')) { // @phpstan-ignore-line $return['base_build_date'] = env('BASE_IMAGE_DATE'); // @phpstan-ignore-line } @@ -442,19 +339,107 @@ class DebugController extends Controller return implode(' ', $flags); } - /** - * Flash all types of messages. - * - * @return Redirector|RedirectResponse - */ - public function testFlash(Request $request) + public function routes(Request $request): never { - $request->session()->flash('success', 'This is a success message.'); - $request->session()->flash('info', 'This is an info message.'); - $request->session()->flash('warning', 'This is a warning.'); - $request->session()->flash('error', 'This is an error!'); + if (!auth()->user()->hasRole('owner')) { + throw new NotFoundHttpException(); + } - return redirect(route('home')); + /** @var iterable $routes */ + $routes = Route::getRoutes(); + + if ('true' === $request->get('api')) { + $collection = []; + $i = 0; + + echo 'PATHS="'; + + /** @var \Illuminate\Routing\Route $route */ + foreach ($routes as $route) { + ++$i; + // skip API and other routes. + if (!str_starts_with($route->uri(), 'api/v1') + ) { + continue; + } + // skip non GET routes + if (!in_array('GET', $route->methods(), true)) { + continue; + } + // no name route: + if (null === $route->getName()) { + var_dump($route); + + exit; + } + + echo substr($route->uri(), 3); + if (0 === $i % 5) { + echo '"
    PATHS="${PATHS},'; + } + if (0 !== $i % 5) { + echo ','; + } + } + + exit; + } + + + $return = []; + + /** @var \Illuminate\Routing\Route $route */ + foreach ($routes as $route) { + // skip API and other routes. + if ( + str_starts_with($route->uri(), 'api') + || str_starts_with($route->uri(), '_debugbar') + || str_starts_with($route->uri(), '_ignition') + || str_starts_with($route->uri(), 'oauth') + || str_starts_with($route->uri(), 'chart') + || str_starts_with($route->uri(), 'v1/jscript') + || str_starts_with($route->uri(), 'v2/jscript') + || str_starts_with($route->uri(), 'json') + || str_starts_with($route->uri(), 'sanctum') + ) { + continue; + } + // skip non GET routes + if (!in_array('GET', $route->methods(), true)) { + continue; + } + // no name route: + if (null === $route->getName()) { + var_dump($route); + + exit; + } + if (!str_contains($route->uri(), '{')) { + + $return[$route->getName()] = route($route->getName()); + + continue; + } + $params = []; + foreach ($route->parameterNames() as $name) { + $params[] = $this->getParameter($name); + } + $return[$route->getName()] = route($route->getName(), $params); + } + $count = 0; + echo '
    '; + echo '

    Routes

    '; + echo sprintf('

    %s

    ', $count); + foreach ($return as $name => $path) { + echo sprintf('%2$s
    ', $path, $name).PHP_EOL; + ++$count; + if (0 === $count % 10) { + echo '
    '; + echo sprintf('

    %s

    ', $count); + } + } + + exit; } private function getParameter(string $name): string @@ -582,4 +567,19 @@ class DebugController extends Controller } } + + /** + * Flash all types of messages. + * + * @return Redirector|RedirectResponse + */ + public function testFlash(Request $request) + { + $request->session()->flash('success', 'This is a success message.'); + $request->session()->flash('info', 'This is an info message.'); + $request->session()->flash('warning', 'This is a warning.'); + $request->session()->flash('error', 'This is an error!'); + + return redirect(route('home')); + } } diff --git a/app/Http/Controllers/JavascriptController.php b/app/Http/Controllers/JavascriptController.php index 2fcc5b3aed..0ce2368bf4 100644 --- a/app/Http/Controllers/JavascriptController.php +++ b/app/Http/Controllers/JavascriptController.php @@ -142,7 +142,6 @@ class JavascriptController extends Controller return response() ->view('v2.javascript.variables', $data) - ->header('Content-Type', 'text/javascript') - ; + ->header('Content-Type', 'text/javascript'); } } diff --git a/app/Http/Controllers/TransactionCurrency/CreateController.php b/app/Http/Controllers/TransactionCurrency/CreateController.php index 84e30328db..49e8645775 100644 --- a/app/Http/Controllers/TransactionCurrency/CreateController.php +++ b/app/Http/Controllers/TransactionCurrency/CreateController.php @@ -27,8 +27,8 @@ namespace FireflyIII\Http\Controllers\TransactionCurrency; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\CurrencyFormRequest; -use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; +use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Contracts\View\Factory; use Illuminate\Http\RedirectResponse; diff --git a/app/Http/Controllers/TransactionCurrency/DeleteController.php b/app/Http/Controllers/TransactionCurrency/DeleteController.php index aa68b1d34e..c7cc7fb83a 100644 --- a/app/Http/Controllers/TransactionCurrency/DeleteController.php +++ b/app/Http/Controllers/TransactionCurrency/DeleteController.php @@ -26,8 +26,8 @@ namespace FireflyIII\Http\Controllers\TransactionCurrency; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\TransactionCurrency; -use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; +use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Contracts\View\Factory; use Illuminate\Http\RedirectResponse; diff --git a/app/Http/Controllers/TransactionCurrency/EditController.php b/app/Http/Controllers/TransactionCurrency/EditController.php index 80789ac1d7..926e973f44 100644 --- a/app/Http/Controllers/TransactionCurrency/EditController.php +++ b/app/Http/Controllers/TransactionCurrency/EditController.php @@ -27,8 +27,8 @@ namespace FireflyIII\Http\Controllers\TransactionCurrency; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\CurrencyFormRequest; use FireflyIII\Models\TransactionCurrency; -use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; +use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Contracts\View\Factory; use Illuminate\Http\RedirectResponse; diff --git a/app/Http/Controllers/TransactionCurrency/IndexController.php b/app/Http/Controllers/TransactionCurrency/IndexController.php index f0ae6910b4..e57cc16384 100644 --- a/app/Http/Controllers/TransactionCurrency/IndexController.php +++ b/app/Http/Controllers/TransactionCurrency/IndexController.php @@ -26,8 +26,8 @@ namespace FireflyIII\Http\Controllers\TransactionCurrency; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\TransactionCurrency; -use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; +use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Contracts\View\Factory; use Illuminate\Http\Request; diff --git a/app/Http/Middleware/InterestingMessage.php b/app/Http/Middleware/InterestingMessage.php index a953365c99..49e013d5ed 100644 --- a/app/Http/Middleware/InterestingMessage.php +++ b/app/Http/Middleware/InterestingMessage.php @@ -94,15 +94,6 @@ class InterestingMessage return null !== $transactionGroupId && null !== $message; } - private function userGroupMessage(Request $request): bool - { - // get parameters from request. - $transactionGroupId = $request->get('user_group_id'); - $message = $request->get('message'); - - return null !== $transactionGroupId && null !== $message; - } - private function handleGroupMessage(Request $request): void { // get parameters from request. @@ -141,13 +132,13 @@ class InterestingMessage } } - private function accountMessage(Request $request): bool + private function userGroupMessage(Request $request): bool { // get parameters from request. - $accountId = $request->get('account_id'); - $message = $request->get('message'); + $transactionGroupId = $request->get('user_group_id'); + $message = $request->get('message'); - return null !== $accountId && null !== $message; + return null !== $transactionGroupId && null !== $message; } private function handleUserGroupMessage(Request $request): void @@ -188,6 +179,15 @@ class InterestingMessage } } + private function accountMessage(Request $request): bool + { + // get parameters from request. + $accountId = $request->get('account_id'); + $message = $request->get('message'); + + return null !== $accountId && null !== $message; + } + private function handleAccountMessage(Request $request): void { // get parameters from request. diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index b36aaa900e..a973d14e83 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -32,7 +32,8 @@ use Symfony\Component\HttpFoundation\Request; class TrustProxies extends Middleware { // After... - protected $headers = Request::HEADER_X_FORWARDED_FOR + protected $headers + = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO diff --git a/app/Jobs/CreateRecurringTransactions.php b/app/Jobs/CreateRecurringTransactions.php index 19fe3c7d97..20a14d3895 100644 --- a/app/Jobs/CreateRecurringTransactions.php +++ b/app/Jobs/CreateRecurringTransactions.php @@ -378,10 +378,10 @@ class CreateRecurringTransactions implements ShouldQueue } $array = [ - 'user' => $recurrence->user, - 'user_group' => $recurrence->user->userGroup, - 'group_title' => $groupTitle, - 'transactions' => $this->getTransactionData($recurrence, $repetition, $date), + 'user' => $recurrence->user, + 'user_group' => $recurrence->user->userGroup, + 'group_title' => $groupTitle, + 'transactions' => $this->getTransactionData($recurrence, $repetition, $date), ]; /** @var TransactionGroup $group */ diff --git a/app/Mail/InvitationMail.php b/app/Mail/InvitationMail.php index 416aef6432..a41e6dbc6d 100644 --- a/app/Mail/InvitationMail.php +++ b/app/Mail/InvitationMail.php @@ -35,6 +35,7 @@ class InvitationMail extends Mailable { use Queueable; use SerializesModels; + public string $host; /** diff --git a/app/Mail/ReportNewJournalsMail.php b/app/Mail/ReportNewJournalsMail.php index cb166b886d..e0a492fa47 100644 --- a/app/Mail/ReportNewJournalsMail.php +++ b/app/Mail/ReportNewJournalsMail.php @@ -40,7 +40,8 @@ class ReportNewJournalsMail extends Mailable { use Queueable; use SerializesModels; - public array $transformed; + + public array $transformed; /** * ConfirmEmailChangeMail constructor. diff --git a/app/Models/Account.php b/app/Models/Account.php index fd99e855f4..f7110c38b7 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -48,15 +48,15 @@ class Account extends Model protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - 'deleted_at' => 'datetime', - 'active' => 'boolean', - 'encrypted' => 'boolean', - 'virtual_balance' => 'string', - 'native_virtual_balance' => 'string', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + 'deleted_at' => 'datetime', + 'active' => 'boolean', + 'encrypted' => 'boolean', + 'virtual_balance' => 'string', + 'native_virtual_balance' => 'string', ]; protected $fillable = ['user_id', 'user_group_id', 'account_type_id', 'name', 'active', 'virtual_balance', 'iban', 'native_virtual_balance']; diff --git a/app/Models/Attachment.php b/app/Models/Attachment.php index 6630ffdf0b..c46326e7fe 100644 --- a/app/Models/Attachment.php +++ b/app/Models/Attachment.php @@ -42,12 +42,12 @@ class Attachment extends Model protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'uploaded' => 'boolean', - 'user_id' => 'integer', - 'user_group_id' => 'integer', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'uploaded' => 'boolean', + 'user_id' => 'integer', + 'user_group_id' => 'integer', ]; protected $fillable = ['attachable_id', 'attachable_type', 'user_id', 'user_group_id', 'md5', 'filename', 'mime', 'title', 'description', 'size', 'uploaded']; diff --git a/app/Models/AutoBudget.php b/app/Models/AutoBudget.php index 922931d5d4..85deb27d83 100644 --- a/app/Models/AutoBudget.php +++ b/app/Models/AutoBudget.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Models; +use Deprecated; use FireflyIII\Support\Models\ReturnsIntegerIdTrait; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Model; @@ -35,13 +36,13 @@ class AutoBudget extends Model use ReturnsIntegerIdTrait; use SoftDeletes; - #[\Deprecated] /** @deprecated */ + #[\Deprecated] /** @deprecated */ public const int AUTO_BUDGET_ADJUSTED = 3; - #[\Deprecated] /** @deprecated */ + #[\Deprecated] /** @deprecated */ public const int AUTO_BUDGET_RESET = 1; - #[\Deprecated] /** @deprecated */ + #[\Deprecated] /** @deprecated */ public const int AUTO_BUDGET_ROLLOVER = 2; protected $casts = [ diff --git a/app/Models/AvailableBudget.php b/app/Models/AvailableBudget.php index 55c16d3df5..043ee93cf5 100644 --- a/app/Models/AvailableBudget.php +++ b/app/Models/AvailableBudget.php @@ -41,16 +41,16 @@ class AvailableBudget extends Model protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'start_date' => 'date', - 'end_date' => 'date', - 'transaction_currency_id' => 'int', - 'amount' => 'string', - 'native_amount' => 'string', - 'user_id' => 'integer', - 'user_group_id' => 'integer', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'start_date' => 'date', + 'end_date' => 'date', + 'transaction_currency_id' => 'int', + 'amount' => 'string', + 'native_amount' => 'string', + 'user_id' => 'integer', + 'user_group_id' => 'integer', ]; protected $fillable = ['user_id', 'user_group_id', 'transaction_currency_id', 'amount', 'start_date', 'end_date', 'start_date_tz', 'end_date_tz', 'native_amount']; @@ -95,10 +95,11 @@ class AvailableBudget extends Model ); } - protected function transactionCurrencyId(): Attribute + protected function endDate(): Attribute { return Attribute::make( - get: static fn ($value) => (int) $value, + get: fn (string $value) => Carbon::parse($value), + set: fn (Carbon $value) => $value->format('Y-m-d'), ); } @@ -110,11 +111,10 @@ class AvailableBudget extends Model ); } - protected function endDate(): Attribute + protected function transactionCurrencyId(): Attribute { return Attribute::make( - get: fn (string $value) => Carbon::parse($value), - set: fn (Carbon $value) => $value->format('Y-m-d'), + get: static fn ($value) => (int) $value, ); } } diff --git a/app/Models/Bill.php b/app/Models/Bill.php index 273b9d0628..2e3ef309ea 100644 --- a/app/Models/Bill.php +++ b/app/Models/Bill.php @@ -44,21 +44,21 @@ class Bill extends Model protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'date' => SeparateTimezoneCaster::class, - 'end_date' => SeparateTimezoneCaster::class, - 'extension_date' => SeparateTimezoneCaster::class, - 'skip' => 'int', - 'automatch' => 'boolean', - 'active' => 'boolean', - 'name_encrypted' => 'boolean', - 'match_encrypted' => 'boolean', - 'amount_min' => 'string', - 'amount_max' => 'string', - 'native_amount_min' => 'string', - 'native_amount_max' => 'string', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'date' => SeparateTimezoneCaster::class, + 'end_date' => SeparateTimezoneCaster::class, + 'extension_date' => SeparateTimezoneCaster::class, + 'skip' => 'int', + 'automatch' => 'boolean', + 'active' => 'boolean', + 'name_encrypted' => 'boolean', + 'match_encrypted' => 'boolean', + 'amount_min' => 'string', + 'amount_max' => 'string', + 'native_amount_min' => 'string', + 'native_amount_max' => 'string', ]; protected $fillable diff --git a/app/Models/Budget.php b/app/Models/Budget.php index 42a42a39cf..ca1f083071 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -43,13 +43,13 @@ class Budget extends Model protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'active' => 'boolean', - 'encrypted' => 'boolean', - 'user_id' => 'integer', - 'user_group_id' => 'integer', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'active' => 'boolean', + 'encrypted' => 'boolean', + 'user_id' => 'integer', + 'user_group_id' => 'integer', ]; protected $fillable = ['user_id', 'user_group_id', 'name', 'active', 'order', 'user_group_id']; diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.php index c330ab4f5b..6f1c891182 100644 --- a/app/Models/BudgetLimit.php +++ b/app/Models/BudgetLimit.php @@ -40,13 +40,13 @@ class BudgetLimit extends Model protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'start_date' => SeparateTimezoneCaster::class, - 'end_date' => SeparateTimezoneCaster::class, - 'auto_budget' => 'boolean', - 'amount' => 'string', - 'native_amount' => 'string', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'start_date' => SeparateTimezoneCaster::class, + 'end_date' => SeparateTimezoneCaster::class, + 'auto_budget' => 'boolean', + 'amount' => 'string', + 'native_amount' => 'string', ]; protected $dispatchesEvents = [ diff --git a/app/Models/Category.php b/app/Models/Category.php index 2b0ab99837..a426ffa0a1 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -42,12 +42,12 @@ class Category extends Model protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'encrypted' => 'boolean', - 'user_id' => 'integer', - 'user_group_id' => 'integer', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'encrypted' => 'boolean', + 'user_id' => 'integer', + 'user_group_id' => 'integer', ]; protected $fillable = ['user_id', 'user_group_id', 'name']; diff --git a/app/Models/CurrencyExchangeRate.php b/app/Models/CurrencyExchangeRate.php index 9d6fb264ba..430a8c2464 100644 --- a/app/Models/CurrencyExchangeRate.php +++ b/app/Models/CurrencyExchangeRate.php @@ -40,15 +40,15 @@ class CurrencyExchangeRate extends Model protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - 'from_currency_id' => 'integer', - 'to_currency_id' => 'integer', - 'date' => SeparateTimezoneCaster::class, - 'rate' => 'string', - 'user_rate' => 'string', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + 'from_currency_id' => 'integer', + 'to_currency_id' => 'integer', + 'date' => SeparateTimezoneCaster::class, + 'rate' => 'string', + 'user_rate' => 'string', ]; protected $fillable = ['user_id', 'from_currency_id', 'to_currency_id', 'date', 'date_tz', 'rate']; diff --git a/app/Models/GroupMembership.php b/app/Models/GroupMembership.php index ef8c189f75..1be2ef9b1d 100644 --- a/app/Models/GroupMembership.php +++ b/app/Models/GroupMembership.php @@ -36,12 +36,13 @@ class GroupMembership extends Model use ReturnsIntegerIdTrait; use ReturnsIntegerUserIdTrait; - protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - ]; + protected $casts + = [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + ]; protected $fillable = ['user_id', 'user_group_id', 'user_role_id']; diff --git a/app/Models/InvitedUser.php b/app/Models/InvitedUser.php index 67a8853a00..da0d77e670 100644 --- a/app/Models/InvitedUser.php +++ b/app/Models/InvitedUser.php @@ -39,10 +39,10 @@ class InvitedUser extends Model protected $casts = [ - 'expires' => SeparateTimezoneCaster::class, - 'redeemed' => 'boolean', - 'user_id' => 'integer', - 'user_group_id' => 'integer', + 'expires' => SeparateTimezoneCaster::class, + 'redeemed' => 'boolean', + 'user_id' => 'integer', + 'user_group_id' => 'integer', ]; protected $fillable = ['user_group_id', 'user_id', 'email', 'invite_code', 'expires', 'expires_tz', 'redeemed']; diff --git a/app/Models/ObjectGroup.php b/app/Models/ObjectGroup.php index 6c37589ce6..a13614d01c 100644 --- a/app/Models/ObjectGroup.php +++ b/app/Models/ObjectGroup.php @@ -40,11 +40,11 @@ class ObjectGroup extends Model protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - 'deleted_at' => 'datetime', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + 'deleted_at' => 'datetime', ]; protected $fillable = ['title', 'order', 'user_id', 'user_group_id']; diff --git a/app/Models/Preference.php b/app/Models/Preference.php index 529c6d6694..dbf2ef212f 100644 --- a/app/Models/Preference.php +++ b/app/Models/Preference.php @@ -37,11 +37,11 @@ class Preference extends Model protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'data' => 'array', - 'user_id' => 'integer', - 'user_group_id' => 'integer', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'data' => 'array', + 'user_id' => 'integer', + 'user_group_id' => 'integer', ]; protected $fillable = ['user_id', 'data', 'name', 'user_group_id']; diff --git a/app/Models/Recurrence.php b/app/Models/Recurrence.php index 235501eb51..5d4ad39ccd 100644 --- a/app/Models/Recurrence.php +++ b/app/Models/Recurrence.php @@ -44,20 +44,20 @@ class Recurrence extends Model protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'title' => 'string', - 'id' => 'int', - 'description' => 'string', - 'first_date' => SeparateTimezoneCaster::class, - 'repeat_until' => SeparateTimezoneCaster::class, - 'latest_date' => SeparateTimezoneCaster::class, - 'repetitions' => 'int', - 'active' => 'bool', - 'apply_rules' => 'bool', - 'user_id' => 'integer', - 'user_group_id' => 'integer', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'title' => 'string', + 'id' => 'int', + 'description' => 'string', + 'first_date' => SeparateTimezoneCaster::class, + 'repeat_until' => SeparateTimezoneCaster::class, + 'latest_date' => SeparateTimezoneCaster::class, + 'repetitions' => 'int', + 'active' => 'bool', + 'apply_rules' => 'bool', + 'user_id' => 'integer', + 'user_group_id' => 'integer', ]; protected $fillable diff --git a/app/Models/RecurrenceRepetition.php b/app/Models/RecurrenceRepetition.php index 5d66eb7e30..a5bcfc7f17 100644 --- a/app/Models/RecurrenceRepetition.php +++ b/app/Models/RecurrenceRepetition.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Models; +use Deprecated; use FireflyIII\Support\Models\ReturnsIntegerIdTrait; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Model; @@ -35,16 +36,16 @@ class RecurrenceRepetition extends Model use ReturnsIntegerIdTrait; use SoftDeletes; - #[\Deprecated] /** @deprecated */ + #[\Deprecated] /** @deprecated */ public const int WEEKEND_DO_NOTHING = 1; - #[\Deprecated] /** @deprecated */ + #[\Deprecated] /** @deprecated */ public const int WEEKEND_SKIP_CREATION = 2; - #[\Deprecated] /** @deprecated */ + #[\Deprecated] /** @deprecated */ public const int WEEKEND_TO_FRIDAY = 3; - #[\Deprecated] /** @deprecated */ + #[\Deprecated] /** @deprecated */ public const int WEEKEND_TO_MONDAY = 4; protected $casts diff --git a/app/Models/Rule.php b/app/Models/Rule.php index 9c4e2f9a45..86d8c36f20 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -41,16 +41,16 @@ class Rule extends Model protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'active' => 'boolean', - 'order' => 'int', - 'stop_processing' => 'boolean', - 'id' => 'int', - 'strict' => 'boolean', - 'user_id' => 'integer', - 'user_group_id' => 'integer', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'active' => 'boolean', + 'order' => 'int', + 'stop_processing' => 'boolean', + 'id' => 'int', + 'strict' => 'boolean', + 'user_id' => 'integer', + 'user_group_id' => 'integer', ]; protected $fillable = ['rule_group_id', 'order', 'active', 'title', 'description', 'user_id', 'user_group_id', 'strict']; diff --git a/app/Models/RuleGroup.php b/app/Models/RuleGroup.php index 1f15b7fee6..02b6494bda 100644 --- a/app/Models/RuleGroup.php +++ b/app/Models/RuleGroup.php @@ -41,14 +41,14 @@ class RuleGroup extends Model protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'active' => 'boolean', - 'stop_processing' => 'boolean', - 'order' => 'int', - 'user_id' => 'integer', - 'user_group_id' => 'integer', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'active' => 'boolean', + 'stop_processing' => 'boolean', + 'order' => 'int', + 'user_id' => 'integer', + 'user_group_id' => 'integer', ]; protected $fillable = ['user_id', 'user_group_id', 'stop_processing', 'order', 'title', 'description', 'active']; diff --git a/app/Models/Tag.php b/app/Models/Tag.php index aa92e5e1b0..fed190c86a 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -42,15 +42,15 @@ class Tag extends Model protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'date' => SeparateTimezoneCaster::class, - 'zoomLevel' => 'int', - 'latitude' => 'float', - 'longitude' => 'float', - 'user_id' => 'integer', - 'user_group_id' => 'integer', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'date' => SeparateTimezoneCaster::class, + 'zoomLevel' => 'int', + 'latitude' => 'float', + 'longitude' => 'float', + 'user_id' => 'integer', + 'user_group_id' => 'integer', ]; protected $fillable = ['user_id', 'user_group_id', 'tag', 'date', 'date_tz', 'description', 'tagMode']; diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index 65aff28889..cad47192fa 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -41,21 +41,21 @@ class Transaction extends Model protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'identifier' => 'int', - 'encrypted' => 'boolean', // model does not have these fields though - 'bill_name_encrypted' => 'boolean', - 'reconciled' => 'boolean', - 'balance_dirty' => 'boolean', - 'balance_before' => 'string', - 'balance_after' => 'string', - 'date' => 'datetime', - 'amount' => 'string', - 'foreign_amount' => 'string', - 'native_amount' => 'string', - 'native_foreign_amount' => 'string', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'identifier' => 'int', + 'encrypted' => 'boolean', // model does not have these fields though + 'bill_name_encrypted' => 'boolean', + 'reconciled' => 'boolean', + 'balance_dirty' => 'boolean', + 'balance_before' => 'string', + 'balance_after' => 'string', + 'date' => 'datetime', + 'amount' => 'string', + 'foreign_amount' => 'string', + 'native_amount' => 'string', + 'native_foreign_amount' => 'string', ]; protected $fillable diff --git a/app/Models/TransactionCurrency.php b/app/Models/TransactionCurrency.php index f20211ff17..33f08ee01b 100644 --- a/app/Models/TransactionCurrency.php +++ b/app/Models/TransactionCurrency.php @@ -37,8 +37,8 @@ class TransactionCurrency extends Model use ReturnsIntegerIdTrait; use SoftDeletes; - public ?bool $userGroupNative = null; public ?bool $userGroupEnabled = null; + public ?bool $userGroupNative = null; protected $casts = [ 'created_at' => 'datetime', diff --git a/app/Models/TransactionGroup.php b/app/Models/TransactionGroup.php index dfddb2f66c..9128667f97 100644 --- a/app/Models/TransactionGroup.php +++ b/app/Models/TransactionGroup.php @@ -40,14 +40,14 @@ class TransactionGroup extends Model protected $casts = [ - 'id' => 'integer', - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'title' => 'string', - 'date' => 'datetime', - 'user_id' => 'integer', - 'user_group_id' => 'integer', + 'id' => 'integer', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'title' => 'string', + 'date' => 'datetime', + 'user_id' => 'integer', + 'user_group_id' => 'integer', ]; protected $fillable = ['user_id', 'user_group_id', 'title']; diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index b777a87a0b..6c39101e1a 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -54,19 +54,19 @@ class TransactionJournal extends Model protected $casts = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'date' => SeparateTimezoneCaster::class, - 'interest_date' => 'date', - 'book_date' => 'date', - 'process_date' => 'date', - 'order' => 'int', - 'tag_count' => 'int', - 'encrypted' => 'boolean', - 'completed' => 'boolean', - 'user_id' => 'integer', - 'user_group_id' => 'integer', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'date' => SeparateTimezoneCaster::class, + 'interest_date' => 'date', + 'book_date' => 'date', + 'process_date' => 'date', + 'order' => 'int', + 'tag_count' => 'int', + 'encrypted' => 'boolean', + 'completed' => 'boolean', + 'user_id' => 'integer', + 'user_group_id' => 'integer', ]; protected $fillable @@ -114,11 +114,6 @@ class TransactionJournal extends Model return $this->belongsTo(User::class); } - public function userGroup(): BelongsTo - { - return $this->belongsTo(UserGroup::class); - } - public function attachments(): MorphMany { return $this->morphMany(Attachment::class, 'attachable'); @@ -246,6 +241,11 @@ class TransactionJournal extends Model return $this->hasMany(Transaction::class); } + public function userGroup(): BelongsTo + { + return $this->belongsTo(UserGroup::class); + } + protected function order(): Attribute { return Attribute::make( diff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.php index 3d5390b3da..06fcde6c17 100644 --- a/app/Models/TransactionType.php +++ b/app/Models/TransactionType.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Models; +use Deprecated; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Support\Models\ReturnsIntegerIdTrait; use Illuminate\Database\Eloquent\Model; @@ -35,25 +36,25 @@ class TransactionType extends Model use ReturnsIntegerIdTrait; use SoftDeletes; - #[\Deprecated] /** @deprecated */ + #[\Deprecated] /** @deprecated */ public const string DEPOSIT = 'Deposit'; - #[\Deprecated] /** @deprecated */ + #[\Deprecated] /** @deprecated */ public const string INVALID = 'Invalid'; - #[\Deprecated] /** @deprecated */ + #[\Deprecated] /** @deprecated */ public const string LIABILITY_CREDIT = 'Liability credit'; - #[\Deprecated] /** @deprecated */ + #[\Deprecated] /** @deprecated */ public const string OPENING_BALANCE = 'Opening balance'; - #[\Deprecated] /** @deprecated */ + #[\Deprecated] /** @deprecated */ public const string RECONCILIATION = 'Reconciliation'; - #[\Deprecated] /** @deprecated */ + #[\Deprecated] /** @deprecated */ public const string TRANSFER = 'Transfer'; - #[\Deprecated] /** @deprecated */ + #[\Deprecated] /** @deprecated */ public const string WITHDRAWAL = 'Withdrawal'; protected $casts diff --git a/app/Models/Webhook.php b/app/Models/Webhook.php index b70c509711..7932894770 100644 --- a/app/Models/Webhook.php +++ b/app/Models/Webhook.php @@ -44,12 +44,12 @@ class Webhook extends Model protected $casts = [ - 'active' => 'boolean', - 'trigger' => 'integer', - 'response' => 'integer', - 'delivery' => 'integer', - 'user_id' => 'integer', - 'user_group_id' => 'integer', + 'active' => 'boolean', + 'trigger' => 'integer', + 'response' => 'integer', + 'delivery' => 'integer', + 'user_id' => 'integer', + 'user_group_id' => 'integer', ]; protected $fillable = ['active', 'trigger', 'response', 'delivery', 'user_id', 'user_group_id', 'url', 'title', 'secret']; diff --git a/app/Policies/AccountPolicy.php b/app/Policies/AccountPolicy.php index 02a0d920c3..7897ca32bc 100644 --- a/app/Policies/AccountPolicy.php +++ b/app/Policies/AccountPolicy.php @@ -40,6 +40,14 @@ class AccountPolicy return $this->view($user, $account); } + /** + * TODO needs better authentication, also for group. + */ + public function view(User $user, Account $account): bool + { + return auth()->check() && $user->id === $account->user_id; + } + /** * Everybody can do this, but selection should limit to user. */ @@ -57,12 +65,4 @@ class AccountPolicy { return $this->view($user, $account); } - - /** - * TODO needs better authentication, also for group. - */ - public function view(User $user, Account $account): bool - { - return auth()->check() && $user->id === $account->user_id; - } } diff --git a/app/Providers/CurrencyServiceProvider.php b/app/Providers/CurrencyServiceProvider.php index 05b875811e..4f9c466cb8 100644 --- a/app/Providers/CurrencyServiceProvider.php +++ b/app/Providers/CurrencyServiceProvider.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Providers; use FireflyIII\Repositories\Currency\CurrencyRepository; -use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepository as GroupCurrencyRepository; +use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface as GroupCurrencyRepositoryInterface; use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepository; use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepositoryInterface; diff --git a/app/Providers/FireflySessionProvider.php b/app/Providers/FireflySessionProvider.php index 9fb080ea35..249325dd55 100644 --- a/app/Providers/FireflySessionProvider.php +++ b/app/Providers/FireflySessionProvider.php @@ -67,7 +67,7 @@ class FireflySessionProvider extends ServiceProvider // First, we will create the session manager which is responsible for the // creation of the various session drivers when they are needed by the // application instance, and will resolve them on a lazy load basis. - => $app->make('session')->driver() + => $app->make('session')->driver() ); } } diff --git a/app/Providers/SearchServiceProvider.php b/app/Providers/SearchServiceProvider.php index 56b1c86b40..10df8973e2 100644 --- a/app/Providers/SearchServiceProvider.php +++ b/app/Providers/SearchServiceProvider.php @@ -23,8 +23,8 @@ declare(strict_types=1); namespace FireflyIII\Providers; -use FireflyIII\Support\Search\QueryParser\GdbotsQueryParser; use FireflyIII\Support\Search\OperatorQuerySearch; +use FireflyIII\Support\Search\QueryParser\GdbotsQueryParser; use FireflyIII\Support\Search\QueryParser\QueryParser; use FireflyIII\Support\Search\QueryParser\QueryParserInterface; use FireflyIII\Support\Search\SearchInterface; diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index d7834bcf9f..c498f6a5b1 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -533,6 +533,38 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac return null; } + #[\Override] + public function periodCollection(Account $account, Carbon $start, Carbon $end): array + { + return $account->transactions() + ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id') + ->leftJoin('transaction_currencies', 'transaction_currencies.id', '=', 'transactions.transaction_currency_id') + ->leftJoin('transaction_currencies as foreign_currencies', 'foreign_currencies.id', '=', 'transactions.foreign_currency_id') + ->where('transaction_journals.date', '>=', $start) + ->where('transaction_journals.date', '<=', $end) + ->get([ + // currencies + 'transaction_currencies.id as currency_id', + 'transaction_currencies.code as currency_code', + 'transaction_currencies.name as currency_name', + 'transaction_currencies.symbol as currency_symbol', + 'transaction_currencies.decimal_places as currency_decimal_places', + + // foreign + 'foreign_currencies.id as foreign_currency_id', + 'foreign_currencies.code as foreign_currency_code', + 'foreign_currencies.name as foreign_currency_name', + 'foreign_currencies.symbol as foreign_currency_symbol', + 'foreign_currencies.decimal_places as foreign_currency_decimal_places', + + // fields + 'transaction_journals.date', 'transaction_types.type', 'transaction_journals.transaction_currency_id', 'transactions.amount']) + ->toArray() + ; + + } + public function resetAccountOrder(): void { $sets = [ @@ -650,36 +682,4 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac return $factory->create($data); } - - #[\Override] - public function periodCollection(Account $account, Carbon $start, Carbon $end): array - { - return $account->transactions() - ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') - ->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id') - ->leftJoin('transaction_currencies', 'transaction_currencies.id', '=', 'transactions.transaction_currency_id') - ->leftJoin('transaction_currencies as foreign_currencies', 'foreign_currencies.id', '=', 'transactions.foreign_currency_id') - ->where('transaction_journals.date', '>=', $start) - ->where('transaction_journals.date', '<=', $end) - ->get([ - // currencies - 'transaction_currencies.id as currency_id', - 'transaction_currencies.code as currency_code', - 'transaction_currencies.name as currency_name', - 'transaction_currencies.symbol as currency_symbol', - 'transaction_currencies.decimal_places as currency_decimal_places', - - // foreign - 'foreign_currencies.id as foreign_currency_id', - 'foreign_currencies.code as foreign_currency_code', - 'foreign_currencies.name as foreign_currency_name', - 'foreign_currencies.symbol as foreign_currency_symbol', - 'foreign_currencies.decimal_places as foreign_currency_decimal_places', - - // fields - 'transaction_journals.date', 'transaction_types.type', 'transaction_journals.transaction_currency_id', 'transactions.amount']) - ->toArray() - ; - - } } diff --git a/app/Repositories/Account/AccountRepositoryInterface.php b/app/Repositories/Account/AccountRepositoryInterface.php index 6bfb568c28..8f54067bc5 100644 --- a/app/Repositories/Account/AccountRepositoryInterface.php +++ b/app/Repositories/Account/AccountRepositoryInterface.php @@ -71,8 +71,6 @@ interface AccountRepositoryInterface public function findByName(string $name, array $types): ?Account; - public function periodCollection(Account $account, Carbon $start, Carbon $end): array; - public function getAccountBalances(Account $account): Collection; public function getAccountCurrency(Account $account): ?TransactionCurrency; @@ -151,6 +149,8 @@ interface AccountRepositoryInterface */ public function oldestJournalDate(Account $account): ?Carbon; + public function periodCollection(Account $account, Carbon $start, Carbon $end): array; + /** * Reset order types of the mentioned accounts. */ diff --git a/app/Repositories/Category/NoCategoryRepository.php b/app/Repositories/Category/NoCategoryRepository.php index 8c687125f6..7ca31375bc 100644 --- a/app/Repositories/Category/NoCategoryRepository.php +++ b/app/Repositories/Category/NoCategoryRepository.php @@ -77,9 +77,9 @@ class NoCategoryRepository implements NoCategoryRepositoryInterface, UserGroupIn $journalId = (int) $journal['transaction_journal_id']; $array[$currencyId]['categories'][0]['transaction_journals'][$journalId] = [ - 'amount' => app('steam')->negative($journal['amount']), - 'date' => $journal['date'], - ]; + 'amount' => app('steam')->negative($journal['amount']), + 'date' => $journal['date'], + ]; } return $array; @@ -123,9 +123,9 @@ class NoCategoryRepository implements NoCategoryRepositoryInterface, UserGroupIn $journalId = (int) $journal['transaction_journal_id']; $array[$currencyId]['categories'][0]['transaction_journals'][$journalId] = [ - 'amount' => app('steam')->positive($journal['amount']), - 'date' => $journal['date'], - ]; + 'amount' => app('steam')->positive($journal['amount']), + 'date' => $journal['date'], + ]; } return $array; diff --git a/app/Repositories/Webhook/WebhookRepository.php b/app/Repositories/Webhook/WebhookRepository.php index 256d0d34e7..6d684b8984 100644 --- a/app/Repositories/Webhook/WebhookRepository.php +++ b/app/Repositories/Webhook/WebhookRepository.php @@ -79,9 +79,8 @@ class WebhookRepository implements WebhookRepositoryInterface, UserGroupInterfac ->where('webhook_messages.errored', 0) ->get(['webhook_messages.*']) ->filter( - static fn (WebhookMessage $message) - // @phpstan-ignore-line - => $message->webhookAttempts()->count() <= 2 + static fn (WebhookMessage $message) // @phpstan-ignore-line + => $message->webhookAttempts()->count() <= 2 )->splice(0, 3) ; } diff --git a/app/Rules/BelongsUser.php b/app/Rules/BelongsUser.php index d1a67e8ca8..564b030443 100644 --- a/app/Rules/BelongsUser.php +++ b/app/Rules/BelongsUser.php @@ -82,8 +82,6 @@ class BelongsUser implements ValidationRule { - - $count = PiggyBank::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id') ->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id') ->where('piggy_banks.id', '=', $value) @@ -104,32 +102,6 @@ class BelongsUser implements ValidationRule return $count > 0; } - protected function countField(string $class, string $field, string $value): int - { - $value = trim($value); - $objects = []; - // get all objects belonging to user: - if (PiggyBank::class === $class) { - $objects = PiggyBank::leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id') - ->where('accounts.user_id', '=', auth()->user()->id)->get(['piggy_banks.*']) - ; - } - if (PiggyBank::class !== $class) { - $objects = $class::where('user_id', '=', auth()->user()->id)->get(); - } - $count = 0; - foreach ($objects as $object) { - $objectValue = trim((string) $object->{$field}); // @phpstan-ignore-line - app('log')->debug(sprintf('Comparing object "%s" with value "%s"', $objectValue, $value)); - if ($objectValue === $value) { - ++$count; - app('log')->debug(sprintf('Hit! Count is now %d', $count)); - } - } - - return $count; - } - private function validateBillId(int $value): bool { if (0 === $value) { @@ -158,6 +130,32 @@ class BelongsUser implements ValidationRule return 1 === $count; } + protected function countField(string $class, string $field, string $value): int + { + $value = trim($value); + $objects = []; + // get all objects belonging to user: + if (PiggyBank::class === $class) { + $objects = PiggyBank::leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id') + ->where('accounts.user_id', '=', auth()->user()->id)->get(['piggy_banks.*']) + ; + } + if (PiggyBank::class !== $class) { + $objects = $class::where('user_id', '=', auth()->user()->id)->get(); + } + $count = 0; + foreach ($objects as $object) { + $objectValue = trim((string) $object->{$field}); // @phpstan-ignore-line + app('log')->debug(sprintf('Comparing object "%s" with value "%s"', $objectValue, $value)); + if ($objectValue === $value) { + ++$count; + app('log')->debug(sprintf('Hit! Count is now %d', $count)); + } + } + + return $count; + } + private function validateBudgetId(int $value): bool { if (0 === $value) { diff --git a/app/Rules/IsAllowedGroupAction.php b/app/Rules/IsAllowedGroupAction.php index b671526366..46c717ef44 100644 --- a/app/Rules/IsAllowedGroupAction.php +++ b/app/Rules/IsAllowedGroupAction.php @@ -34,7 +34,7 @@ use Illuminate\Support\Facades\Log; class IsAllowedGroupAction implements ValidationRule { - private array $acceptedRoles; + private array $acceptedRoles; private readonly UserGroupRepositoryInterface $repository; public function __construct(private readonly string $className, private readonly string $methodName) diff --git a/app/Rules/UniqueIban.php b/app/Rules/UniqueIban.php index 1a4167ee3f..6c1e312d79 100644 --- a/app/Rules/UniqueIban.php +++ b/app/Rules/UniqueIban.php @@ -34,7 +34,7 @@ use Illuminate\Contracts\Validation\ValidationRule; */ class UniqueIban implements ValidationRule { - private array $expectedTypes; + private array $expectedTypes; /** * Create a new rule instance. @@ -153,10 +153,10 @@ class UniqueIban implements ValidationRule } $query = auth()->user() - ->accounts() - ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') - ->where('accounts.iban', $iban) - ->whereIn('account_types.type', $typesArray) + ->accounts() + ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') + ->where('accounts.iban', $iban) + ->whereIn('account_types.type', $typesArray) ; if (null !== $this->account) { diff --git a/app/Services/Internal/Support/AccountServiceTrait.php b/app/Services/Internal/Support/AccountServiceTrait.php index 75cb0ad95c..787a08c239 100644 --- a/app/Services/Internal/Support/AccountServiceTrait.php +++ b/app/Services/Internal/Support/AccountServiceTrait.php @@ -662,10 +662,10 @@ trait AccountServiceTrait // submit to factory: $submission = [ - 'group_title' => null, - 'user' => $account->user, - 'user_group' => $account->user->userGroup, - 'transactions' => [ + 'group_title' => null, + 'user' => $account->user, + 'user_group' => $account->user->userGroup, + 'transactions' => [ [ 'type' => 'Opening balance', 'date' => $openingBalanceDate, diff --git a/app/Services/Internal/Support/JournalServiceTrait.php b/app/Services/Internal/Support/JournalServiceTrait.php index f4e27a24de..507f65e95e 100644 --- a/app/Services/Internal/Support/JournalServiceTrait.php +++ b/app/Services/Internal/Support/JournalServiceTrait.php @@ -286,7 +286,6 @@ trait JournalServiceTrait } - // $data['name'] = $data['name'] ?? '(no name)'; $account = $this->accountRepository->store( diff --git a/app/Support/Amount.php b/app/Support/Amount.php index e4b792acd7..7fc77c0229 100644 --- a/app/Support/Amount.php +++ b/app/Support/Amount.php @@ -48,61 +48,6 @@ class Amount return $this->formatFlat($format->symbol, $format->decimal_places, $amount, $coloured); } - /** - * Experimental function to see if we can quickly and quietly get the amount from a journal. - * This depends on the user's default currency and the wish to have it converted. - */ - public function getAmountFromJournal(array $journal): string - { - $convertToNative = $this->convertToNative(); - $currency = $this->getNativeCurrency(); - $field = $convertToNative && $currency->id !== $journal['currency_id'] ? 'native_amount' : 'amount'; - $amount = $journal[$field] ?? '0'; - // Log::debug(sprintf('Field is %s, amount is %s', $field, $amount)); - // fallback, the transaction has a foreign amount in $currency. - if ($convertToNative && null !== $journal['foreign_amount'] && $currency->id === (int) $journal['foreign_currency_id']) { - $amount = $journal['foreign_amount']; - // Log::debug(sprintf('Overruled, amount is now %s', $amount)); - } - - return (string) $amount; - } - - public function convertToNative(?User $user = null): bool - { - if (null === $user) { - return true === Preferences::get('convert_to_native', false)->data && true === config('cer.enabled'); - // Log::debug(sprintf('convertToNative [a]: %s', var_export($result, true))); - } - - return true === Preferences::getForUser($user, 'convert_to_native', false)->data && true === config('cer.enabled'); - // Log::debug(sprintf('convertToNative [b]: %s', var_export($result, true))); - } - - /** - * Experimental function to see if we can quickly and quietly get the amount from a journal. - * This depends on the user's default currency and the wish to have it converted. - */ - public function getAmountFromJournalObject(TransactionJournal $journal): string - { - $convertToNative = $this->convertToNative(); - $currency = $this->getNativeCurrency(); - $field = $convertToNative && $currency->id !== $journal->transaction_currency_id ? 'native_amount' : 'amount'; - - /** @var null|Transaction $sourceTransaction */ - $sourceTransaction = $journal->transactions()->where('amount', '<', 0)->first(); - if (null === $sourceTransaction) { - return '0'; - } - $amount = $sourceTransaction->{$field} ?? '0'; - if ((int) $sourceTransaction->foreign_currency_id === $currency->id) { - // use foreign amount instead! - $amount = (string) $sourceTransaction->foreign_amount; // hard coded to be foreign amount. - } - - return $amount; - } - /** * This method will properly format the given number, in color or "black and white", * as a currency, given two things: the currency required and the current locale. @@ -147,20 +92,35 @@ class Amount return TransactionCurrency::orderBy('code', 'ASC')->get(); } - public function getCurrencies(): Collection + /** + * Experimental function to see if we can quickly and quietly get the amount from a journal. + * This depends on the user's default currency and the wish to have it converted. + */ + public function getAmountFromJournal(array $journal): string { - /** @var User $user */ - $user = auth()->user(); + $convertToNative = $this->convertToNative(); + $currency = $this->getNativeCurrency(); + $field = $convertToNative && $currency->id !== $journal['currency_id'] ? 'native_amount' : 'amount'; + $amount = $journal[$field] ?? '0'; + // Log::debug(sprintf('Field is %s, amount is %s', $field, $amount)); + // fallback, the transaction has a foreign amount in $currency. + if ($convertToNative && null !== $journal['foreign_amount'] && $currency->id === (int) $journal['foreign_currency_id']) { + $amount = $journal['foreign_amount']; + // Log::debug(sprintf('Overruled, amount is now %s', $amount)); + } - return $user->currencies()->orderBy('code', 'ASC')->get(); + return (string) $amount; } - /** - * @deprecated - */ - public function getDefaultCurrency(): TransactionCurrency + public function convertToNative(?User $user = null): bool { - return $this->getNativeCurrency(); + if (null === $user) { + return true === Preferences::get('convert_to_native', false)->data && true === config('cer.enabled'); + // Log::debug(sprintf('convertToNative [a]: %s', var_export($result, true))); + } + + return true === Preferences::getForUser($user, 'convert_to_native', false)->data && true === config('cer.enabled'); + // Log::debug(sprintf('convertToNative [b]: %s', var_export($result, true))); } public function getNativeCurrency(): TransactionCurrency @@ -176,14 +136,6 @@ class Amount return $this->getSystemCurrency(); } - /** - * @deprecated - */ - public function getDefaultCurrencyByUserGroup(UserGroup $userGroup): TransactionCurrency - { - return $this->getNativeCurrencyByUserGroup($userGroup); - } - public function getNativeCurrencyByUserGroup(UserGroup $userGroup): TransactionCurrency { $cache = new CacheProperties(); @@ -210,6 +162,46 @@ class Amount return TransactionCurrency::where('code', 'EUR')->first(); } + /** + * Experimental function to see if we can quickly and quietly get the amount from a journal. + * This depends on the user's default currency and the wish to have it converted. + */ + public function getAmountFromJournalObject(TransactionJournal $journal): string + { + $convertToNative = $this->convertToNative(); + $currency = $this->getNativeCurrency(); + $field = $convertToNative && $currency->id !== $journal->transaction_currency_id ? 'native_amount' : 'amount'; + + /** @var null|Transaction $sourceTransaction */ + $sourceTransaction = $journal->transactions()->where('amount', '<', 0)->first(); + if (null === $sourceTransaction) { + return '0'; + } + $amount = $sourceTransaction->{$field} ?? '0'; + if ((int) $sourceTransaction->foreign_currency_id === $currency->id) { + // use foreign amount instead! + $amount = (string) $sourceTransaction->foreign_amount; // hard coded to be foreign amount. + } + + return $amount; + } + + public function getCurrencies(): Collection + { + /** @var User $user */ + $user = auth()->user(); + + return $user->currencies()->orderBy('code', 'ASC')->get(); + } + + /** + * @deprecated + */ + public function getDefaultCurrency(): TransactionCurrency + { + return $this->getNativeCurrency(); + } + /** * @deprecated use getDefaultCurrencyByUserGroup instead */ @@ -218,6 +210,14 @@ class Amount return $this->getDefaultCurrencyByUserGroup($user->userGroup); } + /** + * @deprecated + */ + public function getDefaultCurrencyByUserGroup(UserGroup $userGroup): TransactionCurrency + { + return $this->getNativeCurrencyByUserGroup($userGroup); + } + /** * This method returns the correct format rules required by accounting.js, * the library used to format amounts in charts. diff --git a/app/Support/Authentication/RemoteUserGuard.php b/app/Support/Authentication/RemoteUserGuard.php index 31d4874d52..c3aa19cbda 100644 --- a/app/Support/Authentication/RemoteUserGuard.php +++ b/app/Support/Authentication/RemoteUserGuard.php @@ -38,8 +38,8 @@ use Illuminate\Support\Facades\Log; */ class RemoteUserGuard implements Guard { - protected Application $application; - protected ?User $user; + protected Application $application; + protected ?User $user; /** * Create a new authentication guard. diff --git a/app/Support/Chart/Budget/FrontpageChartGenerator.php b/app/Support/Chart/Budget/FrontpageChartGenerator.php index edcc4f260a..b0af8ae353 100644 --- a/app/Support/Chart/Budget/FrontpageChartGenerator.php +++ b/app/Support/Chart/Budget/FrontpageChartGenerator.php @@ -39,14 +39,14 @@ use Illuminate\Support\Facades\Log; */ class FrontpageChartGenerator { - protected OperationsRepositoryInterface $opsRepository; - private readonly BudgetLimitRepositoryInterface $blRepository; - private readonly BudgetRepositoryInterface $budgetRepository; - private Carbon $end; - private string $monthAndDayFormat; - private Carbon $start; - public bool $convertToNative = false; - public TransactionCurrency $default; + public bool $convertToNative = false; + public TransactionCurrency $default; + protected OperationsRepositoryInterface $opsRepository; + private readonly BudgetLimitRepositoryInterface $blRepository; + private readonly BudgetRepositoryInterface $budgetRepository; + private Carbon $end; + private string $monthAndDayFormat; + private Carbon $start; /** * FrontpageChartGenerator constructor. @@ -120,8 +120,8 @@ class FrontpageChartGenerator foreach ($spent as $entry) { $title = sprintf('%s (%s)', $budget->name, $entry['currency_name']); $data[0]['entries'][$title] = bcmul((string) $entry['sum'], '-1'); // spent - $data[1]['entries'][$title] = 0; // left to spend - $data[2]['entries'][$title] = 0; // overspent + $data[1]['entries'][$title] = 0; // left to spend + $data[2]['entries'][$title] = 0; // overspent } return $data; @@ -209,7 +209,7 @@ class FrontpageChartGenerator $data[1]['entries'][$title] ??= '0'; $data[2]['entries'][$title] ??= '0'; - $data[0]['entries'][$title] = bcadd((string) $data[0]['entries'][$title], 1 === bccomp($sumSpent, $amount) ? $amount : $sumSpent); // spent + $data[0]['entries'][$title] = bcadd((string) $data[0]['entries'][$title], 1 === bccomp($sumSpent, $amount) ? $amount : $sumSpent); // spent $data[1]['entries'][$title] = bcadd((string) $data[1]['entries'][$title], 1 === bccomp($amount, $sumSpent) ? bcadd((string) $entry['sum'], $amount) : '0'); // left to spent $data[2]['entries'][$title] = bcadd((string) $data[2]['entries'][$title], 1 === bccomp($amount, $sumSpent) ? '0' : bcmul(bcadd((string) $entry['sum'], $amount), '-1')); // overspent diff --git a/app/Support/Chart/Category/FrontpageChartGenerator.php b/app/Support/Chart/Category/FrontpageChartGenerator.php index 12882ae050..0142097f82 100644 --- a/app/Support/Chart/Category/FrontpageChartGenerator.php +++ b/app/Support/Chart/Category/FrontpageChartGenerator.php @@ -43,13 +43,13 @@ class FrontpageChartGenerator { use AugumentData; + public bool $convertToNative = false; + public TransactionCurrency $defaultCurrency; private AccountRepositoryInterface $accountRepos; private array $currencies; private NoCategoryRepositoryInterface $noCatRepos; private OperationsRepositoryInterface $opsRepos; private CategoryRepositoryInterface $repository; - public bool $convertToNative = false; - public TransactionCurrency $defaultCurrency; /** * FrontpageChartGenerator constructor. diff --git a/app/Support/Export/ExportDataGenerator.php b/app/Support/Export/ExportDataGenerator.php index ca58d58384..78145d74e9 100644 --- a/app/Support/Export/ExportDataGenerator.php +++ b/app/Support/Export/ExportDataGenerator.php @@ -586,6 +586,14 @@ class ExportDataGenerator return $string; } + /** + * @SuppressWarnings("PHPMD.UnusedFormalParameter") + */ + public function get(string $key, mixed $default = null): mixed + { + return null; + } + /** * @throws CannotInsertRecord * @throws Exception @@ -717,14 +725,6 @@ class ExportDataGenerator return $string; } - /** - * @SuppressWarnings("PHPMD.UnusedFormalParameter") - */ - public function get(string $key, mixed $default = null): mixed - { - return null; - } - /** * @throws CannotInsertRecord * @throws Exception diff --git a/app/Support/Http/Api/AccountBalanceGrouped.php b/app/Support/Http/Api/AccountBalanceGrouped.php index d4763ea6ed..6246157049 100644 --- a/app/Support/Http/Api/AccountBalanceGrouped.php +++ b/app/Support/Http/Api/AccountBalanceGrouped.php @@ -36,16 +36,16 @@ use Illuminate\Support\Facades\Log; */ class AccountBalanceGrouped { - private array $accountIds; - private string $carbonFormat; + private array $accountIds; + private string $carbonFormat; private readonly ExchangeRateConverter $converter; - private array $currencies = []; - private array $data = []; - private TransactionCurrency $default; - private Carbon $end; - private array $journals = []; - private string $preferredRange; - private Carbon $start; + private array $currencies = []; + private array $data = []; + private TransactionCurrency $default; + private Carbon $end; + private array $journals = []; + private string $preferredRange; + private Carbon $start; public function __construct() { diff --git a/app/Support/Http/Api/ExchangeRateConverter.php b/app/Support/Http/Api/ExchangeRateConverter.php index e529def18f..2149545a69 100644 --- a/app/Support/Http/Api/ExchangeRateConverter.php +++ b/app/Support/Http/Api/ExchangeRateConverter.php @@ -53,11 +53,6 @@ class ExchangeRateConverter } } - public function setUserGroup(UserGroup $userGroup): void - { - $this->userGroup = $userGroup; - } - /** * @throws FireflyException */ @@ -284,6 +279,11 @@ class ExchangeRateConverter $this->ignoreSettings = $ignoreSettings; } + public function setUserGroup(UserGroup $userGroup): void + { + $this->userGroup = $userGroup; + } + public function summarize(): void { if (false === $this->enabled()) { diff --git a/app/Support/Http/Api/SummaryBalanceGrouped.php b/app/Support/Http/Api/SummaryBalanceGrouped.php index f9fbd65aac..cd281d02d7 100644 --- a/app/Support/Http/Api/SummaryBalanceGrouped.php +++ b/app/Support/Http/Api/SummaryBalanceGrouped.php @@ -30,12 +30,12 @@ use Illuminate\Support\Facades\Log; class SummaryBalanceGrouped { - private const string SUM = 'sum'; - private array $amounts = []; - private array $currencies; + private const string SUM = 'sum'; + private array $amounts = []; + private array $currencies; private readonly CurrencyRepositoryInterface $currencyRepository; - private TransactionCurrency $default; - private array $keys; + private TransactionCurrency $default; + private array $keys; public function __construct() { diff --git a/app/Support/Http/Controllers/PeriodOverview.php b/app/Support/Http/Controllers/PeriodOverview.php index 82b4165f22..b8e950f2ce 100644 --- a/app/Support/Http/Controllers/PeriodOverview.php +++ b/app/Support/Http/Controllers/PeriodOverview.php @@ -35,7 +35,6 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\CacheProperties; use FireflyIII\Support\Debug\Timer; -use Illuminate\Support\Collection; /** * Trait PeriodOverview. @@ -66,8 +65,8 @@ use Illuminate\Support\Collection; */ trait PeriodOverview { - protected JournalRepositoryInterface $journalRepos; protected AccountRepositoryInterface $accountRepository; + protected JournalRepositoryInterface $journalRepos; /** * This method returns "period entries", so nov-2015, dec-2015, etc etc (this depends on the users session range) @@ -109,14 +108,14 @@ trait PeriodOverview [$transactions, $transferredIn] = $this->filterTransfers('in', $transactions, $currentDate['start'], $currentDate['end']); $entries[] = [ - 'title' => $title, - 'route' => route('accounts.show', [$account->id, $currentDate['start']->format('Y-m-d'), $currentDate['end']->format('Y-m-d')]), - 'total_transactions' => count($spent) + count($earned) + count($transferredAway) + count($transferredIn), - 'spent' => $this->groupByCurrency($spent), - 'earned' => $this->groupByCurrency($earned), - 'transferred_away' => $this->groupByCurrency($transferredAway), - 'transferred_in' => $this->groupByCurrency($transferredIn), - ]; + 'title' => $title, + 'route' => route('accounts.show', [$account->id, $currentDate['start']->format('Y-m-d'), $currentDate['end']->format('Y-m-d')]), + 'total_transactions' => count($spent) + count($earned) + count($transferredAway) + count($transferredIn), + 'spent' => $this->groupByCurrency($spent), + 'earned' => $this->groupByCurrency($earned), + 'transferred_away' => $this->groupByCurrency($transferredAway), + 'transferred_in' => $this->groupByCurrency($transferredIn), + ]; } $cache->store($entries); Timer::stop('account-period-total'); @@ -124,6 +123,25 @@ trait PeriodOverview return $entries; } + private function filterTransactionsByType(TransactionTypeEnum $type, array $transactions, Carbon $start, Carbon $end): array + { + $result = []; + + /** + * @var int $index + * @var array $item + */ + foreach ($transactions as $index => $item) { + $date = Carbon::parse($item['date']); + if ($item['type'] === $type->value && $date >= $start && $date <= $end) { + $result[] = $item; + unset($transactions[$index]); + } + } + + return [$transactions, $result]; + } + private function filterTransfers(string $direction, array $transactions, Carbon $start, Carbon $end): array { $result = []; @@ -149,76 +167,6 @@ trait PeriodOverview return [$transactions, $result]; } - private function filterTransactionsByType(TransactionTypeEnum $type, array $transactions, Carbon $start, Carbon $end): array - { - $result = []; - - /** - * @var int $index - * @var array $item - */ - foreach ($transactions as $index => $item) { - $date = Carbon::parse($item['date']); - if ($item['type'] === $type->value && $date >= $start && $date <= $end) { - $result[] = $item; - unset($transactions[$index]); - } - } - - return [$transactions, $result]; - } - - /** - * Filter a list of journals by a set of dates, and then group them by currency. - */ - private function filterJournalsByDate(array $array, Carbon $start, Carbon $end): array - { - $result = []; - - /** @var array $journal */ - foreach ($array as $journal) { - if ($journal['date'] <= $end && $journal['date'] >= $start) { - $result[] = $journal; - } - } - - return $result; - } - - /** - * Return only transactions where $account is the source. - */ - private function filterTransferredAway(Account $account, array $journals): array - { - $return = []; - - /** @var array $journal */ - foreach ($journals as $journal) { - if ($account->id === (int) $journal['source_account_id']) { - $return[] = $journal; - } - } - - return $return; - } - - /** - * Return only transactions where $account is the source. - */ - private function filterTransferredIn(Account $account, array $journals): array - { - $return = []; - - /** @var array $journal */ - foreach ($journals as $journal) { - if ($account->id === (int) $journal['destination_account_id']) { - $return[] = $journal; - } - } - - return $return; - } - private function groupByCurrency(array $journals): array { $return = []; @@ -340,6 +288,23 @@ trait PeriodOverview return $entries; } + /** + * Filter a list of journals by a set of dates, and then group them by currency. + */ + private function filterJournalsByDate(array $array, Carbon $start, Carbon $end): array + { + $result = []; + + /** @var array $journal */ + foreach ($array as $journal) { + if ($journal['date'] <= $end && $journal['date'] >= $start) { + $result[] = $journal; + } + } + + return $result; + } + /** * Same as above, but for lists that involve transactions without a budget. * @@ -603,15 +568,49 @@ trait PeriodOverview } $entries[] = [ - 'title' => $title, - 'route' => route('transactions.index', [$transactionType, $currentDate['start']->format('Y-m-d'), $currentDate['end']->format('Y-m-d')]), - 'total_transactions' => count($spent) + count($earned) + count($transferred), - 'spent' => $this->groupByCurrency($spent), - 'earned' => $this->groupByCurrency($earned), - 'transferred' => $this->groupByCurrency($transferred), - ]; + 'title' => $title, + 'route' => route('transactions.index', [$transactionType, $currentDate['start']->format('Y-m-d'), $currentDate['end']->format('Y-m-d')]), + 'total_transactions' => count($spent) + count($earned) + count($transferred), + 'spent' => $this->groupByCurrency($spent), + 'earned' => $this->groupByCurrency($earned), + 'transferred' => $this->groupByCurrency($transferred), + ]; } return $entries; } + + /** + * Return only transactions where $account is the source. + */ + private function filterTransferredAway(Account $account, array $journals): array + { + $return = []; + + /** @var array $journal */ + foreach ($journals as $journal) { + if ($account->id === (int) $journal['source_account_id']) { + $return[] = $journal; + } + } + + return $return; + } + + /** + * Return only transactions where $account is the source. + */ + private function filterTransferredIn(Account $account, array $journals): array + { + $return = []; + + /** @var array $journal */ + foreach ($journals as $journal) { + if ($account->id === (int) $journal['destination_account_id']) { + $return[] = $journal; + } + } + + return $return; + } } diff --git a/app/Support/JsonApi/Enrichments/AccountEnrichment.php b/app/Support/JsonApi/Enrichments/AccountEnrichment.php index bab93a794d..33a3aa6d56 100644 --- a/app/Support/JsonApi/Enrichments/AccountEnrichment.php +++ b/app/Support/JsonApi/Enrichments/AccountEnrichment.php @@ -34,7 +34,6 @@ use FireflyIII\Models\Location; use FireflyIII\Models\Note; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\UserGroup; -use FireflyIII\Support\Facades\Balance; use FireflyIII\Support\Facades\Steam; use FireflyIII\User; use Illuminate\Database\Eloquent\Model; @@ -48,19 +47,18 @@ use Illuminate\Support\Facades\Log; */ class AccountEnrichment implements EnrichmentInterface { - private Collection $collection; - - private User $user; - private UserGroup $userGroup; - private TransactionCurrency $native; private array $accountIds; private array $accountTypeIds; private array $accountTypes; + private Collection $collection; private array $currencies; + private array $locations; private array $meta; - private array $openingBalances; + private TransactionCurrency $native; private array $notes; - private array $locations; + private array $openingBalances; + private User $user; + private UserGroup $userGroup; public function __construct() { @@ -109,6 +107,17 @@ class AccountEnrichment implements EnrichmentInterface return $this->collection; } + private function collectAccountIds(): void + { + /** @var Account $account */ + foreach ($this->collection as $account) { + $this->accountIds[] = (int) $account->id; + $this->accountTypeIds[] = (int) $account->account_type_id; + } + $this->accountIds = array_unique($this->accountIds); + $this->accountTypeIds = array_unique($this->accountTypeIds); + } + private function getAccountTypes(): void { $types = AccountType::whereIn('id', $this->accountTypeIds)->get(); @@ -119,15 +128,97 @@ class AccountEnrichment implements EnrichmentInterface } } - private function collectAccountIds(): void + private function collectMetaData(): void { - /** @var Account $account */ - foreach ($this->collection as $account) { - $this->accountIds[] = (int) $account->id; - $this->accountTypeIds[] = (int) $account->account_type_id; + $set = AccountMeta::whereIn('name', ['is_multi_currency', 'include_net_worth', 'currency_id', 'account_role', 'account_number', 'BIC', 'liability_direction', 'interest', 'interest_period', 'current_debt']) + ->whereIn('account_id', $this->accountIds) + ->get(['account_meta.id', 'account_meta.account_id', 'account_meta.name', 'account_meta.data'])->toArray() + ; + + /** @var array $entry */ + foreach ($set as $entry) { + $this->meta[(int) $entry['account_id']][$entry['name']] = (string) $entry['data']; + if ('currency_id' === $entry['name']) { + $this->currencies[(int) $entry['data']] = true; + } } - $this->accountIds = array_unique($this->accountIds); - $this->accountTypeIds = array_unique($this->accountTypeIds); + $currencies = TransactionCurrency::whereIn('id', array_keys($this->currencies))->get(); + foreach ($currencies as $currency) { + $this->currencies[(int) $currency->id] = $currency; + } + $this->currencies[0] = $this->native; + foreach ($this->currencies as $id => $currency) { + if (true === $currency) { + throw new FireflyException(sprintf('Currency #%d not found.', $id)); + } + } + } + + private function collectNotes(): void + { + $notes = Note::query()->whereIn('noteable_id', $this->accountIds) + ->whereNotNull('notes.text') + ->where('notes.text', '!=', '') + ->where('noteable_type', Account::class)->get(['notes.noteable_id', 'notes.text'])->toArray() + ; + foreach ($notes as $note) { + $this->notes[(int) $note['noteable_id']] = (string) $note['text']; + } + Log::debug(sprintf('Enrich with %d note(s)', count($this->notes))); + } + + private function collectLocations(): void + { + $locations = Location::query()->whereIn('locatable_id', $this->accountIds) + ->where('locatable_type', Account::class)->get(['locations.locatable_id', 'locations.latitude', 'locations.longitude', 'locations.zoom_level'])->toArray() + ; + foreach ($locations as $location) { + $this->locations[(int) $location['locatable_id']] + = [ + 'latitude' => (float) $location['latitude'], + 'longitude' => (float) $location['longitude'], + 'zoom_level' => (int) $location['zoom_level'], + ]; + } + Log::debug(sprintf('Enrich with %d locations(s)', count($this->locations))); + } + + private function collectOpeningBalances(): void + { + // use new group collector: + /** @var GroupCollectorInterface $collector */ + $collector = app(GroupCollectorInterface::class); + $collector + ->setUser($this->user) + ->setUserGroup($this->userGroup) + ->setAccounts($this->collection) + ->withAccountInformation() + ->setTypes([TransactionTypeEnum::OPENING_BALANCE->value]) + ; + $journals = $collector->getExtractedJournals(); + foreach ($journals as $journal) { + $this->openingBalances[(int) $journal['source_account_id']] + = [ + 'amount' => Steam::negative($journal['amount']), + 'date' => $journal['date'], + ]; + $this->openingBalances[(int) $journal['destination_account_id']] + = [ + 'amount' => Steam::positive($journal['amount']), + 'date' => $journal['date'], + ]; + } + } + + public function setUserGroup(UserGroup $userGroup): void + { + $this->userGroup = $userGroup; + } + + public function setUser(User $user): void + { + $this->user = $user; + $this->userGroup = $user->userGroup; } private function appendCollectedData(): void @@ -179,101 +270,8 @@ class AccountEnrichment implements EnrichmentInterface }); } - private function collectOpeningBalances(): void - { - // use new group collector: - /** @var GroupCollectorInterface $collector */ - $collector = app(GroupCollectorInterface::class); - $collector - ->setUser($this->user) - ->setUserGroup($this->userGroup) - ->setAccounts($this->collection) - ->withAccountInformation() - ->setTypes([TransactionTypeEnum::OPENING_BALANCE->value]) - ; - $journals = $collector->getExtractedJournals(); - foreach ($journals as $journal) { - $this->openingBalances[(int) $journal['source_account_id']] - = [ - 'amount' => Steam::negative($journal['amount']), - 'date' => $journal['date'], - ]; - $this->openingBalances[(int) $journal['destination_account_id']] - = [ - 'amount' => Steam::positive($journal['amount']), - 'date' => $journal['date'], - ]; - } - } - - private function collectLocations(): void - { - $locations = Location::query()->whereIn('locatable_id', $this->accountIds) - ->where('locatable_type', Account::class)->get(['locations.locatable_id', 'locations.latitude', 'locations.longitude', 'locations.zoom_level'])->toArray() - ; - foreach ($locations as $location) { - $this->locations[(int) $location['locatable_id']] - = [ - 'latitude' => (float) $location['latitude'], - 'longitude' => (float) $location['longitude'], - 'zoom_level' => (int) $location['zoom_level'], - ]; - } - Log::debug(sprintf('Enrich with %d locations(s)', count($this->locations))); - } - - private function collectMetaData(): void - { - $set = AccountMeta::whereIn('name', ['is_multi_currency', 'include_net_worth', 'currency_id', 'account_role', 'account_number', 'BIC', 'liability_direction', 'interest', 'interest_period', 'current_debt']) - ->whereIn('account_id', $this->accountIds) - ->get(['account_meta.id', 'account_meta.account_id', 'account_meta.name', 'account_meta.data'])->toArray() - ; - - /** @var array $entry */ - foreach ($set as $entry) { - $this->meta[(int) $entry['account_id']][$entry['name']] = (string) $entry['data']; - if ('currency_id' === $entry['name']) { - $this->currencies[(int) $entry['data']] = true; - } - } - $currencies = TransactionCurrency::whereIn('id', array_keys($this->currencies))->get(); - foreach ($currencies as $currency) { - $this->currencies[(int) $currency->id] = $currency; - } - $this->currencies[0] = $this->native; - foreach ($this->currencies as $id => $currency) { - if (true === $currency) { - throw new FireflyException(sprintf('Currency #%d not found.', $id)); - } - } - } - - public function setUserGroup(UserGroup $userGroup): void - { - $this->userGroup = $userGroup; - } - - public function setUser(User $user): void - { - $this->user = $user; - $this->userGroup = $user->userGroup; - } - public function setNative(TransactionCurrency $native): void { $this->native = $native; } - - private function collectNotes(): void - { - $notes = Note::query()->whereIn('noteable_id', $this->accountIds) - ->whereNotNull('notes.text') - ->where('notes.text', '!=', '') - ->where('noteable_type', Account::class)->get(['notes.noteable_id', 'notes.text'])->toArray() - ; - foreach ($notes as $note) { - $this->notes[(int) $note['noteable_id']] = (string) $note['text']; - } - Log::debug(sprintf('Enrich with %d note(s)', count($this->notes))); - } } diff --git a/app/Support/JsonApi/Enrichments/EnrichmentInterface.php b/app/Support/JsonApi/Enrichments/EnrichmentInterface.php index 916ca3c058..0ccfb7c060 100644 --- a/app/Support/JsonApi/Enrichments/EnrichmentInterface.php +++ b/app/Support/JsonApi/Enrichments/EnrichmentInterface.php @@ -35,7 +35,7 @@ interface EnrichmentInterface public function enrichSingle(array|Model $model): array|Model; - public function setUserGroup(UserGroup $userGroup): void; - public function setUser(User $user): void; + + public function setUserGroup(UserGroup $userGroup): void; } diff --git a/app/Support/JsonApi/Enrichments/TransactionGroupEnrichment.php b/app/Support/JsonApi/Enrichments/TransactionGroupEnrichment.php index 45a79daac1..6e9b516235 100644 --- a/app/Support/JsonApi/Enrichments/TransactionGroupEnrichment.php +++ b/app/Support/JsonApi/Enrichments/TransactionGroupEnrichment.php @@ -42,16 +42,16 @@ use Illuminate\Support\Facades\Log; class TransactionGroupEnrichment implements EnrichmentInterface { - private Collection $collection; - private array $notes; - private array $tags; - private array $locations; - private array $journalIds; - private User $user; // @phpstan-ignore-line - private UserGroup $userGroup; // @phpstan-ignore-line - private array $metaData; - private readonly array $dateFields; - private array $attachmentCount; + private array $attachmentCount; + private Collection $collection; + private readonly array $dateFields; + private array $journalIds; + private array $locations; + private array $metaData; // @phpstan-ignore-line + private array $notes; // @phpstan-ignore-line + private array $tags; + private User $user; + private UserGroup $userGroup; public function __construct() { @@ -64,6 +64,20 @@ class TransactionGroupEnrichment implements EnrichmentInterface $this->dateFields = ['interest_date', 'book_date', 'process_date', 'due_date', 'payment_date', 'invoice_date']; } + #[\Override] + public function enrichSingle(array|Model $model): array|TransactionGroup + { + Log::debug(__METHOD__); + if (is_array($model)) { + $collection = new Collection([$model]); + $collection = $this->enrich($collection); + + return $collection->first(); + } + + throw new FireflyException('Cannot enrich single model.'); + } + #[\Override] public function enrich(Collection $collection): Collection { @@ -83,20 +97,6 @@ class TransactionGroupEnrichment implements EnrichmentInterface return $this->collection; } - #[\Override] - public function enrichSingle(array|Model $model): array|TransactionGroup - { - Log::debug(__METHOD__); - if (is_array($model)) { - $collection = new Collection([$model]); - $collection = $this->enrich($collection); - - return $collection->first(); - } - - throw new FireflyException('Cannot enrich single model.'); - } - private function collectJournalIds(): void { /** @var array $group */ @@ -108,17 +108,6 @@ class TransactionGroupEnrichment implements EnrichmentInterface $this->journalIds = array_unique($this->journalIds); } - public function setUserGroup(UserGroup $userGroup): void - { - $this->userGroup = $userGroup; - } - - public function setUser(User $user): void - { - $this->user = $user; - $this->userGroup = $user->userGroup; - } - private function collectNotes(): void { $notes = Note::query()->whereIn('noteable_id', $this->journalIds) @@ -247,4 +236,15 @@ class TransactionGroupEnrichment implements EnrichmentInterface return $item; }); } + + public function setUser(User $user): void + { + $this->user = $user; + $this->userGroup = $user->userGroup; + } + + public function setUserGroup(UserGroup $userGroup): void + { + $this->userGroup = $userGroup; + } } diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index c21a9353a7..c17d7c5193 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -443,11 +443,11 @@ class Navigation } return match ($range) { - 'last7' => '1W', - 'last30', 'MTD' => '1M', - 'last90', 'QTD' => '3M', + 'last7' => '1W', + 'last30', 'MTD' => '1M', + 'last90', 'QTD' => '3M', 'last365', 'YTD' => '1Y', - default => $range, + default => $range, }; } diff --git a/app/Support/Report/Budget/BudgetReportGenerator.php b/app/Support/Report/Budget/BudgetReportGenerator.php index 96fffd63b4..219b1a76e4 100644 --- a/app/Support/Report/Budget/BudgetReportGenerator.php +++ b/app/Support/Report/Budget/BudgetReportGenerator.php @@ -43,16 +43,16 @@ use Illuminate\Support\Collection; */ class BudgetReportGenerator { - private Collection $accounts; + private Collection $accounts; private readonly BudgetLimitRepositoryInterface $blRepository; - private Collection $budgets; - private TransactionCurrency $currency; - private Carbon $end; + private Collection $budgets; + private TransactionCurrency $currency; + private Carbon $end; private readonly NoBudgetRepositoryInterface $nbRepository; private readonly OperationsRepositoryInterface $opsRepository; - private array $report; + private array $report; private readonly BudgetRepositoryInterface $repository; - private Carbon $start; + private Carbon $start; /** * BudgetReportGenerator constructor. @@ -213,16 +213,16 @@ class BudgetReportGenerator // make sum information: $this->report['sums'][$currencyId] ??= [ - 'budgeted' => '0', - 'spent' => '0', - 'left' => '0', - 'overspent' => '0', - 'currency_id' => $currencyId, - 'currency_code' => $limitCurrency->code, - 'currency_name' => $limitCurrency->name, - 'currency_symbol' => $limitCurrency->symbol, - 'currency_decimal_places' => $limitCurrency->decimal_places, - ]; + 'budgeted' => '0', + 'spent' => '0', + 'left' => '0', + 'overspent' => '0', + 'currency_id' => $currencyId, + 'currency_code' => $limitCurrency->code, + 'currency_name' => $limitCurrency->name, + 'currency_symbol' => $limitCurrency->symbol, + 'currency_decimal_places' => $limitCurrency->decimal_places, + ]; $this->report['sums'][$currencyId]['budgeted'] = bcadd((string) $this->report['sums'][$currencyId]['budgeted'], $limit->amount); $this->report['sums'][$currencyId]['spent'] = bcadd((string) $this->report['sums'][$currencyId]['spent'], $spent); $this->report['sums'][$currencyId]['left'] = bcadd((string) $this->report['sums'][$currencyId]['left'], bcadd($limit->amount, $spent)); diff --git a/app/Support/Report/Category/CategoryReportGenerator.php b/app/Support/Report/Category/CategoryReportGenerator.php index e5947180b3..91f1470bb8 100644 --- a/app/Support/Report/Category/CategoryReportGenerator.php +++ b/app/Support/Report/Category/CategoryReportGenerator.php @@ -35,12 +35,12 @@ use Illuminate\Support\Collection; */ class CategoryReportGenerator { - private Collection $accounts; - private Carbon $end; + private Collection $accounts; + private Carbon $end; private readonly NoCategoryRepositoryInterface $noCatRepository; private readonly OperationsRepositoryInterface $opsRepository; - private array $report; - private Carbon $start; + private array $report; + private Carbon $start; /** * CategoryReportGenerator constructor. diff --git a/app/Support/Report/Summarizer/TransactionSummarizer.php b/app/Support/Report/Summarizer/TransactionSummarizer.php index 070723a779..606fefae11 100644 --- a/app/Support/Report/Summarizer/TransactionSummarizer.php +++ b/app/Support/Report/Summarizer/TransactionSummarizer.php @@ -31,9 +31,9 @@ use Illuminate\Support\Facades\Log; class TransactionSummarizer { - private User $user; - private TransactionCurrency $default; private bool $convertToNative = false; + private TransactionCurrency $default; + private User $user; public function __construct(?User $user = null) { @@ -163,9 +163,6 @@ class TransactionSummarizer $default = Amount::getNativeCurrencyByUserGroup($this->user->userGroup); - - - Log::debug(sprintf('groupByDirection(array, %s, %s).', $direction, $method)); foreach ($journals as $journal) { // currency diff --git a/app/Support/Repositories/UserGroup/UserGroupInterface.php b/app/Support/Repositories/UserGroup/UserGroupInterface.php index 0c86120c1d..8a087f4edf 100644 --- a/app/Support/Repositories/UserGroup/UserGroupInterface.php +++ b/app/Support/Repositories/UserGroup/UserGroupInterface.php @@ -31,15 +31,15 @@ use Illuminate\Contracts\Auth\Authenticatable; interface UserGroupInterface { - public function getUserGroup(): ?UserGroup; + public function checkUserGroupAccess(UserRoleEnum $role): bool; public function getUser(): ?User; - public function checkUserGroupAccess(UserRoleEnum $role): bool; - - public function setUserGroup(UserGroup $userGroup): void; + public function getUserGroup(): ?UserGroup; public function setUser(null|Authenticatable|User $user): void; + public function setUserGroup(UserGroup $userGroup): void; + public function setUserGroupById(int $userGroupId): void; } diff --git a/app/Support/Repositories/UserGroup/UserGroupTrait.php b/app/Support/Repositories/UserGroup/UserGroupTrait.php index e6de102771..eb30fa7f53 100644 --- a/app/Support/Repositories/UserGroup/UserGroupTrait.php +++ b/app/Support/Repositories/UserGroup/UserGroupTrait.php @@ -40,16 +40,6 @@ trait UserGroupTrait protected ?User $user = null; protected ?UserGroup $userGroup = null; - public function getUserGroup(): ?UserGroup - { - return $this->userGroup; - } - - public function getUser(): ?User - { - return $this->user; - } - public function checkUserGroupAccess(UserRoleEnum $role): bool { $result = $this->user->hasRoleInGroupOrOwner($this->userGroup, $role); @@ -63,15 +53,9 @@ trait UserGroupTrait return false; } - /** - * TODO This method does not check if the user has access to this particular user group. - */ - public function setUserGroup(UserGroup $userGroup): void + public function getUser(): ?User { - if (null === $this->user) { - Log::warning(sprintf('User is not set in repository %s', static::class)); - } - $this->userGroup = $userGroup; + return $this->user; } /** @@ -92,6 +76,22 @@ trait UserGroupTrait throw new FireflyException(sprintf('Object is of class %s, not User.', $user::class)); } + public function getUserGroup(): ?UserGroup + { + return $this->userGroup; + } + + /** + * TODO This method does not check if the user has access to this particular user group. + */ + public function setUserGroup(UserGroup $userGroup): void + { + if (null === $this->user) { + Log::warning(sprintf('User is not set in repository %s', static::class)); + } + $this->userGroup = $userGroup; + } + /** * @throws FireflyException */ diff --git a/app/Support/Request/ConvertsDataTypes.php b/app/Support/Request/ConvertsDataTypes.php index 2116abe1f7..0e65fe7343 100644 --- a/app/Support/Request/ConvertsDataTypes.php +++ b/app/Support/Request/ConvertsDataTypes.php @@ -326,6 +326,18 @@ trait ConvertsDataTypes return $carbon; } + protected function floatFromValue(?string $string): ?float + { + if (null === $string) { + return null; + } + if ('' === $string) { + return null; + } + + return (float) $string; + } + /** * Returns all data in the request, or omits the field if not set, * according to the config from the request. This is the way. @@ -376,18 +388,20 @@ trait ConvertsDataTypes } /** - * Parse to integer + * Return integer value, or NULL when it's not set. */ - protected function integerFromValue(?string $string): ?int + protected function nullableInteger(string $field): ?int { - if (null === $string) { - return null; - } - if ('' === $string) { + if (false === $this->has($field)) { return null; } - return (int) $string; + $value = (string) $this->get($field); + if ('' === $value) { + return null; + } + + return (int) $value; } protected function parseAccounts(mixed $array): array @@ -419,7 +433,10 @@ trait ConvertsDataTypes return $return; } - protected function floatFromValue(?string $string): ?float + /** + * Parse to integer + */ + protected function integerFromValue(?string $string): ?int { if (null === $string) { return null; @@ -428,23 +445,6 @@ trait ConvertsDataTypes return null; } - return (float) $string; - } - - /** - * Return integer value, or NULL when it's not set. - */ - protected function nullableInteger(string $field): ?int - { - if (false === $this->has($field)) { - return null; - } - - $value = (string) $this->get($field); - if ('' === $value) { - return null; - } - - return (int) $value; + return (int) $string; } } diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php index 90c039913e..519258c1fa 100644 --- a/app/Support/Search/OperatorQuerySearch.php +++ b/app/Support/Search/OperatorQuerySearch.php @@ -37,14 +37,14 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface; -use FireflyIII\Repositories\Tag\TagRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; -use FireflyIII\Support\Search\QueryParser\QueryParserInterface; -use FireflyIII\Support\Search\QueryParser\Node; -use FireflyIII\Support\Search\QueryParser\FieldNode; -use FireflyIII\Support\Search\QueryParser\StringNode; -use FireflyIII\Support\Search\QueryParser\NodeGroup; +use FireflyIII\Repositories\Tag\TagRepositoryInterface; use FireflyIII\Support\ParseDateString; +use FireflyIII\Support\Search\QueryParser\FieldNode; +use FireflyIII\Support\Search\QueryParser\Node; +use FireflyIII\Support\Search\QueryParser\NodeGroup; +use FireflyIII\Support\Search\QueryParser\QueryParserInterface; +use FireflyIII\Support\Search\QueryParser\StringNode; use FireflyIII\User; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; @@ -56,26 +56,26 @@ use Illuminate\Support\Collection; */ class OperatorQuerySearch implements SearchInterface { - protected Carbon $date; + protected Carbon $date; private readonly AccountRepositoryInterface $accountRepository; private readonly BillRepositoryInterface $billRepository; private readonly BudgetRepositoryInterface $budgetRepository; private readonly CategoryRepositoryInterface $categoryRepository; - private GroupCollectorInterface $collector; + private GroupCollectorInterface $collector; private readonly CurrencyRepositoryInterface $currencyRepository; - private array $excludeTags; - private array $includeAnyTags; + private array $excludeTags; + private array $includeAnyTags; // added to fix #8632 - private array $includeTags; - private array $invalidOperators; - private int $limit; + private array $includeTags; + private array $invalidOperators; + private int $limit; private readonly Collection $operators; - private int $page; - private array $prohibitedWords; + private int $page; + private array $prohibitedWords; private readonly float $startTime; private readonly TagRepositoryInterface $tagRepository; private readonly array $validOperators; - private array $words; + private array $words; /** * OperatorQuerySearch constructor. @@ -122,16 +122,6 @@ class OperatorQuerySearch implements SearchInterface return implode(' ', $this->words); } - public function getWords(): array - { - return $this->words; - } - - public function getExcludedWords(): array - { - return $this->prohibitedWords; - } - /** * @throws FireflyException */ @@ -202,15 +192,6 @@ class OperatorQuerySearch implements SearchInterface } } - private function handleNodeGroup(NodeGroup $node, bool $flipProhibitedFlag): void - { - $prohibited = $node->isProhibited($flipProhibitedFlag); - - foreach ($node->getNodes() as $subNode) { - $this->handleSearchNode($subNode, $prohibited); - } - } - private function handleStringNode(StringNode $node, bool $flipProhibitedFlag): void { $string = $node->getValue(); @@ -2775,6 +2756,15 @@ class OperatorQuerySearch implements SearchInterface } } + private function handleNodeGroup(NodeGroup $node, bool $flipProhibitedFlag): void + { + $prohibited = $node->isProhibited($flipProhibitedFlag); + + foreach ($node->getNodes() as $subNode) { + $this->handleSearchNode($subNode, $prohibited); + } + } + public function searchTime(): float { return microtime(true) - $this->startTime; @@ -2835,6 +2825,16 @@ class OperatorQuerySearch implements SearchInterface } } + public function getWords(): array + { + return $this->words; + } + + public function getExcludedWords(): array + { + return $this->prohibitedWords; + } + public function setDate(Carbon $date): void { $this->date = $date; diff --git a/app/Support/Search/QueryParser/GdbotsQueryParser.php b/app/Support/Search/QueryParser/GdbotsQueryParser.php index a071c972fa..aa802e0df0 100644 --- a/app/Support/Search/QueryParser/GdbotsQueryParser.php +++ b/app/Support/Search/QueryParser/GdbotsQueryParser.php @@ -26,9 +26,9 @@ declare(strict_types=1); namespace FireflyIII\Support\Search\QueryParser; use FireflyIII\Exceptions\FireflyException; -use Gdbots\QueryParser\QueryParser as BaseQueryParser; -use Gdbots\QueryParser\Node as GdbotsNode; use Gdbots\QueryParser\Enum\BoolOperator; +use Gdbots\QueryParser\Node as GdbotsNode; +use Gdbots\QueryParser\QueryParser as BaseQueryParser; use Illuminate\Support\Facades\Log; class GdbotsQueryParser implements QueryParserInterface diff --git a/app/Support/Search/QueryParser/Node.php b/app/Support/Search/QueryParser/Node.php index f13331965c..31412cfdab 100644 --- a/app/Support/Search/QueryParser/Node.php +++ b/app/Support/Search/QueryParser/Node.php @@ -34,28 +34,6 @@ abstract class Node { protected bool $prohibited; - /** - * Returns the prohibited status of the node, optionally inverted based on flipFlag - * - * Flipping is used when a node is inside a NodeGroup that has a prohibited status itself, causing inversion of the - * query parts inside - * - * @param bool $flipFlag When true, inverts the prohibited status - * - * @return bool The (potentially inverted) prohibited status - */ - public function isProhibited(bool $flipFlag): bool - { - if ($flipFlag) { - // Log::debug(sprintf('This %s is (flipped) now prohibited: %s',get_class($this), var_export(!$this->prohibited, true))); - return !$this->prohibited; - } - - // Log::debug(sprintf('This %s is (not flipped) now prohibited: %s',get_class($this), var_export($this->prohibited, true))); - return $this->prohibited; - - } - public function equals(self $compare): bool { if ($compare->isProhibited(false) !== $this->isProhibited(false)) { @@ -87,4 +65,26 @@ abstract class Node return true; } + + /** + * Returns the prohibited status of the node, optionally inverted based on flipFlag + * + * Flipping is used when a node is inside a NodeGroup that has a prohibited status itself, causing inversion of the + * query parts inside + * + * @param bool $flipFlag When true, inverts the prohibited status + * + * @return bool The (potentially inverted) prohibited status + */ + public function isProhibited(bool $flipFlag): bool + { + if ($flipFlag) { + // Log::debug(sprintf('This %s is (flipped) now prohibited: %s',get_class($this), var_export(!$this->prohibited, true))); + return !$this->prohibited; + } + + // Log::debug(sprintf('This %s is (not flipped) now prohibited: %s',get_class($this), var_export($this->prohibited, true))); + return $this->prohibited; + + } } diff --git a/app/Support/Search/QueryParser/QueryParser.php b/app/Support/Search/QueryParser/QueryParser.php index cdca33c415..05225f0fb7 100644 --- a/app/Support/Search/QueryParser/QueryParser.php +++ b/app/Support/Search/QueryParser/QueryParser.php @@ -34,8 +34,8 @@ use Illuminate\Support\Facades\Log; */ class QueryParser implements QueryParserInterface { - private string $query; private int $position = 0; + private string $query; public function parse(string $query): NodeGroup { diff --git a/app/Support/Search/SearchInterface.php b/app/Support/Search/SearchInterface.php index bc0fa0fdb1..7aaef87c68 100644 --- a/app/Support/Search/SearchInterface.php +++ b/app/Support/Search/SearchInterface.php @@ -33,6 +33,8 @@ use Illuminate\Support\Collection; */ interface SearchInterface { + public function getExcludedWords(): array; + public function getInvalidOperators(): array; public function getModifiers(): Collection; @@ -43,8 +45,6 @@ interface SearchInterface public function getWordsAsString(): string; - public function getExcludedWords(): array; - public function hasModifiers(): bool; public function parseQuery(string $query): void; diff --git a/app/Support/Steam.php b/app/Support/Steam.php index 060f204ec1..b6da6a44dd 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -40,21 +40,154 @@ use Illuminate\Support\Str; */ class Steam { - public function getAccountCurrency(Account $account): ?TransactionCurrency + /** + * https://stackoverflow.com/questions/1642614/how-to-ceil-floor-and-round-bcmath-numbers + */ + public function bcround(?string $number, int $precision = 0): string { - $type = $account->accountType->type; - $list = config('firefly.valid_currency_account_types'); - - // return null if not in this list. - if (!in_array($type, $list, true)) { - return null; + if (null === $number) { + return '0'; } - $result = $account->accountMeta()->where('name', 'currency_id')->first(); - if (null === $result) { - return null; + if ('' === trim($number)) { + return '0'; + } + // if the number contains "E", it's in scientific notation, so we need to convert it to a normal number first. + if (false !== stripos($number, 'e')) { + $number = sprintf('%.12f', $number); } - return TransactionCurrency::find((int) $result->data); + // Log::debug(sprintf('Trying bcround("%s",%d)', $number, $precision)); + if (str_contains($number, '.')) { + if ('-' !== $number[0]) { + return bcadd($number, '0.'.str_repeat('0', $precision).'5', $precision); + } + + return bcsub($number, '0.'.str_repeat('0', $precision).'5', $precision); + } + + return $number; + } + + public function filterAccountBalances(array $total, Account $account, bool $convertToNative, ?TransactionCurrency $currency = null): array + { + Log::debug(sprintf('filterAccountBalances(#%d)', $account->id)); + $return = []; + foreach ($total as $key => $value) { + $return[$key] = $this->filterAccountBalance($value, $account, $convertToNative, $currency); + } + Log::debug(sprintf('end of filterAccountBalances(#%d)', $account->id)); + + return $return; + } + + public function filterAccountBalance(array $set, Account $account, bool $convertToNative, ?TransactionCurrency $currency = null): array + { + Log::debug(sprintf('filterAccountBalance(#%d)', $account->id), $set); + if (0 === count($set)) { + Log::debug(sprintf('Return empty array for account #%d', $account->id)); + + return []; + } + $defaultCurrency = app('amount')->getNativeCurrency(); + if ($convertToNative) { + if ($defaultCurrency->id === $currency?->id) { + Log::debug(sprintf('Unset [%s] for account #%d (no longer unset "native_balance")', $defaultCurrency->code, $account->id)); + unset($set[$defaultCurrency->code]); + } + // todo rethink this logic. + if (null !== $currency && $defaultCurrency->id !== $currency->id) { + Log::debug(sprintf('Unset balance for account #%d', $account->id)); + unset($set['balance']); + } + + if (null === $currency) { + Log::debug(sprintf('Unset balance for account #%d', $account->id)); + unset($set['balance']); + } + } + + if (!$convertToNative) { + if (null === $currency) { + Log::debug(sprintf('Unset native_balance and make defaultCurrency balance the balance for account #%d', $account->id)); + $set['balance'] = $set[$defaultCurrency->code] ?? '0'; + unset($set[$defaultCurrency->code]); + } + + if (null !== $currency) { + Log::debug(sprintf('Unset [%s] + [%s] balance for account #%d', $defaultCurrency->code, $currency->code, $account->id)); + unset($set[$defaultCurrency->code], $set[$currency->code]); + } + } + + // put specific value first in array. + if (array_key_exists('native_balance', $set)) { + $set = ['native_balance' => $set['native_balance']] + $set; + } + if (array_key_exists('balance', $set)) { + $set = ['balance' => $set['balance']] + $set; + } + Log::debug(sprintf('Return #%d', $account->id), $set); + + return $set; + } + + public function filterSpaces(string $string): string + { + $search = [ + "\u{0001}", // start of heading + "\u{0002}", // start of text + "\u{0003}", // end of text + "\u{0004}", // end of transmission + "\u{0005}", // enquiry + "\u{0006}", // ACK + "\u{0007}", // BEL + "\u{0008}", // backspace + "\u{000E}", // shift out + "\u{000F}", // shift in + "\u{0010}", // data link escape + "\u{0011}", // DC1 + "\u{0012}", // DC2 + "\u{0013}", // DC3 + "\u{0014}", // DC4 + "\u{0015}", // NAK + "\u{0016}", // SYN + "\u{0017}", // ETB + "\u{0018}", // CAN + "\u{0019}", // EM + "\u{001A}", // SUB + "\u{001B}", // escape + "\u{001C}", // file separator + "\u{001D}", // group separator + "\u{001E}", // record separator + "\u{001F}", // unit separator + "\u{007F}", // DEL + "\u{00A0}", // non-breaking space + "\u{1680}", // ogham space mark + "\u{180E}", // mongolian vowel separator + "\u{2000}", // en quad + "\u{2001}", // em quad + "\u{2002}", // en space + "\u{2003}", // em space + "\u{2004}", // three-per-em space + "\u{2005}", // four-per-em space + "\u{2006}", // six-per-em space + "\u{2007}", // figure space + "\u{2008}", // punctuation space + "\u{2009}", // thin space + "\u{200A}", // hair space + "\u{200B}", // zero width space + "\u{202F}", // narrow no-break space + "\u{3000}", // ideographic space + "\u{FEFF}", // zero width no -break space + "\x20", // plain old normal space, + ' ', + ]; + + // clear zalgo text + $string = \Safe\preg_replace('/(\pM{2})\pM+/u', '\1', $string); + $string = \Safe\preg_replace('/\s+/', '', $string); + + return str_replace($search, '', $string); } public function finalAccountBalanceInRange(Account $account, Carbon $start, Carbon $end, bool $convertToNative): array @@ -178,104 +311,6 @@ class Steam return $balances; } - public function finalAccountsBalance(Collection $accounts, Carbon $date): array - { - Log::debug(sprintf('finalAccountsBalance: Call finalAccountBalance with date/time "%s"', $date->toIso8601String())); - $balances = []; - foreach ($accounts as $account) { - $balances[$account->id] = $this->finalAccountBalance($account, $date); - } - - return $balances; - } - - /** - * https://stackoverflow.com/questions/1642614/how-to-ceil-floor-and-round-bcmath-numbers - */ - public function bcround(?string $number, int $precision = 0): string - { - if (null === $number) { - return '0'; - } - if ('' === trim($number)) { - return '0'; - } - // if the number contains "E", it's in scientific notation, so we need to convert it to a normal number first. - if (false !== stripos($number, 'e')) { - $number = sprintf('%.12f', $number); - } - - // Log::debug(sprintf('Trying bcround("%s",%d)', $number, $precision)); - if (str_contains($number, '.')) { - if ('-' !== $number[0]) { - return bcadd($number, '0.'.str_repeat('0', $precision).'5', $precision); - } - - return bcsub($number, '0.'.str_repeat('0', $precision).'5', $precision); - } - - return $number; - } - - public function filterSpaces(string $string): string - { - $search = [ - "\u{0001}", // start of heading - "\u{0002}", // start of text - "\u{0003}", // end of text - "\u{0004}", // end of transmission - "\u{0005}", // enquiry - "\u{0006}", // ACK - "\u{0007}", // BEL - "\u{0008}", // backspace - "\u{000E}", // shift out - "\u{000F}", // shift in - "\u{0010}", // data link escape - "\u{0011}", // DC1 - "\u{0012}", // DC2 - "\u{0013}", // DC3 - "\u{0014}", // DC4 - "\u{0015}", // NAK - "\u{0016}", // SYN - "\u{0017}", // ETB - "\u{0018}", // CAN - "\u{0019}", // EM - "\u{001A}", // SUB - "\u{001B}", // escape - "\u{001C}", // file separator - "\u{001D}", // group separator - "\u{001E}", // record separator - "\u{001F}", // unit separator - "\u{007F}", // DEL - "\u{00A0}", // non-breaking space - "\u{1680}", // ogham space mark - "\u{180E}", // mongolian vowel separator - "\u{2000}", // en quad - "\u{2001}", // em quad - "\u{2002}", // en space - "\u{2003}", // em space - "\u{2004}", // three-per-em space - "\u{2005}", // four-per-em space - "\u{2006}", // six-per-em space - "\u{2007}", // figure space - "\u{2008}", // punctuation space - "\u{2009}", // thin space - "\u{200A}", // hair space - "\u{200B}", // zero width space - "\u{202F}", // narrow no-break space - "\u{3000}", // ideographic space - "\u{FEFF}", // zero width no -break space - "\x20", // plain old normal space, - ' ', - ]; - - // clear zalgo text - $string = \Safe\preg_replace('/(\pM{2})\pM+/u', '\1', $string); - $string = \Safe\preg_replace('/\s+/', '', $string); - - return str_replace($search, '', $string); - } - /** * Returns smaller than or equal to, so be careful with END OF DAY. * @@ -365,67 +400,21 @@ class Steam return $final; } - public function filterAccountBalances(array $total, Account $account, bool $convertToNative, ?TransactionCurrency $currency = null): array + public function getAccountCurrency(Account $account): ?TransactionCurrency { - Log::debug(sprintf('filterAccountBalances(#%d)', $account->id)); - $return = []; - foreach ($total as $key => $value) { - $return[$key] = $this->filterAccountBalance($value, $account, $convertToNative, $currency); + $type = $account->accountType->type; + $list = config('firefly.valid_currency_account_types'); + + // return null if not in this list. + if (!in_array($type, $list, true)) { + return null; } - Log::debug(sprintf('end of filterAccountBalances(#%d)', $account->id)); - - return $return; - } - - public function filterAccountBalance(array $set, Account $account, bool $convertToNative, ?TransactionCurrency $currency = null): array - { - Log::debug(sprintf('filterAccountBalance(#%d)', $account->id), $set); - if (0 === count($set)) { - Log::debug(sprintf('Return empty array for account #%d', $account->id)); - - return []; - } - $defaultCurrency = app('amount')->getNativeCurrency(); - if ($convertToNative) { - if ($defaultCurrency->id === $currency?->id) { - Log::debug(sprintf('Unset [%s] for account #%d (no longer unset "native_balance")', $defaultCurrency->code, $account->id)); - unset($set[$defaultCurrency->code]); - } - // todo rethink this logic. - if (null !== $currency && $defaultCurrency->id !== $currency->id) { - Log::debug(sprintf('Unset balance for account #%d', $account->id)); - unset($set['balance']); - } - - if (null === $currency) { - Log::debug(sprintf('Unset balance for account #%d', $account->id)); - unset($set['balance']); - } + $result = $account->accountMeta()->where('name', 'currency_id')->first(); + if (null === $result) { + return null; } - if (!$convertToNative) { - if (null === $currency) { - Log::debug(sprintf('Unset native_balance and make defaultCurrency balance the balance for account #%d', $account->id)); - $set['balance'] = $set[$defaultCurrency->code] ?? '0'; - unset($set[$defaultCurrency->code]); - } - - if (null !== $currency) { - Log::debug(sprintf('Unset [%s] + [%s] balance for account #%d', $defaultCurrency->code, $currency->code, $account->id)); - unset($set[$defaultCurrency->code], $set[$currency->code]); - } - } - - // put specific value first in array. - if (array_key_exists('native_balance', $set)) { - $set = ['native_balance' => $set['native_balance']] + $set; - } - if (array_key_exists('balance', $set)) { - $set = ['balance' => $set['balance']] + $set; - } - Log::debug(sprintf('Return #%d', $account->id), $set); - - return $set; + return TransactionCurrency::find((int) $result->data); } private function groupAndSumTransactions(array $array, string $group, string $field): array @@ -440,6 +429,34 @@ class Steam return $return; } + private function convertAllBalances(array $others, TransactionCurrency $native, Carbon $date): string + { + $total = '0'; + $converter = new ExchangeRateConverter(); + foreach ($others as $key => $amount) { + $currency = TransactionCurrency::where('code', $key)->first(); + if (null === $currency) { + continue; + } + $current = $converter->convert($currency, $native, $date, $amount); + Log::debug(sprintf('Convert %s %s to %s %s', $currency->code, $amount, $native->code, $current)); + $total = bcadd($current, $total); + } + + return $total; + } + + public function finalAccountsBalance(Collection $accounts, Carbon $date): array + { + Log::debug(sprintf('finalAccountsBalance: Call finalAccountBalance with date/time "%s"', $date->toIso8601String())); + $balances = []; + foreach ($accounts as $account) { + $balances[$account->id] = $this->finalAccountBalance($account, $date); + } + + return $balances; + } + /** * @throws FireflyException */ @@ -665,21 +682,4 @@ class Steam return $amount; } - - private function convertAllBalances(array $others, TransactionCurrency $native, Carbon $date): string - { - $total = '0'; - $converter = new ExchangeRateConverter(); - foreach ($others as $key => $amount) { - $currency = TransactionCurrency::where('code', $key)->first(); - if (null === $currency) { - continue; - } - $current = $converter->convert($currency, $native, $date, $amount); - Log::debug(sprintf('Convert %s %s to %s %s', $currency->code, $amount, $native->code, $current)); - $total = bcadd($current, $total); - } - - return $total; - } } diff --git a/app/Support/Twig/AmountFormat.php b/app/Support/Twig/AmountFormat.php index 7028a04a51..4cf3ac7b07 100644 --- a/app/Support/Twig/AmountFormat.php +++ b/app/Support/Twig/AmountFormat.php @@ -105,31 +105,6 @@ class AmountFormat extends AbstractExtension ); } - /** - * Use the code to format a currency. - */ - protected function formatAmountByCode(): TwigFunction - { - // formatAmountByCode - return new TwigFunction( - 'formatAmountByCode', - static function (string $amount, string $code, ?bool $coloured = null): string { - $coloured ??= true; - - /** @var null|TransactionCurrency $currency */ - $currency = TransactionCurrency::whereCode($code)->first(); - if (null === $currency) { - Log::error(sprintf('Could not find currency with code "%s". Fallback to native currency.', $code)); - $currency = Amount::getNativeCurrency(); - Log::error(sprintf('Fallback currency is "%s".', $currency->code)); - } - - return app('amount')->formatAnything($currency, $amount, $coloured); - }, - ['is_safe' => ['html']] - ); - } - /** * Will format the amount by the currency related to the given account. */ @@ -165,4 +140,29 @@ class AmountFormat extends AbstractExtension ['is_safe' => ['html']] ); } + + /** + * Use the code to format a currency. + */ + protected function formatAmountByCode(): TwigFunction + { + // formatAmountByCode + return new TwigFunction( + 'formatAmountByCode', + static function (string $amount, string $code, ?bool $coloured = null): string { + $coloured ??= true; + + /** @var null|TransactionCurrency $currency */ + $currency = TransactionCurrency::whereCode($code)->first(); + if (null === $currency) { + Log::error(sprintf('Could not find currency with code "%s". Fallback to native currency.', $code)); + $currency = Amount::getNativeCurrency(); + Log::error(sprintf('Fallback currency is "%s".', $currency->code)); + } + + return app('amount')->formatAnything($currency, $amount, $coloured); + }, + ['is_safe' => ['html']] + ); + } } diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index 80b4e1b482..37e3fb2b45 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -139,14 +139,14 @@ class General extends AbstractExtension return new TwigFilter( 'mimeIcon', static fn (string $string): string => match ($string) { - 'application/pdf' => 'fa-file-pdf-o', - 'image/png', 'image/jpeg', 'image/svg+xml', 'image/heic', 'image/heic-sequence', 'application/vnd.oasis.opendocument.image' => 'fa-file-image-o', + 'application/pdf' => 'fa-file-pdf-o', + 'image/png', 'image/jpeg', 'image/svg+xml', 'image/heic', 'image/heic-sequence', 'application/vnd.oasis.opendocument.image' => 'fa-file-image-o', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'application/x-iwork-pages-sffpages', 'application/vnd.sun.xml.writer', 'application/vnd.sun.xml.writer.template', 'application/vnd.sun.xml.writer.global', 'application/vnd.stardivision.writer', 'application/vnd.stardivision.writer-global', 'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.text-template', 'application/vnd.oasis.opendocument.text-web', 'application/vnd.oasis.opendocument.text-master' => 'fa-file-word-o', - 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'application/vnd.sun.xml.calc', 'application/vnd.sun.xml.calc.template', 'application/vnd.stardivision.calc', 'application/vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.spreadsheet-template' => 'fa-file-excel-o', - 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.openxmlformats-officedocument.presentationml.template', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'application/vnd.sun.xml.impress', 'application/vnd.sun.xml.impress.template', 'application/vnd.stardivision.impress', 'application/vnd.oasis.opendocument.presentation', 'application/vnd.oasis.opendocument.presentation-template' => 'fa-file-powerpoint-o', - 'application/vnd.sun.xml.draw', 'application/vnd.sun.xml.draw.template', 'application/vnd.stardivision.draw', 'application/vnd.oasis.opendocument.chart' => 'fa-paint-brush', - 'application/vnd.oasis.opendocument.graphics', 'application/vnd.oasis.opendocument.graphics-template', 'application/vnd.sun.xml.math', 'application/vnd.stardivision.math', 'application/vnd.oasis.opendocument.formula', 'application/vnd.oasis.opendocument.database' => 'fa-calculator', - default => 'fa-file-o', + 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'application/vnd.sun.xml.calc', 'application/vnd.sun.xml.calc.template', 'application/vnd.stardivision.calc', 'application/vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.spreadsheet-template' => 'fa-file-excel-o', + 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.openxmlformats-officedocument.presentationml.template', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'application/vnd.sun.xml.impress', 'application/vnd.sun.xml.impress.template', 'application/vnd.stardivision.impress', 'application/vnd.oasis.opendocument.presentation', 'application/vnd.oasis.opendocument.presentation-template' => 'fa-file-powerpoint-o', + 'application/vnd.sun.xml.draw', 'application/vnd.sun.xml.draw.template', 'application/vnd.stardivision.draw', 'application/vnd.oasis.opendocument.chart' => 'fa-paint-brush', + 'application/vnd.oasis.opendocument.graphics', 'application/vnd.oasis.opendocument.graphics-template', 'application/vnd.sun.xml.math', 'application/vnd.stardivision.math', 'application/vnd.oasis.opendocument.formula', 'application/vnd.oasis.opendocument.database' => 'fa-calculator', + default => 'fa-file-o', }, ['is_safe' => ['html']] ); diff --git a/app/TransactionRules/Actions/UpdatePiggyBank.php b/app/TransactionRules/Actions/UpdatePiggyBank.php index 5633ba6b83..6b7113b6b2 100644 --- a/app/TransactionRules/Actions/UpdatePiggyBank.php +++ b/app/TransactionRules/Actions/UpdatePiggyBank.php @@ -140,6 +140,29 @@ class UpdatePiggyBank implements ActionInterface return $repository->findByName($name); } + private function getAccounts(TransactionJournal $journal): array + { + return [ + 'source' => $journal->transactions()->where('amount', '<', '0')->first()?->account, + 'destination' => $journal->transactions()->where('amount', '>', '0')->first()?->account, + ]; + } + + private function isConnected(PiggyBank $piggyBank, ?Account $link): bool + { + if (null === $link) { + return false; + } + foreach ($piggyBank->accounts as $account) { + if ($account->id === $link->id) { + return true; + } + } + Log::debug(sprintf('Piggy bank is not connected to account #%d "%s"', $link->id, $link->name)); + + return false; + } + private function removeAmount(PiggyBank $piggyBank, array $array, TransactionJournal $journal, Account $account, string $amount): void { $repository = app(PiggyBankRepositoryInterface::class); @@ -208,27 +231,4 @@ class UpdatePiggyBank implements ActionInterface $repository->addAmount($piggyBank, $account, $amount, $journal); } - - private function getAccounts(TransactionJournal $journal): array - { - return [ - 'source' => $journal->transactions()->where('amount', '<', '0')->first()?->account, - 'destination' => $journal->transactions()->where('amount', '>', '0')->first()?->account, - ]; - } - - private function isConnected(PiggyBank $piggyBank, ?Account $link): bool - { - if (null === $link) { - return false; - } - foreach ($piggyBank->accounts as $account) { - if ($account->id === $link->id) { - return true; - } - } - Log::debug(sprintf('Piggy bank is not connected to account #%d "%s"', $link->id, $link->name)); - - return false; - } } diff --git a/app/TransactionRules/Engine/SearchRuleEngine.php b/app/TransactionRules/Engine/SearchRuleEngine.php index ce1398b3fc..385d8bdd14 100644 --- a/app/TransactionRules/Engine/SearchRuleEngine.php +++ b/app/TransactionRules/Engine/SearchRuleEngine.php @@ -45,11 +45,11 @@ use Illuminate\Support\Facades\Log; class SearchRuleEngine implements RuleEngineInterface { private readonly Collection $groups; - private array $operators; - private bool $refreshTriggers; - private array $resultCount; + private array $operators; + private bool $refreshTriggers; + private array $resultCount; private readonly Collection $rules; - private User $user; + private User $user; public function __construct() { diff --git a/app/TransactionRules/Expressions/ActionExpression.php b/app/TransactionRules/Expressions/ActionExpression.php index 97970c2634..a012c3c3b3 100644 --- a/app/TransactionRules/Expressions/ActionExpression.php +++ b/app/TransactionRules/Expressions/ActionExpression.php @@ -29,7 +29,7 @@ use Symfony\Component\ExpressionLanguage\SyntaxError; class ActionExpression { - private static array $NAMES + private static array $NAMES = [ // 'transaction_group_id', // 'user_id', diff --git a/app/Transformers/AccountTransformer.php b/app/Transformers/AccountTransformer.php index 935bc3104d..82c8fc9c04 100644 --- a/app/Transformers/AccountTransformer.php +++ b/app/Transformers/AccountTransformer.php @@ -40,9 +40,9 @@ use Symfony\Component\HttpFoundation\ParameterBag; */ class AccountTransformer extends AbstractTransformer { - protected AccountRepositoryInterface $repository; protected bool $convertToNative; protected TransactionCurrency $native; + protected AccountRepositoryInterface $repository; /** * AccountTransformer constructor. diff --git a/app/Transformers/AttachmentTransformer.php b/app/Transformers/AttachmentTransformer.php index a0a2fa8670..dba5661a7d 100644 --- a/app/Transformers/AttachmentTransformer.php +++ b/app/Transformers/AttachmentTransformer.php @@ -50,21 +50,21 @@ class AttachmentTransformer extends AbstractTransformer $this->repository->setUser($attachment->user); return [ - 'id' => (string) $attachment->id, - 'created_at' => $attachment->created_at->toAtomString(), - 'updated_at' => $attachment->updated_at->toAtomString(), - 'attachable_id' => (string) $attachment->attachable_id, - 'attachable_type' => str_replace('FireflyIII\Models\\', '', $attachment->attachable_type), - 'md5' => $attachment->md5, - 'hash' => $attachment->md5, - 'filename' => $attachment->filename, - 'download_url' => route('api.v1.attachments.download', [$attachment->id]), - 'upload_url' => route('api.v1.attachments.upload', [$attachment->id]), - 'title' => $attachment->title, - 'notes' => $this->repository->getNoteText($attachment), - 'mime' => $attachment->mime, - 'size' => (int) $attachment->size, - 'links' => [ + 'id' => (string) $attachment->id, + 'created_at' => $attachment->created_at->toAtomString(), + 'updated_at' => $attachment->updated_at->toAtomString(), + 'attachable_id' => (string) $attachment->attachable_id, + 'attachable_type' => str_replace('FireflyIII\Models\\', '', $attachment->attachable_type), + 'md5' => $attachment->md5, + 'hash' => $attachment->md5, + 'filename' => $attachment->filename, + 'download_url' => route('api.v1.attachments.download', [$attachment->id]), + 'upload_url' => route('api.v1.attachments.upload', [$attachment->id]), + 'title' => $attachment->title, + 'notes' => $this->repository->getNoteText($attachment), + 'mime' => $attachment->mime, + 'size' => (int) $attachment->size, + 'links' => [ [ 'rel' => 'self', 'uri' => '/attachment/'.$attachment->id, diff --git a/app/Transformers/AvailableBudgetTransformer.php b/app/Transformers/AvailableBudgetTransformer.php index 100138acee..dacc389d07 100644 --- a/app/Transformers/AvailableBudgetTransformer.php +++ b/app/Transformers/AvailableBudgetTransformer.php @@ -36,11 +36,11 @@ use FireflyIII\Support\Facades\Amount; */ class AvailableBudgetTransformer extends AbstractTransformer { + private readonly bool $convertToNative; + private readonly TransactionCurrency $default; private readonly NoBudgetRepositoryInterface $noBudgetRepository; private readonly OperationsRepositoryInterface $opsRepository; private readonly BudgetRepositoryInterface $repository; - private readonly TransactionCurrency $default; - private readonly bool $convertToNative; /** * CurrencyTransformer constructor. diff --git a/app/Transformers/BillTransformer.php b/app/Transformers/BillTransformer.php index e793bc015e..ec152568f8 100644 --- a/app/Transformers/BillTransformer.php +++ b/app/Transformers/BillTransformer.php @@ -41,9 +41,9 @@ use Illuminate\Support\Collection; class BillTransformer extends AbstractTransformer { private readonly BillDateCalculator $calculator; - private readonly BillRepositoryInterface $repository; - private readonly TransactionCurrency $default; private readonly bool $convertToNative; + private readonly TransactionCurrency $default; + private readonly BillRepositoryInterface $repository; /** * BillTransformer constructor. diff --git a/app/Transformers/BudgetLimitTransformer.php b/app/Transformers/BudgetLimitTransformer.php index 1a4eaa5d3f..a1990febec 100644 --- a/app/Transformers/BudgetLimitTransformer.php +++ b/app/Transformers/BudgetLimitTransformer.php @@ -41,9 +41,8 @@ class BudgetLimitTransformer extends AbstractTransformer = [ 'budget', ]; - - protected TransactionCurrency $default; protected bool $convertToNative; + protected TransactionCurrency $default; public function __construct() { diff --git a/app/Transformers/BudgetTransformer.php b/app/Transformers/BudgetTransformer.php index 9dac0351bf..12e5feac28 100644 --- a/app/Transformers/BudgetTransformer.php +++ b/app/Transformers/BudgetTransformer.php @@ -38,10 +38,10 @@ use Symfony\Component\HttpFoundation\ParameterBag; */ class BudgetTransformer extends AbstractTransformer { - private readonly OperationsRepositoryInterface $opsRepository; - private readonly BudgetRepositoryInterface $repository; private readonly bool $convertToNative; private readonly TransactionCurrency $default; + private readonly OperationsRepositoryInterface $opsRepository; + private readonly BudgetRepositoryInterface $repository; /** * BudgetTransformer constructor. diff --git a/app/Transformers/CategoryTransformer.php b/app/Transformers/CategoryTransformer.php index 90ee854fcb..a5516e03c3 100644 --- a/app/Transformers/CategoryTransformer.php +++ b/app/Transformers/CategoryTransformer.php @@ -36,10 +36,10 @@ use Illuminate\Support\Collection; */ class CategoryTransformer extends AbstractTransformer { + private readonly bool $convertToNative; + private readonly TransactionCurrency $default; private readonly OperationsRepositoryInterface $opsRepository; private readonly CategoryRepositoryInterface $repository; - private readonly TransactionCurrency $default; - private readonly bool $convertToNative; /** * CategoryTransformer constructor. diff --git a/app/Transformers/TransactionGroupTransformer.php b/app/Transformers/TransactionGroupTransformer.php index af5bf4815f..787c5e74a3 100644 --- a/app/Transformers/TransactionGroupTransformer.php +++ b/app/Transformers/TransactionGroupTransformer.php @@ -83,14 +83,14 @@ class TransactionGroupTransformer extends AbstractTransformer $first = new NullArrayObject(reset($group['transactions'])); return [ - 'id' => (int) $first['transaction_group_id'], - 'created_at' => $first['created_at']->toAtomString(), - 'updated_at' => $first['updated_at']->toAtomString(), - 'user' => (string) $data['user_id'], - 'user_group' => (string) $data['user_group_id'], - 'group_title' => $data['title'], - 'transactions' => $this->transformTransactions($data), - 'links' => [ + 'id' => (int) $first['transaction_group_id'], + 'created_at' => $first['created_at']->toAtomString(), + 'updated_at' => $first['updated_at']->toAtomString(), + 'user' => (string) $data['user_id'], + 'user_group' => (string) $data['user_group_id'], + 'group_title' => $data['title'], + 'transactions' => $this->transformTransactions($data), + 'links' => [ [ 'rel' => 'self', 'uri' => '/transactions/'.$first['transaction_group_id'], @@ -231,12 +231,6 @@ class TransactionGroupTransformer extends AbstractTransformer return null; } - private function getLocation(TransactionJournal $journal): ?Location - { - /** @var null|Location */ - return $journal->locations()->first(); - } - /** * @throws FireflyException */ @@ -526,4 +520,10 @@ class TransactionGroupTransformer extends AbstractTransformer return $array; } + + private function getLocation(TransactionJournal $journal): ?Location + { + /** @var null|Location */ + return $journal->locations()->first(); + } } diff --git a/app/Transformers/V2/AccountTransformer.php b/app/Transformers/V2/AccountTransformer.php index c416a83ecc..2f71df27d4 100644 --- a/app/Transformers/V2/AccountTransformer.php +++ b/app/Transformers/V2/AccountTransformer.php @@ -44,13 +44,13 @@ class AccountTransformer extends AbstractTransformer private array $accountMeta; private array $accountTypes; private array $balanceDifferences; + private array $balances; private array $convertedBalances; private array $currencies; private TransactionCurrency $default; private array $fullTypes; private array $lastActivity; private array $objectGroups; - private array $balances; /** * This method collects meta-data for one or all accounts in the transformer's collection. diff --git a/app/Transformers/V2/BillTransformer.php b/app/Transformers/V2/BillTransformer.php index 34d9afe5e1..d5209d2243 100644 --- a/app/Transformers/V2/BillTransformer.php +++ b/app/Transformers/V2/BillTransformer.php @@ -143,9 +143,9 @@ class BillTransformer extends AbstractTransformer app('log')->debug(sprintf('Foreign currency is #%d', $transaction['foreign_currency_id'])); $foreignCurrencyId = (int) $transaction['foreign_currency_id']; $currencies[$foreignCurrencyId] ??= TransactionCurrency::find($foreignCurrencyId); - $foreignCurrencyCode = $currencies[$foreignCurrencyId]->code; // @phpstan-ignore property.notFound - $foreignCurrencyName = $currencies[$foreignCurrencyId]->name; // @phpstan-ignore property.notFound - $foreignCurrencySymbol = $currencies[$foreignCurrencyId]->symbol; // @phpstan-ignore property.notFound + $foreignCurrencyCode = $currencies[$foreignCurrencyId]->code; // @phpstan-ignore property.notFound + $foreignCurrencyName = $currencies[$foreignCurrencyId]->name; // @phpstan-ignore property.notFound + $foreignCurrencySymbol = $currencies[$foreignCurrencyId]->symbol; // @phpstan-ignore property.notFound $foreignCurrencyDp = $currencies[$foreignCurrencyId]->decimal_places; // @phpstan-ignore property.notFound } diff --git a/app/Transformers/V2/TransactionGroupTransformer.php b/app/Transformers/V2/TransactionGroupTransformer.php index 1a30321466..e23bd8506b 100644 --- a/app/Transformers/V2/TransactionGroupTransformer.php +++ b/app/Transformers/V2/TransactionGroupTransformer.php @@ -53,14 +53,14 @@ class TransactionGroupTransformer extends AbstractTransformer private array $currencies = []; private TransactionCurrency $default; // collection of all currencies for this transformer. private array $journals = []; - private array $objects = []; + private array $meta = []; // private array $currencies = []; // private array $transactionTypes = []; - private array $meta = []; - private array $notes = []; + private array $notes = []; + private array $objects = []; // private array $locations = []; - private array $tags = []; + private array $tags = []; // private array $amounts = []; // private array $foreignAmounts = []; // private array $journalCurrencies = []; diff --git a/app/Validation/AccountValidator.php b/app/Validation/AccountValidator.php index 128f851a05..456d0df50b 100644 --- a/app/Validation/AccountValidator.php +++ b/app/Validation/AccountValidator.php @@ -49,14 +49,14 @@ class AccountValidator use TransferValidation; use WithdrawalValidation; - public bool $createMode; - public string $destError; - public ?Account $destination; - public ?Account $source; - public string $sourceError; - private AccountRepositoryInterface $accountRepository; - private array $combinations; - private string $transactionType; + public bool $createMode; + public string $destError; + public ?Account $destination; + public ?Account $source; + public string $sourceError; + private AccountRepositoryInterface $accountRepository; + private array $combinations; + private string $transactionType; /** * AccountValidator constructor. diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index 6f9ae81c09..8b06e056c3 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -104,7 +104,7 @@ class FireflyValidator extends Validator /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ - public function validateBic(mixed $attribute, mixed $value): bool + public function validateBic(mixed $attribute, mixed $value): bool { if (!is_string($value) || strlen($value) < 8) { return false; @@ -857,8 +857,7 @@ class FireflyValidator extends Validator ->where('trigger', $trigger) ->where('response', $response) ->where('delivery', $delivery) - ->where('url', $url)->count() - ; + ->where('url', $url)->count(); } return false; From a4f7c90e098b6e5ee936578011788b2bcb283422 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 May 2025 21:24:50 +0200 Subject: [PATCH 33/87] Fix back and forth between v1 and v2 --- app/Console/Commands/Upgrade/UpgradesDatabase.php | 8 +++++++- app/Http/Controllers/Controller.php | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/Upgrade/UpgradesDatabase.php b/app/Console/Commands/Upgrade/UpgradesDatabase.php index d30b32662a..cfe9a8a44c 100644 --- a/app/Console/Commands/Upgrade/UpgradesDatabase.php +++ b/app/Console/Commands/Upgrade/UpgradesDatabase.php @@ -23,8 +23,14 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Upgrade; +use Illuminate\Support\Facades\Log; +use Safe\Exceptions\InfoException; -\Safe\set_time_limit(0); +try { + set_time_limit(0); +} catch (InfoException) { + Log::warning('set_time_limit returned false. This could be an issue, unless you also run XDebug.'); +} use FireflyIII\Console\Commands\ShowsFriendlyMessages; use Illuminate\Console\Command; diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 2ac0db4408..f7e5922f1a 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -32,6 +32,7 @@ use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Routing\Controller as BaseController; +use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\View; use Route; @@ -80,6 +81,8 @@ abstract class Controller extends BaseController // overrule v2 layout back to v1. if ('true' === request()->get('force_default_layout') && 'v2' === config('view.layout')) { + //config('view.layout','v1'); + Config::set('view.layout', 'v1'); View::getFinder()->setPaths([\Safe\realpath(base_path('resources/views'))]); // @phpstan-ignore-line } From 3760aabf134d62909265472dac6221fb9446409e Mon Sep 17 00:00:00 2001 From: JC5 Date: Mon, 5 May 2025 05:25:13 +0200 Subject: [PATCH 34/87] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-05-05?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../List/TransactionController.php | 3 +- .../Correction/RemovesEmptyGroups.php | 2 +- .../Commands/Upgrade/UpgradesDatabase.php | 1 + app/Helpers/Collector/GroupCollector.php | 3 +- .../Controllers/Budget/IndexController.php | 10 +++---- .../Controllers/Chart/CategoryController.php | 10 +++---- app/Http/Controllers/JavascriptController.php | 3 +- .../Category/NoCategoryRepository.php | 12 ++++---- app/Rules/UniqueIban.php | 8 ++--- .../Http/Controllers/PeriodOverview.php | 30 +++++++++---------- .../Report/Budget/BudgetReportGenerator.php | 20 ++++++------- app/Validation/FireflyValidator.php | 3 +- config/firefly.php | 2 +- resources/assets/v1/src/locales/nl.json | 2 +- 14 files changed, 57 insertions(+), 52 deletions(-) diff --git a/app/Api/V2/Controllers/Transaction/List/TransactionController.php b/app/Api/V2/Controllers/Transaction/List/TransactionController.php index 0de0879812..0e630d7444 100644 --- a/app/Api/V2/Controllers/Transaction/List/TransactionController.php +++ b/app/Api/V2/Controllers/Transaction/List/TransactionController.php @@ -114,6 +114,7 @@ class TransactionController extends Controller return response() ->json($this->jsonApiList('transactions', $paginator, new TransactionGroupTransformer())) - ->header('Content-Type', self::CONTENT_TYPE); + ->header('Content-Type', self::CONTENT_TYPE) + ; } } diff --git a/app/Console/Commands/Correction/RemovesEmptyGroups.php b/app/Console/Commands/Correction/RemovesEmptyGroups.php index fd07c3cbb9..7f64fc048a 100644 --- a/app/Console/Commands/Correction/RemovesEmptyGroups.php +++ b/app/Console/Commands/Correction/RemovesEmptyGroups.php @@ -44,7 +44,7 @@ class RemovesEmptyGroups extends Command { $groupIds = TransactionGroup::leftJoin('transaction_journals', 'transaction_groups.id', '=', 'transaction_journals.transaction_group_id') - ->whereNull('transaction_journals.id')->get(['transaction_groups.id'])->pluck('id')->toArray() + ->whereNull('transaction_journals.id')->get(['transaction_groups.id'])->pluck('id')->toArray() ; $total = count($groupIds); diff --git a/app/Console/Commands/Upgrade/UpgradesDatabase.php b/app/Console/Commands/Upgrade/UpgradesDatabase.php index cfe9a8a44c..8a02417a36 100644 --- a/app/Console/Commands/Upgrade/UpgradesDatabase.php +++ b/app/Console/Commands/Upgrade/UpgradesDatabase.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Upgrade; + use Illuminate\Support\Facades\Log; use Safe\Exceptions\InfoException; diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index 98f2ba1bff..4cff722226 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -1168,7 +1168,8 @@ class GroupCollector implements GroupCollectorInterface // include budget ID + name (if any) ->withBudgetInformation() // include bill ID + name (if any) - ->withBillInformation(); + ->withBillInformation() + ; return $this; } diff --git a/app/Http/Controllers/Budget/IndexController.php b/app/Http/Controllers/Budget/IndexController.php index a71146878d..cbaf9d35d5 100644 --- a/app/Http/Controllers/Budget/IndexController.php +++ b/app/Http/Controllers/Budget/IndexController.php @@ -287,11 +287,11 @@ class IndexController extends Controller // also calculate how much left from budgeted: $sums['left'][$currencyId] ??= [ - 'amount' => '0', - 'currency_id' => $budgeted['currency_id'], - 'currency_symbol' => $budgeted['currency_symbol'], - 'currency_decimal_places' => $budgeted['currency_decimal_places'], - ]; + 'amount' => '0', + 'currency_id' => $budgeted['currency_id'], + 'currency_symbol' => $budgeted['currency_symbol'], + 'currency_decimal_places' => $budgeted['currency_decimal_places'], + ]; } } diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index b491bc06d3..3a88fd8f5b 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -197,11 +197,11 @@ class CategoryController extends Controller $chartData[$inKey] = [ - 'label' => sprintf('%s (%s)', (string) trans('firefly.earned'), $currencyInfo['currency_name']), - 'entries' => [], - 'type' => 'bar', - 'backgroundColor' => 'rgba(0, 141, 76, 0.5)', // green - ]; + 'label' => sprintf('%s (%s)', (string) trans('firefly.earned'), $currencyInfo['currency_name']), + 'entries' => [], + 'type' => 'bar', + 'backgroundColor' => 'rgba(0, 141, 76, 0.5)', // green + ]; // loop empty periods: foreach (array_keys($periods) as $period) { $label = $periods[$period]; diff --git a/app/Http/Controllers/JavascriptController.php b/app/Http/Controllers/JavascriptController.php index 0ce2368bf4..2fcc5b3aed 100644 --- a/app/Http/Controllers/JavascriptController.php +++ b/app/Http/Controllers/JavascriptController.php @@ -142,6 +142,7 @@ class JavascriptController extends Controller return response() ->view('v2.javascript.variables', $data) - ->header('Content-Type', 'text/javascript'); + ->header('Content-Type', 'text/javascript') + ; } } diff --git a/app/Repositories/Category/NoCategoryRepository.php b/app/Repositories/Category/NoCategoryRepository.php index 7ca31375bc..8c687125f6 100644 --- a/app/Repositories/Category/NoCategoryRepository.php +++ b/app/Repositories/Category/NoCategoryRepository.php @@ -77,9 +77,9 @@ class NoCategoryRepository implements NoCategoryRepositoryInterface, UserGroupIn $journalId = (int) $journal['transaction_journal_id']; $array[$currencyId]['categories'][0]['transaction_journals'][$journalId] = [ - 'amount' => app('steam')->negative($journal['amount']), - 'date' => $journal['date'], - ]; + 'amount' => app('steam')->negative($journal['amount']), + 'date' => $journal['date'], + ]; } return $array; @@ -123,9 +123,9 @@ class NoCategoryRepository implements NoCategoryRepositoryInterface, UserGroupIn $journalId = (int) $journal['transaction_journal_id']; $array[$currencyId]['categories'][0]['transaction_journals'][$journalId] = [ - 'amount' => app('steam')->positive($journal['amount']), - 'date' => $journal['date'], - ]; + 'amount' => app('steam')->positive($journal['amount']), + 'date' => $journal['date'], + ]; } return $array; diff --git a/app/Rules/UniqueIban.php b/app/Rules/UniqueIban.php index 6c1e312d79..b6aca57927 100644 --- a/app/Rules/UniqueIban.php +++ b/app/Rules/UniqueIban.php @@ -153,10 +153,10 @@ class UniqueIban implements ValidationRule } $query = auth()->user() - ->accounts() - ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') - ->where('accounts.iban', $iban) - ->whereIn('account_types.type', $typesArray) + ->accounts() + ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') + ->where('accounts.iban', $iban) + ->whereIn('account_types.type', $typesArray) ; if (null !== $this->account) { diff --git a/app/Support/Http/Controllers/PeriodOverview.php b/app/Support/Http/Controllers/PeriodOverview.php index b8e950f2ce..8104d133e3 100644 --- a/app/Support/Http/Controllers/PeriodOverview.php +++ b/app/Support/Http/Controllers/PeriodOverview.php @@ -108,14 +108,14 @@ trait PeriodOverview [$transactions, $transferredIn] = $this->filterTransfers('in', $transactions, $currentDate['start'], $currentDate['end']); $entries[] = [ - 'title' => $title, - 'route' => route('accounts.show', [$account->id, $currentDate['start']->format('Y-m-d'), $currentDate['end']->format('Y-m-d')]), - 'total_transactions' => count($spent) + count($earned) + count($transferredAway) + count($transferredIn), - 'spent' => $this->groupByCurrency($spent), - 'earned' => $this->groupByCurrency($earned), - 'transferred_away' => $this->groupByCurrency($transferredAway), - 'transferred_in' => $this->groupByCurrency($transferredIn), - ]; + 'title' => $title, + 'route' => route('accounts.show', [$account->id, $currentDate['start']->format('Y-m-d'), $currentDate['end']->format('Y-m-d')]), + 'total_transactions' => count($spent) + count($earned) + count($transferredAway) + count($transferredIn), + 'spent' => $this->groupByCurrency($spent), + 'earned' => $this->groupByCurrency($earned), + 'transferred_away' => $this->groupByCurrency($transferredAway), + 'transferred_in' => $this->groupByCurrency($transferredIn), + ]; } $cache->store($entries); Timer::stop('account-period-total'); @@ -568,13 +568,13 @@ trait PeriodOverview } $entries[] = [ - 'title' => $title, - 'route' => route('transactions.index', [$transactionType, $currentDate['start']->format('Y-m-d'), $currentDate['end']->format('Y-m-d')]), - 'total_transactions' => count($spent) + count($earned) + count($transferred), - 'spent' => $this->groupByCurrency($spent), - 'earned' => $this->groupByCurrency($earned), - 'transferred' => $this->groupByCurrency($transferred), - ]; + 'title' => $title, + 'route' => route('transactions.index', [$transactionType, $currentDate['start']->format('Y-m-d'), $currentDate['end']->format('Y-m-d')]), + 'total_transactions' => count($spent) + count($earned) + count($transferred), + 'spent' => $this->groupByCurrency($spent), + 'earned' => $this->groupByCurrency($earned), + 'transferred' => $this->groupByCurrency($transferred), + ]; } return $entries; diff --git a/app/Support/Report/Budget/BudgetReportGenerator.php b/app/Support/Report/Budget/BudgetReportGenerator.php index 219b1a76e4..d8516bbc7b 100644 --- a/app/Support/Report/Budget/BudgetReportGenerator.php +++ b/app/Support/Report/Budget/BudgetReportGenerator.php @@ -213,16 +213,16 @@ class BudgetReportGenerator // make sum information: $this->report['sums'][$currencyId] ??= [ - 'budgeted' => '0', - 'spent' => '0', - 'left' => '0', - 'overspent' => '0', - 'currency_id' => $currencyId, - 'currency_code' => $limitCurrency->code, - 'currency_name' => $limitCurrency->name, - 'currency_symbol' => $limitCurrency->symbol, - 'currency_decimal_places' => $limitCurrency->decimal_places, - ]; + 'budgeted' => '0', + 'spent' => '0', + 'left' => '0', + 'overspent' => '0', + 'currency_id' => $currencyId, + 'currency_code' => $limitCurrency->code, + 'currency_name' => $limitCurrency->name, + 'currency_symbol' => $limitCurrency->symbol, + 'currency_decimal_places' => $limitCurrency->decimal_places, + ]; $this->report['sums'][$currencyId]['budgeted'] = bcadd((string) $this->report['sums'][$currencyId]['budgeted'], $limit->amount); $this->report['sums'][$currencyId]['spent'] = bcadd((string) $this->report['sums'][$currencyId]['spent'], $spent); $this->report['sums'][$currencyId]['left'] = bcadd((string) $this->report['sums'][$currencyId]['left'], bcadd($limit->amount, $spent)); diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index 8b06e056c3..86409ed951 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -857,7 +857,8 @@ class FireflyValidator extends Validator ->where('trigger', $trigger) ->where('response', $response) ->where('delivery', $delivery) - ->where('url', $url)->count(); + ->where('url', $url)->count() + ; } return false; diff --git a/config/firefly.php b/config/firefly.php index ff7827f861..4fd9cf0475 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -78,7 +78,7 @@ return [ 'running_balance_column' => env('USE_RUNNING_BALANCE', false), // see cer.php for exchange rates feature flag. ], - 'version' => 'develop/2025-05-04', + 'version' => 'develop/2025-05-05', 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 25, diff --git a/resources/assets/v1/src/locales/nl.json b/resources/assets/v1/src/locales/nl.json index 83ebbd6e10..c87bdf1f7a 100644 --- a/resources/assets/v1/src/locales/nl.json +++ b/resources/assets/v1/src/locales/nl.json @@ -2,7 +2,7 @@ "firefly": { "administrations_page_title": "Grootboeken", "administrations_index_menu": "Grootboeken", - "expires_at": "Expires at", + "expires_at": "Verloopt op", "temp_administrations_introduction": "Firefly III krijgt binnenkort het vermogen om meerdere grootboeken te beheren. Op dit moment kan dat nog niet. Je kan de titel van dit grootboek instellen en de basisvaluta. Dit vervangt de voorgaande manier waarop je je \"standaardvaluta\" zou instellen. Deze instelling is nu gekoppeld aan dit grootboek, en kan per grootboek verschillend zijn.", "administration_currency_form_help": "Het wijzigen van deze instelling betekent dat heel veel transacties omgerekend moeten worden naar je nieuwe basisvaluta en dat kan lang duren.", "administrations_page_edit_sub_title_js": "Wijzig grootboek \"{title}\"", From 31dbc57e8b6dfc4dcf2a0ca9a1d52e5cee55f8cc Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 5 May 2025 07:48:13 +0200 Subject: [PATCH 35/87] Update packages --- .../ReturnsAvailableChannels.php | 85 +- composer.json | 10 +- composer.lock | 1162 ++++++----------- config/notifications.php | 2 +- 4 files changed, 456 insertions(+), 803 deletions(-) diff --git a/app/Notifications/ReturnsAvailableChannels.php b/app/Notifications/ReturnsAvailableChannels.php index 21ee5c49f9..4ec5e5629d 100644 --- a/app/Notifications/ReturnsAvailableChannels.php +++ b/app/Notifications/ReturnsAvailableChannels.php @@ -51,29 +51,35 @@ class ReturnsAvailableChannels { $channels = ['mail']; - $slackUrl = app('fireflyconfig')->getEncrypted('slack_webhook_url', '')->data; - if (UrlValidator::isValidWebhookURL($slackUrl)) { - $channels[] = 'slack'; + if(true === config('notifications.channels.slack.enabled', false)) { + $slackUrl = app('fireflyconfig')->getEncrypted('slack_webhook_url', '')->data; + if (UrlValidator::isValidWebhookURL($slackUrl)) { + $channels[] = 'slack'; + } } - // validate presence of of Ntfy settings. - if ('' !== (string) app('fireflyconfig')->getEncrypted('ntfy_topic', '')->data) { - Log::debug('Enabled ntfy.'); - $channels[] = NtfyChannel::class; - } - if ('' === (string) app('fireflyconfig')->getEncrypted('ntfy_topic', '')->data) { - Log::warning('No topic name for Ntfy, channel is disabled.'); + if(true === config('notifications.channels.ntfy.enabled', false)) { + // validate presence of of Ntfy settings. + if ('' !== (string) app('fireflyconfig')->getEncrypted('ntfy_topic', '')->data) { + Log::debug('Enabled ntfy.'); + $channels[] = NtfyChannel::class; + } + if ('' === (string) app('fireflyconfig')->getEncrypted('ntfy_topic', '')->data) { + Log::warning('No topic name for Ntfy, channel is disabled.'); + } } // pushover - $pushoverAppToken = (string) app('fireflyconfig')->getEncrypted('pushover_app_token', '')->data; - $pushoverUserToken = (string) app('fireflyconfig')->getEncrypted('pushover_user_token', '')->data; - if ('' === $pushoverAppToken || '' === $pushoverUserToken) { - Log::warning('[b] No Pushover token, channel is disabled.'); - } - if ('' !== $pushoverAppToken && '' !== $pushoverUserToken) { - Log::debug('Enabled pushover.'); - $channels[] = PushoverChannel::class; + if(true === config('notifications.channels.pushover.enabled', false)) { + $pushoverAppToken = (string) app('fireflyconfig')->getEncrypted('pushover_app_token', '')->data; + $pushoverUserToken = (string) app('fireflyconfig')->getEncrypted('pushover_user_token', '')->data; + if ('' === $pushoverAppToken || '' === $pushoverUserToken) { + Log::warning('[b] No Pushover token, channel is disabled.'); + } + if ('' !== $pushoverAppToken && '' !== $pushoverUserToken) { + Log::debug('Enabled pushover.'); + $channels[] = PushoverChannel::class; + } } Log::debug(sprintf('Final channel set in ReturnsAvailableChannels: %s ', implode(', ', $channels))); @@ -85,30 +91,37 @@ class ReturnsAvailableChannels { Log::debug(sprintf('Checking channels for user #%d', $user->id)); $channels = ['mail']; - $slackUrl = (string) app('preferences')->getEncryptedForUser($user, 'slack_webhook_url', '')->data; - if (UrlValidator::isValidWebhookURL($slackUrl)) { - $channels[] = 'slack'; + + if(true === config('notifications.channels.slack.enabled', false)) { + $slackUrl = (string) app('preferences')->getEncryptedForUser($user, 'slack_webhook_url', '')->data; + if (UrlValidator::isValidWebhookURL($slackUrl)) { + $channels[] = 'slack'; + } } // validate presence of of Ntfy settings. - $ntfyTopic = (string) app('preferences')->getEncryptedForUser($user, 'ntfy_topic', '')->data; - if ('' !== $ntfyTopic) { - Log::debug(sprintf('Enabled ntfy, "%s"', $ntfyTopic)); - $channels[] = NtfyChannel::class; - } - if ('' === (string) app('preferences')->getEncryptedForUser($user, 'ntfy_topic', '')->data) { - Log::warning('No topic name for Ntfy, channel is disabled.'); + if(true === config('notifications.channels.nfy.enabled', false)) { + $ntfyTopic = (string) app('preferences')->getEncryptedForUser($user, 'ntfy_topic', '')->data; + if ('' !== $ntfyTopic) { + Log::debug(sprintf('Enabled ntfy, "%s"', $ntfyTopic)); + $channels[] = NtfyChannel::class; + } + if ('' === (string) app('preferences')->getEncryptedForUser($user, 'ntfy_topic', '')->data) { + Log::warning('No topic name for Ntfy, channel is disabled.'); + } } // pushover - $pushoverAppToken = (string) app('preferences')->getEncryptedForUser($user, 'pushover_app_token', '')->data; - $pushoverUserToken = (string) app('preferences')->getEncryptedForUser($user, 'pushover_user_token', '')->data; - if ('' === $pushoverAppToken || '' === $pushoverUserToken) { - Log::warning('[b] No Pushover token, channel is disabled.'); - } - if ('' !== $pushoverAppToken && '' !== $pushoverUserToken) { - Log::debug('Enabled pushover.'); - $channels[] = PushoverChannel::class; + if(true === config('notifications.channels.slack.enabled', false)) { + $pushoverAppToken = (string) app('preferences')->getEncryptedForUser($user, 'pushover_app_token', '')->data; + $pushoverUserToken = (string) app('preferences')->getEncryptedForUser($user, 'pushover_user_token', '')->data; + if ('' === $pushoverAppToken || '' === $pushoverUserToken) { + Log::warning('[b] No Pushover token, channel is disabled.'); + } + if ('' !== $pushoverAppToken && '' !== $pushoverUserToken) { + Log::debug('Enabled pushover.'); + $channels[] = PushoverChannel::class; + } } Log::debug(sprintf('Final channel set in ReturnsAvailableChannels (user): %s ', implode(', ', $channels))); diff --git a/composer.json b/composer.json index eca5b62ed0..8a461e9fe3 100644 --- a/composer.json +++ b/composer.json @@ -88,9 +88,8 @@ "jc5/google2fa-laravel": "^2.0", "jc5/recovery": "^2", "laravel-notification-channels/pushover": "^4.0", - "laravel/framework": "^11", + "laravel/framework": "^12", "laravel/passport": "^12", - "laravel/sanctum": "^4", "laravel/slack-notification-channel": "^3.3", "laravel/ui": "^4.2", "league/commonmark": "^2", @@ -99,7 +98,7 @@ "mailersend/laravel-driver": "^2.7", "nunomaduro/collision": "^8", "pragmarx/google2fa": "^8.0", - "predis/predis": "^2.2", + "predis/predis": "^3", "psr/log": "<4", "ramsey/uuid": "^4.7", "rcrowe/twigbridge": "^0.14", @@ -108,8 +107,7 @@ "spatie/period": "^2.4", "symfony/expression-language": "^7.0", "symfony/http-client": "^7.1", - "symfony/mailgun-mailer": "^7.1", - "wijourdil/ntfy-notification-channel": "^3.0" + "symfony/mailgun-mailer": "^7.1" }, "require-dev": { "barryvdh/laravel-debugbar": "^3.9", @@ -123,7 +121,7 @@ "phpstan/phpstan": "^2", "phpstan/phpstan-deprecation-rules": "^2", "phpstan/phpstan-strict-rules": "^2", - "phpunit/phpunit": "^11", + "phpunit/phpunit": "^12", "rector/rector": "^2.0", "thecodingmachine/phpstan-safe-rule": "^1.4" }, diff --git a/composer.lock b/composer.lock index 186d66d610..bc2b4af8cf 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ce140fe154a7c5c4f9326b67873620d3", + "content-hash": "be90fbe2c861ffb51547daafa97e4473", "packages": [ { "name": "bacon/bacon-qr-code", @@ -1656,26 +1656,27 @@ }, { "name": "jc5/google2fa-laravel", - "version": "2.0.9", + "version": "2.0.10", "source": { "type": "git", "url": "https://github.com/JC5/google2fa-laravel.git", - "reference": "af390d117e92963c75fa36868b754e6321b3710f" + "reference": "7b521b07c60786719d74c12c1d6306f5add0d998" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JC5/google2fa-laravel/zipball/af390d117e92963c75fa36868b754e6321b3710f", - "reference": "af390d117e92963c75fa36868b754e6321b3710f", + "url": "https://api.github.com/repos/JC5/google2fa-laravel/zipball/7b521b07c60786719d74c12c1d6306f5add0d998", + "reference": "7b521b07c60786719d74c12c1d6306f5add0d998", "shasum": "" }, "require": { - "laravel/framework": ">=5.4.36", + "laravel/framework": "^11.0|^12.0", "php": ">=8", - "pragmarx/google2fa-qrcode": ">1.0" + "pragmarx/google2fa-qrcode": "^3" }, "require-dev": { - "orchestra/testbench": "3.4.*|3.5.*|3.6.*|3.7.*|4.*|5.*|6.*", - "phpunit/phpunit": "~9", + "bacon/bacon-qr-code": "^3.0", + "orchestra/testbench": "3.4.*|3.5.*|3.6.*|3.7.*|4.*|5.*|6.*|7.*|8.*|9.*|10.*", + "phpunit/phpunit": "~5|~6|~7|~8|~9|~10|~11", "roave/security-advisories": "dev-master" }, "suggest": { @@ -1731,9 +1732,9 @@ ], "support": { "issues": "https://github.com/JC5/google2fa-laravel/issues", - "source": "https://github.com/JC5/google2fa-laravel/tree/2.0.9" + "source": "https://github.com/JC5/google2fa-laravel/tree/2.0.10" }, - "time": "2023-09-16T02:59:44+00:00" + "time": "2025-05-05T04:27:12+00:00" }, { "name": "jc5/recovery", @@ -1878,20 +1879,20 @@ }, { "name": "laravel/framework", - "version": "v11.44.7", + "version": "v12.12.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "00bc6ac91a6d577bf051c18ddaa638c0d221e1c7" + "reference": "8f6cd73696068c28f30f5964556ec9d14e5d90d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/00bc6ac91a6d577bf051c18ddaa638c0d221e1c7", - "reference": "00bc6ac91a6d577bf051c18ddaa638c0d221e1c7", + "url": "https://api.github.com/repos/laravel/framework/zipball/8f6cd73696068c28f30f5964556ec9d14e5d90d7", + "reference": "8f6cd73696068c28f30f5964556ec9d14e5d90d7", "shasum": "" }, "require": { - "brick/math": "^0.9.3|^0.10.2|^0.11|^0.12", + "brick/math": "^0.11|^0.12", "composer-runtime-api": "^2.2", "doctrine/inflector": "^2.0.5", "dragonmantank/cron-expression": "^3.4", @@ -1906,32 +1907,32 @@ "fruitcake/php-cors": "^1.3", "guzzlehttp/guzzle": "^7.8.2", "guzzlehttp/uri-template": "^1.0", - "laravel/prompts": "^0.1.18|^0.2.0|^0.3.0", + "laravel/prompts": "^0.3.0", "laravel/serializable-closure": "^1.3|^2.0", "league/commonmark": "^2.6", "league/flysystem": "^3.25.1", "league/flysystem-local": "^3.25.1", "league/uri": "^7.5.1", "monolog/monolog": "^3.0", - "nesbot/carbon": "^2.72.6|^3.8.4", + "nesbot/carbon": "^3.8.4", "nunomaduro/termwind": "^2.0", "php": "^8.2", "psr/container": "^1.1.1|^2.0.1", "psr/log": "^1.0|^2.0|^3.0", "psr/simple-cache": "^1.0|^2.0|^3.0", "ramsey/uuid": "^4.7", - "symfony/console": "^7.0.3", - "symfony/error-handler": "^7.0.3", - "symfony/finder": "^7.0.3", + "symfony/console": "^7.2.0", + "symfony/error-handler": "^7.2.0", + "symfony/finder": "^7.2.0", "symfony/http-foundation": "^7.2.0", - "symfony/http-kernel": "^7.0.3", - "symfony/mailer": "^7.0.3", - "symfony/mime": "^7.0.3", + "symfony/http-kernel": "^7.2.0", + "symfony/mailer": "^7.2.0", + "symfony/mime": "^7.2.0", "symfony/polyfill-php83": "^1.31", - "symfony/process": "^7.0.3", - "symfony/routing": "^7.0.3", - "symfony/uid": "^7.0.3", - "symfony/var-dumper": "^7.0.3", + "symfony/process": "^7.2.0", + "symfony/routing": "^7.2.0", + "symfony/uid": "^7.2.0", + "symfony/var-dumper": "^7.2.0", "tijsverkoyen/css-to-inline-styles": "^2.2.5", "vlucas/phpdotenv": "^5.6.1", "voku/portable-ascii": "^2.0.2" @@ -1995,17 +1996,17 @@ "league/flysystem-read-only": "^3.25.1", "league/flysystem-sftp-v3": "^3.25.1", "mockery/mockery": "^1.6.10", - "orchestra/testbench-core": "^9.11.2", - "pda/pheanstalk": "^5.0.6", + "orchestra/testbench-core": "^10.0.0", + "pda/pheanstalk": "^5.0.6|^7.0.0", "php-http/discovery": "^1.15", "phpstan/phpstan": "^2.0", - "phpunit/phpunit": "^10.5.35|^11.3.6|^12.0.1", + "phpunit/phpunit": "^10.5.35|^11.5.3|^12.0.1", "predis/predis": "^2.3", "resend/resend-php": "^0.10.0", - "symfony/cache": "^7.0.3", - "symfony/http-client": "^7.0.3", - "symfony/psr-http-message-bridge": "^7.0.3", - "symfony/translation": "^7.0.3" + "symfony/cache": "^7.2.0", + "symfony/http-client": "^7.2.0", + "symfony/psr-http-message-bridge": "^7.2.0", + "symfony/translation": "^7.2.0" }, "suggest": { "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", @@ -2031,22 +2032,22 @@ "mockery/mockery": "Required to use mocking (^1.6).", "pda/pheanstalk": "Required to use the beanstalk queue driver (^5.0).", "php-http/discovery": "Required to use PSR-7 bridging features (^1.15).", - "phpunit/phpunit": "Required to use assertions and run tests (^10.5.35|^11.3.6|^12.0.1).", + "phpunit/phpunit": "Required to use assertions and run tests (^10.5.35|^11.5.3|^12.0.1).", "predis/predis": "Required to use the predis connector (^2.3).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).", "resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0).", - "symfony/cache": "Required to PSR-6 cache bridge (^7.0).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^7.0).", - "symfony/http-client": "Required to enable support for the Symfony API mail transports (^7.0).", - "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^7.0).", - "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^7.0).", - "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^7.0)." + "symfony/cache": "Required to PSR-6 cache bridge (^7.2).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^7.2).", + "symfony/http-client": "Required to enable support for the Symfony API mail transports (^7.2).", + "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^7.2).", + "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^7.2).", + "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^7.2)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "11.x-dev" + "dev-master": "12.x-dev" } }, "autoload": { @@ -2089,7 +2090,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2025-04-25T12:40:47+00:00" + "time": "2025-05-01T16:13:12+00:00" }, { "name": "laravel/passport", @@ -2226,70 +2227,6 @@ }, "time": "2025-02-11T13:34:40+00:00" }, - { - "name": "laravel/sanctum", - "version": "v4.1.1", - "source": { - "type": "git", - "url": "https://github.com/laravel/sanctum.git", - "reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/sanctum/zipball/a360a6a1fd2400ead4eb9b6a9c1bb272939194f5", - "reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5", - "shasum": "" - }, - "require": { - "ext-json": "*", - "illuminate/console": "^11.0|^12.0", - "illuminate/contracts": "^11.0|^12.0", - "illuminate/database": "^11.0|^12.0", - "illuminate/support": "^11.0|^12.0", - "php": "^8.2", - "symfony/console": "^7.0" - }, - "require-dev": { - "mockery/mockery": "^1.6", - "orchestra/testbench": "^9.0|^10.0", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^11.3" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Laravel\\Sanctum\\SanctumServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Laravel\\Sanctum\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.", - "keywords": [ - "auth", - "laravel", - "sanctum" - ], - "support": { - "issues": "https://github.com/laravel/sanctum/issues", - "source": "https://github.com/laravel/sanctum" - }, - "time": "2025-04-23T13:03:38+00:00" - }, { "name": "laravel/serializable-closure", "version": "v2.0.4", @@ -5102,26 +5039,27 @@ }, { "name": "predis/predis", - "version": "v2.4.0", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/predis/predis.git", - "reference": "f49e13ee3a2a825631562aa0223ac922ec5d058b" + "reference": "7d86f7afb37940bfc7aaa2909147616881377667" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/predis/predis/zipball/f49e13ee3a2a825631562aa0223ac922ec5d058b", - "reference": "f49e13ee3a2a825631562aa0223ac922ec5d058b", + "url": "https://api.github.com/repos/predis/predis/zipball/7d86f7afb37940bfc7aaa2909147616881377667", + "reference": "7d86f7afb37940bfc7aaa2909147616881377667", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.2 || ^8.0", + "psr/http-message": "^1.0|^2.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.3", "phpstan/phpstan": "^1.9", "phpunit/phpcov": "^6.0 || ^8.0", - "phpunit/phpunit": "^8.0 || ^9.4" + "phpunit/phpunit": "^8.0 || ~9.4.4" }, "suggest": { "ext-relay": "Faster connection with in-memory caching (>=0.6.2)" @@ -5152,7 +5090,7 @@ ], "support": { "issues": "https://github.com/predis/predis/issues", - "source": "https://github.com/predis/predis/tree/v2.4.0" + "source": "https://github.com/predis/predis/tree/v3.0.0" }, "funding": [ { @@ -5160,7 +5098,7 @@ "type": "github" } ], - "time": "2025-04-30T15:16:02+00:00" + "time": "2025-05-02T23:18:59+00:00" }, { "name": "psr/cache", @@ -6365,67 +6303,6 @@ ], "time": "2025-02-20T13:13:55+00:00" }, - { - "name": "spatie/laravel-package-tools", - "version": "1.92.4", - "source": { - "type": "git", - "url": "https://github.com/spatie/laravel-package-tools.git", - "reference": "d20b1969f836d210459b78683d85c9cd5c5f508c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/d20b1969f836d210459b78683d85c9cd5c5f508c", - "reference": "d20b1969f836d210459b78683d85c9cd5c5f508c", - "shasum": "" - }, - "require": { - "illuminate/contracts": "^9.28|^10.0|^11.0|^12.0", - "php": "^8.0" - }, - "require-dev": { - "mockery/mockery": "^1.5", - "orchestra/testbench": "^7.7|^8.0|^9.0|^10.0", - "pestphp/pest": "^1.23|^2.1|^3.1", - "phpunit/php-code-coverage": "^9.0|^10.0|^11.0", - "phpunit/phpunit": "^9.5.24|^10.5|^11.5", - "spatie/pest-plugin-test-time": "^1.1|^2.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\LaravelPackageTools\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "role": "Developer" - } - ], - "description": "Tools for creating Laravel packages", - "homepage": "https://github.com/spatie/laravel-package-tools", - "keywords": [ - "laravel-package-tools", - "spatie" - ], - "support": { - "issues": "https://github.com/spatie/laravel-package-tools/issues", - "source": "https://github.com/spatie/laravel-package-tools/tree/1.92.4" - }, - "funding": [ - { - "url": "https://github.com/spatie", - "type": "github" - } - ], - "time": "2025-04-11T15:27:14+00:00" - }, { "name": "spatie/period", "version": "2.4.0", @@ -9415,145 +9292,6 @@ ], "time": "2025-05-02T08:36:00+00:00" }, - { - "name": "thecodingmachine/safe", - "version": "v2.5.0", - "source": { - "type": "git", - "url": "https://github.com/thecodingmachine/safe.git", - "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/3115ecd6b4391662b4931daac4eba6b07a2ac1f0", - "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0", - "shasum": "" - }, - "require": { - "php": "^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.5", - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "^3.2", - "thecodingmachine/phpstan-strict-rules": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "files": [ - "deprecated/apc.php", - "deprecated/array.php", - "deprecated/datetime.php", - "deprecated/libevent.php", - "deprecated/misc.php", - "deprecated/password.php", - "deprecated/mssql.php", - "deprecated/stats.php", - "deprecated/strings.php", - "lib/special_cases.php", - "deprecated/mysqli.php", - "generated/apache.php", - "generated/apcu.php", - "generated/array.php", - "generated/bzip2.php", - "generated/calendar.php", - "generated/classobj.php", - "generated/com.php", - "generated/cubrid.php", - "generated/curl.php", - "generated/datetime.php", - "generated/dir.php", - "generated/eio.php", - "generated/errorfunc.php", - "generated/exec.php", - "generated/fileinfo.php", - "generated/filesystem.php", - "generated/filter.php", - "generated/fpm.php", - "generated/ftp.php", - "generated/funchand.php", - "generated/gettext.php", - "generated/gmp.php", - "generated/gnupg.php", - "generated/hash.php", - "generated/ibase.php", - "generated/ibmDb2.php", - "generated/iconv.php", - "generated/image.php", - "generated/imap.php", - "generated/info.php", - "generated/inotify.php", - "generated/json.php", - "generated/ldap.php", - "generated/libxml.php", - "generated/lzf.php", - "generated/mailparse.php", - "generated/mbstring.php", - "generated/misc.php", - "generated/mysql.php", - "generated/network.php", - "generated/oci8.php", - "generated/opcache.php", - "generated/openssl.php", - "generated/outcontrol.php", - "generated/pcntl.php", - "generated/pcre.php", - "generated/pgsql.php", - "generated/posix.php", - "generated/ps.php", - "generated/pspell.php", - "generated/readline.php", - "generated/rpminfo.php", - "generated/rrd.php", - "generated/sem.php", - "generated/session.php", - "generated/shmop.php", - "generated/sockets.php", - "generated/sodium.php", - "generated/solr.php", - "generated/spl.php", - "generated/sqlsrv.php", - "generated/ssdeep.php", - "generated/ssh2.php", - "generated/stream.php", - "generated/strings.php", - "generated/swoole.php", - "generated/uodbc.php", - "generated/uopz.php", - "generated/url.php", - "generated/var.php", - "generated/xdiff.php", - "generated/xml.php", - "generated/xmlrpc.php", - "generated/yaml.php", - "generated/yaz.php", - "generated/zip.php", - "generated/zlib.php" - ], - "classmap": [ - "lib/DateTime.php", - "lib/DateTimeImmutable.php", - "lib/Exceptions/", - "deprecated/Exceptions/", - "generated/Exceptions/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHP core functions that throw exceptions instead of returning FALSE on error", - "support": { - "issues": "https://github.com/thecodingmachine/safe/issues", - "source": "https://github.com/thecodingmachine/safe/tree/v2.5.0" - }, - "time": "2023-04-05T11:54:14+00:00" - }, { "name": "tijsverkoyen/css-to-inline-styles", "version": "v2.3.0", @@ -9688,60 +9426,6 @@ ], "time": "2025-05-03T07:21:55+00:00" }, - { - "name": "verifiedjoseph/ntfy-php-library", - "version": "v4.7.1", - "source": { - "type": "git", - "url": "https://github.com/VerifiedJoseph/ntfy-php-library.git", - "reference": "b191721dfed447a94f220a89dd372861d4c41115" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/VerifiedJoseph/ntfy-php-library/zipball/b191721dfed447a94f220a89dd372861d4c41115", - "reference": "b191721dfed447a94f220a89dd372861d4c41115", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "guzzlehttp/guzzle": "^7.4", - "php": "^8.2" - }, - "require-dev": { - "phpstan/phpstan": "^2.0", - "phpstan/phpstan-deprecation-rules": "^2.0", - "phpstan/phpstan-phpunit": "^2.0", - "phpunit/phpunit": "^11.4", - "squizlabs/php_codesniffer": "^3.7" - }, - "type": "library", - "autoload": { - "psr-4": { - "Ntfy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "VerifiedJoseph", - "homepage": "https://github.com/VerifiedJoseph" - } - ], - "description": "PHP library for interacting with a Ntfy server", - "homepage": "https://github.com/VerifiedJoseph/ntfy-php-library", - "keywords": [ - "Ntfy" - ], - "support": { - "issues": "https://github.com/VerifiedJoseph/ntfy-php-library/issues", - "source": "https://github.com/VerifiedJoseph/ntfy-php-library/tree/v4.7.1" - }, - "time": "2025-04-01T14:02:04+00:00" - }, { "name": "vlucas/phpdotenv", "version": "v5.6.2", @@ -9957,81 +9641,6 @@ "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, "time": "2022-06-03T18:03:27+00:00" - }, - { - "name": "wijourdil/ntfy-notification-channel", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/wijourdil/ntfy-notification-channel.git", - "reference": "508ad1f0e1852b0bed966e9ebbf6f760ca2bac7b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wijourdil/ntfy-notification-channel/zipball/508ad1f0e1852b0bed966e9ebbf6f760ca2bac7b", - "reference": "508ad1f0e1852b0bed966e9ebbf6f760ca2bac7b", - "shasum": "" - }, - "require": { - "illuminate/contracts": "^11.0", - "php": "^8.2", - "spatie/laravel-package-tools": "^1.13.0", - "thecodingmachine/safe": "^2.4", - "verifiedjoseph/ntfy-php-library": "^4.0", - "webmozart/assert": "^1.11" - }, - "require-dev": { - "larastan/larastan": "^2.0.1", - "laravel/pint": "^1.0", - "nunomaduro/collision": "^8.1", - "orchestra/testbench": "^9.0", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-webmozart-assert": "^1.2", - "phpunit/phpunit": "^10.1", - "thecodingmachine/phpstan-safe-rule": "^1.2" - }, - "type": "library", - "extra": { - "laravel": { - "aliases": { - "NtfyNotificationChannel": "Wijourdil\\NtfyNotificationChannel\\Facades\\NtfyNotificationChannel" - }, - "providers": [ - "Wijourdil\\NtfyNotificationChannel\\NtfyNotificationChannelServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Wijourdil\\NtfyNotificationChannel\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Wilfried Jourdil", - "email": "wijourdil@protonmail.com", - "role": "Developer" - } - ], - "description": "ntfy.sh Notification Channel for Laravel", - "homepage": "https://github.com/wijourdil/ntfy-notification-channel", - "keywords": [ - "laravel", - "notification", - "ntfy-notification-channel", - "ntfy.sh", - "wijourdil" - ], - "support": { - "issues": "https://github.com/wijourdil/ntfy-notification-channel/issues", - "source": "https://github.com/wijourdil/ntfy-notification-channel/tree/3.0.0" - }, - "time": "2024-04-17T12:37:09+00:00" } ], "packages-dev": [ @@ -11377,16 +10986,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "11.0.9", + "version": "12.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "14d63fbcca18457e49c6f8bebaa91a87e8e188d7" + "reference": "448f2c504d86dbff3949dcd02c95aa85db2c7617" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/14d63fbcca18457e49c6f8bebaa91a87e8e188d7", - "reference": "14d63fbcca18457e49c6f8bebaa91a87e8e188d7", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/448f2c504d86dbff3949dcd02c95aa85db2c7617", + "reference": "448f2c504d86dbff3949dcd02c95aa85db2c7617", "shasum": "" }, "require": { @@ -11394,18 +11003,17 @@ "ext-libxml": "*", "ext-xmlwriter": "*", "nikic/php-parser": "^5.4.0", - "php": ">=8.2", - "phpunit/php-file-iterator": "^5.1.0", - "phpunit/php-text-template": "^4.0.1", - "sebastian/code-unit-reverse-lookup": "^4.0.1", - "sebastian/complexity": "^4.0.1", - "sebastian/environment": "^7.2.0", - "sebastian/lines-of-code": "^3.0.1", - "sebastian/version": "^5.0.2", + "php": ">=8.3", + "phpunit/php-file-iterator": "^6.0", + "phpunit/php-text-template": "^5.0", + "sebastian/complexity": "^5.0", + "sebastian/environment": "^8.0", + "sebastian/lines-of-code": "^4.0", + "sebastian/version": "^6.0", "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^11.5.2" + "phpunit/phpunit": "^12.1" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -11414,7 +11022,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "11.0.x-dev" + "dev-main": "12.2.x-dev" } }, "autoload": { @@ -11443,40 +11051,52 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.9" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.2.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-code-coverage", + "type": "tidelift" } ], - "time": "2025-02-25T13:26:39+00:00" + "time": "2025-05-04T05:25:05+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "5.1.0", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6" + "reference": "961bc913d42fe24a257bfff826a5068079ac7782" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/118cfaaa8bc5aef3287bf315b6060b1174754af6", - "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/961bc913d42fe24a257bfff826a5068079ac7782", + "reference": "961bc913d42fe24a257bfff826a5068079ac7782", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -11504,7 +11124,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.0" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/6.0.0" }, "funding": [ { @@ -11512,28 +11132,28 @@ "type": "github" } ], - "time": "2024-08-27T05:02:59+00:00" + "time": "2025-02-07T04:58:37+00:00" }, { "name": "phpunit/php-invoker", - "version": "5.0.1", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2" + "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/c1ca3814734c07492b3d4c5f794f4b0995333da2", - "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/12b54e689b07a25a9b41e57736dfab6ec9ae5406", + "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^12.0" }, "suggest": { "ext-pcntl": "*" @@ -11541,7 +11161,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -11568,7 +11188,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/5.0.1" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/6.0.0" }, "funding": [ { @@ -11576,32 +11196,32 @@ "type": "github" } ], - "time": "2024-07-03T05:07:44+00:00" + "time": "2025-02-07T04:58:58+00:00" }, { "name": "phpunit/php-text-template", - "version": "4.0.1", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964" + "reference": "e1367a453f0eda562eedb4f659e13aa900d66c53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/3e0404dc6b300e6bf56415467ebcb3fe4f33e964", - "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/e1367a453f0eda562eedb4f659e13aa900d66c53", + "reference": "e1367a453f0eda562eedb4f659e13aa900d66c53", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -11628,7 +11248,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/4.0.1" + "source": "https://github.com/sebastianbergmann/php-text-template/tree/5.0.0" }, "funding": [ { @@ -11636,32 +11256,32 @@ "type": "github" } ], - "time": "2024-07-03T05:08:43+00:00" + "time": "2025-02-07T04:59:16+00:00" }, { "name": "phpunit/php-timer", - "version": "7.0.1", + "version": "8.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3" + "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", - "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc", + "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "8.0-dev" } }, "autoload": { @@ -11688,7 +11308,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", "security": "https://github.com/sebastianbergmann/php-timer/security/policy", - "source": "https://github.com/sebastianbergmann/php-timer/tree/7.0.1" + "source": "https://github.com/sebastianbergmann/php-timer/tree/8.0.0" }, "funding": [ { @@ -11696,20 +11316,20 @@ "type": "github" } ], - "time": "2024-07-03T05:09:35+00:00" + "time": "2025-02-07T04:59:38+00:00" }, { "name": "phpunit/phpunit", - "version": "11.5.19", + "version": "12.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0da1ebcdbc4d5bd2d189cfe02846a89936d8dda5" + "reference": "5ee57ad690bda2c487594577600931a99053436c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0da1ebcdbc4d5bd2d189cfe02846a89936d8dda5", - "reference": "0da1ebcdbc4d5bd2d189cfe02846a89936d8dda5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5ee57ad690bda2c487594577600931a99053436c", + "reference": "5ee57ad690bda2c487594577600931a99053436c", "shasum": "" }, "require": { @@ -11722,34 +11342,30 @@ "myclabs/deep-copy": "^1.13.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", - "php": ">=8.2", - "phpunit/php-code-coverage": "^11.0.9", - "phpunit/php-file-iterator": "^5.1.0", - "phpunit/php-invoker": "^5.0.1", - "phpunit/php-text-template": "^4.0.1", - "phpunit/php-timer": "^7.0.1", - "sebastian/cli-parser": "^3.0.2", - "sebastian/code-unit": "^3.0.3", - "sebastian/comparator": "^6.3.1", - "sebastian/diff": "^6.0.2", - "sebastian/environment": "^7.2.0", - "sebastian/exporter": "^6.3.0", - "sebastian/global-state": "^7.0.2", - "sebastian/object-enumerator": "^6.0.1", - "sebastian/type": "^5.1.2", - "sebastian/version": "^5.0.2", + "php": ">=8.3", + "phpunit/php-code-coverage": "^12.1.2", + "phpunit/php-file-iterator": "^6.0.0", + "phpunit/php-invoker": "^6.0.0", + "phpunit/php-text-template": "^5.0.0", + "phpunit/php-timer": "^8.0.0", + "sebastian/cli-parser": "^4.0.0", + "sebastian/comparator": "^7.0.1", + "sebastian/diff": "^7.0.0", + "sebastian/environment": "^8.0.0", + "sebastian/exporter": "^7.0.0", + "sebastian/global-state": "^8.0.0", + "sebastian/object-enumerator": "^7.0.0", + "sebastian/type": "^6.0.2", + "sebastian/version": "^6.0.0", "staabm/side-effects-detector": "^1.0.5" }, - "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files" - }, "bin": [ "phpunit" ], "type": "library", "extra": { "branch-alias": { - "dev-main": "11.5-dev" + "dev-main": "12.1-dev" } }, "autoload": { @@ -11781,7 +11397,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.19" + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.1.4" }, "funding": [ { @@ -11805,7 +11421,7 @@ "type": "tidelift" } ], - "time": "2025-05-02T06:56:52+00:00" + "time": "2025-05-02T07:01:56+00:00" }, { "name": "rector/rector", @@ -11868,28 +11484,28 @@ }, { "name": "sebastian/cli-parser", - "version": "3.0.2", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180" + "reference": "6d584c727d9114bcdc14c86711cd1cad51778e7c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/15c5dd40dc4f38794d383bb95465193f5e0ae180", - "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/6d584c727d9114bcdc14c86711cd1cad51778e7c", + "reference": "6d584c727d9114bcdc14c86711cd1cad51778e7c", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -11913,7 +11529,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.2" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.0.0" }, "funding": [ { @@ -11921,144 +11537,31 @@ "type": "github" } ], - "time": "2024-07-03T04:41:36+00:00" - }, - { - "name": "sebastian/code-unit", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/54391c61e4af8078e5b276ab082b6d3c54c9ad64", - "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64", - "shasum": "" - }, - "require": { - "php": ">=8.2" - }, - "require-dev": { - "phpunit/phpunit": "^11.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "security": "https://github.com/sebastianbergmann/code-unit/security/policy", - "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2025-03-19T07:56:08+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "4.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "183a9b2632194febd219bb9246eee421dad8d45e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/183a9b2632194febd219bb9246eee421dad8d45e", - "reference": "183a9b2632194febd219bb9246eee421dad8d45e", - "shasum": "" - }, - "require": { - "php": ">=8.2" - }, - "require-dev": { - "phpunit/phpunit": "^11.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "security": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-07-03T04:45:54+00:00" + "time": "2025-02-07T04:53:50+00:00" }, { "name": "sebastian/comparator", - "version": "6.3.1", + "version": "7.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "24b8fbc2c8e201bb1308e7b05148d6ab393b6959" + "reference": "b478f34614f934e0291598d0c08cbaba9644bee5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/24b8fbc2c8e201bb1308e7b05148d6ab393b6959", - "reference": "24b8fbc2c8e201bb1308e7b05148d6ab393b6959", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/b478f34614f934e0291598d0c08cbaba9644bee5", + "reference": "b478f34614f934e0291598d0c08cbaba9644bee5", "shasum": "" }, "require": { "ext-dom": "*", "ext-mbstring": "*", - "php": ">=8.2", - "sebastian/diff": "^6.0", - "sebastian/exporter": "^6.0" + "php": ">=8.3", + "sebastian/diff": "^7.0", + "sebastian/exporter": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^11.4" + "phpunit/phpunit": "^12.0" }, "suggest": { "ext-bcmath": "For comparing BcMath\\Number objects" @@ -12066,7 +11569,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "6.3-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -12106,7 +11609,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.1" + "source": "https://github.com/sebastianbergmann/comparator/tree/7.0.1" }, "funding": [ { @@ -12114,33 +11617,33 @@ "type": "github" } ], - "time": "2025-03-07T06:57:01+00:00" + "time": "2025-03-07T07:00:32+00:00" }, { "name": "sebastian/complexity", - "version": "4.0.1", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "ee41d384ab1906c68852636b6de493846e13e5a0" + "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ee41d384ab1906c68852636b6de493846e13e5a0", - "reference": "ee41d384ab1906c68852636b6de493846e13e5a0", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/bad4316aba5303d0221f43f8cee37eb58d384bbb", + "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb", "shasum": "" }, "require": { "nikic/php-parser": "^5.0", - "php": ">=8.2" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -12164,7 +11667,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", "security": "https://github.com/sebastianbergmann/complexity/security/policy", - "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.1" + "source": "https://github.com/sebastianbergmann/complexity/tree/5.0.0" }, "funding": [ { @@ -12172,33 +11675,33 @@ "type": "github" } ], - "time": "2024-07-03T04:49:50+00:00" + "time": "2025-02-07T04:55:25+00:00" }, { "name": "sebastian/diff", - "version": "6.0.2", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" + "reference": "7ab1ea946c012266ca32390913653d844ecd085f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", - "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7ab1ea946c012266ca32390913653d844ecd085f", + "reference": "7ab1ea946c012266ca32390913653d844ecd085f", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^11.0", - "symfony/process": "^4.2 || ^5" + "phpunit/phpunit": "^12.0", + "symfony/process": "^7.2" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -12231,7 +11734,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" + "source": "https://github.com/sebastianbergmann/diff/tree/7.0.0" }, "funding": [ { @@ -12239,27 +11742,27 @@ "type": "github" } ], - "time": "2024-07-03T04:53:05+00:00" + "time": "2025-02-07T04:55:46+00:00" }, { "name": "sebastian/environment", - "version": "7.2.0", + "version": "8.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5" + "reference": "8afe311eca49171bf95405cc0078be9a3821f9f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5", - "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8afe311eca49171bf95405cc0078be9a3821f9f2", + "reference": "8afe311eca49171bf95405cc0078be9a3821f9f2", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^12.0" }, "suggest": { "ext-posix": "*" @@ -12267,7 +11770,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "7.2-dev" + "dev-main": "8.0-dev" } }, "autoload": { @@ -12295,7 +11798,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", "security": "https://github.com/sebastianbergmann/environment/security/policy", - "source": "https://github.com/sebastianbergmann/environment/tree/7.2.0" + "source": "https://github.com/sebastianbergmann/environment/tree/8.0.0" }, "funding": [ { @@ -12303,34 +11806,34 @@ "type": "github" } ], - "time": "2024-07-03T04:54:44+00:00" + "time": "2025-02-07T04:56:08+00:00" }, { "name": "sebastian/exporter", - "version": "6.3.0", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "3473f61172093b2da7de1fb5782e1f24cc036dc3" + "reference": "76432aafc58d50691a00d86d0632f1217a47b688" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/3473f61172093b2da7de1fb5782e1f24cc036dc3", - "reference": "3473f61172093b2da7de1fb5782e1f24cc036dc3", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/76432aafc58d50691a00d86d0632f1217a47b688", + "reference": "76432aafc58d50691a00d86d0632f1217a47b688", "shasum": "" }, "require": { "ext-mbstring": "*", - "php": ">=8.2", - "sebastian/recursion-context": "^6.0" + "php": ">=8.3", + "sebastian/recursion-context": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^11.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.1-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -12373,7 +11876,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/6.3.0" + "source": "https://github.com/sebastianbergmann/exporter/tree/7.0.0" }, "funding": [ { @@ -12381,35 +11884,35 @@ "type": "github" } ], - "time": "2024-12-05T09:17:50+00:00" + "time": "2025-02-07T04:56:42+00:00" }, { "name": "sebastian/global-state", - "version": "7.0.2", + "version": "8.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "3be331570a721f9a4b5917f4209773de17f747d7" + "reference": "570a2aeb26d40f057af686d63c4e99b075fb6cbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/3be331570a721f9a4b5917f4209773de17f747d7", - "reference": "3be331570a721f9a4b5917f4209773de17f747d7", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/570a2aeb26d40f057af686d63c4e99b075fb6cbc", + "reference": "570a2aeb26d40f057af686d63c4e99b075fb6cbc", "shasum": "" }, "require": { - "php": ">=8.2", - "sebastian/object-reflector": "^4.0", - "sebastian/recursion-context": "^6.0" + "php": ">=8.3", + "sebastian/object-reflector": "^5.0", + "sebastian/recursion-context": "^7.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "8.0-dev" } }, "autoload": { @@ -12435,7 +11938,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", "security": "https://github.com/sebastianbergmann/global-state/security/policy", - "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.2" + "source": "https://github.com/sebastianbergmann/global-state/tree/8.0.0" }, "funding": [ { @@ -12443,33 +11946,33 @@ "type": "github" } ], - "time": "2024-07-03T04:57:36+00:00" + "time": "2025-02-07T04:56:59+00:00" }, { "name": "sebastian/lines-of-code", - "version": "3.0.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a" + "reference": "97ffee3bcfb5805568d6af7f0f893678fc076d2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d36ad0d782e5756913e42ad87cb2890f4ffe467a", - "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/97ffee3bcfb5805568d6af7f0f893678fc076d2f", + "reference": "97ffee3bcfb5805568d6af7f0f893678fc076d2f", "shasum": "" }, "require": { "nikic/php-parser": "^5.0", - "php": ">=8.2" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -12493,7 +11996,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.1" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/4.0.0" }, "funding": [ { @@ -12501,34 +12004,34 @@ "type": "github" } ], - "time": "2024-07-03T04:58:38+00:00" + "time": "2025-02-07T04:57:28+00:00" }, { "name": "sebastian/object-enumerator", - "version": "6.0.1", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "f5b498e631a74204185071eb41f33f38d64608aa" + "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f5b498e631a74204185071eb41f33f38d64608aa", - "reference": "f5b498e631a74204185071eb41f33f38d64608aa", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1effe8e9b8e068e9ae228e542d5d11b5d16db894", + "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894", "shasum": "" }, "require": { - "php": ">=8.2", - "sebastian/object-reflector": "^4.0", - "sebastian/recursion-context": "^6.0" + "php": ">=8.3", + "sebastian/object-reflector": "^5.0", + "sebastian/recursion-context": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -12551,7 +12054,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.1" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/7.0.0" }, "funding": [ { @@ -12559,32 +12062,32 @@ "type": "github" } ], - "time": "2024-07-03T05:00:13+00:00" + "time": "2025-02-07T04:57:48+00:00" }, { "name": "sebastian/object-reflector", - "version": "4.0.1", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9" + "reference": "4bfa827c969c98be1e527abd576533293c634f6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6e1a43b411b2ad34146dee7524cb13a068bb35f9", - "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/4bfa827c969c98be1e527abd576533293c634f6a", + "reference": "4bfa827c969c98be1e527abd576533293c634f6a", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -12607,7 +12110,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.1" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/5.0.0" }, "funding": [ { @@ -12615,32 +12118,32 @@ "type": "github" } ], - "time": "2024-07-03T05:01:32+00:00" + "time": "2025-02-07T04:58:17+00:00" }, { "name": "sebastian/recursion-context", - "version": "6.0.2", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "694d156164372abbd149a4b85ccda2e4670c0e16" + "reference": "c405ae3a63e01b32eb71577f8ec1604e39858a7c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/694d156164372abbd149a4b85ccda2e4670c0e16", - "reference": "694d156164372abbd149a4b85ccda2e4670c0e16", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/c405ae3a63e01b32eb71577f8ec1604e39858a7c", + "reference": "c405ae3a63e01b32eb71577f8ec1604e39858a7c", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -12671,7 +12174,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/6.0.2" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/7.0.0" }, "funding": [ { @@ -12679,32 +12182,32 @@ "type": "github" } ], - "time": "2024-07-03T05:10:34+00:00" + "time": "2025-02-07T05:00:01+00:00" }, { "name": "sebastian/type", - "version": "5.1.2", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "a8a7e30534b0eb0c77cd9d07e82de1a114389f5e" + "reference": "1d7cd6e514384c36d7a390347f57c385d4be6069" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/a8a7e30534b0eb0c77cd9d07e82de1a114389f5e", - "reference": "a8a7e30534b0eb0c77cd9d07e82de1a114389f5e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/1d7cd6e514384c36d7a390347f57c385d4be6069", + "reference": "1d7cd6e514384c36d7a390347f57c385d4be6069", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^11.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -12728,7 +12231,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/type/issues", "security": "https://github.com/sebastianbergmann/type/security/policy", - "source": "https://github.com/sebastianbergmann/type/tree/5.1.2" + "source": "https://github.com/sebastianbergmann/type/tree/6.0.2" }, "funding": [ { @@ -12736,29 +12239,29 @@ "type": "github" } ], - "time": "2025-03-18T13:35:50+00:00" + "time": "2025-03-18T13:37:31+00:00" }, { "name": "sebastian/version", - "version": "5.0.2", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874" + "reference": "3e6ccf7657d4f0a59200564b08cead899313b53c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c687e3387b99f5b03b6caa64c74b63e2936ff874", - "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/3e6ccf7657d4f0a59200564b08cead899313b53c", + "reference": "3e6ccf7657d4f0a59200564b08cead899313b53c", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -12782,7 +12285,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/version/issues", "security": "https://github.com/sebastianbergmann/version/security/policy", - "source": "https://github.com/sebastianbergmann/version/tree/5.0.2" + "source": "https://github.com/sebastianbergmann/version/tree/6.0.0" }, "funding": [ { @@ -12790,7 +12293,7 @@ "type": "github" } ], - "time": "2024-10-09T05:16:32+00:00" + "time": "2025-02-07T05:00:38+00:00" }, { "name": "staabm/side-effects-detector", @@ -12902,6 +12405,145 @@ }, "time": "2025-02-11T12:41:29+00:00" }, + { + "name": "thecodingmachine/safe", + "version": "v3.1.1", + "source": { + "type": "git", + "url": "https://github.com/thecodingmachine/safe.git", + "reference": "234f6fe34a0bead8c5ae1cfc0800539442e6f619" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/234f6fe34a0bead8c5ae1cfc0800539442e6f619", + "reference": "234f6fe34a0bead8c5ae1cfc0800539442e6f619", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^10", + "squizlabs/php_codesniffer": "^3.2" + }, + "type": "library", + "autoload": { + "files": [ + "lib/special_cases.php", + "generated/apache.php", + "generated/apcu.php", + "generated/array.php", + "generated/bzip2.php", + "generated/calendar.php", + "generated/classobj.php", + "generated/com.php", + "generated/cubrid.php", + "generated/curl.php", + "generated/datetime.php", + "generated/dir.php", + "generated/eio.php", + "generated/errorfunc.php", + "generated/exec.php", + "generated/fileinfo.php", + "generated/filesystem.php", + "generated/filter.php", + "generated/fpm.php", + "generated/ftp.php", + "generated/funchand.php", + "generated/gettext.php", + "generated/gmp.php", + "generated/gnupg.php", + "generated/hash.php", + "generated/ibase.php", + "generated/ibmDb2.php", + "generated/iconv.php", + "generated/image.php", + "generated/imap.php", + "generated/info.php", + "generated/inotify.php", + "generated/json.php", + "generated/ldap.php", + "generated/libxml.php", + "generated/lzf.php", + "generated/mailparse.php", + "generated/mbstring.php", + "generated/misc.php", + "generated/mysql.php", + "generated/mysqli.php", + "generated/network.php", + "generated/oci8.php", + "generated/opcache.php", + "generated/openssl.php", + "generated/outcontrol.php", + "generated/pcntl.php", + "generated/pcre.php", + "generated/pgsql.php", + "generated/posix.php", + "generated/ps.php", + "generated/pspell.php", + "generated/readline.php", + "generated/rnp.php", + "generated/rpminfo.php", + "generated/rrd.php", + "generated/sem.php", + "generated/session.php", + "generated/shmop.php", + "generated/sockets.php", + "generated/sodium.php", + "generated/solr.php", + "generated/spl.php", + "generated/sqlsrv.php", + "generated/ssdeep.php", + "generated/ssh2.php", + "generated/stream.php", + "generated/strings.php", + "generated/swoole.php", + "generated/uodbc.php", + "generated/uopz.php", + "generated/url.php", + "generated/var.php", + "generated/xdiff.php", + "generated/xml.php", + "generated/xmlrpc.php", + "generated/yaml.php", + "generated/yaz.php", + "generated/zip.php", + "generated/zlib.php" + ], + "classmap": [ + "lib/DateTime.php", + "lib/DateTimeImmutable.php", + "lib/Exceptions/", + "generated/Exceptions/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP core functions that throw exceptions instead of returning FALSE on error", + "support": { + "issues": "https://github.com/thecodingmachine/safe/issues", + "source": "https://github.com/thecodingmachine/safe/tree/v3.1.1" + }, + "funding": [ + { + "url": "https://github.com/OskarStark", + "type": "github" + }, + { + "url": "https://github.com/shish", + "type": "github" + }, + { + "url": "https://github.com/staabm", + "type": "github" + } + ], + "time": "2025-04-28T07:56:17+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.3", diff --git a/config/notifications.php b/config/notifications.php index a3e1bd7630..164e6e339f 100644 --- a/config/notifications.php +++ b/config/notifications.php @@ -26,7 +26,7 @@ return [ 'channels' => [ 'email' => ['enabled' => true, 'ui_configurable' => 0], 'slack' => ['enabled' => true, 'ui_configurable' => 1], - 'ntfy' => ['enabled' => true, 'ui_configurable' => 1], + 'ntfy' => ['enabled' => false, 'ui_configurable' => 1], 'pushover' => ['enabled' => true, 'ui_configurable' => 1], // 'gotify' => ['enabled' => false, 'ui_configurable' => 0], // 'pushbullet' => ['enabled' => false, 'ui_configurable' => 0], From 07ff2305fd7760349c61fd25245bf21b61c26a42 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 8 May 2025 20:22:01 +0200 Subject: [PATCH 36/87] Fix account list and remove sanctum --- .env.example | 7 -- app/Http/Kernel.php | 2 +- .../JsonApi/Enrichments/AccountEnrichment.php | 64 +++++++++++-------- app/Transformers/AccountTransformer.php | 1 + package-lock.json | 6 +- .../assets/v2/src/api/v1/model/account/get.js | 26 ++++++++ .../assets/v2/src/pages/accounts/index.js | 3 +- .../partials/dashboard/account-list.blade.php | 6 +- .../dashboard/subscriptions.blade.php | 2 +- 9 files changed, 73 insertions(+), 44 deletions(-) diff --git a/.env.example b/.env.example index 6ca952fe17..7c32e7c613 100644 --- a/.env.example +++ b/.env.example @@ -296,13 +296,6 @@ STATIC_CRON_TOKEN= # However if you know what you're doing you can significantly speed up container start times. # Set each value to true to enable, or false to disable. -# Set this to true to build all locales supported by Firefly III. -# This may take quite some time (several minutes) and is generally not recommended. -# If you wish to change or alter the list of locales, start your Docker container with -# `docker run -v locale.gen:/etc/locale.gen -e DKR_BUILD_LOCALE=true` -# and make sure your preferred locales are in your own locale.gen. -DKR_BUILD_LOCALE=false - # Check if the SQLite database exists. Can be skipped if you're not using SQLite. # Won't significantly speed up things. DKR_CHECK_SQLITE=true diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 139547582c..e11e92afbd 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -177,7 +177,7 @@ class Kernel extends HttpKernel // full API authentication 'api' => [ AcceptHeaders::class, - EnsureFrontendRequestsAreStateful::class, +// EnsureFrontendRequestsAreStateful::class, 'auth:api,sanctum', 'bindings', ], diff --git a/app/Support/JsonApi/Enrichments/AccountEnrichment.php b/app/Support/JsonApi/Enrichments/AccountEnrichment.php index 33a3aa6d56..baa5b45e79 100644 --- a/app/Support/JsonApi/Enrichments/AccountEnrichment.php +++ b/app/Support/JsonApi/Enrichments/AccountEnrichment.php @@ -50,7 +50,7 @@ class AccountEnrichment implements EnrichmentInterface private array $accountIds; private array $accountTypeIds; private array $accountTypes; - private Collection $collection; + private Collection $collection; private array $currencies; private array $locations; private array $meta; @@ -59,6 +59,7 @@ class AccountEnrichment implements EnrichmentInterface private array $openingBalances; private User $user; private UserGroup $userGroup; + private array $lastActivities; public function __construct() { @@ -69,6 +70,7 @@ class AccountEnrichment implements EnrichmentInterface $this->accountTypes = []; $this->meta = []; $this->notes = []; + $this->lastActivities = []; $this->locations = []; // $this->repository = app(AccountRepositoryInterface::class); // $this->currencyRepository = app(CurrencyRepositoryInterface::class); @@ -77,7 +79,7 @@ class AccountEnrichment implements EnrichmentInterface } #[\Override] - public function enrichSingle(array|Model $model): Account|array + public function enrichSingle(array | Model $model): Account | array { Log::debug(__METHOD__); $collection = new Collection([$model]); @@ -100,6 +102,7 @@ class AccountEnrichment implements EnrichmentInterface $this->getAccountTypes(); $this->collectMetaData(); $this->collectNotes(); + $this->collectLastActivities(); $this->collectLocations(); $this->collectOpeningBalances(); $this->appendCollectedData(); @@ -130,10 +133,9 @@ class AccountEnrichment implements EnrichmentInterface private function collectMetaData(): void { - $set = AccountMeta::whereIn('name', ['is_multi_currency', 'include_net_worth', 'currency_id', 'account_role', 'account_number', 'BIC', 'liability_direction', 'interest', 'interest_period', 'current_debt']) - ->whereIn('account_id', $this->accountIds) - ->get(['account_meta.id', 'account_meta.account_id', 'account_meta.name', 'account_meta.data'])->toArray() - ; + $set = AccountMeta::whereIn('name', ['is_multi_currency', 'include_net_worth', 'currency_id', 'account_role', 'account_number', 'BIC', 'liability_direction', 'interest', 'interest_period', 'current_debt']) + ->whereIn('account_id', $this->accountIds) + ->get(['account_meta.id', 'account_meta.account_id', 'account_meta.name', 'account_meta.data'])->toArray(); /** @var array $entry */ foreach ($set as $entry) { @@ -142,7 +144,7 @@ class AccountEnrichment implements EnrichmentInterface $this->currencies[(int) $entry['data']] = true; } } - $currencies = TransactionCurrency::whereIn('id', array_keys($this->currencies))->get(); + $currencies = TransactionCurrency::whereIn('id', array_keys($this->currencies))->get(); foreach ($currencies as $currency) { $this->currencies[(int) $currency->id] = $currency; } @@ -157,10 +159,9 @@ class AccountEnrichment implements EnrichmentInterface private function collectNotes(): void { $notes = Note::query()->whereIn('noteable_id', $this->accountIds) - ->whereNotNull('notes.text') - ->where('notes.text', '!=', '') - ->where('noteable_type', Account::class)->get(['notes.noteable_id', 'notes.text'])->toArray() - ; + ->whereNotNull('notes.text') + ->where('notes.text', '!=', '') + ->where('noteable_type', Account::class)->get(['notes.noteable_id', 'notes.text'])->toArray(); foreach ($notes as $note) { $this->notes[(int) $note['noteable_id']] = (string) $note['text']; } @@ -170,15 +171,14 @@ class AccountEnrichment implements EnrichmentInterface private function collectLocations(): void { $locations = Location::query()->whereIn('locatable_id', $this->accountIds) - ->where('locatable_type', Account::class)->get(['locations.locatable_id', 'locations.latitude', 'locations.longitude', 'locations.zoom_level'])->toArray() - ; + ->where('locatable_type', Account::class)->get(['locations.locatable_id', 'locations.latitude', 'locations.longitude', 'locations.zoom_level'])->toArray(); foreach ($locations as $location) { $this->locations[(int) $location['locatable_id']] = [ - 'latitude' => (float) $location['latitude'], - 'longitude' => (float) $location['longitude'], - 'zoom_level' => (int) $location['zoom_level'], - ]; + 'latitude' => (float) $location['latitude'], + 'longitude' => (float) $location['longitude'], + 'zoom_level' => (int) $location['zoom_level'], + ]; } Log::debug(sprintf('Enrich with %d locations(s)', count($this->locations))); } @@ -193,20 +193,19 @@ class AccountEnrichment implements EnrichmentInterface ->setUserGroup($this->userGroup) ->setAccounts($this->collection) ->withAccountInformation() - ->setTypes([TransactionTypeEnum::OPENING_BALANCE->value]) - ; - $journals = $collector->getExtractedJournals(); + ->setTypes([TransactionTypeEnum::OPENING_BALANCE->value]); + $journals = $collector->getExtractedJournals(); foreach ($journals as $journal) { $this->openingBalances[(int) $journal['source_account_id']] = [ - 'amount' => Steam::negative($journal['amount']), - 'date' => $journal['date'], - ]; + 'amount' => Steam::negative($journal['amount']), + 'date' => $journal['date'], + ]; $this->openingBalances[(int) $journal['destination_account_id']] = [ - 'amount' => Steam::positive($journal['amount']), - 'date' => $journal['date'], - ]; + 'amount' => Steam::positive($journal['amount']), + 'date' => $journal['date'], + ]; } } @@ -229,7 +228,8 @@ class AccountEnrichment implements EnrichmentInterface $notes = $this->notes; $openingBalances = $this->openingBalances; $locations = $this->locations; - $this->collection = $this->collection->map(function (Account $item) use ($accountTypes, $meta, $currencies, $notes, $openingBalances, $locations) { + $lastActivities = $this->lastActivities; + $this->collection = $this->collection->map(function (Account $item) use ($accountTypes, $meta, $currencies, $notes, $openingBalances, $locations, $lastActivities) { $item->full_account_type = $accountTypes[(int) $item->account_type_id] ?? null; $accountMeta = [ 'currency' => null, @@ -264,7 +264,10 @@ class AccountEnrichment implements EnrichmentInterface if (array_key_exists($item->id, $locations)) { $accountMeta['location'] = $locations[$item->id]; } - $item->meta = $accountMeta; + if (array_key_exists($item->id, $lastActivities)) { + $accountMeta['last_activity'] = $lastActivities[$item->id]; + } + $item->meta = $accountMeta; return $item; }); @@ -274,4 +277,9 @@ class AccountEnrichment implements EnrichmentInterface { $this->native = $native; } + + private function collectLastActivities(): void + { + $this->lastActivities = Steam::getLastActivities($this->accountIds); + } } diff --git a/app/Transformers/AccountTransformer.php b/app/Transformers/AccountTransformer.php index 82c8fc9c04..5d959898a3 100644 --- a/app/Transformers/AccountTransformer.php +++ b/app/Transformers/AccountTransformer.php @@ -152,6 +152,7 @@ class AccountTransformer extends AbstractTransformer 'longitude' => $longitude, 'latitude' => $latitude, 'zoom_level' => $zoomLevel, + 'last_activity' => array_key_exists('last_activity', $account->meta) ? $account->meta['last_activity']->toAtomString() : null, 'links' => [ [ 'rel' => 'self', diff --git a/package-lock.json b/package-lock.json index 5ba613d7ec..23e6dd8ac3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4416,9 +4416,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001716", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001716.tgz", - "integrity": "sha512-49/c1+x3Kwz7ZIWt+4DvK3aMJy9oYXXG6/97JKsnjdCk/6n9vVyWL8NAwVt95Lwt9eigI10Hl782kDfZUUlRXw==", + "version": "1.0.30001717", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001717.tgz", + "integrity": "sha512-auPpttCq6BDEG8ZAuHJIplGw6GODhjw+/11e7IjpnYCxZcW/ONgPs0KVBJ0d1bY3e2+7PRe5RCLyP+PfwVgkYw==", "dev": true, "funding": [ { diff --git a/resources/assets/v2/src/api/v1/model/account/get.js b/resources/assets/v2/src/api/v1/model/account/get.js index a8d014a42c..8d8b8aed5b 100644 --- a/resources/assets/v2/src/api/v1/model/account/get.js +++ b/resources/assets/v2/src/api/v1/model/account/get.js @@ -20,6 +20,7 @@ import {api} from "../../../../boot/axios"; import format from "date-fns/format"; +import {getCacheKey} from "../../../../support/get-cache-key.js"; export default class Get { @@ -37,6 +38,31 @@ export default class Get { return api.get('/api/v1/accounts/' + identifier, {params: params}); } + /** + * + * @param params + * @returns {Promise>} + */ + index(params) { + // first, check API in some consistent manner. + // then, load if necessary. + const cacheKey = getCacheKey('/api/v1/accounts', params); + const cacheValid = window.store.get('cacheValid'); + let cachedData = window.store.get(cacheKey); + + if (cacheValid && typeof cachedData !== 'undefined') { + console.log('Cache is valid, return cache.'); + return Promise.resolve(cachedData); + } + + // if not, store in cache and then return res. + + return api.get('/api/v1/accounts', {params: params}).then(response => { + console.log('Cache is invalid, return fresh.'); + window.store.set(cacheKey, response.data); + return Promise.resolve({data: response.data.data, meta: response.data.meta}); + }); + } /** * diff --git a/resources/assets/v2/src/pages/accounts/index.js b/resources/assets/v2/src/pages/accounts/index.js index 80f4b34649..295aaa2902 100644 --- a/resources/assets/v2/src/pages/accounts/index.js +++ b/resources/assets/v2/src/pages/accounts/index.js @@ -383,7 +383,8 @@ let index = function () { // one page only.o (new Get()).index(params).then(response => { console.log(response); - this.totalPages = response.meta.lastPage; + this.totalPages = response.meta.pagination.total_pages; + console.log('a'); for (let i = 0; i < response.data.length; i++) { if (response.data.hasOwnProperty(i)) { let current = response.data[i]; diff --git a/resources/views/v2/partials/dashboard/account-list.blade.php b/resources/views/v2/partials/dashboard/account-list.blade.php index 9dafa4da16..a7b2f5078d 100644 --- a/resources/views/v2/partials/dashboard/account-list.blade.php +++ b/resources/views/v2/partials/dashboard/account-list.blade.php @@ -9,7 +9,7 @@

    - @@ -42,7 +42,7 @@ -
    +
      diff --git a/resources/views/v2/partials/dashboard/subscriptions.blade.php b/resources/views/v2/partials/dashboard/subscriptions.blade.php index d5102d6898..823e5ced30 100644 --- a/resources/views/v2/partials/dashboard/subscriptions.blade.php +++ b/resources/views/v2/partials/dashboard/subscriptions.blade.php @@ -30,7 +30,7 @@