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/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/.ci/rector.php b/.ci/rector.php
new file mode 100644
index 0000000000..3ba2f28d41
--- /dev/null
+++ b/.ci/rector.php
@@ -0,0 +1,69 @@
+withSkip([
+ ChangeOrIfContinueToMultiContinueRector::class,
+ ])
+ ->withPaths([
+// __DIR__ . '/../app',
+__DIR__ . '/../app/Http',
+// __DIR__ . '/../bootstrap',
+// __DIR__ . '/../config',
+// __DIR__ . '/../public',
+// __DIR__ . '/../resources',
+// __DIR__ . '/../routes',
+// __DIR__ . '/../tests',
+ ])
+ // uncomment to reach your current PHP version
+ ->withPhpSets()
+ ->withPreparedSets(
+ codingStyle : false, // leave false
+ privatization: false, // leave false.
+ naming : false, // leave false
+ instanceOf : true,
+ earlyReturn : true,
+ strictBooleans : true,
+ carbon : true,
+ rectorPreset : true,
+ phpunitCodeQuality : true,
+ doctrineCodeQuality: true,
+ symfonyCodeQuality : true,
+ symfonyConfigs : true
+
+ )
+ ->withComposerBased(
+ twig: true,
+ doctrine: true,
+ phpunit: true,
+ symfony: true)
+ ->withTypeCoverageLevel(0)
+ ->withDeadCodeLevel(0)
+ ->withCodeQualityLevel(0)
+
+ ->withImportNames(removeUnusedImports: true);// import statements instead of full classes.
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
diff --git a/.env.example b/.env.example
index 6ca952fe17..282c144904 100644
--- a/.env.example
+++ b/.env.example
@@ -289,20 +289,13 @@ ALLOW_WEBHOOKS=false
#
# You can set this variable from a file by appending it with _FILE
#
-STATIC_CRON_TOKEN=
+STATIC_CRON_TOKEN=PLEASE_REPLACE_WITH_32_CHAR_CODE
# You can fine tune the start-up of a Docker container by editing these environment variables.
# Use this at your own risk. Disabling certain checks and features may result in lots of inconsistent data.
# 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/.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
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/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/BillController.php b/app/Api/V1/Controllers/Autocomplete/BillController.php
index 224a899076..d95e1ee108 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..dec3e5961c 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..ea4032bc6f 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/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/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 dd2c277c5e..7790880de0 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,14 +114,12 @@ 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);
// 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/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/Data/Export/ExportController.php b/app/Api/V1/Controllers/Data/Export/ExportController.php
index b4decbf49f..ac316e9930 100644
--- a/app/Api/V1/Controllers/Data/Export/ExportController.php
+++ b/app/Api/V1/Controllers/Data/Export/ExportController.php
@@ -30,6 +30,8 @@ use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Support\Export\ExportDataGenerator;
use Illuminate\Http\Response as LaravelResponse;
+use function Safe\date;
+
/**
* Class ExportController
*/
@@ -88,7 +90,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/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/Models/TransactionCurrency/ListController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php
index acac15728d..20362f6e6d 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/Controllers/Summary/BasicController.php b/app/Api/V1/Controllers/Summary/BasicController.php
index f5feb2fa2c..25d2346ea2 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
@@ -190,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;
@@ -228,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']);
}
}
}
@@ -361,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;
}
@@ -373,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;
}
@@ -396,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']]),
@@ -415,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']]),
@@ -482,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),
@@ -512,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);
@@ -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((string) $spentInCurrency, '0')) {
+ $perDay = bcdiv((string) $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);
@@ -593,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/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 fb8f302f76..b9319e0240 100644
--- a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php
+++ b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php
@@ -33,6 +33,8 @@ use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
+use function Safe\json_decode;
+
/**
* Class TransactionRequest
*/
@@ -74,7 +76,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..2c8f572843 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..c84cd6a9d9 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/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/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..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']),
];
}
@@ -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..ea3635be5f 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..92a620bcdd 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/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 0a0639a94c..e259739805 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,15 +128,13 @@ 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);
// 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/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/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/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..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')]);
@@ -175,7 +234,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();
@@ -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/CorrectsCurrencies.php b/app/Console/Commands/Correction/CorrectsCurrencies.php
index 0f621fe5be..e96a15523d 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/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/CorrectsNativeAmounts.php b/app/Console/Commands/Correction/CorrectsNativeAmounts.php
index abf952000f..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;
@@ -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/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/CorrectsTransactionTypes.php b/app/Console/Commands/Correction/CorrectsTransactionTypes.php
index bb185d5d87..3663917ef5 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/Correction/CorrectsUnevenAmount.php b/app/Console/Commands/Correction/CorrectsUnevenAmount.php
index d2b2e9e364..a864fcb115 100644
--- a/app/Console/Commands/Correction/CorrectsUnevenAmount.php
+++ b/app/Console/Commands/Correction/CorrectsUnevenAmount.php
@@ -25,9 +25,11 @@ declare(strict_types=1);
namespace FireflyIII\Console\Commands\Correction;
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
+use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionJournal;
+use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Support\Models\AccountBalanceCalculator;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
@@ -47,7 +49,12 @@ class CorrectsUnevenAmount extends Command
public function handle(): int
{
$this->count = 0;
+ // convert transfers with foreign currency info where the amount is NOT uneven (it should be)
$this->convertOldStyleTransfers();
+
+ // convert old-style transactions between assets and liabilities.
+ $this->convertOldStyleTransactions();
+
$this->fixUnevenAmounts();
$this->matchCurrencies();
if (true === config('firefly.feature_flags.running_balance_column')) {
@@ -72,8 +79,6 @@ class CorrectsUnevenAmount extends Command
;
$count = 0;
- Log::debug(sprintf('Found %d potential journal(s)', $transactions->count()));
-
/** @var Transaction $transaction */
foreach ($transactions as $transaction) {
/** @var null|TransactionJournal $journal */
@@ -115,10 +120,15 @@ class CorrectsUnevenAmount extends Command
++$count;
}
}
+ if (0 === $count) {
+ return;
+ }
+ $this->friendlyPositive(sprintf('Fixed %d transfer(s) with unbalanced amounts.', $count));
}
private function fixUnevenAmounts(): void
{
+ Log::debug('fixUnevenAmounts()');
$journals = DB::table('transactions')
->groupBy('transaction_journal_id')
->whereNull('deleted_at')
@@ -153,7 +163,7 @@ class CorrectsUnevenAmount extends Command
Log::error($e->getTraceAsString());
}
if (0 !== $res) {
- $this->fixJournal($entry->transaction_journal_id);
+ $this->fixJournal((int) $entry->transaction_journal_id);
}
}
}
@@ -184,7 +194,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 */
@@ -207,8 +217,8 @@ class CorrectsUnevenAmount extends Command
}
// may still be able to salvage this journal if it is a transfer with foreign currency info
- if ($this->isForeignCurrencyTransfer($journal)) {
- Log::debug(sprintf('Can skip foreign currency transfer #%d.', $journal->id));
+ if ($this->isForeignCurrencyTransfer($journal) || $this->isBetweenAssetAndLiability($journal)) {
+ Log::debug(sprintf('Can skip foreign currency transfer / asset+liability transaction #%d.', $journal->id));
return;
}
@@ -249,9 +259,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;
@@ -271,13 +281,13 @@ class CorrectsUnevenAmount extends Command
/** @var TransactionJournal $journal */
foreach ($journals as $journal) {
- if (!$this->isForeignCurrencyTransfer($journal)) {
+ if (!$this->isForeignCurrencyTransfer($journal) && !$this->isBetweenAssetAndLiability($journal)) {
Transaction::where('transaction_journal_id', $journal->id)->update(['transaction_currency_id' => $journal->transaction_currency_id]);
++$count;
continue;
}
- Log::debug(sprintf('Can skip foreign currency transfer #%d.', $journal->id));
+ Log::debug(sprintf('Can skip foreign currency transfer or transaction between asset and liability #%d.', $journal->id));
}
if (0 === $count) {
return;
@@ -285,4 +295,155 @@ class CorrectsUnevenAmount extends Command
$this->friendlyPositive(sprintf('Fixed %d journal(s) with mismatched currencies.', $journals->count()));
}
+
+ private function isBetweenAssetAndLiability(TransactionJournal $journal): bool
+ {
+ /** @var Transaction $sourceTransaction */
+ $sourceTransaction = $journal->transactions()->where('amount', '<', 0)->first();
+
+ /** @var Transaction $destinationTransaction */
+ $destinationTransaction = $journal->transactions()->where('amount', '>', 0)->first();
+ if (null === $sourceTransaction || null === $destinationTransaction) {
+ Log::warning('Either transaction is false, stop.');
+
+ return false;
+ }
+ if (null === $sourceTransaction->foreign_amount || null === $destinationTransaction->foreign_amount) {
+ Log::warning('Either foreign amount is false, stop.');
+
+ return false;
+ }
+
+ $source = $sourceTransaction->account;
+ $destination = $destinationTransaction->account;
+
+ if (null === $source || null === $destination) {
+ Log::warning('Either is false, stop.');
+
+ return false;
+ }
+ $sourceTypes = [AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value];
+
+ // source is liability, destination is asset
+ if (in_array($source->accountType->type, $sourceTypes, true) && AccountTypeEnum::ASSET->value === $destination->accountType->type) {
+ Log::debug('Source is a liability account, destination is an asset account, return TRUE.');
+
+ return true;
+ }
+ // source is asset, destination is liability
+ if (in_array($destination->accountType->type, $sourceTypes, true) && AccountTypeEnum::ASSET->value === $source->accountType->type) {
+ Log::debug('Destination is a liability account, source is an asset account, return TRUE.');
+
+ return true;
+ }
+
+ return false;
+ }
+
+ private function convertOldStyleTransactions(): void
+ {
+
+ /** @var AccountRepositoryInterface $repository */
+ $repository = app(AccountRepositoryInterface::class);
+ Log::debug('convertOldStyleTransactions()');
+ $count = 0;
+ $transactions = Transaction::distinct()
+ ->leftJoin('transaction_journals', 'transaction_journals.id', 'transactions.transaction_journal_id')
+ ->leftJoin('transaction_types', 'transaction_types.id', 'transaction_journals.transaction_type_id')
+ ->leftJoin('accounts', 'accounts.id', 'transactions.account_id')
+ ->leftJoin('account_types', 'account_types.id', 'accounts.account_type_id')
+ ->whereNot('transaction_types.type', TransactionTypeEnum::TRANSFER->value)
+ ->whereNotNull('foreign_currency_id')
+ ->whereNotNull('foreign_amount')
+ ->whereIn('account_types.type', [AccountTypeEnum::ASSET->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::LOAN->value])
+ ->get(['transactions.transaction_journal_id'])
+ ;
+
+ /** @var Transaction $transaction */
+ foreach ($transactions as $transaction) {
+ /** @var null|TransactionJournal $journal */
+ $journal = TransactionJournal::find($transaction->transaction_journal_id);
+ $repository->setUser($journal->user);
+ if (null === $journal) {
+ Log::debug('Found no journal, continue.');
+
+ continue;
+ }
+ if (!$this->isBetweenAssetAndLiability($journal)) {
+ Log::debug('Not between asset and liability, continue.');
+
+ continue;
+ }
+ $source = $journal->transactions()->where('amount', '<', 0)->first();
+ $destination = $journal->transactions()->where('amount', '>', 0)->first();
+ $sourceAccount = $source->account;
+ $destAccount = $destination->account;
+ $sourceCurrency = $repository->getAccountCurrency($sourceAccount);
+ $destCurrency = $repository->getAccountCurrency($destAccount);
+ if (null === $source || null === $destination) {
+ Log::debug('Either transaction is NULL, continue.');
+
+ continue;
+ }
+ if (0 === bccomp($source->amount, $source->foreign_amount) && 0 === bccomp($source->foreign_amount, $source->amount)) {
+ Log::debug('Already fixed, continue.');
+
+ continue;
+ }
+ // source transaction. Switch info when does not match.
+ if ((int) $source->transaction_currency_id !== (int) $sourceCurrency->id) {
+ Log::debug(sprintf('Ready to swap data in transaction #%d.', $source->id));
+ // swap amounts.
+ $amount = $source->amount;
+ $currency = $source->transaction_currency_id;
+ $source->amount = $source->foreign_amount;
+ $source->transaction_currency_id = $source->foreign_currency_id;
+ $source->foreign_amount = $amount;
+ $source->foreign_currency_id = $currency;
+ $source->saveQuietly();
+ $source->refresh();
+ // Log::debug(sprintf('source->amount = %s', $source->amount));
+ // Log::debug(sprintf('source->transaction_currency_id = %s', $source->transaction_currency_id));
+ // Log::debug(sprintf('source->foreign_amount = %s', $source->foreign_amount));
+ // Log::debug(sprintf('source->foreign_currency_id = %s', $source->foreign_currency_id));
+ ++$count;
+ }
+ // same but for destination
+ if ((int) $destination->transaction_currency_id !== (int) $destCurrency->id) {
+ ++$count;
+ Log::debug(sprintf('Ready to swap data in transaction #%d.', $destination->id));
+ // swap amounts.
+ $amount = $destination->amount;
+ $currency = $destination->transaction_currency_id;
+ $destination->amount = $destination->foreign_amount;
+ $destination->transaction_currency_id = $destination->foreign_currency_id;
+ $destination->foreign_amount = $amount;
+ $destination->foreign_currency_id = $currency;
+ $destination->balance_dirty = true;
+ $destination->saveQuietly();
+ $destination->refresh();
+ // Log::debug(sprintf('destination->amount = %s', $destination->amount));
+ // Log::debug(sprintf('destination->transaction_currency_id = %s', $destination->transaction_currency_id));
+ // Log::debug(sprintf('destination->foreign_amount = %s', $destination->foreign_amount));
+ // Log::debug(sprintf('destination->foreign_currency_id = %s', $destination->foreign_currency_id));
+ }
+
+
+ // // only fix the destination transaction
+ // $destination->foreign_currency_id = $source->transaction_currency_id;
+ // $destination->foreign_amount = app('steam')->positive($source->amount);
+ // $destination->transaction_currency_id = $source->foreign_currency_id;
+ // $destination->amount = app('steam')->positive($source->foreign_amount);
+ // $destination->balance_dirty = true;
+ // $source->balance_dirty = true;
+ // $destination->save();
+ // $source->save();
+ // $this->friendlyWarning(sprintf('Corrected foreign amounts of transaction #%d.', $journal->id));
+ }
+ if (0 === $count) {
+ return;
+ }
+
+ $this->friendlyPositive(sprintf('Fixed %d journal(s) with unbalanced amounts.', $count));
+ }
}
diff --git a/app/Console/Commands/Export/ExportsData.php b/app/Console/Commands/Export/ExportsData.php
index a4cc991d89..9205749126 100644
--- a/app/Console/Commands/Export/ExportsData.php
+++ b/app/Console/Commands/Export/ExportsData.php
@@ -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/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/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..0d3e64d854 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)));
}
/**
@@ -175,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.
*/
@@ -228,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
new file mode 100644
index 0000000000..5e51a4fcc6
--- /dev/null
+++ b/app/Console/Commands/System/RecalculatesRunningBalance.php
@@ -0,0 +1,67 @@
+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/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/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/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..b6e5764dd4 100644
--- a/app/Console/Commands/Upgrade/UpgradesDatabase.php
+++ b/app/Console/Commands/Upgrade/UpgradesDatabase.php
@@ -24,7 +24,14 @@ declare(strict_types=1);
namespace FireflyIII\Console\Commands\Upgrade;
-set_time_limit(0);
+use Illuminate\Support\Facades\Log;
+use Safe\Exceptions\InfoException;
+
+try {
+ \Safe\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/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/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/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 d1c0625efe..137a9f8bea 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
);
}
@@ -236,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/Console/Commands/Upgrade/UpgradesTransferCurrencies.php b/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php
index eec9c08e44..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;
- 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..dcd7cf86d3 100644
--- a/app/Events/Admin/InvitationCreated.php
+++ b/app/Events/Admin/InvitationCreated.php
@@ -36,15 +36,10 @@ class InvitationCreated extends Event
{
use SerializesModels;
- public InvitedUser $invitee;
-
public TransactionGroup $transactionGroup;
/**
* Create a new event instance.
*/
- public function __construct(InvitedUser $invitee)
- {
- $this->invitee = $invitee;
- }
+ public function __construct(public InvitedUser $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..60d43011ad 100644
--- a/app/Events/DestroyedTransactionLink.php
+++ b/app/Events/DestroyedTransactionLink.php
@@ -34,13 +34,10 @@ class DestroyedTransactionLink extends Event
{
use SerializesModels;
- private TransactionJournalLink $link; // @phpstan-ignore-line
+ // @phpstan-ignore-line
/**
* DestroyedTransactionLink constructor.
*/
- public function __construct(TransactionJournalLink $link)
- {
- $this->link = $link;
- }
+ public function __construct(private TransactionJournalLink $link) {}
}
diff --git a/app/Events/DetectedNewIPAddress.php b/app/Events/DetectedNewIPAddress.php
index a04d65cb7c..3298a7e164 100644
--- a/app/Events/DetectedNewIPAddress.php
+++ b/app/Events/DetectedNewIPAddress.php
@@ -34,13 +34,8 @@ 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)
- {
- $this->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 8f86723bd3..fe765e1d08 100644
--- a/app/Events/Model/Account/Updated.php
+++ b/app/Events/Model/Account/Updated.php
@@ -31,10 +31,5 @@ class Updated
{
use SerializesModels;
- public Account $account;
-
- public function __construct(Account $account)
- {
- $this->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 2600c41632..4f8dd98430 100644
--- a/app/Events/Model/BudgetLimit/Created.php
+++ b/app/Events/Model/BudgetLimit/Created.php
@@ -35,10 +35,5 @@ class Created extends Event
{
use SerializesModels;
- public BudgetLimit $budgetLimit;
-
- public function __construct(BudgetLimit $budgetLimit)
- {
- $this->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 06aab6e0ca..080ca56510 100644
--- a/app/Events/Model/BudgetLimit/Deleted.php
+++ b/app/Events/Model/BudgetLimit/Deleted.php
@@ -35,10 +35,5 @@ class Deleted extends Event
{
use SerializesModels;
- public BudgetLimit $budgetLimit;
-
- public function __construct(BudgetLimit $budgetLimit)
- {
- $this->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 6429635ea0..a1d99a081e 100644
--- a/app/Events/Model/BudgetLimit/Updated.php
+++ b/app/Events/Model/BudgetLimit/Updated.php
@@ -35,10 +35,5 @@ class Updated extends Event
{
use SerializesModels;
- public BudgetLimit $budgetLimit;
-
- public function __construct(BudgetLimit $budgetLimit)
- {
- $this->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 9521641ab3..f60e8a5113 100644
--- a/app/Events/Model/PiggyBank/ChangedAmount.php
+++ b/app/Events/Model/PiggyBank/ChangedAmount.php
@@ -37,20 +37,16 @@ class ChangedAmount extends Event
{
use SerializesModels;
- public string $amount;
- public PiggyBank $piggyBank;
- public ?TransactionGroup $transactionGroup;
- public ?TransactionJournal $transactionJournal;
+ public string $amount;
+ public PiggyBank $piggyBank;
/**
* 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;
+ $this->piggyBank = $piggyBank;
+ $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..160844b0ec 100644
--- a/app/Events/RegisteredUser.php
+++ b/app/Events/RegisteredUser.php
@@ -35,15 +35,8 @@ 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)
- {
- $this->user = $user;
- $this->owner = $owner;
- }
+ public function __construct(public OwnerNotifiable $owner, public User $user) {}
}
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..63ac4df6ca 100644
--- a/app/Events/RequestedVersionCheckStatus.php
+++ b/app/Events/RequestedVersionCheckStatus.php
@@ -34,14 +34,9 @@ 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)
- {
- $this->user = $user;
- }
+ public function __construct(public User $user) {}
}
diff --git a/app/Events/Security/MFABackupFewLeft.php b/app/Events/Security/MFABackupFewLeft.php
index dd1129c7d3..0379afeb3e 100644
--- a/app/Events/Security/MFABackupFewLeft.php
+++ b/app/Events/Security/MFABackupFewLeft.php
@@ -33,14 +33,12 @@ 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..e1b9067c5b 100644
--- a/app/Events/Security/MFAManyFailedAttempts.php
+++ b/app/Events/Security/MFAManyFailedAttempts.php
@@ -33,14 +33,12 @@ 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..6482316711 100644
--- a/app/Events/Security/UnknownUserAttemptedLogin.php
+++ b/app/Events/Security/UnknownUserAttemptedLogin.php
@@ -30,10 +30,5 @@ class UnknownUserAttemptedLogin
{
use SerializesModels;
- public string $address;
-
- public function __construct(string $address)
- {
- $this->address = $address;
- }
+ public function __construct(public string $address) {}
}
diff --git a/app/Events/StoredAccount.php b/app/Events/StoredAccount.php
index 441afed64a..6dc34379ae 100644
--- a/app/Events/StoredAccount.php
+++ b/app/Events/StoredAccount.php
@@ -34,13 +34,8 @@ class StoredAccount extends Event
{
use SerializesModels;
- public Account $account;
-
/**
* Create a new event instance.
*/
- public function __construct(Account $account)
- {
- $this->account = $account;
- }
+ public function __construct(public Account $account) {}
}
diff --git a/app/Events/StoredTransactionGroup.php b/app/Events/StoredTransactionGroup.php
index 268525635f..15c0d42b7b 100644
--- a/app/Events/StoredTransactionGroup.php
+++ b/app/Events/StoredTransactionGroup.php
@@ -34,17 +34,8 @@ 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)
- {
- $this->transactionGroup = $transactionGroup;
- $this->fireWebhooks = $fireWebhooks;
- $this->applyRules = $applyRules;
- }
+ public function __construct(public TransactionGroup $transactionGroup, public bool $applyRules, public bool $fireWebhooks) {}
}
diff --git a/app/Events/Test/OwnerTestNotificationChannel.php b/app/Events/Test/OwnerTestNotificationChannel.php
index c246520c2d..efce1b2a80 100644
--- a/app/Events/Test/OwnerTestNotificationChannel.php
+++ b/app/Events/Test/OwnerTestNotificationChannel.php
@@ -31,16 +31,14 @@ class OwnerTestNotificationChannel
{
use SerializesModels;
- public string $channel;
- public OwnerNotifiable $owner;
+ public string $channel;
/**
* 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..e0472815c0 100644
--- a/app/Events/TriggeredAuditLog.php
+++ b/app/Events/TriggeredAuditLog.php
@@ -34,23 +34,10 @@ 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)
- {
- $this->changer = $changer;
- $this->auditable = $auditable;
- $this->field = $field;
- $this->before = $before;
- $this->after = $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 3deceba692..bf34c61348 100644
--- a/app/Events/UpdatedAccount.php
+++ b/app/Events/UpdatedAccount.php
@@ -34,13 +34,8 @@ class UpdatedAccount extends Event
{
use SerializesModels;
- public Account $account;
-
/**
* Create a new event instance.
*/
- public function __construct(Account $account)
- {
- $this->account = $account;
- }
+ public function __construct(public Account $account) {}
}
diff --git a/app/Events/UpdatedTransactionGroup.php b/app/Events/UpdatedTransactionGroup.php
index 9827d81d06..39754e23b5 100644
--- a/app/Events/UpdatedTransactionGroup.php
+++ b/app/Events/UpdatedTransactionGroup.php
@@ -34,17 +34,8 @@ 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)
- {
- $this->transactionGroup = $transactionGroup;
- $this->fireWebhooks = $fireWebhooks;
- $this->applyRules = $applyRules;
- }
+ 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 1d2e11fcf7..afdd422d52 100644
--- a/app/Events/UserChangedEmail.php
+++ b/app/Events/UserChangedEmail.php
@@ -34,17 +34,8 @@ 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)
- {
- $this->user = $user;
- $this->oldEmail = $oldEmail;
- $this->newEmail = $newEmail;
- }
+ 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 98b7d5c449..92be173dc0 100644
--- a/app/Events/WarnUserAboutBill.php
+++ b/app/Events/WarnUserAboutBill.php
@@ -34,14 +34,5 @@ class WarnUserAboutBill extends Event
{
use SerializesModels;
- public Bill $bill;
- public int $diff;
- public string $field;
-
- public function __construct(Bill $bill, string $field, int $diff)
- {
- $this->bill = $bill;
- $this->field = $field;
- $this->diff = $diff;
- }
+ public function __construct(public Bill $bill, public string $field, public int $diff) {}
}
diff --git a/app/Exceptions/GracefulNotFoundHandler.php b/app/Exceptions/GracefulNotFoundHandler.php
index 371add870f..7faa9e03e2 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();
@@ -217,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/Exceptions/Handler.php b/app/Exceptions/Handler.php
index 13fa54bc88..9368d57cc0 100644
--- a/app/Exceptions/Handler.php
+++ b/app/Exceptions/Handler.php
@@ -45,6 +45,7 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+// temp
/**
* Class Handler
*/
@@ -69,6 +70,7 @@ class Handler extends ExceptionHandler
/**
* Register the exception handling callbacks for the application.
*/
+ #[\Override]
public function register(): void {}
/**
@@ -82,6 +84,7 @@ class Handler extends ExceptionHandler
* @SuppressWarnings("PHPMD.NPathComplexity")
* @SuppressWarnings("PHPMD.CyclomaticComplexity")
*/
+ #[\Override]
public function render($request, \Throwable $e): Response
{
$expectsJson = $request->expectsJson();
@@ -149,12 +152,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 +165,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 +195,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 +205,7 @@ class Handler extends ExceptionHandler
*
* @throws \Throwable
*/
+ #[\Override]
public function report(\Throwable $e): void
{
$doMailError = (bool) config('firefly.send_error_message');
@@ -222,7 +226,7 @@ class Handler extends ExceptionHandler
$headers = request()->headers->all();
$data = [
- 'class' => get_class($e),
+ 'class' => $e::class,
'errorMessage' => $e->getMessage(),
'time' => date('r'),
'stackTrace' => $e->getTraceAsString(),
@@ -235,7 +239,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.
@@ -250,9 +254,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 +263,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.
@@ -283,8 +286,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/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/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/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..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
@@ -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/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..10ecf31b52 100644
--- a/app/Factory/TransactionGroupFactory.php
+++ b/app/Factory/TransactionGroupFactory.php
@@ -35,9 +35,9 @@ use FireflyIII\User;
*/
class TransactionGroupFactory
{
- private TransactionJournalFactory $journalFactory;
- private User $user;
- private UserGroup $userGroup;
+ private readonly TransactionJournalFactory $journalFactory;
+ private User $user;
+ private UserGroup $userGroup;
/**
* TransactionGroupFactory constructor.
@@ -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/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php
index 67428dbc50..f89c86b3aa 100644
--- a/app/Factory/TransactionJournalFactory.php
+++ b/app/Factory/TransactionJournalFactory.php
@@ -25,6 +25,7 @@ declare(strict_types=1);
namespace FireflyIII\Factory;
use Carbon\Carbon;
+use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Exceptions\DuplicateTransactionException;
use FireflyIII\Exceptions\FireflyException;
@@ -39,9 +40,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 +71,7 @@ class TransactionJournalFactory
private PiggyBankRepositoryInterface $piggyRepository;
private TransactionTypeRepositoryInterface $typeRepository;
private User $user;
- private UserGroup $userGroup;
+ private UserGroup $userGroup;
/**
* Constructor.
@@ -101,15 +102,15 @@ class TransactionJournalFactory
*/
public function create(array $data): Collection
{
- app('log')->debug('Now in TransactionJournalFactory::create()');
+ Log::debug('Now in TransactionJournalFactory::create()');
// convert to special object.
$dataObject = new NullArrayObject($data);
- app('log')->debug('Start of TransactionJournalFactory::create()');
+ Log::debug('Start of TransactionJournalFactory::create()');
$collection = new Collection();
$transactions = $dataObject['transactions'] ?? [];
if (0 === count($transactions)) {
- app('log')->error('There are no transactions in the array, the TransactionJournalFactory cannot continue.');
+ Log::error('There are no transactions in the array, the TransactionJournalFactory cannot continue.');
return new Collection();
}
@@ -117,26 +118,26 @@ class TransactionJournalFactory
try {
/** @var array $row */
foreach ($transactions as $index => $row) {
- app('log')->debug(sprintf('Now creating journal %d/%d', $index + 1, count($transactions)));
+ Log::debug(sprintf('Now creating journal %d/%d', $index + 1, count($transactions)));
$journal = $this->createJournal(new NullArrayObject($row));
if (null !== $journal) {
$collection->push($journal);
}
if (null === $journal) {
- app('log')->error('The createJournal() method returned NULL. This may indicate an error.');
+ Log::error('The createJournal() method returned NULL. This may indicate an error.');
}
}
} catch (DuplicateTransactionException $e) {
- app('log')->warning('TransactionJournalFactory::create() caught a duplicate journal in createJournal()');
- app('log')->error($e->getMessage());
- app('log')->error($e->getTraceAsString());
+ Log::warning('TransactionJournalFactory::create() caught a duplicate journal in createJournal()');
+ Log::error($e->getMessage());
+ Log::error($e->getTraceAsString());
$this->forceDeleteOnError($collection);
throw new DuplicateTransactionException($e->getMessage(), 0, $e);
} catch (FireflyException $e) {
- app('log')->warning('TransactionJournalFactory::create() caught an exception.');
- app('log')->error($e->getMessage());
- app('log')->error($e->getTraceAsString());
+ Log::warning('TransactionJournalFactory::create() caught an exception.');
+ Log::error($e->getMessage());
+ Log::error($e->getTraceAsString());
$this->forceDeleteOnError($collection);
throw new FireflyException($e->getMessage(), 0, $e);
@@ -156,6 +157,7 @@ class TransactionJournalFactory
*/
private function createJournal(NullArrayObject $row): ?TransactionJournal
{
+ Log::debug('Now in TransactionJournalFactory::createJournal()');
$row['import_hash_v2'] = $this->hashArray($row);
$this->errorIfDuplicate($row['import_hash_v2']);
@@ -164,7 +166,11 @@ class TransactionJournalFactory
$type = $this->typeRepository->findTransactionType(null, $row['type']);
$carbon = $row['date'] ?? today(config('app.timezone'));
$order = $row['order'] ?? 0;
+
+ Log::debug('Find currency or return default.');
$currency = $this->currencyRepository->findCurrency((int) $row['currency_id'], $row['currency_code']);
+ Log::debug('Find foreign currency or return NULL.');
+
$foreignCurrency = $this->currencyRepository->findCurrencyNull($row['foreign_currency_id'], $row['foreign_currency_code']);
$bill = $this->billRepository->findBill((int) $row['bill_id'], $row['bill_name']);
$billId = TransactionTypeEnum::WITHDRAWAL->value === $type->type && null !== $bill ? $bill->id : null;
@@ -183,8 +189,8 @@ class TransactionJournalFactory
// validate source and destination using a new Validator.
$this->validateAccounts($row);
} catch (FireflyException $e) {
- app('log')->error('Could not validate source or destination.');
- app('log')->error($e->getMessage());
+ Log::error('Could not validate source or destination.');
+ Log::error($e->getMessage());
return null;
}
@@ -207,11 +213,12 @@ class TransactionJournalFactory
'bic' => $row['destination_bic'],
'currency_id' => $currency->id,
];
- app('log')->debug('Source info:', $sourceInfo);
- app('log')->debug('Destination info:', $destInfo);
+ Log::debug('Source info:', $sourceInfo);
+ Log::debug('Destination info:', $destInfo);
$sourceAccount = $this->getAccount($type->type, 'source', $sourceInfo);
$destinationAccount = $this->getAccount($type->type, 'destination', $destInfo);
- app('log')->debug('Done with getAccount(2x)');
+ Log::debug('Done with getAccount(2x)');
+
// this is the moment for a reconciliation sanity check (again).
if (TransactionTypeEnum::RECONCILIATION->value === $type->type) {
@@ -223,7 +230,8 @@ class TransactionJournalFactory
$foreignCurrency = $this->getForeignByAccount($type->type, $foreignCurrency, $destinationAccount);
$description = $this->getDescription($description);
- app('log')->debug(sprintf('Date: %s (%s)', $carbon->toW3cString(), $carbon->getTimezone()->getName()));
+ Log::debug(sprintf('Currency is #%d "%s", foreign currency is #%d "%s"', $currency->id, $currency->code, $foreignCurrency?->id, $foreignCurrency));
+ Log::debug(sprintf('Date: %s (%s)', $carbon->toW3cString(), $carbon->getTimezone()->getName()));
/** Create a basic journal. */
$journal = TransactionJournal::create(
@@ -241,7 +249,7 @@ class TransactionJournalFactory
'completed' => 0,
]
);
- app('log')->debug(sprintf('Created new journal #%d: "%s"', $journal->id, $journal->description));
+ Log::debug(sprintf('Created new journal #%d: "%s"', $journal->id, $journal->description));
/** Create two transactions. */
$transactionFactory = app(TransactionFactory::class);
@@ -255,7 +263,7 @@ class TransactionJournalFactory
try {
$negative = $transactionFactory->createNegative((string) $row['amount'], (string) $row['foreign_amount']);
} catch (FireflyException $e) {
- app('log')->error(sprintf('Exception creating negative transaction: %s', $e->getMessage()));
+ Log::error(sprintf('Exception creating negative transaction: %s', $e->getMessage()));
$this->forceDeleteOnError(new Collection([$journal]));
throw new FireflyException($e->getMessage(), 0, $e);
@@ -277,7 +285,7 @@ class TransactionJournalFactory
$amount = (string) $row['amount'];
$foreignAmount = (string) $row['foreign_amount'];
if (null !== $foreignCurrency && $foreignCurrency->id !== $currency->id
- && TransactionTypeEnum::TRANSFER->value === $type->type
+ && (TransactionTypeEnum::TRANSFER->value === $type->type || $this->isBetweenAssetAndLiability($sourceAccount, $destinationAccount))
) {
$transactionFactory->setCurrency($foreignCurrency);
$transactionFactory->setForeignCurrency($currency);
@@ -289,7 +297,7 @@ class TransactionJournalFactory
try {
$transactionFactory->createPositive($amount, $foreignAmount);
} catch (FireflyException $e) {
- app('log')->error(sprintf('Exception creating positive transaction: %s', $e->getMessage()));
+ Log::error(sprintf('Exception creating positive transaction: %s', $e->getMessage()));
$this->forceTrDelete($negative);
$this->forceDeleteOnError(new Collection([$journal]));
@@ -315,13 +323,13 @@ 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()));
+ Log::error(sprintf('Could not encode dataRow: %s', $e->getMessage()));
$json = microtime();
}
$hash = hash('sha256', $json);
- app('log')->debug(sprintf('The hash is: %s', $hash), $dataRow);
+ Log::debug(sprintf('The hash is: %s', $hash), $dataRow);
return $hash;
}
@@ -333,23 +341,23 @@ class TransactionJournalFactory
*/
private function errorIfDuplicate(string $hash): void
{
- app('log')->debug(sprintf('In errorIfDuplicate(%s)', $hash));
+ Log::debug(sprintf('In errorIfDuplicate(%s)', $hash));
if (false === $this->errorOnHash) {
return;
}
- app('log')->debug('Will verify duplicate!');
+ Log::debug('Will verify duplicate!');
/** @var null|TransactionJournalMeta $result */
$result = TransactionJournalMeta::withTrashed()
->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.*'])
;
if (null !== $result) {
- app('log')->warning(sprintf('Found a duplicate in errorIfDuplicate because hash %s is not unique!', $hash));
+ Log::warning(sprintf('Found a duplicate in errorIfDuplicate because hash %s is not unique!', $hash));
$journal = $result->transactionJournal()->withTrashed()->first();
$group = $journal?->transactionGroup()->withTrashed()->first();
$groupId = (int) $group?->id;
@@ -363,7 +371,7 @@ class TransactionJournalFactory
*/
private function validateAccounts(NullArrayObject $data): void
{
- app('log')->debug(sprintf('Now in %s', __METHOD__));
+ Log::debug(sprintf('Now in %s', __METHOD__));
$transactionType = $data['type'] ?? 'invalid';
$this->accountValidator->setUser($this->user);
$this->accountValidator->setTransactionType($transactionType);
@@ -381,7 +389,7 @@ class TransactionJournalFactory
if (false === $validSource) {
throw new FireflyException(sprintf('Source: %s', $this->accountValidator->sourceError));
}
- app('log')->debug('Source seems valid.');
+ Log::debug('Source seems valid.');
// validate destination account
$array = [
@@ -414,42 +422,30 @@ 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__));
+ Log::debug(sprintf('Now in %s', __METHOD__));
if (null !== $sourceAccount && null !== $destinationAccount) {
- app('log')->debug('Both accounts exist, simply return them.');
+ Log::debug('Both accounts exist, simply return them.');
return [$sourceAccount, $destinationAccount];
}
if (null === $destinationAccount) {
- app('log')->debug('Destination account is NULL, source account is not.');
+ Log::debug('Destination account is NULL, source account is not.');
$account = $this->accountRepository->getReconciliation($sourceAccount);
- app('log')->debug(sprintf('Will return account #%d ("%s") of type "%s"', $account->id, $account->name, $account->accountType->type));
+ Log::debug(sprintf('Will return account #%d ("%s") of type "%s"', $account->id, $account->name, $account->accountType->type));
return [$sourceAccount, $account];
}
if (null === $sourceAccount) { // @phpstan-ignore-line
- app('log')->debug('Source account is NULL, destination account is not.');
+ Log::debug('Source account is NULL, destination account is not.');
$account = $this->accountRepository->getReconciliation($destinationAccount);
- app('log')->debug(sprintf('Will return account #%d ("%s") of type "%s"', $account->id, $account->name, $account->accountType->type));
+ Log::debug(sprintf('Will return account #%d ("%s") of type "%s"', $account->id, $account->name, $account->accountType->type));
return [$account, $destinationAccount];
}
- app('log')->debug('Unused fallback'); // @phpstan-ignore-line
+ Log::debug('Unused fallback'); // @phpstan-ignore-line
return [$sourceAccount, $destinationAccount];
}
@@ -459,7 +455,15 @@ class TransactionJournalFactory
*/
private function getCurrencyByAccount(string $type, ?TransactionCurrency $currency, Account $source, Account $destination): TransactionCurrency
{
- app('log')->debug('Now in getCurrencyByAccount()');
+ Log::debug('Now in getCurrencyByAccount()');
+
+ /*
+ * Deze functie moet bij een transactie van liability naar asset wel degelijk de currency
+ * van de liability teruggeven en niet die van de destination. Fix voor #10265
+ */
+ if ($this->isBetweenAssetAndLiability($source, $destination) && TransactionTypeEnum::DEPOSIT->value === $type) {
+ return $this->getCurrency($currency, $source);
+ }
return match ($type) {
default => $this->getCurrency($currency, $source),
@@ -472,7 +476,7 @@ class TransactionJournalFactory
*/
private function getCurrency(?TransactionCurrency $currency, Account $account): TransactionCurrency
{
- app('log')->debug('Now in getCurrency()');
+ Log::debug(sprintf('Now in getCurrency(#%d, "%s")', $currency?->id, $account->name));
/** @var null|TransactionCurrency $preference */
$preference = $this->accountRepository->getAccountCurrency($account);
@@ -481,7 +485,7 @@ class TransactionJournalFactory
return app('amount')->getNativeCurrencyByUserGroup($this->user->userGroup);
}
$result = $preference ?? $currency;
- app('log')->debug(sprintf('Currency is now #%d (%s) because of account #%d (%s)', $result->id, $result->code, $account->id, $account->name));
+ Log::debug(sprintf('Currency is now #%d (%s) because of account #%d (%s)', $result->id, $result->code, $account->id, $account->name));
return $result;
}
@@ -491,6 +495,7 @@ class TransactionJournalFactory
*/
private function compareCurrencies(?TransactionCurrency $currency, ?TransactionCurrency $foreignCurrency): ?TransactionCurrency
{
+ Log::debug(sprintf('Now in compareCurrencies("%s", "%s")', $currency?->code, $foreignCurrency?->code));
if (null === $currency) {
return null;
}
@@ -506,6 +511,7 @@ class TransactionJournalFactory
*/
private function getForeignByAccount(string $type, ?TransactionCurrency $foreignCurrency, Account $destination): ?TransactionCurrency
{
+ Log::debug(sprintf('Now in getForeignByAccount("%s", #%d, "%s")', $type, $foreignCurrency?->id, $destination->name));
if (TransactionTypeEnum::TRANSFER->value === $type) {
return $this->getCurrency($foreignCurrency, $destination);
}
@@ -526,12 +532,12 @@ class TransactionJournalFactory
*/
private function forceDeleteOnError(Collection $collection): void
{
- app('log')->debug(sprintf('forceDeleteOnError on collection size %d item(s)', $collection->count()));
+ Log::debug(sprintf('forceDeleteOnError on collection size %d item(s)', $collection->count()));
$service = app(JournalDestroyService::class);
/** @var TransactionJournal $journal */
foreach ($collection as $journal) {
- app('log')->debug(sprintf('forceDeleteOnError on journal #%d', $journal->id));
+ Log::debug(sprintf('forceDeleteOnError on journal #%d', $journal->id));
$service->destroy($journal);
}
}
@@ -546,17 +552,17 @@ class TransactionJournalFactory
*/
private function storePiggyEvent(TransactionJournal $journal, NullArrayObject $data): void
{
- app('log')->debug('Will now store piggy event.');
+ Log::debug('Will now store piggy event.');
$piggyBank = $this->piggyRepository->findPiggyBank((int) $data['piggy_bank_id'], $data['piggy_bank_name']);
if (null !== $piggyBank) {
$this->piggyEventFactory->create($journal, $piggyBank);
- app('log')->debug('Create piggy event.');
+ Log::debug('Create piggy event.');
return;
}
- app('log')->debug('Create no piggy event');
+ Log::debug('Create no piggy event');
}
private function storeMetaFields(TransactionJournal $journal, NullArrayObject $transaction): void
@@ -575,11 +581,11 @@ class TransactionJournalFactory
];
if ($data[$field] instanceof Carbon) {
$data[$field]->setTimezone(config('app.timezone'));
- app('log')->debug(sprintf('%s Date: %s (%s)', $field, $data[$field], $data[$field]->timezone->getName()));
+ Log::debug(sprintf('%s Date: %s (%s)', $field, $data[$field], $data[$field]->timezone->getName()));
$set['data'] = $data[$field]->format('Y-m-d H:i:s');
}
- app('log')->debug(sprintf('Going to store meta-field "%s", with value "%s".', $set['name'], $set['data']));
+ Log::debug(sprintf('Going to store meta-field "%s", with value "%s".', $set['name'], $set['data']));
/** @var TransactionJournalMetaFactory $factory */
$factory = app(TransactionJournalMetaFactory::class);
@@ -602,7 +608,40 @@ class TransactionJournalFactory
{
$this->errorOnHash = $errorOnHash;
if (true === $errorOnHash) {
- app('log')->info('Will trigger duplication alert for this journal.');
+ 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);
+ }
+
+ private function isBetweenAssetAndLiability(Account $source, Account $destination): bool
+ {
+ $sourceTypes = [AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value];
+
+ // source is liability, destination is asset
+ if (in_array($source->accountType->type, $sourceTypes, true) && AccountTypeEnum::ASSET->value === $destination->accountType->type) {
+ Log::debug('Source is a liability account, destination is an asset account, return TRUE.');
+
+ return true;
+ }
+ // source is asset, destination is liability
+ if (in_array($destination->accountType->type, $sourceTypes, true) && AccountTypeEnum::ASSET->value === $source->accountType->type) {
+ Log::debug('Destination is a liability account, source is an asset account, return TRUE.');
+
+ return true;
+ }
+ Log::debug('Not between asset and liability, return FALSE');
+
+ return false;
+ }
}
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/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/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/DestroyedGroupEventHandler.php b/app/Handlers/Events/DestroyedGroupEventHandler.php
index 0b28a7fb10..90a7feb0be 100644
--- a/app/Handlers/Events/DestroyedGroupEventHandler.php
+++ b/app/Handlers/Events/DestroyedGroupEventHandler.php
@@ -28,14 +28,22 @@ use FireflyIII\Enums\WebhookTrigger;
use FireflyIII\Events\DestroyedTransactionGroup;
use FireflyIII\Events\RequestedSendWebhookMessages;
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 +58,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/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/Handlers/Events/UpdatedGroupEventHandler.php b/app/Handlers/Events/UpdatedGroupEventHandler.php
index 723cb9743a..a2e7209eb9 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,16 +49,66 @@ class UpdatedGroupEventHandler
$this->processRules($event);
$this->recalculateCredit($event);
$this->triggerWebhooks($event);
+ $this->updateRunningBalance($event);
}
+ /**
+ * 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.
*/
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;
}
@@ -69,7 +121,7 @@ class UpdatedGroupEventHandler
$array[] = $journal->id;
}
$journalIds = implode(',', $array);
- app('log')->debug(sprintf('Add local operator for journal(s): %s', $journalIds));
+ Log::debug(sprintf('Add local operator for journal(s): %s', $journalIds));
// collect rules:
$ruleGroupRepository = app(RuleGroupRepositoryInterface::class);
@@ -97,10 +149,10 @@ class UpdatedGroupEventHandler
private function triggerWebhooks(UpdatedTransactionGroup $updatedGroupEvent): void
{
- app('log')->debug(__METHOD__);
+ 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;
}
@@ -116,52 +168,12 @@ class UpdatedGroupEventHandler
event(new RequestedSendWebhookMessages());
}
- /**
- * This method will make sure all source / destination accounts are the same.
- */
- public function unifyAccounts(UpdatedTransactionGroup $updatedGroupEvent): void
+ private function updateRunningBalance(UpdatedTransactionGroup $event): 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) {
- app('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])
- ;
+ Log::debug(__METHOD__);
+ $group = $event->transactionGroup;
+ foreach ($group->transactionJournals as $journal) {
+ AccountBalanceCalculator::recalculateForJournal($journal);
}
}
}
diff --git a/app/Handlers/Events/WebhookEventHandler.php b/app/Handlers/Events/WebhookEventHandler.php
index bcab140724..3d0f12a2e3 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/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 35d6ec3612..0f62454063 100644
--- a/app/Handlers/Observer/PiggyBankEventObserver.php
+++ b/app/Handlers/Observer/PiggyBankEventObserver.php
@@ -37,15 +37,15 @@ 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
{
- 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);
@@ -59,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/Attachments/AttachmentHelper.php b/app/Helpers/Attachments/AttachmentHelper.php
index a4cbc352ba..3d8583805e 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;
@@ -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.');
@@ -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,9 +333,9 @@ 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);
+ $class = $model::class;
$count = 0;
// ignore lines about polymorphic calls.
if ($model instanceof PiggyBank) {
diff --git a/app/Helpers/Collector/Extensions/AccountCollection.php b/app/Helpers/Collector/Extensions/AccountCollection.php
index 2a755dba2e..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($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/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/CollectorProperties.php b/app/Helpers/Collector/Extensions/CollectorProperties.php
index 81aa7fca10..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;
diff --git a/app/Helpers/Collector/Extensions/MetaCollection.php b/app/Helpers/Collector/Extensions/MetaCollection.php
index 1ce417a77d..37d99ee720 100644
--- a/app/Helpers/Collector/Extensions/MetaCollection.php
+++ b/app/Helpers/Collector/Extensions/MetaCollection.php
@@ -29,6 +29,7 @@ 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;
@@ -166,7 +167,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 +190,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 +211,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 +230,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 +242,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 +254,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 +266,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 +278,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 +291,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 +302,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 +313,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 +324,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 +337,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 +348,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 +399,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 +414,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 +427,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 +440,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 +453,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 +466,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();
@@ -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');
+ $join->where('notes.noteable_type', '=', TransactionJournal::class);
$join->whereNull('notes.deleted_at');
}
);
@@ -601,8 +602,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'];
@@ -703,7 +704,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 +714,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 +722,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 +737,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 +747,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;
@@ -779,8 +780,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 +812,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 7d090996a7..4cff722226 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', 'source_balance_after', 'destination_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 source_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',
@@ -149,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',
];
}
@@ -589,13 +593,16 @@ 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((string) \Safe\json_decode($result['meta_data']), 0, 10));
}
}
// 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 +660,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) {
@@ -727,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'];
@@ -742,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);
}
}
@@ -884,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;
@@ -941,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.
*/
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 968e8e2640..cc09678a6f 100644
--- a/app/Helpers/Report/NetWorth.php
+++ b/app/Helpers/Report/NetWorth.php
@@ -49,8 +49,8 @@ class NetWorth implements NetWorthInterface
{
private AccountRepositoryInterface $accountRepository;
private CurrencyRepositoryInterface $currencyRepos;
- private User $user; // @phpstan-ignore-line
- private ?UserGroup $userGroup; // @phpstan-ignore-line
+ private User $user; // @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/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/Helpers/Webhook/Sha3SignatureGenerator.php b/app/Helpers/Webhook/Sha3SignatureGenerator.php
index 4e13fac540..e1b77af37d 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));
@@ -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..7b0115a32c 100644
--- a/app/Http/Controllers/Account/EditController.php
+++ b/app/Http/Controllers/Account/EditController.php
@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Account;
+use FireflyIII\Models\Location;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\AccountFormRequest;
@@ -87,16 +88,16 @@ class EditController extends Controller
$roles = $this->getRoles();
$liabilityTypes = $this->getLiabilityTypes();
$location = $repository->getLocation($account);
- $latitude = null !== $location ? $location->latitude : config('firefly.default_location.latitude');
- $longitude = null !== $location ? $location->longitude : config('firefly.default_location.longitude');
- $zoomLevel = null !== $location ? $location->zoom_level : config('firefly.default_location.zoom_level');
+ $latitude = $location instanceof Location ? $location->latitude : config('firefly.default_location.latitude');
+ $longitude = $location instanceof Location ? $location->longitude : config('firefly.default_location.longitude');
+ $zoomLevel = $location instanceof Location ? $location->zoom_level : config('firefly.default_location.zoom_level');
$canEditCurrency = 0 === $account->piggyBanks()->count();
- $hasLocation = null !== $location;
+ $hasLocation = $location instanceof 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 +139,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..4e8ded5f1e 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.
*
@@ -153,7 +163,9 @@ class IndexController extends Controller
/** @var Carbon $end */
$end = clone session('end', today(config('app.timezone'))->endOfMonth());
- $start->subDay();
+
+ // 2025-05-11 removed this so start is exactly the start of the month.
+ // $start->subDay();
$ids = $accounts->pluck('id')->toArray();
Log::debug(sprintf('index start: finalAccountsBalance("%s")', $start->format('Y-m-d H:i:s')));
@@ -199,14 +211,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($value, $startBalances[$key] ?? '0');
- }
-
- return $result;
- }
}
diff --git a/app/Http/Controllers/Account/ReconcileController.php b/app/Http/Controllers/Account/ReconcileController.php
index dccf39c835..bbad4248a9 100644
--- a/app/Http/Controllers/Account/ReconcileController.php
+++ b/app/Http/Controllers/Account/ReconcileController.php
@@ -94,7 +94,7 @@ class ReconcileController extends Controller
// get start and end
- if (null === $start && null === $end) {
+ if (!$start instanceof Carbon && !$end instanceof Carbon) {
/** @var Carbon $start */
$start = clone session('start', app('navigation')->startOfPeriod(new Carbon(), $range));
@@ -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 8a602f59e4..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;
@@ -145,6 +144,7 @@ class ShowController extends Controller
$collector->setExpandGroupSearch(true);
$groups = $collector->getPaginatedGroups();
+
Log::debug('End collect transactions');
Timer::stop('collection');
diff --git a/app/Http/Controllers/Admin/UpdateController.php b/app/Http/Controllers/Admin/UpdateController.php
index ab35af1662..8502d43ce8 100644
--- a/app/Http/Controllers/Admin/UpdateController.php
+++ b/app/Http/Controllers/Admin/UpdateController.php
@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Admin;
+use Carbon\Carbon;
use FireflyIII\Helpers\Update\UpdateTrait;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Middleware\IsDemoUser;
@@ -96,7 +97,7 @@ class UpdateController extends Controller
$channel = in_array($channel, ['stable', 'beta', 'alpha'], true) ? $channel : 'stable';
app('fireflyconfig')->set('permission_update_check', $checkForUpdates);
- app('fireflyconfig')->set('last_update_check', time());
+ app('fireflyconfig')->set('last_update_check', Carbon::now()->getTimestamp());
app('fireflyconfig')->set('update_channel', $channel);
session()->flash('success', (string) trans('firefly.configuration_updated'));
diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php
index de924f295b..60abcfb5f0 100644
--- a/app/Http/Controllers/Auth/ForgotPasswordController.php
+++ b/app/Http/Controllers/Auth/ForgotPasswordController.php
@@ -34,6 +34,8 @@ use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
+use function Safe\parse_url;
+
/**
* Class ForgotPasswordController
*/
@@ -59,7 +61,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..8b8af307ce 100644
--- a/app/Http/Controllers/Auth/LoginController.php
+++ b/app/Http/Controllers/Auth/LoginController.php
@@ -23,7 +23,9 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Auth;
-use Cookie;
+use Carbon\Carbon;
+use FireflyIII\User;
+use Illuminate\Support\Facades\Cookie;
use FireflyIII\Events\ActuallyLoggedIn;
use FireflyIII\Events\Security\UnknownUserAttemptedLogin;
use FireflyIII\Events\Security\UserAttemptedLogin;
@@ -44,6 +46,7 @@ use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\ValidationException;
+use Symfony\Component\HttpFoundation\Response as ResponseAlias;
/**
* Class LoginController
@@ -89,7 +92,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.
@@ -130,11 +133,11 @@ class LoginController extends Controller
app('log')->warning('Login attempt failed.');
$username = (string) $request->get($this->username());
$user = $this->repository->findByEmail($username);
- if (null === $user) {
+ if (!$user instanceof User) {
// send event to owner.
event(new UnknownUserAttemptedLogin($username));
}
- if (null !== $user) {
+ if ($user instanceof User) {
event(new UserAttemptedLogin($user));
}
@@ -198,7 +201,7 @@ class LoginController extends Controller
// also logout current 2FA tokens.
$cookieName = config('google2fa.cookie_name', 'google2fa_token');
- \Cookie::forget($cookieName);
+ Cookie::forget($cookieName);
$this->guard()->logout();
@@ -209,7 +212,7 @@ class LoginController extends Controller
$this->loggedOut($request);
return $request->wantsJson()
- ? new Response('', 204)
+ ? new Response('', ResponseAlias::HTTP_NO_CONTENT)
: redirect('/');
}
@@ -220,7 +223,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).');
@@ -246,13 +249,13 @@ class LoginController extends Controller
$allowReset = false;
}
- $email = $request->old('email');
- $remember = $request->old('remember');
+ $email = $request?->old('email');
+ $remember = $request?->old('remember');
$storeInCookie = config('google2fa.store_in_cookie', false);
if (false !== $storeInCookie) {
$cookieName = config('google2fa.cookie_name', 'google2fa_token');
- \Cookie::queue(\Cookie::make($cookieName, 'invalid-'.time()));
+ Cookie::queue(Cookie::make($cookieName, 'invalid-'.Carbon::now()->getTimestamp()));
}
$usernameField = $this->username();
diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php
index effbd4f322..5d7f731206 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();
@@ -130,7 +130,7 @@ class RegisterController extends Controller
$allowRegistration = false;
}
if ('web' !== $guard) {
- $allowRegistration = false;
+ return false;
}
return $allowRegistration;
@@ -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');
@@ -187,7 +187,7 @@ class RegisterController extends Controller
return view('error', compact('message'));
}
- $email = $request->old('email');
+ $email = $request?->old('email');
return view('auth.register', compact('isDemoSite', 'email', 'pageTitle'));
}
diff --git a/app/Http/Controllers/Auth/TwoFactorController.php b/app/Http/Controllers/Auth/TwoFactorController.php
index b1e7e053a2..1ebce31552 100644
--- a/app/Http/Controllers/Auth/TwoFactorController.php
+++ b/app/Http/Controllers/Auth/TwoFactorController.php
@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Auth;
+use Carbon\Carbon;
use FireflyIII\Events\Security\MFABackupFewLeft;
use FireflyIII\Events\Security\MFABackupNoLeft;
use FireflyIII\Events\Security\MFAManyFailedAttempts;
@@ -129,7 +130,7 @@ class TwoFactorController extends Controller
*/
private function inMFAHistory(string $mfaCode, array $mfaHistory): bool
{
- $now = time();
+ $now = Carbon::now()->getTimestamp();
foreach ($mfaHistory as $entry) {
$time = $entry['time'];
$code = $entry['code'];
@@ -149,7 +150,7 @@ class TwoFactorController extends Controller
/** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data;
$newHistory = [];
- $now = time();
+ $now = Carbon::now()->getTimestamp();
foreach ($mfaHistory as $entry) {
$time = $entry['time'];
$code = $entry['code'];
@@ -184,7 +185,7 @@ class TwoFactorController extends Controller
/** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data;
$entry = [
- 'time' => time(),
+ 'time' => Carbon::now()->getTimestamp(),
'code' => $mfaCode,
];
$mfaHistory[] = $entry;
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..812ea5149e 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..367bbba1ad 100644
--- a/app/Http/Controllers/Budget/BudgetLimitController.php
+++ b/app/Http/Controllers/Budget/BudgetLimitController.php
@@ -143,13 +143,13 @@ class BudgetLimitController extends Controller
// first search for existing one and update it if necessary.
$currency = $this->currencyRepos->find((int) $request->get('transaction_currency_id'));
$budget = $this->repository->find((int) $request->get('budget_id'));
- if (null === $currency || null === $budget) {
+ if (!$currency instanceof TransactionCurrency || !$budget instanceof Budget) {
throw new FireflyException('No valid currency or budget.');
}
$start = Carbon::createFromFormat('Y-m-d', $request->get('start'));
$end = Carbon::createFromFormat('Y-m-d', $request->get('end'));
- if (null === $start || null === $end) {
+ if (!$start instanceof Carbon || !$end instanceof Carbon) {
return response()->json([]);
}
@@ -167,7 +167,7 @@ class BudgetLimitController extends Controller
// sanity check on amount:
if (0 === bccomp($amount, '0')) {
- if (null !== $limit) {
+ if ($limit instanceof BudgetLimit) {
$this->blRepository->destroyBudgetLimit($limit);
}
@@ -181,11 +181,11 @@ class BudgetLimitController extends Controller
$amount = bcmul($amount, '-1');
}
- if (null !== $limit) {
+ if ($limit instanceof BudgetLimit) {
$limit->amount = $amount;
$limit->save();
}
- if (null === $limit) {
+ if (!$limit instanceof BudgetLimit) {
$limit = $this->blRepository->store(
[
'budget_id' => $request->get('budget_id'),
@@ -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/EditController.php b/app/Http/Controllers/Budget/EditController.php
index 73110ded81..7f9aeb8504 100644
--- a/app/Http/Controllers/Budget/EditController.php
+++ b/app/Http/Controllers/Budget/EditController.php
@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Budget;
+use FireflyIII\Models\AutoBudget;
use FireflyIII\Enums\AutoBudgetType;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller;
@@ -95,7 +96,7 @@ class EditController extends Controller
'active' => $hasOldInput ? (bool) $request->old('active') : $budget->active,
'auto_budget_currency_id' => $hasOldInput ? (int) $request->old('auto_budget_currency_id') : $this->defaultCurrency->id,
];
- if (null !== $autoBudget) {
+ if ($autoBudget instanceof AutoBudget) {
$amount = $hasOldInput ? $request->old('auto_budget_amount') : $autoBudget->amount;
if (is_array($amount)) {
$amount = '0';
diff --git a/app/Http/Controllers/Budget/IndexController.php b/app/Http/Controllers/Budget/IndexController.php
index 6e04f56134..d70f894c6d 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;
@@ -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]
@@ -316,7 +316,7 @@ class IndexController extends Controller
foreach ($budgetIds as $index => $budgetId) {
$budgetId = (int) $budgetId;
$budget = $repository->find($budgetId);
- if (null !== $budget) {
+ if ($budget instanceof Budget) {
app('log')->debug(sprintf('Set budget #%d ("%s") to position %d', $budget->id, $budget->name, $index + 1));
$repository->setBudgetOrder($budget, $index + 1);
}
diff --git a/app/Http/Controllers/Budget/ShowController.php b/app/Http/Controllers/Budget/ShowController.php
index e59abc4437..9c90829c77 100644
--- a/app/Http/Controllers/Budget/ShowController.php
+++ b/app/Http/Controllers/Budget/ShowController.php
@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Budget;
+use FireflyIII\Models\TransactionJournal;
use Carbon\Carbon;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Exceptions\FireflyException;
@@ -90,7 +91,7 @@ class ShowController extends Controller
// get first journal ever to set off the budget period overview.
$first = $this->journalRepos->firstNull();
- $firstDate = null !== $first ? $first->date : $start;
+ $firstDate = $first instanceof TransactionJournal ? $first->date : $start;
$periods = $this->getNoBudgetPeriodOverview($firstDate, $end);
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
@@ -115,7 +116,7 @@ class ShowController extends Controller
{
$subTitle = (string) trans('firefly.all_journals_without_budget');
$first = $this->journalRepos->firstNull();
- $start = null === $first ? new Carbon() : $first->date;
+ $start = $first instanceof TransactionJournal ? $first->date : new Carbon();
$end = today(config('app.timezone'));
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
@@ -175,9 +176,10 @@ class ShowController extends Controller
throw new FireflyException('This budget limit is not part of this budget.');
}
- $page = (int) $request->get('page');
- $pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
- $subTitle = trans(
+ $currencySymbol = $budgetLimit->transactionCurrency->symbol;
+ $page = (int) $request->get('page');
+ $pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
+ $subTitle = trans(
'firefly.budget_in_period',
[
'name' => $budget->name,
@@ -186,23 +188,26 @@ class ShowController extends Controller
'currency' => $budgetLimit->transactionCurrency->name,
]
);
+ 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'));
+ return view('budgets.show', compact('limits', 'attachments', 'budget', 'budgetLimit', 'groups', 'subTitle', 'currencySymbol'));
}
}
diff --git a/app/Http/Controllers/Category/NoCategoryController.php b/app/Http/Controllers/Category/NoCategoryController.php
index 7309209ca2..be784e6aa6 100644
--- a/app/Http/Controllers/Category/NoCategoryController.php
+++ b/app/Http/Controllers/Category/NoCategoryController.php
@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Category;
+use FireflyIII\Models\TransactionJournal;
use Carbon\Carbon;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Exceptions\FireflyException;
@@ -119,7 +120,7 @@ class NoCategoryController extends Controller
app('log')->debug('Start of noCategory()');
$subTitle = (string) trans('firefly.all_journals_without_category');
$first = $this->journalRepos->firstNull();
- $start = null === $first ? new Carbon() : $first->date;
+ $start = $first instanceof TransactionJournal ? $first->date : new Carbon();
$end = today(config('app.timezone'));
app('log')->debug(sprintf('Start for noCategory() is %s', $start->format('Y-m-d')));
app('log')->debug(sprintf('End for noCategory() is %s', $end->format('Y-m-d')));
diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php
index 80c803cc68..085ef0bb91 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;
@@ -44,6 +43,8 @@ use Illuminate\Http\JsonResponse;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
+use function Safe\json_encode;
+
/**
* Class AccountController.
*/
@@ -250,7 +251,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 +313,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 +402,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));
@@ -511,7 +512,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);
@@ -535,6 +536,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 +688,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/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 ae56ea84f0..0865b5270b 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;
@@ -110,7 +109,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 +132,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));
@@ -172,15 +171,15 @@ 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);
+ $amount = bcadd((string) $amount, $spent);
$format = $start->isoFormat((string) trans('config.month_and_day_js', [], $locale));
$entries[$format] = $amount;
@@ -191,6 +190,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);
}
@@ -202,7 +202,7 @@ class BudgetController extends Controller
{
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
- $budgetLimitId = null === $budgetLimit ? 0 : $budgetLimit->id;
+ $budgetLimitId = $budgetLimit instanceof BudgetLimit ? $budgetLimit->id : 0;
$cache = new CacheProperties();
$cache->addProperty($budget->id);
$cache->addProperty($this->convertToNative);
@@ -211,10 +211,10 @@ class BudgetController extends Controller
$start = session('first', today(config('app.timezone'))->startOfYear());
$end = today();
- if (null !== $budgetLimit) {
+ if ($budgetLimit instanceof 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);
@@ -256,7 +256,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));
@@ -285,7 +285,7 @@ class BudgetController extends Controller
{
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
- $budgetLimitId = null === $budgetLimit ? 0 : $budgetLimit->id;
+ $budgetLimitId = $budgetLimit instanceof BudgetLimit ? $budgetLimit->id : 0;
$cache = new CacheProperties();
$cache->addProperty($budget->id);
$cache->addProperty($this->convertToNative);
@@ -293,10 +293,10 @@ class BudgetController extends Controller
$cache->addProperty('chart.budget.expense-category');
$start = session('first', today(config('app.timezone'))->startOfYear());
$end = today();
- if (null !== $budgetLimit) {
+ if ($budgetLimit instanceof BudgetLimit) {
$start = $budgetLimit->start_date;
$end = $budgetLimit->end_date;
- $collector->setCurrency($budgetLimit->transactionCurrency);
+ $collector->setNormalCurrency($budgetLimit->transactionCurrency);
}
$cache->addProperty($start);
$cache->addProperty($end);
@@ -340,7 +340,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));
@@ -367,7 +367,7 @@ class BudgetController extends Controller
{
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
- $budgetLimitId = null === $budgetLimit ? 0 : $budgetLimit->id;
+ $budgetLimitId = $budgetLimit instanceof BudgetLimit ? $budgetLimit->id : 0;
$cache = new CacheProperties();
$cache->addProperty($budget->id);
$cache->addProperty($budgetLimitId);
@@ -375,10 +375,10 @@ class BudgetController extends Controller
$cache->addProperty('chart.budget.expense-expense');
$start = session('first', today(config('app.timezone'))->startOfYear());
$end = today();
- if (null !== $budgetLimit) {
+ if ($budgetLimit instanceof 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);
@@ -423,7 +423,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));
@@ -529,7 +529,7 @@ class BudgetController extends Controller
// get budget limit in this period for this currency.
$limit = $this->blRepository->find($budget, $currency, $currentStart, $currentEnd);
- if (null !== $limit) {
+ if ($limit instanceof BudgetLimit) {
$chartData[1]['entries'][$title] = app('steam')->bcround($limit->amount, $currency->decimal_places);
}
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..c9e243844f 100644
--- a/app/Http/Controllers/Chart/CategoryController.php
+++ b/app/Http/Controllers/Chart/CategoryController.php
@@ -159,7 +159,7 @@ class CategoryController extends Controller
$income = [];
$expenses = [];
$categoryId = 0;
- if (null === $category) {
+ if (!$category instanceof Category) {
/** @var NoCategoryRepositoryInterface $noCatRepository */
$noCatRepository = app(NoCategoryRepositoryInterface::class);
@@ -168,7 +168,7 @@ class CategoryController extends Controller
$income = $noCatRepository->listIncome($start, $end, $accounts);
}
- if (null !== $category) {
+ if ($category instanceof Category) {
/** @var OperationsRepositoryInterface $opsRepository */
$opsRepository = app(OperationsRepositoryInterface::class);
$categoryId = $category->id;
@@ -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..920c3a9301 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 e64530ebcf..50fc2118a4 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -23,6 +23,8 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
+use function Safe\realpath;
+use function Safe\ini_get;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Support\Facades\Amount;
use FireflyIII\Support\Facades\Steam;
@@ -32,6 +34,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;
@@ -51,13 +54,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.
@@ -81,6 +83,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([realpath(base_path('resources/views'))]); // @phpstan-ignore-line
}
@@ -94,17 +98,17 @@ 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(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;
}
@@ -120,16 +124,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 a4d93201c0..761070bd46 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;
@@ -49,6 +50,9 @@ use Illuminate\View\View;
use Monolog\Handler\RotatingFileHandler;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+use function Safe\file_get_contents;
+use function Safe\ini_get;
+
/**
* Class DebugController
*/
@@ -65,110 +69,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 +216,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 +342,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 +570,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/Export/IndexController.php b/app/Http/Controllers/Export/IndexController.php
index 8ab072fb12..3167f65525 100644
--- a/app/Http/Controllers/Export/IndexController.php
+++ b/app/Http/Controllers/Export/IndexController.php
@@ -24,6 +24,8 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Export;
+use Carbon\Carbon;
+use FireflyIII\Models\TransactionJournal;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Middleware\IsDemoUser;
@@ -84,14 +86,14 @@ class IndexController extends Controller
$firstDate = today(config('app.timezone'));
$firstDate->subYear();
$journal = $this->journalRepository->firstNull();
- if (null !== $journal) {
+ if ($journal instanceof TransactionJournal) {
Log::debug('First journal is NULL, using today() - 1 year.');
$firstDate = clone $journal->date;
}
$generator->setStart($firstDate);
$result = $generator->export();
- $name = sprintf('%s_transaction_export.csv', date('Y_m_d'));
+ $name = sprintf('%s_transaction_export.csv', Carbon::now()->format('Y_m_d'));
$quoted = sprintf('"%s"', addcslashes($name, '"\\'));
// headers for CSV file.
@@ -106,7 +108,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..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();
}
@@ -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/JavascriptController.php b/app/Http/Controllers/JavascriptController.php
index 2fcc5b3aed..ea062700d4 100644
--- a/app/Http/Controllers/JavascriptController.php
+++ b/app/Http/Controllers/JavascriptController.php
@@ -96,7 +96,7 @@ class JavascriptController extends Controller
{
$account = $repository->find((int) $request->get('account'));
$currency = $this->defaultCurrency;
- if (null !== $account) {
+ if ($account instanceof Account) {
$currency = $repository->getAccountCurrency($account) ?? $this->defaultCurrency;
}
$locale = app('steam')->getLocale();
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/BudgetController.php b/app/Http/Controllers/Json/BudgetController.php
index ca72b59698..23a687ed46 100644
--- a/app/Http/Controllers/Json/BudgetController.php
+++ b/app/Http/Controllers/Json/BudgetController.php
@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Json;
+use FireflyIII\Models\AvailableBudget;
use Carbon\Carbon;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\TransactionCurrency;
@@ -72,7 +73,7 @@ class BudgetController extends Controller
$available = '0';
$percentage = '0';
- if (null !== $availableBudget) {
+ if ($availableBudget instanceof AvailableBudget) {
$available = $availableBudget->amount;
if (0 !== bccomp($available, '0')) {
$percentage = bcmul(bcdiv($budgeted, $available), '100');
diff --git a/app/Http/Controllers/Json/FrontpageController.php b/app/Http/Controllers/Json/FrontpageController.php
index 88717a51f5..08ed98cd53 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/IntroController.php b/app/Http/Controllers/Json/IntroController.php
index 6ea2ca32d2..f3bd44b660 100644
--- a/app/Http/Controllers/Json/IntroController.php
+++ b/app/Http/Controllers/Json/IntroController.php
@@ -95,9 +95,9 @@ class IntroController extends Controller
{
$specialPage ??= '';
$route = str_replace('.', '_', $route);
- $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 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/Json/ReconcileController.php b/app/Http/Controllers/Json/ReconcileController.php
index 5469be7251..f2122dc310 100644
--- a/app/Http/Controllers/Json/ReconcileController.php
+++ b/app/Http/Controllers/Json/ReconcileController.php
@@ -77,7 +77,7 @@ class ReconcileController extends Controller
$amount = '0';
$clearedAmount = '0';
- if (null === $start && null === $end) {
+ if (!$start instanceof Carbon && !$end instanceof Carbon) {
throw new FireflyException('Invalid dates submitted.');
}
if ($end->lt($start)) {
@@ -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;
@@ -183,7 +183,7 @@ class ReconcileController extends Controller
*/
public function transactions(Account $account, ?Carbon $start = null, ?Carbon $end = null)
{
- if (null === $start || null === $end) {
+ if (!$start instanceof Carbon || !$end instanceof Carbon) {
throw new FireflyException('Invalid dates submitted.');
}
if ($end->lt($start)) {
diff --git a/app/Http/Controllers/Json/RecurrenceController.php b/app/Http/Controllers/Json/RecurrenceController.php
index 10fdb61b67..477260d5f0 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 = '';
@@ -82,12 +82,12 @@ class RecurrenceController extends Controller
$skip = $skip < 0 || $skip > 31 ? 0 : $skip;
$weekend = $weekend < 1 || $weekend > 4 ? 1 : $weekend;
- if (null === $endDate) {
+ if (!$endDate instanceof Carbon) {
// safety catch:
$endDate = now()->addYear();
}
- if (null === $start || null === $end || null === $firstDate) {
+ if (!$start instanceof Carbon || !$end instanceof Carbon || !$firstDate instanceof Carbon) {
return response()->json();
}
@@ -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();
@@ -153,15 +153,15 @@ 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') ? Carbon::now()->format('Y-m-d') : (string) $request->get('date');
$today = today(config('app.timezone'))->startOfDay();
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) {
+ if (!$date instanceof Carbon) {
return response()->json();
}
$date->startOfDay();
diff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.php
index e5d2dcb68b..ab53751cce 100644
--- a/app/Http/Controllers/NewUserController.php
+++ b/app/Http/Controllers/NewUserController.php
@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
+use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Requests\NewUserFormRequest;
@@ -101,7 +102,7 @@ class NewUserController extends Controller
$currency = $currencyRepository->find((int) $request->input('amount_currency_id_bank_balance'));
// if is null, set to EUR:
- if (null === $currency) {
+ if (!$currency instanceof TransactionCurrency) {
$currency = $currencyRepository->findByCode('EUR');
}
$currencyRepository->enable($currency);
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/PreferencesController.php b/app/Http/Controllers/PreferencesController.php
index bf8b12af22..4f2526083c 100644
--- a/app/Http/Controllers/PreferencesController.php
+++ b/app/Http/Controllers/PreferencesController.php
@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
+use Carbon\Carbon;
use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Events\Preferences\UserGroupChangedDefaultCurrency;
use FireflyIII\Events\Test\UserTestNotificationChannel;
@@ -40,6 +41,10 @@ use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
+use function Safe\json_decode;
+use function Safe\file_get_contents;
+use function Safe\strtotime;
+
/**
* Class PreferencesController.
*/
@@ -110,7 +115,7 @@ class PreferencesController extends Controller
if (is_array($fiscalYearStartStr)) {
$fiscalYearStartStr = '01-01';
}
- $fiscalYearStart = sprintf('%s-%s', date('Y'), (string) $fiscalYearStartStr);
+ $fiscalYearStart = sprintf('%s-%s', Carbon::now()->format('Y'), (string) $fiscalYearStartStr);
$tjOptionalFields = Preferences::get('transaction_journal_optional_fields', [])->data;
$availableDarkModes = config('firefly.available_dark_modes');
@@ -273,7 +278,7 @@ class PreferencesController extends Controller
$customFiscalYear = 1 === (int) $request->get('customFiscalYear');
$string = strtotime((string) $request->get('fiscalYearStart'));
if (false !== $string) {
- $fiscalYearStart = date('m-d', $string);
+ $fiscalYearStart = Carbon::createFromTimestamp($string)->format('m-d');
Preferences::set('customFiscalYear', $customFiscalYear);
Preferences::set('fiscalYearStart', $fiscalYearStart);
}
diff --git a/app/Http/Controllers/Profile/MfaController.php b/app/Http/Controllers/Profile/MfaController.php
index 09af41c9d0..675b95d6f3 100644
--- a/app/Http/Controllers/Profile/MfaController.php
+++ b/app/Http/Controllers/Profile/MfaController.php
@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Profile;
+use Carbon\Carbon;
use FireflyIII\Events\Security\DisabledMFA;
use FireflyIII\Events\Security\EnabledMFA;
use FireflyIII\Events\Security\MFANewBackupCodes;
@@ -294,7 +295,7 @@ class MfaController extends Controller
/** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data;
$entry = [
- 'time' => time(),
+ 'time' => Carbon::now()->getTimestamp(),
'code' => $mfaCode,
];
$mfaHistory[] = $entry;
@@ -311,7 +312,7 @@ class MfaController extends Controller
/** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data;
$newHistory = [];
- $now = time();
+ $now = Carbon::now()->getTimestamp();
foreach ($mfaHistory as $entry) {
$time = $entry['time'];
$code = $entry['code'];
diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php
index de80d147db..74b9dad6f3 100644
--- a/app/Http/Controllers/ProfileController.php
+++ b/app/Http/Controllers/ProfileController.php
@@ -201,7 +201,7 @@ class ProfileController extends Controller
return redirect(route('profile.change-email'))->withInput();
}
$existing = $repository->findByEmail($newEmail);
- if (null !== $existing) {
+ if ($existing instanceof User) {
// force user logout.
\Auth::guard()->logout(); // @phpstan-ignore-line (does not recognize function)
$request->session()->invalidate();
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 b48e5f7b85..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 .= ','.$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").
@@ -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/Rule/CreateController.php b/app/Http/Controllers/Rule/CreateController.php
index d4def2dab4..847162db5e 100644
--- a/app/Http/Controllers/Rule/CreateController.php
+++ b/app/Http/Controllers/Rule/CreateController.php
@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Rule;
+use FireflyIII\Models\Rule;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\RuleFormRequest;
@@ -128,7 +129,7 @@ class CreateController extends Controller
// title depends on whether or not there is a rule group:
$subTitle = (string) trans('firefly.make_new_rule_no_group');
- if (null !== $ruleGroup) {
+ if ($ruleGroup instanceof RuleGroup) {
$subTitle = (string) trans('firefly.make_new_rule', ['title' => $ruleGroup->title]);
}
@@ -252,7 +253,7 @@ class CreateController extends Controller
{
$ruleId = (int) $request->get('id');
$rule = $this->ruleRepos->find($ruleId);
- if (null !== $rule) {
+ if ($rule instanceof Rule) {
$this->ruleRepos->duplicate($rule);
}
diff --git a/app/Http/Controllers/Rule/EditController.php b/app/Http/Controllers/Rule/EditController.php
index 9dbcf54ae9..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', ['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/Http/Controllers/RuleGroup/EditController.php b/app/Http/Controllers/RuleGroup/EditController.php
index a1e6f47487..ecf18bfa47 100644
--- a/app/Http/Controllers/RuleGroup/EditController.php
+++ b/app/Http/Controllers/RuleGroup/EditController.php
@@ -91,7 +91,7 @@ class EditController extends Controller
{
$groupId = (int) $request->get('id');
$ruleGroup = $this->repository->find($groupId);
- if (null !== $ruleGroup) {
+ if ($ruleGroup instanceof RuleGroup) {
$direction = $request->get('direction');
if ('down' === $direction) {
$maxOrder = $this->repository->maxOrder();
diff --git a/app/Http/Controllers/System/InstallController.php b/app/Http/Controllers/System/InstallController.php
index df765dc6fb..55a0054632 100644
--- a/app/Http/Controllers/System/InstallController.php
+++ b/app/Http/Controllers/System/InstallController.php
@@ -36,6 +36,8 @@ use Illuminate\View\View;
use Laravel\Passport\Passport;
use phpseclib3\Crypt\RSA;
+use function Safe\file_put_contents;
+
/**
* Class InstallController
*/
diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php
index 23c45810a0..a036a1b754 100644
--- a/app/Http/Controllers/TagController.php
+++ b/app/Http/Controllers/TagController.php
@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
+use FireflyIII\Models\Location;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
@@ -124,10 +125,10 @@ class TagController extends Controller
$subTitleIcon = 'fa-tag';
$location = $this->repository->getLocation($tag);
- $latitude = null !== $location ? $location->latitude : config('firefly.default_location.latitude');
- $longitude = null !== $location ? $location->longitude : config('firefly.default_location.longitude');
- $zoomLevel = null !== $location ? $location->zoom_level : config('firefly.default_location.zoom_level');
- $hasLocation = null !== $location;
+ $latitude = $location instanceof Location ? $location->latitude : config('firefly.default_location.latitude');
+ $longitude = $location instanceof Location ? $location->longitude : config('firefly.default_location.longitude');
+ $zoomLevel = $location instanceof Location ? $location->zoom_level : config('firefly.default_location.zoom_level');
+ $hasLocation = $location instanceof Location;
$locations = [
'location' => [
'latitude' => old('location_latitude') ?? $latitude,
@@ -155,8 +156,8 @@ class TagController extends Controller
{
// start with oldest tag
$first = session('first', today()) ?? today();
- $oldestTagDate = null === $repository->oldestTag() ? clone $first : $repository->oldestTag()->date;
- $newestTagDate = null === $repository->newestTag() ? today() : $repository->newestTag()->date;
+ $oldestTagDate = $repository->oldestTag() instanceof Tag ? $repository->oldestTag()->date : clone $first;
+ $newestTagDate = $repository->newestTag() instanceof Tag ? $repository->newestTag()->date : today();
$oldestTagDate->startOfYear();
$newestTagDate->endOfYear();
$tags = [];
@@ -184,7 +185,7 @@ class TagController extends Controller
foreach ($tags as $tagId) {
$tagId = (int) $tagId;
$tag = $this->repository->find($tagId);
- if (null !== $tag) {
+ if ($tag instanceof Tag) {
$this->repository->destroy($tag);
++$count;
}
diff --git a/app/Http/Controllers/Transaction/ConvertController.php b/app/Http/Controllers/Transaction/ConvertController.php
index 8511b939f7..929d46ede7 100644
--- a/app/Http/Controllers/Transaction/ConvertController.php
+++ b/app/Http/Controllers/Transaction/ConvertController.php
@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction;
+use FireflyIII\Models\TransactionCurrency;
use Exception;
use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Enums\TransactionTypeEnum;
@@ -342,7 +343,7 @@ class ConvertController extends Controller
$sourceCurrency = $this->accountRepository->getAccountCurrency($source);
$dest = $this->accountRepository->find((int) $destinationId);
$destCurrency = $this->accountRepository->getAccountCurrency($dest);
- if (null !== $sourceCurrency && null !== $destCurrency && $sourceCurrency->code !== $destCurrency->code) {
+ if ($sourceCurrency instanceof TransactionCurrency && $destCurrency instanceof TransactionCurrency && $sourceCurrency->code !== $destCurrency->code) {
$update['currency_id'] = $sourceCurrency->id;
$update['foreign_currency_id'] = $destCurrency->id;
$update['foreign_amount'] = '1'; // not the best solution but at this point the amount is hard to get.
diff --git a/app/Http/Controllers/Transaction/CreateController.php b/app/Http/Controllers/Transaction/CreateController.php
index fad87c640a..8fdaf2e2a4 100644
--- a/app/Http/Controllers/Transaction/CreateController.php
+++ b/app/Http/Controllers/Transaction/CreateController.php
@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction;
+use FireflyIII\Models\TransactionGroup;
use FireflyIII\Events\StoredTransactionGroup;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
@@ -35,6 +36,8 @@ use Illuminate\Contracts\View\View;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
+use function Safe\parse_url;
+
/**
* Class CreateController
*/
@@ -65,7 +68,7 @@ class CreateController extends Controller
$groupId = (int) $request->get('id');
if (0 !== $groupId) {
$group = $this->repository->find($groupId);
- if (null !== $group) {
+ if ($group instanceof TransactionGroup) {
/** @var GroupCloneService $service */
$service = app(GroupCloneService::class);
$newGroup = $service->cloneGroup($group);
@@ -116,7 +119,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 = parse_url((string) $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..ee8a9897a4 100644
--- a/app/Http/Controllers/Transaction/EditController.php
+++ b/app/Http/Controllers/Transaction/EditController.php
@@ -35,6 +35,8 @@ use Illuminate\Http\RedirectResponse;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
+use function Safe\parse_url;
+
/**
* Class EditController
*/
@@ -85,7 +87,7 @@ class EditController extends Controller
$defaultCurrency = $this->defaultCurrency;
$cash = $repository->getCashAccount();
$previousUrl = $this->rememberPreviousUrl('transactions.edit.url');
- $parts = parse_url($previousUrl);
+ $parts = parse_url((string) $previousUrl);
$search = sprintf('?%s', $parts['query'] ?? '');
$previousUrl = str_replace($search, '', $previousUrl);
diff --git a/app/Http/Controllers/Transaction/IndexController.php b/app/Http/Controllers/Transaction/IndexController.php
index 7b6ecd2b39..54e6a6e967 100644
--- a/app/Http/Controllers/Transaction/IndexController.php
+++ b/app/Http/Controllers/Transaction/IndexController.php
@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction;
+use FireflyIII\Models\TransactionJournal;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
@@ -81,14 +82,14 @@ class IndexController extends Controller
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
- if (null === $start) {
+ if (!$start instanceof Carbon) {
$start = session('start');
$end = session('end');
}
if (null === $end) {
// get last transaction ever?
$last = $this->repository->getLast();
- $end = null !== $last ? $last->date : session('end');
+ $end = $last instanceof TransactionJournal ? $last->date : session('end');
}
[$start, $end] = $end < $start ? [$end, $start] : [$start, $end];
@@ -97,7 +98,7 @@ class IndexController extends Controller
$subTitle = (string) trans(sprintf('firefly.title_%s_between', $objectType), ['start' => $startStr, 'end' => $endStr]);
$path = route('transactions.index', [$objectType, $start->format('Y-m-d'), $end->format('Y-m-d')]);
$firstJournal = $this->repository->firstNull();
- $startPeriod = null === $firstJournal ? new Carbon() : $firstJournal->date;
+ $startPeriod = $firstJournal instanceof TransactionJournal ? $firstJournal->date : new Carbon();
$endPeriod = clone $end;
$periods = $this->getTransactionPeriodOverview($objectType, $startPeriod, $endPeriod);
@@ -132,9 +133,9 @@ class IndexController extends Controller
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$path = route('transactions.index.all', [$objectType]);
$first = $this->repository->firstNull();
- $start = null === $first ? new Carbon() : $first->date;
+ $start = $first instanceof TransactionJournal ? $first->date : new Carbon();
$last = $this->repository->getLast();
- $end = null !== $last ? $last->date : today(config('app.timezone'));
+ $end = $last instanceof TransactionJournal ? $last->date : today(config('app.timezone'));
$subTitle = (string) trans('firefly.all_'.$objectType);
/** @var GroupCollectorInterface $collector */
diff --git a/app/Http/Controllers/Transaction/LinkController.php b/app/Http/Controllers/Transaction/LinkController.php
index d46fa20eee..d06bc0c089 100644
--- a/app/Http/Controllers/Transaction/LinkController.php
+++ b/app/Http/Controllers/Transaction/LinkController.php
@@ -113,7 +113,7 @@ class LinkController extends Controller
app('log')->debug('We are here (store)');
$other = $this->journalRepository->find($linkInfo['transaction_journal_id']);
- if (null === $other) {
+ if (!$other instanceof TransactionJournal) {
session()->flash('error', (string) trans('firefly.invalid_link_selection'));
return redirect(route('transactions.show', [$journal->transaction_group_id]));
diff --git a/app/Http/Controllers/Transaction/MassController.php b/app/Http/Controllers/Transaction/MassController.php
index 67a2fc6add..aa44005821 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
}
}
@@ -191,7 +191,7 @@ class MassController extends Controller
private function updateJournal(int $journalId, MassEditJournalRequest $request): void
{
$journal = $this->repository->find($journalId);
- if (null === $journal) {
+ if (!$journal instanceof TransactionJournal) {
throw new FireflyException(sprintf('Trying to edit non-existent or deleted journal #%d', $journalId));
}
$service = app(JournalUpdateService::class);
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/Controllers/TransactionCurrency/CreateController.php b/app/Http/Controllers/TransactionCurrency/CreateController.php
index 84e30328db..2e7372b213 100644
--- a/app/Http/Controllers/TransactionCurrency/CreateController.php
+++ b/app/Http/Controllers/TransactionCurrency/CreateController.php
@@ -24,11 +24,12 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\TransactionCurrency;
+use FireflyIII\Models\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;
@@ -122,7 +123,7 @@ class CreateController extends Controller
}
$redirect = redirect($this->getPreviousUrl('currencies.create.url'));
- if (null !== $currency) {
+ if ($currency instanceof TransactionCurrency) {
$request->session()->flash('success', (string) trans('firefly.created_currency', ['name' => $currency->name]));
Log::channel('audit')->info('Created (POST) currency.', $data);
if (1 === (int) $request->get('create_another')) {
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/AcceptHeaders.php b/app/Http/Middleware/AcceptHeaders.php
index 54c9d1f643..0f797dea01 100644
--- a/app/Http/Middleware/AcceptHeaders.php
+++ b/app/Http/Middleware/AcceptHeaders.php
@@ -29,6 +29,8 @@ use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
+use function Safe\preg_match;
+
class AcceptHeaders
{
/**
diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php
index 4dafb75854..a4de77717e 100644
--- a/app/Http/Middleware/Authenticate.php
+++ b/app/Http/Middleware/Authenticate.php
@@ -35,18 +35,15 @@ use Illuminate\Http\Request;
*/
class Authenticate
{
- /**
- * The authentication factory instance.
- */
- protected Auth $auth;
-
/**
* Create a new middleware instance.
*/
- public function __construct(Auth $auth)
- {
- $this->auth = $auth;
- }
+ public function __construct(
+ /**
+ * The authentication factory instance.
+ */
+ protected Auth $auth
+ ) {}
/**
* Handle an incoming request.
@@ -117,10 +114,10 @@ class Authenticate
*/
private function validateBlockedUser(?User $user, array $guards): void
{
- if (null === $user) {
+ if (!$user instanceof User) {
app('log')->warning('User is null, throw exception?');
}
- if (null !== $user) {
+ if ($user instanceof User) {
// app('log')->debug(get_class($user));
if (1 === (int) $user->blocked) {
$message = (string) trans('firefly.block_account_logout');
diff --git a/app/Http/Middleware/InterestingMessage.php b/app/Http/Middleware/InterestingMessage.php
index 30f5bfd238..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.
@@ -130,24 +121,24 @@ 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]));
}
}
- 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/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..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')) {
+ if (class_exists(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/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/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..959678e64c 100644
--- a/app/Http/Requests/CurrencyFormRequest.php
+++ b/app/Http/Requests/CurrencyFormRequest.php
@@ -70,7 +70,7 @@ class CurrencyFormRequest extends FormRequest
$currency = $this->route()->parameter('currency');
if (null !== $currency) {
- $rules = [
+ return [
'name' => 'required|max:48|min:1',
'code' => 'required|min:3|max:51',
'symbol' => 'required|min:1|max:51',
@@ -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 da6c5e4417..bf7e4417bb 100644
--- a/app/Http/Requests/ReportFormRequest.php
+++ b/app/Http/Requests/ReportFormRequest.php
@@ -36,6 +36,8 @@ use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
+use function Safe\preg_match;
+
/**
* Class CategoryFormRequest.
*/
@@ -251,7 +253,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..20a14d3895 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)
);
}
@@ -380,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 */
@@ -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/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..7b906b93a6 100644
--- a/app/Jobs/MailError.php
+++ b/app/Jobs/MailError.php
@@ -38,24 +38,15 @@ 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', json_encode($debug)));
+ app('log')->error(sprintf('Exception is: %s', \Safe\json_encode($debug)));
}
/**
@@ -126,11 +117,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 +149,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/Jobs/SendWebhookMessage.php b/app/Jobs/SendWebhookMessage.php
index b656b58df3..dbaab99fe3 100644
--- a/app/Jobs/SendWebhookMessage.php
+++ b/app/Jobs/SendWebhookMessage.php
@@ -42,15 +42,10 @@ class SendWebhookMessage implements ShouldQueue
use Queueable;
use SerializesModels;
- private WebhookMessage $message;
-
/**
* Create a new job instance.
*/
- public function __construct(WebhookMessage $message)
- {
- $this->message = $message;
- }
+ public function __construct(private WebhookMessage $message) {}
/**
* Execute the job.
diff --git a/app/Mail/BillWarningMail.php b/app/Mail/BillWarningMail.php
index ac16d4a1de..8b438091d5 100644
--- a/app/Mail/BillWarningMail.php
+++ b/app/Mail/BillWarningMail.php
@@ -37,19 +37,10 @@ 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)
- {
- $this->bill = $bill;
- $this->field = $field;
- $this->diff = $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 d5161e2a66..de4153e21c 100644
--- a/app/Mail/ConfirmEmailChangeMail.php
+++ b/app/Mail/ConfirmEmailChangeMail.php
@@ -37,19 +37,10 @@ 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)
- {
- $this->newEmail = $newEmail;
- $this->oldEmail = $oldEmail;
- $this->url = $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 36bae2e7bb..a41e6dbc6d 100644
--- a/app/Mail/InvitationMail.php
+++ b/app/Mail/InvitationMail.php
@@ -36,20 +36,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) 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..8afba582a9 100644
--- a/app/Mail/NewIPAddressWarningMail.php
+++ b/app/Mail/NewIPAddressWarningMail.php
@@ -38,16 +38,12 @@ class NewIPAddressWarningMail extends Mailable
use SerializesModels;
public string $host;
- public string $ipAddress;
public string $time;
/**
* OAuthTokenCreatedMail constructor.
*/
- public function __construct(string $ipAddress)
- {
- $this->ipAddress = $ipAddress;
- }
+ public function __construct(public string $ipAddress) {}
/**
* Build the message.
diff --git a/app/Mail/OAuthTokenCreatedMail.php b/app/Mail/OAuthTokenCreatedMail.php
index 3c252b6ad6..4f68259546 100644
--- a/app/Mail/OAuthTokenCreatedMail.php
+++ b/app/Mail/OAuthTokenCreatedMail.php
@@ -37,15 +37,10 @@ class OAuthTokenCreatedMail extends Mailable
use Queueable;
use SerializesModels;
- public Client $client;
-
/**
* OAuthTokenCreatedMail constructor.
*/
- public function __construct(Client $client)
- {
- $this->client = $client;
- }
+ public function __construct(public Client $client) {}
/**
* Build the message.
diff --git a/app/Mail/RegisteredUser.php b/app/Mail/RegisteredUser.php
index fbbe6d2aaa..991d64d26f 100644
--- a/app/Mail/RegisteredUser.php
+++ b/app/Mail/RegisteredUser.php
@@ -37,15 +37,10 @@ class RegisteredUser extends Mailable
use Queueable;
use SerializesModels;
- public string $address;
-
/**
* Create a new message instance.
*/
- public function __construct(string $address)
- {
- $this->address = $address;
- }
+ public function __construct(public string $address) {}
/**
* Build the message.
diff --git a/app/Mail/ReportNewJournalsMail.php b/app/Mail/ReportNewJournalsMail.php
index ff7515ff68..e0a492fa47 100644
--- a/app/Mail/ReportNewJournalsMail.php
+++ b/app/Mail/ReportNewJournalsMail.php
@@ -41,16 +41,12 @@ class ReportNewJournalsMail extends Mailable
use Queueable;
use SerializesModels;
- public Collection $groups;
- public array $transformed;
+ public array $transformed;
/**
* ConfirmEmailChangeMail constructor.
*/
- public function __construct(Collection $groups)
- {
- $this->groups = $groups;
- }
+ public function __construct(public Collection $groups) {}
/**
* Build the message.
diff --git a/app/Mail/RequestedNewPassword.php b/app/Mail/RequestedNewPassword.php
index 8d1342908e..fb5202d6f2 100644
--- a/app/Mail/RequestedNewPassword.php
+++ b/app/Mail/RequestedNewPassword.php
@@ -36,15 +36,10 @@ class RequestedNewPassword extends Mailable
use Queueable;
use SerializesModels;
- public string $url;
-
/**
* RequestedNewPassword constructor.
*/
- public function __construct(string $url)
- {
- $this->url = $url;
- }
+ public function __construct(public string $url) {}
/**
* Build the message.
diff --git a/app/Mail/UndoEmailChangeMail.php b/app/Mail/UndoEmailChangeMail.php
index 5f676b24d3..98c55721e7 100644
--- a/app/Mail/UndoEmailChangeMail.php
+++ b/app/Mail/UndoEmailChangeMail.php
@@ -35,19 +35,10 @@ 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)
- {
- $this->newEmail = $newEmail;
- $this->oldEmail = $oldEmail;
- $this->url = $url;
- }
+ public function __construct(public string $newEmail, public string $oldEmail, public string $url) {}
/**
* Build the message.
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/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/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/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/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/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/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/Notifications/Admin/UnknownUserLoginAttempt.php b/app/Notifications/Admin/UnknownUserLoginAttempt.php
index 57723356fc..b72b0b9324 100644
--- a/app/Notifications/Admin/UnknownUserLoginAttempt.php
+++ b/app/Notifications/Admin/UnknownUserLoginAttempt.php
@@ -41,12 +41,7 @@ class UnknownUserLoginAttempt extends Notification
{
use Queueable;
- private string $address;
-
- public function __construct(string $address)
- {
- $this->address = $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 eed76f98a3..613bfa1f93 100644
--- a/app/Notifications/Admin/UserInvitation.php
+++ b/app/Notifications/Admin/UserInvitation.php
@@ -45,12 +45,7 @@ class UserInvitation extends Notification
{
use Queueable;
- private InvitedUser $invitee;
-
- public function __construct(InvitedUser $invitee)
- {
- $this->invitee = $invitee;
- }
+ public function __construct(private InvitedUser $invitee) {}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
@@ -72,7 +67,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..4d6fcf9b29 100644
--- a/app/Notifications/Admin/UserRegistration.php
+++ b/app/Notifications/Admin/UserRegistration.php
@@ -45,12 +45,7 @@ class UserRegistration extends Notification
{
use Queueable;
- private User $user;
-
- public function __construct(User $user)
- {
- $this->user = $user;
- }
+ public function __construct(private User $user) {}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
@@ -71,7 +66,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..deb2f5b4cb 100644
--- a/app/Notifications/Admin/VersionCheckResult.php
+++ b/app/Notifications/Admin/VersionCheckResult.php
@@ -42,12 +42,7 @@ class VersionCheckResult extends Notification
{
use Queueable;
- private string $message;
-
- public function __construct(string $message)
- {
- $this->message = $message;
- }
+ public function __construct(private string $message) {}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
@@ -63,7 +58,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/ReturnsAvailableChannels.php b/app/Notifications/ReturnsAvailableChannels.php
index 21ee5c49f9..77cebfc2ab 100644
--- a/app/Notifications/ReturnsAvailableChannels.php
+++ b/app/Notifications/ReturnsAvailableChannels.php
@@ -50,30 +50,36 @@ class ReturnsAvailableChannels
private static function returnOwnerChannels(): array
{
- $channels = ['mail'];
- $slackUrl = app('fireflyconfig')->getEncrypted('slack_webhook_url', '')->data;
- if (UrlValidator::isValidWebhookURL($slackUrl)) {
- $channels[] = 'slack';
+ $channels = ['mail'];
+ 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)));
@@ -84,31 +90,38 @@ class ReturnsAvailableChannels
private static function returnUserChannels(User $user): array
{
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';
+ $channels = ['mail'];
+
+ 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/app/Notifications/Security/DisabledMFANotification.php b/app/Notifications/Security/DisabledMFANotification.php
index 991d98d7e8..511b5cecab 100644
--- a/app/Notifications/Security/DisabledMFANotification.php
+++ b/app/Notifications/Security/DisabledMFANotification.php
@@ -40,12 +40,7 @@ class DisabledMFANotification extends Notification
{
use Queueable;
- private User $user;
-
- public function __construct(User $user)
- {
- $this->user = $user;
- }
+ public function __construct(private User $user) {}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
@@ -67,7 +62,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..e3863aee9e 100644
--- a/app/Notifications/Security/EnabledMFANotification.php
+++ b/app/Notifications/Security/EnabledMFANotification.php
@@ -40,12 +40,7 @@ class EnabledMFANotification extends Notification
{
use Queueable;
- private User $user;
-
- public function __construct(User $user)
- {
- $this->user = $user;
- }
+ public function __construct(private User $user) {}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
@@ -67,7 +62,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..4302d10c46 100644
--- a/app/Notifications/Security/MFABackupFewLeftNotification.php
+++ b/app/Notifications/Security/MFABackupFewLeftNotification.php
@@ -40,14 +40,7 @@ class MFABackupFewLeftNotification extends Notification
{
use Queueable;
- private int $count;
- private User $user;
-
- public function __construct(User $user, int $count)
- {
- $this->user = $user;
- $this->count = $count;
- }
+ public function __construct(private User $user, private int $count) {}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
@@ -69,7 +62,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..246119e901 100644
--- a/app/Notifications/Security/MFABackupNoLeftNotification.php
+++ b/app/Notifications/Security/MFABackupNoLeftNotification.php
@@ -40,12 +40,7 @@ class MFABackupNoLeftNotification extends Notification
{
use Queueable;
- private User $user;
-
- public function __construct(User $user)
- {
- $this->user = $user;
- }
+ public function __construct(private User $user) {}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
@@ -67,7 +62,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..400cee87e7 100644
--- a/app/Notifications/Security/MFAManyFailedAttemptsNotification.php
+++ b/app/Notifications/Security/MFAManyFailedAttemptsNotification.php
@@ -40,14 +40,7 @@ class MFAManyFailedAttemptsNotification extends Notification
{
use Queueable;
- private int $count;
- private User $user;
-
- public function __construct(User $user, int $count)
- {
- $this->user = $user;
- $this->count = $count;
- }
+ public function __construct(private User $user, private int $count) {}
public function toArray(User $notifiable): array
{
@@ -66,7 +59,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..01a3aac01c 100644
--- a/app/Notifications/Security/MFAUsedBackupCodeNotification.php
+++ b/app/Notifications/Security/MFAUsedBackupCodeNotification.php
@@ -40,12 +40,7 @@ class MFAUsedBackupCodeNotification extends Notification
{
use Queueable;
- private User $user;
-
- public function __construct(User $user)
- {
- $this->user = $user;
- }
+ public function __construct(private User $user) {}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
@@ -67,7 +62,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..ede672e96b 100644
--- a/app/Notifications/Security/NewBackupCodesNotification.php
+++ b/app/Notifications/Security/NewBackupCodesNotification.php
@@ -40,12 +40,7 @@ class NewBackupCodesNotification extends Notification
{
use Queueable;
- private User $user;
-
- public function __construct(User $user)
- {
- $this->user = $user;
- }
+ public function __construct(private User $user) {}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
@@ -67,7 +62,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..c4ac85a2c6 100644
--- a/app/Notifications/Security/UserFailedLoginAttempt.php
+++ b/app/Notifications/Security/UserFailedLoginAttempt.php
@@ -41,12 +41,7 @@ class UserFailedLoginAttempt extends Notification
{
use Queueable;
- private User $user;
-
- public function __construct(User $user)
- {
- $this->user = $user;
- }
+ public function __construct(private User $user) {}
public function toArray(User $notifiable): array
{
@@ -65,7 +60,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..f30a158ead 100644
--- a/app/Notifications/User/BillReminder.php
+++ b/app/Notifications/User/BillReminder.php
@@ -42,16 +42,7 @@ class BillReminder extends Notification
{
use Queueable;
- private Bill $bill;
- private int $diff;
- private string $field;
-
- public function __construct(Bill $bill, string $field, int $diff)
- {
- $this->bill = $bill;
- $this->field = $field;
- $this->diff = $diff;
- }
+ public function __construct(private Bill $bill, private string $field, private int $diff) {}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
@@ -67,7 +58,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..9a09d82a6c 100644
--- a/app/Notifications/User/TransactionCreation.php
+++ b/app/Notifications/User/TransactionCreation.php
@@ -36,12 +36,7 @@ class TransactionCreation extends Notification
{
use Queueable;
- private array $collection;
-
- public function __construct(array $collection)
- {
- $this->collection = $collection;
- }
+ public function __construct(private array $collection) {}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
@@ -57,7 +52,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..16ffb0b31a 100644
--- a/app/Notifications/User/UserNewPassword.php
+++ b/app/Notifications/User/UserNewPassword.php
@@ -43,12 +43,7 @@ class UserNewPassword extends Notification
{
use Queueable;
- private string $url;
-
- public function __construct(string $url)
- {
- $this->url = $url;
- }
+ public function __construct(private string $url) {}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
@@ -69,7 +64,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/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/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 ca3b82710a..ec474c598b 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -41,12 +41,13 @@ class AppServiceProvider extends ServiceProvider
public function boot(): void
{
Schema::defaultStringLength(191);
+ Passport::$clientUuids = false;
Response::macro('api', function (array $value) {
$headers = [
'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;
}
@@ -86,6 +87,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..9f39f3d8a8 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..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;
@@ -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 1e9d655b0d..7b3be85ddc 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 => [
@@ -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..2b9360f85a 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..249325dd55 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..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;
@@ -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 3f97289ee6..c498f6a5b1 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);
}
@@ -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;
@@ -535,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 = [
@@ -652,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/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..c08acbad8e 100644
--- a/app/Repositories/Bill/BillRepository.php
+++ b/app/Repositories/Bill/BillRepository.php
@@ -133,7 +133,7 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface
return $searchResult;
}
}
- app('log')->debug('Found nothing');
+ app('log')->debug('Found no bill in findBill()');
return null;
}
@@ -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..456e8197f6 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 18cf66c3d4..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;
@@ -201,9 +201,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,10 +236,12 @@ 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);
+ }
+ if ($budgets->count() > 0) {
+ $collector->setBudgets($budgets);
}
- $collector->setBudgets($budgets);
$journals = $collector->getExtractedJournals();
// same but for transactions in the foreign currency:
@@ -246,6 +249,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/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 3100f2d809..9676766b6c 100644
--- a/app/Repositories/Currency/CurrencyRepository.php
+++ b/app/Repositories/Currency/CurrencyRepository.php
@@ -65,33 +65,33 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
*/
public function currencyInUseAt(TransactionCurrency $currency): ?string
{
- app('log')->debug(sprintf('Now in currencyInUse() for #%d ("%s")', $currency->id, $currency->code));
+ Log::debug(sprintf('Now in currencyInUse() for #%d ("%s")', $currency->id, $currency->code));
$countJournals = $this->countJournals($currency);
if ($countJournals > 0) {
- app('log')->info(sprintf('Count journals is %d, return true.', $countJournals));
+ Log::info(sprintf('Count journals is %d, return true.', $countJournals));
return 'journals';
}
// is the only currency left
if (1 === $this->getAll()->count()) {
- app('log')->info('Is the last currency in the system, return true. ');
+ Log::info('Is the last currency in the system, return true. ');
return 'last_left';
}
// 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));
+ Log::info(sprintf('Used in %d accounts as currency_id, return true. ', $meta));
return 'account_meta';
}
// 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));
+ Log::info(sprintf('Used in %d accounts as currency_id, return true. ', $meta));
return 'account_meta';
}
@@ -99,7 +99,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
// is being used in bills:
$bills = Bill::where('transaction_currency_id', $currency->id)->count();
if ($bills > 0) {
- app('log')->info(sprintf('Used in %d bills as currency, return true. ', $bills));
+ Log::info(sprintf('Used in %d bills as currency, return true. ', $bills));
return 'bills';
}
@@ -109,7 +109,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
$recurringForeign = RecurrenceTransaction::where('foreign_currency_id', $currency->id)->count();
if ($recurringAmount > 0 || $recurringForeign > 0) {
- app('log')->info(sprintf('Used in %d recurring transactions as (foreign) currency id, return true. ', $recurringAmount + $recurringForeign));
+ Log::info(sprintf('Used in %d recurring transactions as (foreign) currency id, return true. ', $recurringAmount + $recurringForeign));
return 'recurring';
}
@@ -117,10 +117,10 @@ 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));
+ Log::info(sprintf('Used in %d accounts as currency_id, return true. ', $meta));
return 'account_meta';
}
@@ -128,7 +128,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
// is being used in available budgets
$availableBudgets = AvailableBudget::where('transaction_currency_id', $currency->id)->count();
if ($availableBudgets > 0) {
- app('log')->info(sprintf('Used in %d available budgets as currency, return true. ', $availableBudgets));
+ Log::info(sprintf('Used in %d available budgets as currency, return true. ', $availableBudgets));
return 'available_budgets';
}
@@ -136,7 +136,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
// is being used in budget limits
$budgetLimit = BudgetLimit::where('transaction_currency_id', $currency->id)->count();
if ($budgetLimit > 0) {
- app('log')->info(sprintf('Used in %d budget limits as currency, return true. ', $budgetLimit));
+ Log::info(sprintf('Used in %d budget limits as currency, return true. ', $budgetLimit));
return 'budget_limits';
}
@@ -144,7 +144,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
// is the default currency for the user or the system
$count = $this->userGroup->currencies()->where('transaction_currencies.id', $currency->id)->wherePivot('group_default', 1)->count();
if ($count > 0) {
- app('log')->info('Is the default currency of the user, return true.');
+ Log::info('Is the default currency of the user, return true.');
return 'current_default';
}
@@ -152,12 +152,12 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
// is the default currency for the user or the system
$count = $this->userGroup->currencies()->where('transaction_currencies.id', $currency->id)->wherePivot('group_default', 1)->count();
if ($count > 0) {
- app('log')->info('Is the default currency of the user group, return true.');
+ Log::info('Is the default currency of the user group, return true.');
return 'current_default';
}
- app('log')->debug('Currency is not used, return false.');
+ Log::debug('Currency is not used, return false.');
return null;
}
@@ -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;
@@ -241,15 +237,15 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
$result = $this->findCurrencyNull($currencyId, $currencyCode);
if (null === $result) {
- app('log')->debug('Grabbing default currency for this user...');
+ Log::debug('Grabbing default currency for this user...');
/** @var null|TransactionCurrency $result */
$result = app('amount')->getNativeCurrencyByUserGroup($this->user->userGroup);
}
- app('log')->debug(sprintf('Final result: %s', $result->code));
+ Log::debug(sprintf('Final result: %s', $result->code));
if (false === $result->enabled) {
- app('log')->debug(sprintf('Also enabled currency %s', $result->code));
+ Log::debug(sprintf('Also enabled currency %s', $result->code));
$this->enable($result);
}
@@ -261,16 +257,22 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
*/
public function findCurrencyNull(?int $currencyId, ?string $currencyCode): ?TransactionCurrency
{
- app('log')->debug('Now in findCurrencyNull()');
+ Log::debug(sprintf('Now in findCurrencyNull(%s, "%s")', var_export($currencyId, true), $currencyCode));
$result = $this->find((int) $currencyId);
+ if (null !== $result) {
+ Log::debug(sprintf('Found currency by ID: %s', $result->code));
+
+ return $result;
+ }
if (null === $result) {
- app('log')->debug(sprintf('Searching for currency with code %s...', $currencyCode));
+ Log::debug(sprintf('Searching for currency with code "%s"...', $currencyCode));
$result = $this->findByCode((string) $currencyCode);
}
if (null !== $result && false === $result->enabled) {
- app('log')->debug(sprintf('Also enabled currency %s', $result->code));
+ Log::debug(sprintf('Also enabled currency %s', $result->code));
$this->enable($result);
}
+ Log::debug('Found no currency, returning NULL.');
return $result;
}
@@ -325,7 +327,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
->where('date', $date->format('Y-m-d'))->first()
;
if (null !== $rate) {
- app('log')->debug(sprintf('Found cached exchange rate in database for %s to %s on %s', $fromCurrency->code, $toCurrency->code, $date->format('Y-m-d')));
+ Log::debug(sprintf('Found cached exchange rate in database for %s to %s on %s', $fromCurrency->code, $toCurrency->code, $date->format('Y-m-d')));
return $rate;
}
@@ -384,7 +386,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
public function update(TransactionCurrency $currency, array $data): TransactionCurrency
{
- app('log')->debug('Now in update()');
+ Log::debug('Now in update()');
// can be true, false, null
$enabled = array_key_exists('enabled', $data) ? $data['enabled'] : null;
// can be true, false, but method only responds to "true".
@@ -400,12 +402,12 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
// currency is enabled, must be disabled.
if (false === $enabled) {
- app('log')->debug(sprintf('Disabled currency %s for user #%d', $currency->code, $this->userGroup->id));
+ Log::debug(sprintf('Disabled currency %s for user #%d', $currency->code, $this->userGroup->id));
$this->userGroup->currencies()->detach($currency->id);
}
// currency must be enabled
if (true === $enabled) {
- app('log')->debug(sprintf('Enabled currency %s for user #%d', $currency->code, $this->userGroup->id));
+ Log::debug(sprintf('Enabled currency %s for user #%d', $currency->code, $this->userGroup->id));
$this->userGroup->currencies()->detach($currency->id);
$this->userGroup->currencies()->syncWithoutDetaching([$currency->id => ['group_default' => false]]);
}
@@ -424,7 +426,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
public function makeDefault(TransactionCurrency $currency): void
{
$current = app('amount')->getNativeCurrencyByUserGroup($this->userGroup);
- app('log')->debug(sprintf('Enabled + made default currency %s for user #%d', $currency->code, $this->userGroup->id));
+ Log::debug(sprintf('Enabled + made default currency %s for user #%d', $currency->code, $this->userGroup->id));
$this->userGroup->currencies()->detach($currency->id);
foreach ($this->userGroup->currencies()->get() as $item) {
$this->userGroup->currencies()->updateExistingPivot($item->id, ['group_default' => false]);
diff --git a/app/Repositories/LinkType/LinkTypeRepository.php b/app/Repositories/LinkType/LinkTypeRepository.php
index 024e097959..08a346db38 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..9296d3c977 100644
--- a/app/Repositories/PiggyBank/PiggyBankRepository.php
+++ b/app/Repositories/PiggyBank/PiggyBankRepository.php
@@ -82,7 +82,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface, UserGroupInte
return $searchResult;
}
}
- app('log')->debug('Found nothing');
+ app('log')->debug('Found no piggy bank.');
return null;
}
@@ -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/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/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 97a5b7f48c..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;
@@ -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/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 97877aeb3e..f7aae4dfce 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);
}
@@ -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 73bce5a06b..092ef4b50c 100644
--- a/app/Repositories/UserGroups/Currency/CurrencyRepository.php
+++ b/app/Repositories/UserGroups/Currency/CurrencyRepository.php
@@ -65,33 +65,33 @@ class CurrencyRepository implements CurrencyRepositoryInterface
*/
public function currencyInUseAt(TransactionCurrency $currency): ?string
{
- app('log')->debug(sprintf('Now in currencyInUse() for #%d ("%s")', $currency->id, $currency->code));
+ Log::debug(sprintf('Now in currencyInUse() for #%d ("%s")', $currency->id, $currency->code));
$countJournals = $this->countJournals($currency);
if ($countJournals > 0) {
- app('log')->info(sprintf('Count journals is %d, return true.', $countJournals));
+ Log::info(sprintf('Count journals is %d, return true.', $countJournals));
return 'journals';
}
// is the only currency left
if (1 === $this->getAll()->count()) {
- app('log')->info('Is the last currency in the system, return true. ');
+ Log::info('Is the last currency in the system, return true. ');
return 'last_left';
}
// 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));
+ Log::info(sprintf('Used in %d accounts as currency_id, return true. ', $meta));
return 'account_meta';
}
// 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));
+ Log::info(sprintf('Used in %d accounts as currency_id, return true. ', $meta));
return 'account_meta';
}
@@ -99,7 +99,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
// is being used in bills:
$bills = Bill::where('transaction_currency_id', $currency->id)->count();
if ($bills > 0) {
- app('log')->info(sprintf('Used in %d bills as currency, return true. ', $bills));
+ Log::info(sprintf('Used in %d bills as currency, return true. ', $bills));
return 'bills';
}
@@ -109,7 +109,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
$recurringForeign = RecurrenceTransaction::where('foreign_currency_id', $currency->id)->count();
if ($recurringAmount > 0 || $recurringForeign > 0) {
- app('log')->info(sprintf('Used in %d recurring transactions as (foreign) currency id, return true. ', $recurringAmount + $recurringForeign));
+ Log::info(sprintf('Used in %d recurring transactions as (foreign) currency id, return true. ', $recurringAmount + $recurringForeign));
return 'recurring';
}
@@ -117,10 +117,10 @@ 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));
+ Log::info(sprintf('Used in %d accounts as currency_id, return true. ', $meta));
return 'account_meta';
}
@@ -128,7 +128,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
// is being used in available budgets
$availableBudgets = AvailableBudget::where('transaction_currency_id', $currency->id)->count();
if ($availableBudgets > 0) {
- app('log')->info(sprintf('Used in %d available budgets as currency, return true. ', $availableBudgets));
+ Log::info(sprintf('Used in %d available budgets as currency, return true. ', $availableBudgets));
return 'available_budgets';
}
@@ -136,7 +136,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
// is being used in budget limits
$budgetLimit = BudgetLimit::where('transaction_currency_id', $currency->id)->count();
if ($budgetLimit > 0) {
- app('log')->info(sprintf('Used in %d budget limits as currency, return true. ', $budgetLimit));
+ Log::info(sprintf('Used in %d budget limits as currency, return true. ', $budgetLimit));
return 'budget_limits';
}
@@ -144,7 +144,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
// is the default currency for the user or the system
$count = $this->userGroup->currencies()->where('transaction_currencies.id', $currency->id)->wherePivot('group_default', 1)->count();
if ($count > 0) {
- app('log')->info('Is the default currency of the user, return true.');
+ Log::info('Is the default currency of the user, return true.');
return 'current_default';
}
@@ -152,12 +152,12 @@ class CurrencyRepository implements CurrencyRepositoryInterface
// is the default currency for the user or the system
$count = $this->userGroup->currencies()->where('transaction_currencies.id', $currency->id)->wherePivot('group_default', 1)->count();
if ($count > 0) {
- app('log')->info('Is the default currency of the user group, return true.');
+ Log::info('Is the default currency of the user group, return true.');
return 'current_default';
}
- app('log')->debug('Currency is not used, return false.');
+ Log::debug('Currency is not used, return false.');
return null;
}
@@ -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;
@@ -244,15 +240,15 @@ class CurrencyRepository implements CurrencyRepositoryInterface
$result = $this->findCurrencyNull($currencyId, $currencyCode);
if (null === $result) {
- app('log')->debug('Grabbing default currency for this user...');
+ Log::debug('Grabbing default currency for this user...');
/** @var null|TransactionCurrency $result */
$result = app('amount')->getNativeCurrencyByUserGroup($this->user->userGroup);
}
- app('log')->debug(sprintf('Final result: %s', $result->code));
+ Log::debug(sprintf('Final result: %s', $result->code));
if (false === $result->enabled) {
- app('log')->debug(sprintf('Also enabled currency %s', $result->code));
+ Log::debug(sprintf('Also enabled currency %s', $result->code));
$this->enable($result);
}
@@ -264,14 +260,14 @@ class CurrencyRepository implements CurrencyRepositoryInterface
*/
public function findCurrencyNull(?int $currencyId, ?string $currencyCode): ?TransactionCurrency
{
- app('log')->debug('Now in findCurrencyNull()');
+ Log::debug(sprintf('Now in findCurrencyNull("%s", "%s")', $currencyId, $currencyCode));
$result = $this->find((int) $currencyId);
if (null === $result) {
- app('log')->debug(sprintf('Searching for currency with code %s...', $currencyCode));
+ Log::debug(sprintf('Searching for currency with code "%s"...', $currencyCode));
$result = $this->findByCode((string) $currencyCode);
}
if (null !== $result && false === $result->enabled) {
- app('log')->debug(sprintf('Also enabled currency %s', $result->code));
+ Log::debug(sprintf('Also enabled currency %s', $result->code));
$this->enable($result);
}
@@ -339,7 +335,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
public function update(TransactionCurrency $currency, array $data): TransactionCurrency
{
- app('log')->debug('Now in update()');
+ Log::debug('Now in update()');
// can be true, false, null
$enabled = array_key_exists('enabled', $data) ? $data['enabled'] : null;
// can be true, false, but method only responds to "true".
@@ -355,12 +351,12 @@ class CurrencyRepository implements CurrencyRepositoryInterface
// currency is enabled, must be disabled.
if (false === $enabled) {
- app('log')->debug(sprintf('Disabled currency %s for user #%d', $currency->code, $this->userGroup->id));
+ Log::debug(sprintf('Disabled currency %s for user #%d', $currency->code, $this->userGroup->id));
$this->userGroup->currencies()->detach($currency->id);
}
// currency must be enabled
if (true === $enabled) {
- app('log')->debug(sprintf('Enabled currency %s for user #%d', $currency->code, $this->userGroup->id));
+ Log::debug(sprintf('Enabled currency %s for user #%d', $currency->code, $this->userGroup->id));
$this->userGroup->currencies()->detach($currency->id);
$this->userGroup->currencies()->syncWithoutDetaching([$currency->id => ['group_default' => false]]);
}
@@ -379,7 +375,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
public function makeDefault(TransactionCurrency $currency): void
{
$current = app('amount')->getNativeCurrencyByUserGroup($this->userGroup);
- app('log')->debug(sprintf('Enabled + made default currency %s for user #%d', $currency->code, $this->userGroup->id));
+ Log::debug(sprintf('Enabled + made default currency %s for user #%d', $currency->code, $this->userGroup->id));
$this->userGroup->currencies()->detach($currency->id);
foreach ($this->userGroup->currencies()->get() as $item) {
$this->userGroup->currencies()->updateExistingPivot($item->id, ['group_default' => false]);
diff --git a/app/Repositories/Webhook/WebhookRepository.php b/app/Repositories/Webhook/WebhookRepository.php
index 0cc7dee0e2..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 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/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/BelongsUserGroup.php b/app/Rules/BelongsUserGroup.php
index dc30295e27..8a4f1519c5 100644
--- a/app/Rules/BelongsUserGroup.php
+++ b/app/Rules/BelongsUserGroup.php
@@ -42,15 +42,10 @@ use Illuminate\Contracts\Validation\ValidationRule;
*/
class BelongsUserGroup implements ValidationRule
{
- private UserGroup $userGroup;
-
/**
* Create a new rule instance.
*/
- public function __construct(UserGroup $userGroup)
- {
- $this->userGroup = $userGroup;
- }
+ public function __construct(private readonly 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..46c717ef44 100644
--- a/app/Rules/IsAllowedGroupAction.php
+++ b/app/Rules/IsAllowedGroupAction.php
@@ -34,15 +34,11 @@ use Illuminate\Support\Facades\Log;
class IsAllowedGroupAction implements ValidationRule
{
- private array $acceptedRoles;
- private string $className;
- private string $methodName;
- private UserGroupRepositoryInterface $repository;
+ private array $acceptedRoles;
+ 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..6f314e8dff 100644
--- a/app/Rules/IsDefaultUserGroupName.php
+++ b/app/Rules/IsDefaultUserGroupName.php
@@ -34,12 +34,7 @@ use Illuminate\Contracts\Validation\ValidationRule;
*/
class IsDefaultUserGroupName implements ValidationRule
{
- private UserGroup $userGroup;
-
- public function __construct(UserGroup $userGroup)
- {
- $this->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 3a08483811..dddd247fa9 100644
--- a/app/Rules/IsFilterValueIn.php
+++ b/app/Rules/IsFilterValueIn.php
@@ -28,14 +28,7 @@ use Illuminate\Contracts\Validation\ValidationRule;
class IsFilterValueIn implements ValidationRule
{
- private string $key;
- private array $values;
-
- public function __construct(string $key, array $values)
- {
- $this->key = $key;
- $this->values = $values;
- }
+ public function __construct(private readonly string $key, private readonly array $values) {}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
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 30d108edd1..148d5600b1 100644
--- a/app/Rules/IsValidBulkClause.php
+++ b/app/Rules/IsValidBulkClause.php
@@ -63,8 +63,8 @@ class IsValidBulkClause implements ValidationRule
private function basicValidation(string $value): bool
{
try {
- $array = json_decode($value, true, 8, JSON_THROW_ON_ERROR);
- } catch (\JsonException $e) {
+ $array = \Safe\json_decode($value, true, 8, JSON_THROW_ON_ERROR);
+ } catch (\JsonException) {
$this->error = (string) trans('validation.json');
return false;
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/IsValidZeroOrMoreAmount.php b/app/Rules/IsValidZeroOrMoreAmount.php
index 03df93bc00..263691ff8a 100644
--- a/app/Rules/IsValidZeroOrMoreAmount.php
+++ b/app/Rules/IsValidZeroOrMoreAmount.php
@@ -32,12 +32,8 @@ use Illuminate\Support\Facades\Log;
class IsValidZeroOrMoreAmount implements ValidationRule
{
use ValidatesAmountsTrait;
- private bool $nullable = false;
- public function __construct(bool $nullable = false)
- {
- $this->nullable = $nullable;
- }
+ public function __construct(private bool $nullable = false) {}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
diff --git a/app/Rules/UniqueAccountNumber.php b/app/Rules/UniqueAccountNumber.php
index 7e2bc5d24c..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));
@@ -138,7 +133,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/Rules/UniqueIban.php b/app/Rules/UniqueIban.php
index 62e6cdc89d..b6aca57927 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;
+ 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 b6321dd852..29499570bc 100644
--- a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php
+++ b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php
@@ -99,8 +99,8 @@ class UpdateRequest implements UpdateRequestInterface
$body = (string) $res->getBody();
try {
- $json = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
- } catch (\JsonException $e) {
+ $json = \Safe\json_decode($body, true, 512, JSON_THROW_ON_ERROR);
+ } 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..787a08c239 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.');
@@ -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/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/Support/JournalServiceTrait.php b/app/Services/Internal/Support/JournalServiceTrait.php
index 9a87b5aa75..507f65e95e 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']) {
@@ -286,7 +286,6 @@ trait JournalServiceTrait
}
-
// $data['name'] = $data['name'] ?? '(no name)';
$account = $this->accountRepository->store(
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/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/Services/Internal/Update/GroupCloneService.php b/app/Services/Internal/Update/GroupCloneService.php
index 53cfb14c44..db78b5092b 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/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/Services/Internal/Update/JournalUpdateService.php b/app/Services/Internal/Update/JournalUpdateService.php
index 4acf1d9242..671e0bcb4f 100644
--- a/app/Services/Internal/Update/JournalUpdateService.php
+++ b/app/Services/Internal/Update/JournalUpdateService.php
@@ -27,6 +27,7 @@ namespace FireflyIII\Services\Internal\Update;
use Carbon\Carbon;
use Carbon\Exceptions\InvalidDateException;
use Carbon\Exceptions\InvalidFormatException;
+use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Events\TriggeredAuditLog;
use FireflyIII\Exceptions\FireflyException;
@@ -723,14 +724,17 @@ class JournalUpdateService
// the correct fields to update in the destination transaction are NOT the foreign amount and currency
// but rather the normal amount and currency. This is new behavior.
$isTransfer = TransactionTypeEnum::TRANSFER->value === $this->transactionJournal->transactionType->type;
- if ($isTransfer) {
+ // also check if it is not between an asset account and a liability, because then the same rule applies.
+ $isBetween = $this->isBetweenAssetAndLiability();
+
+ if ($isTransfer || $isBetween) {
Log::debug('Switch amounts, store in amount and not foreign_amount');
$dest->transaction_currency_id = $foreignCurrency->id;
$dest->amount = app('steam')->positive($foreignAmount);
$dest->foreign_amount = app('steam')->positive($source->amount);
$dest->foreign_currency_id = $source->transaction_currency_id;
}
- if (!$isTransfer) {
+ if (!$isTransfer && !$isBetween) {
$dest->foreign_currency_id = $foreignCurrency->id;
$dest->foreign_amount = app('steam')->positive($foreignAmount);
}
@@ -768,4 +772,48 @@ class JournalUpdateService
$this->sourceTransaction->refresh();
$this->destinationTransaction->refresh();
}
+
+ private function isBetweenAssetAndLiability(): bool
+ {
+ /** @var Transaction $sourceTransaction */
+ $sourceTransaction = $this->transactionJournal->transactions()->where('amount', '<', 0)->first();
+
+ /** @var Transaction $destinationTransaction */
+ $destinationTransaction = $this->transactionJournal->transactions()->where('amount', '>', 0)->first();
+ if (null === $sourceTransaction || null === $destinationTransaction) {
+ Log::warning('Either transaction is false, stop.');
+
+ return false;
+ }
+ if (null === $sourceTransaction->foreign_amount || null === $destinationTransaction->foreign_amount) {
+ Log::warning('Either foreign amount is false, stop.');
+
+ return false;
+ }
+
+ $source = $sourceTransaction->account;
+ $destination = $destinationTransaction->account;
+
+ if (null === $source || null === $destination) {
+ Log::warning('Either is false, stop.');
+
+ return false;
+ }
+ $sourceTypes = [AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value];
+
+ // source is liability, destination is asset
+ if (in_array($source->accountType->type, $sourceTypes, true) && AccountTypeEnum::ASSET->value === $destination->accountType->type) {
+ Log::debug('Source is a liability account, destination is an asset account, return TRUE.');
+
+ return true;
+ }
+ // source is asset, destination is liability
+ if (in_array($destination->accountType->type, $sourceTypes, true) && AccountTypeEnum::ASSET->value === $source->accountType->type) {
+ Log::debug('Destination is a liability account, source is an asset account, return TRUE.');
+
+ return true;
+ }
+
+ return false;
+ }
}
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/Amount.php b/app/Support/Amount.php
index f01ab27085..7fc77c0229 100644
--- a/app/Support/Amount.php
+++ b/app/Support/Amount.php
@@ -48,6 +48,50 @@ class Amount
return $this->formatFlat($format->symbol, $format->decimal_places, $amount, $coloured);
}
+ /**
+ * 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.
+ *
+ * @throws FireflyException
+ */
+ public function formatFlat(string $symbol, int $decimalPlaces, string $amount, ?bool $coloured = null): string
+ {
+ $locale = app('steam')->getLocale();
+ $rounded = app('steam')->bcround($amount, $decimalPlaces);
+ $coloured ??= true;
+
+ $fmt = new \NumberFormatter($locale, \NumberFormatter::CURRENCY);
+ $fmt->setSymbol(\NumberFormatter::CURRENCY_SYMBOL, $symbol);
+ $fmt->setAttribute(\NumberFormatter::MIN_FRACTION_DIGITS, $decimalPlaces);
+ $fmt->setAttribute(\NumberFormatter::MAX_FRACTION_DIGITS, $decimalPlaces);
+ $result = (string) $fmt->format((float) $rounded); // intentional float
+
+ if (true === $coloured) {
+ if (1 === bccomp((string) $rounded, '0')) {
+ return sprintf('%s', $result);
+ }
+ if (-1 === bccomp((string) $rounded, '0')) {
+ return sprintf('%s', $result);
+ }
+
+ return sprintf('%s', $result);
+ }
+
+ return $result;
+ }
+
+ public function formatByCurrencyId(int $currencyId, string $amount, ?bool $coloured = null): string
+ {
+ $format = TransactionCurrency::find($currencyId);
+
+ return $this->formatFlat($format->symbol, $format->decimal_places, $amount, $coloured);
+ }
+
+ public function getAllCurrencies(): Collection
+ {
+ return TransactionCurrency::orderBy('code', 'ASC')->get();
+ }
+
/**
* 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.
@@ -79,90 +123,6 @@ class Amount
// 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.
- *
- * @throws FireflyException
- */
- public function formatFlat(string $symbol, int $decimalPlaces, string $amount, ?bool $coloured = null): string
- {
- $locale = app('steam')->getLocale();
- $rounded = app('steam')->bcround($amount, $decimalPlaces);
- $coloured ??= true;
-
- $fmt = new \NumberFormatter($locale, \NumberFormatter::CURRENCY);
- $fmt->setSymbol(\NumberFormatter::CURRENCY_SYMBOL, $symbol);
- $fmt->setAttribute(\NumberFormatter::MIN_FRACTION_DIGITS, $decimalPlaces);
- $fmt->setAttribute(\NumberFormatter::MAX_FRACTION_DIGITS, $decimalPlaces);
- $result = (string) $fmt->format((float) $rounded); // intentional float
-
- if (true === $coloured) {
- if (1 === bccomp($rounded, '0')) {
- return sprintf('%s', $result);
- }
- if (-1 === bccomp($rounded, '0')) {
- return sprintf('%s', $result);
- }
-
- return sprintf('%s', $result);
- }
-
- return $result;
- }
-
- public function formatByCurrencyId(int $currencyId, string $amount, ?bool $coloured = null): string
- {
- $format = TransactionCurrency::find($currencyId);
-
- return $this->formatFlat($format->symbol, $format->decimal_places, $amount, $coloured);
- }
-
- public function getAllCurrencies(): Collection
- {
- return TransactionCurrency::orderBy('code', 'ASC')->get();
- }
-
- 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();
- }
-
public function getNativeCurrency(): TransactionCurrency
{
if (auth()->check()) {
@@ -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 93c418ce69..f3e3c68d34 100644
--- a/app/Support/Authentication/RemoteUserGuard.php
+++ b/app/Support/Authentication/RemoteUserGuard.php
@@ -38,20 +38,18 @@ use Illuminate\Support\Facades\Log;
*/
class RemoteUserGuard implements Guard
{
- protected Application $application;
- protected UserProvider $provider;
- protected ?User $user;
+ protected Application $application;
+ 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 8a8ba020b7..2a95210a8c 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,7 +71,7 @@ class CacheProperties
}
$this->hash();
- return \Cache::has($this->hash);
+ return Cache::has($this->hash);
}
private function hash(): void
@@ -78,10 +79,10 @@ class CacheProperties
$content = '';
foreach ($this->properties as $property) {
try {
- $content .= json_encode($property, JSON_THROW_ON_ERROR);
- } catch (\JsonException $e) {
+ $content = sprintf('%s%s', $content, \Safe\json_encode($property, JSON_THROW_ON_ERROR));
+ } catch (\JsonException) {
// @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);
}
}
diff --git a/app/Support/Chart/Budget/FrontpageChartGenerator.php b/app/Support/Chart/Budget/FrontpageChartGenerator.php
index 530ffbd8c9..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 BudgetLimitRepositoryInterface $blRepository;
- private 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.
@@ -119,9 +119,9 @@ 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[1]['entries'][$title] = 0; // left to spend
- $data[2]['entries'][$title] = 0; // overspent
+ $data[0]['entries'][$title] = bcmul((string) $entry['sum'], '-1'); // spent
+ $data[1]['entries'][$title] = 0; // left to spend
+ $data[2]['entries'][$title] = 0; // overspent
}
return $data;
@@ -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..0142097f82 100644
--- a/app/Support/Chart/Category/FrontpageChartGenerator.php
+++ b/app/Support/Chart/Category/FrontpageChartGenerator.php
@@ -43,24 +43,20 @@ class FrontpageChartGenerator
{
use AugumentData;
+ public bool $convertToNative = false;
+ public TransactionCurrency $defaultCurrency;
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/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/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..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 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 $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;
public function __construct()
{
@@ -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/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 1f03ed2e5d..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 CurrencyRepositoryInterface $currencyRepository;
- private TransactionCurrency $default;
- private array $keys;
+ private const string SUM = 'sum';
+ private array $amounts = [];
+ private array $currencies;
+ private readonly CurrencyRepositoryInterface $currencyRepository;
+ private TransactionCurrency $default;
+ private array $keys;
public function __construct()
{
@@ -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 dc47cd4711..487446d6d1 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
@@ -109,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'];
@@ -151,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'];
@@ -167,6 +168,8 @@ 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);
@@ -195,24 +198,30 @@ trait AugumentData
/** @var BudgetLimit $entry */
foreach ($set as $entry) {
- $currency = $entry->transactionCurrency;
+ 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;
}
// 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';
+ $entry->native_spent = $spent;
- $expenses = $opsRepository->sumExpenses($currentStart, $currentEnd, null, $budgetCollection, $currency);
- $spent = $expenses[$currency->id]['sum'] ?? '0';
- $entry->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);
}
@@ -240,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;
@@ -278,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/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/PeriodOverview.php b/app/Support/Http/Controllers/PeriodOverview.php
index 79b4979029..8104d133e3 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)
@@ -124,31 +123,6 @@ trait PeriodOverview
return $entries;
}
- private function filterTransfers(string $direction, 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 ($date >= $start && $date <= $end) {
- if ('away' === $direction && -1 === bccomp($item['amount'], '0')) {
- $result[] = $item;
- unset($transactions[$index]);
- }
- if ('in' === $direction && 1 === bccomp($item['amount'], '0')) {
- $result[] = $item;
- unset($transactions[$index]);
- }
- }
- }
-
- return [$transactions, $result];
- }
-
private function filterTransactionsByType(TransactionTypeEnum $type, array $transactions, Carbon $start, Carbon $end): array
{
$result = [];
@@ -168,55 +142,29 @@ trait PeriodOverview
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
+ private function filterTransfers(string $direction, array $transactions, Carbon $start, Carbon $end): array
{
$result = [];
- /** @var array $journal */
- foreach ($array as $journal) {
- if ($journal['date'] <= $end && $journal['date'] >= $start) {
- $result[] = $journal;
+ /**
+ * @var int $index
+ * @var array $item
+ */
+ foreach ($transactions as $index => $item) {
+ $date = Carbon::parse($item['date']);
+ if ($date >= $start && $date <= $end) {
+ if ('away' === $direction && -1 === bccomp((string) $item['amount'], '0')) {
+ $result[] = $item;
+ unset($transactions[$index]);
+ }
+ if ('in' === $direction && 1 === bccomp((string) $item['amount'], '0')) {
+ $result[] = $item;
+ unset($transactions[$index]);
+ }
}
}
- 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;
+ return [$transactions, $result];
}
private function groupByCurrency(array $journals): array
@@ -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.
*
@@ -614,4 +579,38 @@ trait PeriodOverview
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/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/JsonApi/Enrichments/AccountEnrichment.php b/app/Support/JsonApi/Enrichments/AccountEnrichment.php
index bab93a794d..2de881736e 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,19 @@ 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;
+ private array $lastActivities;
public function __construct()
{
@@ -71,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);
@@ -102,6 +102,7 @@ class AccountEnrichment implements EnrichmentInterface
$this->getAccountTypes();
$this->collectMetaData();
$this->collectNotes();
+ $this->collectLastActivities();
$this->collectLocations();
$this->collectOpeningBalances();
$this->appendCollectedData();
@@ -109,16 +110,6 @@ class AccountEnrichment implements EnrichmentInterface
return $this->collection;
}
- private function getAccountTypes(): void
- {
- $types = AccountType::whereIn('id', $this->accountTypeIds)->get();
-
- /** @var AccountType $type */
- foreach ($types as $type) {
- $this->accountTypes[(int) $type->id] = $type->type;
- }
- }
-
private function collectAccountIds(): void
{
/** @var Account $account */
@@ -130,6 +121,109 @@ class AccountEnrichment implements EnrichmentInterface
$this->accountTypeIds = array_unique($this->accountTypeIds);
}
+ private function getAccountTypes(): void
+ {
+ $types = AccountType::whereIn('id', $this->accountTypeIds)->get();
+
+ /** @var AccountType $type */
+ foreach ($types as $type) {
+ $this->accountTypes[(int) $type->id] = $type->type;
+ }
+ }
+
+ 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));
+ }
+ }
+ }
+
+ 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
{
$accountTypes = $this->accountTypes;
@@ -138,7 +232,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,
@@ -173,107 +268,22 @@ class AccountEnrichment implements EnrichmentInterface
if (array_key_exists($item->id, $locations)) {
$accountMeta['location'] = $locations[$item->id];
}
+ if (array_key_exists($item->id, $lastActivities)) {
+ $accountMeta['last_activity'] = $lastActivities[$item->id];
+ }
$item->meta = $accountMeta;
return $item;
});
}
- 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
+ private function collectLastActivities(): 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)));
+ $this->lastActivities = Steam::getLastActivities($this->accountIds);
}
}
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 ff70a0ba5f..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 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/Models/AccountBalanceCalculator.php b/app/Support/Models/AccountBalanceCalculator.php
index 554936da51..21e9e8dc7f 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.
@@ -101,7 +102,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;
@@ -200,11 +201,11 @@ class AccountBalanceCalculator
Log::debug(__METHOD__);
$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);
}
}
diff --git a/app/Support/Models/BillDateCalculator.php b/app/Support/Models/BillDateCalculator.php
index f8b5e9f376..e20993de38 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..c17d7c5193 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/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/Report/Budget/BudgetReportGenerator.php b/app/Support/Report/Budget/BudgetReportGenerator.php
index 91c58b4b30..d8516bbc7b 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 BudgetLimitRepositoryInterface $blRepository;
- private Collection $budgets;
- private TransactionCurrency $currency;
- private Carbon $end;
- private NoBudgetRepositoryInterface $nbRepository;
- private OperationsRepositoryInterface $opsRepository;
- private array $report;
- private BudgetRepositoryInterface $repository;
- private Carbon $start;
+ private Collection $accounts;
+ private readonly BudgetLimitRepositoryInterface $blRepository;
+ private Collection $budgets;
+ private TransactionCurrency $currency;
+ private Carbon $end;
+ private readonly NoBudgetRepositoryInterface $nbRepository;
+ private readonly OperationsRepositoryInterface $opsRepository;
+ private array $report;
+ private readonly BudgetRepositoryInterface $repository;
+ private Carbon $start;
/**
* BudgetReportGenerator constructor.
@@ -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..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 NoCategoryRepositoryInterface $noCatRepository;
- private OperationsRepositoryInterface $opsRepository;
- private array $report;
- private Carbon $start;
+ private Collection $accounts;
+ private Carbon $end;
+ private readonly NoCategoryRepositoryInterface $noCatRepository;
+ private readonly OperationsRepositoryInterface $opsRepository;
+ private array $report;
+ private Carbon $start;
/**
* CategoryReportGenerator constructor.
@@ -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 27f5bc1cda..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)
{
@@ -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) {
@@ -117,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.
@@ -136,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));
}
}
@@ -161,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
@@ -200,7 +199,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)
@@ -218,10 +217,16 @@ 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
}
}
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/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 6511748619..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;
}
/**
@@ -89,7 +73,23 @@ 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));
+ }
+
+ 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;
}
/**
diff --git a/app/Support/Request/ConvertsDataTypes.php b/app/Support/Request/ConvertsDataTypes.php
index fd776c1e60..0e65fe7343 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);
}
@@ -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) {
@@ -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.
@@ -364,7 +376,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)));
}
@@ -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/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/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php
index 96cfbcd422..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;
- private AccountRepositoryInterface $accountRepository;
- private BillRepositoryInterface $billRepository;
- private BudgetRepositoryInterface $budgetRepository;
- private CategoryRepositoryInterface $categoryRepository;
- private GroupCollectorInterface $collector;
- private CurrencyRepositoryInterface $currencyRepository;
- private array $excludeTags;
- private array $includeAnyTags;
+ protected Carbon $date;
+ private readonly AccountRepositoryInterface $accountRepository;
+ private readonly BillRepositoryInterface $billRepository;
+ private readonly BudgetRepositoryInterface $budgetRepository;
+ private readonly CategoryRepositoryInterface $categoryRepository;
+ private GroupCollectorInterface $collector;
+ 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 int $page;
- private array $prohibitedWords;
- private float $startTime;
- private TagRepositoryInterface $tagRepository;
- private array $validOperators;
- private array $words;
+ private array $includeTags;
+ private array $invalidOperators;
+ private int $limit;
+ private readonly Collection $operators;
+ private int $page;
+ private array $prohibitedWords;
+ private readonly float $startTime;
+ private readonly TagRepositoryInterface $tagRepository;
+ private readonly array $validOperators;
+ 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
*/
@@ -149,7 +139,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 +167,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,18 +186,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)));
- }
- }
-
- private function handleNodeGroup(NodeGroup $node, bool $flipProhibitedFlag): void
- {
- $prohibited = $node->isProhibited($flipProhibitedFlag);
-
- foreach ($node->getNodes() as $subNode) {
- $this->handleSearchNode($subNode, $prohibited);
+ throw new FireflyException(sprintf('Firefly III search can\'t handle "%s"-nodes', $node::class));
}
}
@@ -2009,9 +1990,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 +2074,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 +2125,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,
@@ -2777,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;
@@ -2837,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/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 3685e8c281..aa802e0df0 100644
--- a/app/Support/Search/QueryParser/GdbotsQueryParser.php
+++ b/app/Support/Search/QueryParser/GdbotsQueryParser.php
@@ -26,14 +26,14 @@ 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
{
- private BaseQueryParser $parser;
+ private readonly BaseQueryParser $parser;
public function __construct()
{
@@ -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));
@@ -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/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/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/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/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/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 5d53d36515..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
@@ -139,7 +272,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 +285,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);
}
}
@@ -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 = preg_replace('/(\pM{2})\pM+/u', '\1', $string);
- $string = 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
@@ -434,12 +423,40 @@ 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;
}
+ 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
*/
@@ -549,8 +566,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;
@@ -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/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/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/AmountFormat.php b/app/Support/Twig/AmountFormat.php
index 9a70e1da0f..4cf3ac7b07 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 [
@@ -103,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.
*/
@@ -163,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 80383ec78f..96b7475dac 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']]
);
@@ -240,14 +179,15 @@ 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));
}
);
}
+ #[\Override]
public function getFunctions(): array
{
return [
@@ -271,9 +211,7 @@ class General extends AbstractExtension
{
return new TwigFunction(
'phpdate',
- static function (string $str): string {
- return date($str);
- }
+ static fn (string $str): string => 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..45e763da1b 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 73d1542a26..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 [
@@ -254,7 +255,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 +276,7 @@ class TransactionGroupTwig extends AbstractExtension
return '';
}
- return json_decode($entry->data, true);
+ return \Safe\json_decode($entry->data, true);
}
);
}
diff --git a/app/Support/Twig/Translation.php b/app/Support/Twig/Translation.php
index 706dd74221..7167ebb3a4 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..3823f7721f 100644
--- a/app/TransactionRules/Actions/AddTag.php
+++ b/app/TransactionRules/Actions/AddTag.php
@@ -36,15 +36,10 @@ use Illuminate\Support\Facades\DB;
*/
class AddTag implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 fba8df1a58..946c4c5def 100644
--- a/app/TransactionRules/Actions/AppendDescription.php
+++ b/app/TransactionRules/Actions/AppendDescription.php
@@ -37,15 +37,10 @@ class AppendDescription implements ActionInterface
{
use RefreshNotesTrait;
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 5ca9f9214f..952d27fd3a 100644
--- a/app/TransactionRules/Actions/AppendDescriptionToNotes.php
+++ b/app/TransactionRules/Actions/AppendDescriptionToNotes.php
@@ -39,15 +39,10 @@ class AppendDescriptionToNotes implements ActionInterface
{
use RefreshNotesTrait;
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 c3f06b8ada..c27853d8ed 100644
--- a/app/TransactionRules/Actions/AppendNotes.php
+++ b/app/TransactionRules/Actions/AppendNotes.php
@@ -37,15 +37,10 @@ class AppendNotes implements ActionInterface
{
use RefreshNotesTrait;
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 5d8c4584fb..86c46891b3 100644
--- a/app/TransactionRules/Actions/AppendNotesToDescription.php
+++ b/app/TransactionRules/Actions/AppendNotesToDescription.php
@@ -41,15 +41,10 @@ class AppendNotesToDescription implements ActionInterface
use ConvertsDataTypes;
use RefreshNotesTrait;
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 06275d4bc8..08e7dce7fa 100644
--- a/app/TransactionRules/Actions/ClearBudget.php
+++ b/app/TransactionRules/Actions/ClearBudget.php
@@ -34,15 +34,10 @@ use Illuminate\Support\Facades\DB;
*/
class ClearBudget implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 4831064c9b..73fa40b3f0 100644
--- a/app/TransactionRules/Actions/ClearCategory.php
+++ b/app/TransactionRules/Actions/ClearCategory.php
@@ -34,15 +34,10 @@ use Illuminate\Support\Facades\DB;
*/
class ClearCategory implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 0aa0d693df..48e770012b 100644
--- a/app/TransactionRules/Actions/ClearNotes.php
+++ b/app/TransactionRules/Actions/ClearNotes.php
@@ -35,15 +35,10 @@ use Illuminate\Support\Facades\DB;
*/
class ClearNotes implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 d7aa0dfeb0..b61599190d 100644
--- a/app/TransactionRules/Actions/ConvertToDeposit.php
+++ b/app/TransactionRules/Actions/ConvertToDeposit.php
@@ -43,15 +43,10 @@ use Illuminate\Support\Facades\DB;
*/
class ConvertToDeposit implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 a2f6e69317..ba613d795f 100644
--- a/app/TransactionRules/Actions/ConvertToTransfer.php
+++ b/app/TransactionRules/Actions/ConvertToTransfer.php
@@ -42,15 +42,10 @@ use Illuminate\Support\Facades\DB;
*/
class ConvertToTransfer implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 05ded624b6..61fba99de4 100644
--- a/app/TransactionRules/Actions/ConvertToWithdrawal.php
+++ b/app/TransactionRules/Actions/ConvertToWithdrawal.php
@@ -43,15 +43,10 @@ use Illuminate\Support\Facades\DB;
*/
class ConvertToWithdrawal implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 5863422fa3..fec4cb3ad4 100644
--- a/app/TransactionRules/Actions/DeleteTransaction.php
+++ b/app/TransactionRules/Actions/DeleteTransaction.php
@@ -35,15 +35,10 @@ use FireflyIII\Services\Internal\Destroy\TransactionGroupDestroyService;
*/
class DeleteTransaction implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 3e114846ac..b52f278442 100644
--- a/app/TransactionRules/Actions/LinkToBill.php
+++ b/app/TransactionRules/Actions/LinkToBill.php
@@ -37,15 +37,10 @@ use Illuminate\Support\Facades\DB;
*/
class LinkToBill implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 6dae68c34d..62711bf5e6 100644
--- a/app/TransactionRules/Actions/MoveDescriptionToNotes.php
+++ b/app/TransactionRules/Actions/MoveDescriptionToNotes.php
@@ -36,15 +36,10 @@ use FireflyIII\Models\TransactionJournal;
*/
class MoveDescriptionToNotes implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 108d3ce499..6852f5644b 100644
--- a/app/TransactionRules/Actions/MoveNotesToDescription.php
+++ b/app/TransactionRules/Actions/MoveNotesToDescription.php
@@ -42,15 +42,10 @@ class MoveNotesToDescription implements ActionInterface
{
use ConvertsDataTypes;
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 8e409b0ee3..37e888ca34 100644
--- a/app/TransactionRules/Actions/PrependDescription.php
+++ b/app/TransactionRules/Actions/PrependDescription.php
@@ -34,15 +34,10 @@ use Illuminate\Support\Facades\DB;
*/
class PrependDescription implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 12cdacf466..e4e8249c8b 100644
--- a/app/TransactionRules/Actions/PrependNotes.php
+++ b/app/TransactionRules/Actions/PrependNotes.php
@@ -34,15 +34,10 @@ use FireflyIII\Models\TransactionJournal;
*/
class PrependNotes implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 e53a11404f..cf5d7ee783 100644
--- a/app/TransactionRules/Actions/RemoveAllTags.php
+++ b/app/TransactionRules/Actions/RemoveAllTags.php
@@ -34,15 +34,10 @@ use Illuminate\Support\Facades\DB;
*/
class RemoveAllTags implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 451ed252d0..956835b2e3 100644
--- a/app/TransactionRules/Actions/RemoveTag.php
+++ b/app/TransactionRules/Actions/RemoveTag.php
@@ -35,15 +35,10 @@ use Illuminate\Support\Facades\DB;
*/
class RemoveTag implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 d08a2f78f4..c7c2e47518 100644
--- a/app/TransactionRules/Actions/SetAmount.php
+++ b/app/TransactionRules/Actions/SetAmount.php
@@ -35,15 +35,10 @@ class SetAmount implements ActionInterface
{
use RefreshNotesTrait;
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 cd80f7872b..54bb75902b 100644
--- a/app/TransactionRules/Actions/SetBudget.php
+++ b/app/TransactionRules/Actions/SetBudget.php
@@ -36,15 +36,10 @@ use Illuminate\Support\Facades\DB;
*/
class SetBudget implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 9f9321a928..c546dcad1a 100644
--- a/app/TransactionRules/Actions/SetCategory.php
+++ b/app/TransactionRules/Actions/SetCategory.php
@@ -36,15 +36,10 @@ use Illuminate\Support\Facades\DB;
*/
class SetCategory implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 805dcd96f0..cec857fc5a 100644
--- a/app/TransactionRules/Actions/SetDescription.php
+++ b/app/TransactionRules/Actions/SetDescription.php
@@ -36,15 +36,10 @@ class SetDescription implements ActionInterface
{
use RefreshNotesTrait;
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 810dcbaa3b..8140d1f9a8 100644
--- a/app/TransactionRules/Actions/SetDestinationAccount.php
+++ b/app/TransactionRules/Actions/SetDestinationAccount.php
@@ -39,16 +39,12 @@ use Illuminate\Support\Facades\DB;
*/
class SetDestinationAccount implements ActionInterface
{
- private RuleAction $action;
private AccountRepositoryInterface $repository;
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $action;
- }
+ public function __construct(private readonly RuleAction $action) {}
public function actOnArray(array $journal): bool
{
@@ -120,6 +116,18 @@ class SetDestinationAccount implements ActionInterface
if (TransactionTypeEnum::WITHDRAWAL->value === $type) {
$newAccount = $this->findWithdrawalDestinationAccount($accountName);
}
+ if (null === $newAccount) {
+ app('log')->error(
+ sprintf(
+ 'No destination account found for name "%s".',
+ $accountName
+ )
+ );
+
+ event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.no_destination', ['name' => $accountName])));
+
+ return false;
+ }
app('log')->debug(sprintf('New destination account is #%d ("%s").', $newAccount->id, $newAccount->name));
diff --git a/app/TransactionRules/Actions/SetDestinationToCashAccount.php b/app/TransactionRules/Actions/SetDestinationToCashAccount.php
index fe88ddc06e..967e07928d 100644
--- a/app/TransactionRules/Actions/SetDestinationToCashAccount.php
+++ b/app/TransactionRules/Actions/SetDestinationToCashAccount.php
@@ -39,15 +39,10 @@ use Illuminate\Support\Facades\DB;
*/
class SetDestinationToCashAccount implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 e8e3e92f2c..a3c144fa11 100644
--- a/app/TransactionRules/Actions/SetNotes.php
+++ b/app/TransactionRules/Actions/SetNotes.php
@@ -33,15 +33,10 @@ use FireflyIII\Models\TransactionJournal;
*/
class SetNotes implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 2c656a815b..340741cc81 100644
--- a/app/TransactionRules/Actions/SetSourceAccount.php
+++ b/app/TransactionRules/Actions/SetSourceAccount.php
@@ -39,16 +39,12 @@ use Illuminate\Support\Facades\DB;
*/
class SetSourceAccount implements ActionInterface
{
- private RuleAction $action;
private AccountRepositoryInterface $repository;
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 af618b44a8..bb83c36908 100644
--- a/app/TransactionRules/Actions/SetSourceToCashAccount.php
+++ b/app/TransactionRules/Actions/SetSourceToCashAccount.php
@@ -39,15 +39,10 @@ use Illuminate\Support\Facades\DB;
*/
class SetSourceToCashAccount implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 585a934281..e49ea4a19d 100644
--- a/app/TransactionRules/Actions/SwitchAccounts.php
+++ b/app/TransactionRules/Actions/SwitchAccounts.php
@@ -36,15 +36,10 @@ use FireflyIII\Models\TransactionJournal;
*/
class SwitchAccounts implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $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 4a4f00f35d..6b7113b6b2 100644
--- a/app/TransactionRules/Actions/UpdatePiggyBank.php
+++ b/app/TransactionRules/Actions/UpdatePiggyBank.php
@@ -37,15 +37,10 @@ use Illuminate\Support\Facades\Log;
class UpdatePiggyBank implements ActionInterface
{
- private RuleAction $action;
-
/**
* TriggerInterface constructor.
*/
- public function __construct(RuleAction $action)
- {
- $this->action = $action;
- }
+ public function __construct(private readonly RuleAction $action) {}
public function actOnArray(array $journal): bool
{
@@ -145,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);
@@ -213,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 fac43b1d59..385d8bdd14 100644
--- a/app/TransactionRules/Engine/SearchRuleEngine.php
+++ b/app/TransactionRules/Engine/SearchRuleEngine.php
@@ -44,12 +44,12 @@ use Illuminate\Support\Facades\Log;
*/
class SearchRuleEngine implements RuleEngineInterface
{
- private Collection $groups;
- private array $operators;
- private bool $refreshTriggers;
- private array $resultCount;
- private Collection $rules;
- private User $user;
+ private readonly Collection $groups;
+ private array $operators;
+ private bool $refreshTriggers;
+ private array $resultCount;
+ private readonly Collection $rules;
+ private User $user;
public function __construct()
{
@@ -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/TransactionRules/Expressions/ActionExpression.php b/app/TransactionRules/Expressions/ActionExpression.php
index fbabc1a3eb..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',
@@ -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..f1e2758d9f 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/AccountTransformer.php b/app/Transformers/AccountTransformer.php
index e48f0205b4..7a784ae774 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.
@@ -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',
@@ -201,7 +202,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/AttachmentTransformer.php b/app/Transformers/AttachmentTransformer.php
index 4bafc977a1..dba5661a7d 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.
@@ -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 6d8881482e..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 NoBudgetRepositoryInterface $noBudgetRepository;
- private OperationsRepositoryInterface $opsRepository;
- private BudgetRepositoryInterface $repository;
- private TransactionCurrency $default;
- private bool $convertToNative;
+ private readonly bool $convertToNative;
+ private readonly TransactionCurrency $default;
+ private readonly NoBudgetRepositoryInterface $noBudgetRepository;
+ private readonly OperationsRepositoryInterface $opsRepository;
+ private readonly BudgetRepositoryInterface $repository;
/**
* CurrencyTransformer constructor.
diff --git a/app/Transformers/BillTransformer.php b/app/Transformers/BillTransformer.php
index b19fd5615f..ec152568f8 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 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 504520916e..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 OperationsRepositoryInterface $opsRepository;
- private BudgetRepositoryInterface $repository;
- private bool $convertToNative;
- private TransactionCurrency $default;
+ 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 c60d80a3da..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 OperationsRepositoryInterface $opsRepository;
- private CategoryRepositoryInterface $repository;
- private TransactionCurrency $default;
- private bool $convertToNative;
+ private readonly bool $convertToNative;
+ private readonly TransactionCurrency $default;
+ private readonly OperationsRepositoryInterface $opsRepository;
+ private readonly CategoryRepositoryInterface $repository;
/**
* 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 8eecfbcf3e..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.
@@ -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/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..787c5e74a3 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.
@@ -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'],
@@ -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'],
@@ -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
*/
@@ -296,7 +290,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 +315,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,
@@ -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 175a6121c1..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.
@@ -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/BillTransformer.php b/app/Transformers/V2/BillTransformer.php
index e0a63cf4f2..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
}
@@ -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/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..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 = [];
@@ -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/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/AccountValidator.php b/app/Validation/AccountValidator.php
index 128f851a05..d6de97ed25 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.
@@ -305,7 +305,7 @@ class AccountValidator
return $first;
}
}
- app('log')->debug('Found nothing!');
+ app('log')->debug('Found nothing in findExistingAccount()');
return null;
}
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..86409ed951 100644
--- a/app/Validation/FireflyValidator.php
+++ b/app/Validation/FireflyValidator.php
@@ -104,13 +104,13 @@ 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;
}
$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'];
@@ -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;
}
@@ -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/app/Validation/TransactionValidation.php b/app/Validation/TransactionValidation.php
index 26cf199834..afae5b0e49 100644
--- a/app/Validation/TransactionValidation.php
+++ b/app/Validation/TransactionValidation.php
@@ -214,7 +214,7 @@ trait TransactionValidation
$destination = $accountValidator->destination;
Log::debug(sprintf('Source: #%d "%s (%s)"', $source->id, $source->name, $source->accountType->type));
- Log::debug(sprintf('Destination: #%d "%s" (%s)', $destination->id, $destination->name, $source->accountType->type));
+ Log::debug(sprintf('Destination: #%d "%s" (%s)', $destination->id, $destination->name, $destination->accountType->type));
if (!$this->isLiabilityOrAsset($source) || !$this->isLiabilityOrAsset($destination)) {
Log::debug('Any account must be liability or asset account to continue.');
@@ -233,16 +233,16 @@ trait TransactionValidation
return;
}
- Log::debug(sprintf('Source account expects %s', $sourceCurrency->code));
- Log::debug(sprintf('Destination account expects %s', $destinationCurrency->code));
+ Log::debug(sprintf('Source account expects #%d: %s', $sourceCurrency->id, $sourceCurrency->code));
+ Log::debug(sprintf('Destination account expects #%d: %s', $destinationCurrency->id, $destinationCurrency->code));
Log::debug(sprintf('Amount is %s', $transaction['amount']));
if (TransactionTypeEnum::DEPOSIT->value === ucfirst($transactionType)) {
Log::debug(sprintf('Processing as a "%s"', $transactionType));
// use case: deposit from liability account to an asset account
- // the foreign amount must be in the currency of the source
- // the amount must be in the currency of the destination
+ // the amount must be in the currency of the SOURCE
+ // the foreign amount must be in the currency of the DESTINATION
// no foreign currency information is present:
if (!$this->hasForeignCurrencyInfo($transaction)) {
@@ -255,7 +255,7 @@ trait TransactionValidation
$foreignCurrencyCode = $transaction['foreign_currency_code'] ?? false;
$foreignCurrencyId = (int) ($transaction['foreign_currency_id'] ?? 0);
Log::debug(sprintf('Foreign currency code seems to be #%d "%s"', $foreignCurrencyId, $foreignCurrencyCode), $transaction);
- if ($foreignCurrencyCode !== $sourceCurrency->code && $foreignCurrencyId !== $sourceCurrency->id) {
+ if ($foreignCurrencyCode !== $destinationCurrency->code && $foreignCurrencyId !== $destinationCurrency->id) {
$validator->errors()->add(sprintf('transactions.%d.foreign_currency_code', $index), (string) trans('validation.require_foreign_src'));
return;
@@ -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/changelog.md b/changelog.md
index 78e8c940df..d045b0d2cc 100644
--- a/changelog.md
+++ b/changelog.md
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
+## 6.2.13 - 2025-05-25
+
+### Fixed
+
+- [Issue 10114](https://github.com/firefly-iii/firefly-iii/issues/10114) (Budget for foreign currency not getting updated when a transaction refers to it) reported by @srikakulamts
+- [Issue 10180](https://github.com/firefly-iii/firefly-iii/issues/10180) (missing SPENT info) reported by @frank-bg
+- [Issue 10197](https://github.com/firefly-iii/firefly-iii/issues/10197) (Add rule number) reported by @gogoizzy
+- [PR 10203](https://github.com/firefly-iii/firefly-iii/pull/10203) (Fix Ukrainian language names) reported by @den-is
+- [Issue 10265](https://github.com/firefly-iii/firefly-iii/issues/10265) (Liabilities, foreign currencies have some issues (payment/exchange with native currency)) reported by @jgmm81
+- [Issue 10290](https://github.com/firefly-iii/firefly-iii/issues/10290) (edit multiple transactions individually ignores reconciled state) reported by @goebeler
+- [Issue 10302](https://github.com/firefly-iii/firefly-iii/issues/10302) (Attempt to read property "id" on null Error) reported by @XBadPlayerX
+- [Issue 10305](https://github.com/firefly-iii/firefly-iii/issues/10305) (The info icon used to display transactions is not clickable in the default financial reports "budgets by accounts"-section's sum column) reported by @goebeler
+- [Issue 10308](https://github.com/firefly-iii/firefly-iii/issues/10308) (Liabilities, with some details (payment/exchange with native currency)) reported by @jgmm81
+- [Issue 10320](https://github.com/firefly-iii/firefly-iii/issues/10320) (Button to update transaction keeps being disabled after correcting form errors) reported by @Astro1247
+- [Issue 10336](https://github.com/firefly-iii/firefly-iii/issues/10336) (New install recovering backup from 5.7.18 fails to run. ($param) must be of type int, string given in orrectsUnevenAmount.php) reported by @perezalvarezhi
+
## 6.2.12 - 2025-04-21
### Fixed
diff --git a/composer.json b/composer.json
index b2b00813bc..00bc69782e 100644
--- a/composer.json
+++ b/composer.json
@@ -81,16 +81,16 @@
"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",
"jc5/google2fa-laravel": "^2.0",
"jc5/recovery": "^2",
"laravel-notification-channels/pushover": "^4.0",
- "laravel/framework": "^11",
- "laravel/passport": "^12",
- "laravel/sanctum": "^4",
+ "laravel/framework": "^12",
+ "laravel/passport": "^13.0",
+ "laravel/sanctum": "^4.1",
"laravel/slack-notification-channel": "^3.3",
"laravel/ui": "^4.2",
"league/commonmark": "^2",
@@ -99,7 +99,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",
@@ -109,7 +109,7 @@
"symfony/expression-language": "^7.0",
"symfony/http-client": "^7.1",
"symfony/mailgun-mailer": "^7.1",
- "wijourdil/ntfy-notification-channel": "^3.0"
+ "thecodingmachine/safe": "^3.1"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.9",
@@ -123,7 +123,9 @@
"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"
},
"suggest": {},
"autoload": {
diff --git a/composer.lock b/composer.lock
index e86bb06ad5..a8bea46c45 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": "6f1ffe4fde89e06daca72732fa904917",
"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,26 +1656,27 @@
},
{
"name": "jc5/google2fa-laravel",
- "version": "v2.0.8",
+ "version": "2.0.10",
"source": {
"type": "git",
"url": "https://github.com/JC5/google2fa-laravel.git",
- "reference": "0205b0e58b90ee41e6d108d4c26ad9d0f7997baa"
+ "reference": "7b521b07c60786719d74c12c1d6306f5add0d998"
},
"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/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": {
@@ -1718,7 +1719,7 @@
},
{
"name": "James Cole",
- "email": "thegrumpydictator@gmail.com",
+ "email": "james@firefly-iii.org",
"role": "Developer"
}
],
@@ -1731,9 +1732,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.10"
},
- "time": "2022-03-30T16:00:00+00:00"
+ "time": "2025-05-05T04:27:12+00:00"
},
{
"name": "jc5/recovery",
@@ -1878,20 +1879,20 @@
},
{
"name": "laravel/framework",
- "version": "v11.44.2",
+ "version": "v12.15.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "f85216c82cbd38b66d67ebd20ea762cb3751a4b4"
+ "reference": "2ef7fb183f18e547af4eb9f5a55b2ac1011f0b77"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/f85216c82cbd38b66d67ebd20ea762cb3751a4b4",
- "reference": "f85216c82cbd38b66d67ebd20ea762cb3751a4b4",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/2ef7fb183f18e547af4eb9f5a55b2ac1011f0b77",
+ "reference": "2ef7fb183f18e547af4eb9f5a55b2ac1011f0b77",
"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/commonmark": "^2.7",
"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",
- "predis/predis": "^2.3",
+ "phpunit/phpunit": "^10.5.35|^11.5.3|^12.0.1",
+ "predis/predis": "^2.3|^3.0",
"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).",
- "predis/predis": "Required to use the predis connector (^2.3).",
+ "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|^3.0).",
"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,47 +2090,48 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
- "time": "2025-03-12T14:34:30+00:00"
+ "time": "2025-05-20T15:10:44+00:00"
},
{
"name": "laravel/passport",
- "version": "v12.4.2",
+ "version": "v13.0.1",
"source": {
"type": "git",
"url": "https://github.com/laravel/passport.git",
- "reference": "65a885607b62d361aedaeb10a946bc6b5a954262"
+ "reference": "d96323a1c3699efe51ca477c3dd8fdd6500d7997"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/passport/zipball/65a885607b62d361aedaeb10a946bc6b5a954262",
- "reference": "65a885607b62d361aedaeb10a946bc6b5a954262",
+ "url": "https://api.github.com/repos/laravel/passport/zipball/d96323a1c3699efe51ca477c3dd8fdd6500d7997",
+ "reference": "d96323a1c3699efe51ca477c3dd8fdd6500d7997",
"shasum": ""
},
"require": {
"ext-json": "*",
+ "ext-openssl": "*",
"firebase/php-jwt": "^6.4",
- "illuminate/auth": "^9.21|^10.0|^11.0|^12.0",
- "illuminate/console": "^9.21|^10.0|^11.0|^12.0",
- "illuminate/container": "^9.21|^10.0|^11.0|^12.0",
- "illuminate/contracts": "^9.21|^10.0|^11.0|^12.0",
- "illuminate/cookie": "^9.21|^10.0|^11.0|^12.0",
- "illuminate/database": "^9.21|^10.0|^11.0|^12.0",
- "illuminate/encryption": "^9.21|^10.0|^11.0|^12.0",
- "illuminate/http": "^9.21|^10.0|^11.0|^12.0",
- "illuminate/support": "^9.21|^10.0|^11.0|^12.0",
- "lcobucci/jwt": "^4.3|^5.0",
- "league/oauth2-server": "^8.5.3",
- "nyholm/psr7": "^1.5",
- "php": "^8.0",
- "phpseclib/phpseclib": "^2.0|^3.0",
- "symfony/console": "^6.0|^7.0",
- "symfony/psr-http-message-bridge": "^2.1|^6.0|^7.0"
+ "illuminate/auth": "^11.35|^12.0",
+ "illuminate/console": "^11.35|^12.0",
+ "illuminate/container": "^11.35|^12.0",
+ "illuminate/contracts": "^11.35|^12.0",
+ "illuminate/cookie": "^11.35|^12.0",
+ "illuminate/database": "^11.35|^12.0",
+ "illuminate/encryption": "^11.35|^12.0",
+ "illuminate/http": "^11.35|^12.0",
+ "illuminate/support": "^11.35|^12.0",
+ "league/oauth2-server": "^9.2",
+ "php": "^8.2",
+ "php-http/discovery": "^1.20",
+ "phpseclib/phpseclib": "^3.0",
+ "psr/http-factory-implementation": "*",
+ "symfony/console": "^7.1",
+ "symfony/psr-http-message-bridge": "^7.1"
},
"require-dev": {
- "mockery/mockery": "^1.0",
- "orchestra/testbench": "^7.35|^8.14|^9.0|^10.0",
- "phpstan/phpstan": "^1.10",
- "phpunit/phpunit": "^9.3|^10.5|^11.5"
+ "mockery/mockery": "^1.6",
+ "orchestra/testbench": "^9.9|^10.0",
+ "phpstan/phpstan": "^2.0",
+ "phpunit/phpunit": "^11.5|^12.0"
},
"type": "library",
"extra": {
@@ -2165,7 +2167,7 @@
"issues": "https://github.com/laravel/passport/issues",
"source": "https://github.com/laravel/passport"
},
- "time": "2025-02-12T16:11:33+00:00"
+ "time": "2025-05-07T17:16:06+00:00"
},
{
"name": "laravel/prompts",
@@ -2228,16 +2230,16 @@
},
{
"name": "laravel/sanctum",
- "version": "v4.0.8",
+ "version": "v4.1.1",
"source": {
"type": "git",
"url": "https://github.com/laravel/sanctum.git",
- "reference": "ec1dd9ddb2ab370f79dfe724a101856e0963f43c"
+ "reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/sanctum/zipball/ec1dd9ddb2ab370f79dfe724a101856e0963f43c",
- "reference": "ec1dd9ddb2ab370f79dfe724a101856e0963f43c",
+ "url": "https://api.github.com/repos/laravel/sanctum/zipball/a360a6a1fd2400ead4eb9b6a9c1bb272939194f5",
+ "reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5",
"shasum": ""
},
"require": {
@@ -2288,7 +2290,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-23T13:03:38+00:00"
},
{
"name": "laravel/serializable-closure",
@@ -2898,29 +2900,34 @@
},
{
"name": "league/event",
- "version": "2.3.0",
+ "version": "3.0.3",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/event.git",
- "reference": "062ebb450efbe9a09bc2478e89b7c933875b0935"
+ "reference": "ec38ff7ea10cad7d99a79ac937fbcffb9334c210"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/event/zipball/062ebb450efbe9a09bc2478e89b7c933875b0935",
- "reference": "062ebb450efbe9a09bc2478e89b7c933875b0935",
+ "url": "https://api.github.com/repos/thephpleague/event/zipball/ec38ff7ea10cad7d99a79ac937fbcffb9334c210",
+ "reference": "ec38ff7ea10cad7d99a79ac937fbcffb9334c210",
"shasum": ""
},
"require": {
- "php": ">=7.1.0"
+ "php": ">=7.2.0",
+ "psr/event-dispatcher": "^1.0"
+ },
+ "provide": {
+ "psr/event-dispatcher-implementation": "1.0"
},
"require-dev": {
- "henrikbjorn/phpspec-code-coverage": "~1.0.1",
- "phpspec/phpspec": "^2.2"
+ "friendsofphp/php-cs-fixer": "^2.16",
+ "phpstan/phpstan": "^0.12.45",
+ "phpunit/phpunit": "^8.5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.2-dev"
+ "dev-master": "3.0-dev"
}
},
"autoload": {
@@ -2946,9 +2953,9 @@
],
"support": {
"issues": "https://github.com/thephpleague/event/issues",
- "source": "https://github.com/thephpleague/event/tree/2.3.0"
+ "source": "https://github.com/thephpleague/event/tree/3.0.3"
},
- "time": "2025-03-14T19:51:10+00:00"
+ "time": "2024-09-04T16:06:53+00:00"
},
{
"name": "league/flysystem",
@@ -3210,38 +3217,46 @@
},
{
"name": "league/oauth2-server",
- "version": "8.5.5",
+ "version": "9.2.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/oauth2-server.git",
- "reference": "cc8778350f905667e796b3c2364a9d3bd7a73518"
+ "reference": "00323013403e1a1e0f424affafca56c28b60c22c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/cc8778350f905667e796b3c2364a9d3bd7a73518",
- "reference": "cc8778350f905667e796b3c2364a9d3bd7a73518",
+ "url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/00323013403e1a1e0f424affafca56c28b60c22c",
+ "reference": "00323013403e1a1e0f424affafca56c28b60c22c",
"shasum": ""
},
"require": {
- "defuse/php-encryption": "^2.3",
+ "defuse/php-encryption": "^2.4",
+ "ext-json": "*",
"ext-openssl": "*",
- "lcobucci/clock": "^2.2 || ^3.0",
- "lcobucci/jwt": "^4.3 || ^5.0",
- "league/event": "^2.2",
- "league/uri": "^6.7 || ^7.0",
- "php": "^8.0",
- "psr/http-message": "^1.0.1 || ^2.0"
+ "lcobucci/clock": "^2.3 || ^3.0",
+ "lcobucci/jwt": "^5.0",
+ "league/event": "^3.0",
+ "league/uri": "^7.0",
+ "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
+ "psr/http-message": "^2.0",
+ "psr/http-server-middleware": "^1.0"
},
"replace": {
"league/oauth2server": "*",
"lncd/oauth2": "*"
},
"require-dev": {
- "laminas/laminas-diactoros": "^3.0.0",
- "phpstan/phpstan": "^0.12.57",
- "phpstan/phpstan-phpunit": "^0.12.16",
- "phpunit/phpunit": "^9.6.6",
- "roave/security-advisories": "dev-master"
+ "laminas/laminas-diactoros": "^3.5",
+ "php-parallel-lint/php-parallel-lint": "^1.3.2",
+ "phpstan/extension-installer": "^1.3.1",
+ "phpstan/phpstan": "^1.12",
+ "phpstan/phpstan-deprecation-rules": "^1.1.4",
+ "phpstan/phpstan-phpunit": "^1.3.15",
+ "phpstan/phpstan-strict-rules": "^1.5.2",
+ "phpunit/phpunit": "^9.6.21",
+ "roave/security-advisories": "dev-master",
+ "slevomat/coding-standard": "^8.14.1",
+ "squizlabs/php_codesniffer": "^3.8"
},
"type": "library",
"autoload": {
@@ -3286,7 +3301,7 @@
],
"support": {
"issues": "https://github.com/thephpleague/oauth2-server/issues",
- "source": "https://github.com/thephpleague/oauth2-server/tree/8.5.5"
+ "source": "https://github.com/thephpleague/oauth2-server/tree/9.2.0"
},
"funding": [
{
@@ -3294,7 +3309,7 @@
"type": "github"
}
],
- "time": "2024-12-20T23:06:10+00:00"
+ "time": "2025-02-15T00:49:10+00:00"
},
{
"name": "league/uri",
@@ -3711,16 +3726,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 +3828,7 @@
"type": "tidelift"
}
],
- "time": "2025-03-27T12:57:33+00:00"
+ "time": "2025-05-01T19:51:51+00:00"
},
{
"name": "nette/schema",
@@ -4064,31 +4079,31 @@
},
{
"name": "nunomaduro/termwind",
- "version": "v2.3.0",
+ "version": "v2.3.1",
"source": {
"type": "git",
"url": "https://github.com/nunomaduro/termwind.git",
- "reference": "52915afe6a1044e8b9cee1bcff836fb63acf9cda"
+ "reference": "dfa08f390e509967a15c22493dc0bac5733d9123"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/52915afe6a1044e8b9cee1bcff836fb63acf9cda",
- "reference": "52915afe6a1044e8b9cee1bcff836fb63acf9cda",
+ "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/dfa08f390e509967a15c22493dc0bac5733d9123",
+ "reference": "dfa08f390e509967a15c22493dc0bac5733d9123",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": "^8.2",
- "symfony/console": "^7.1.8"
+ "symfony/console": "^7.2.6"
},
"require-dev": {
- "illuminate/console": "^11.33.2",
- "laravel/pint": "^1.18.2",
+ "illuminate/console": "^11.44.7",
+ "laravel/pint": "^1.22.0",
"mockery/mockery": "^1.6.12",
- "pestphp/pest": "^2.36.0",
- "phpstan/phpstan": "^1.12.11",
- "phpstan/phpstan-strict-rules": "^1.6.1",
- "symfony/var-dumper": "^7.1.8",
+ "pestphp/pest": "^2.36.0 || ^3.8.2",
+ "phpstan/phpstan": "^1.12.25",
+ "phpstan/phpstan-strict-rules": "^1.6.2",
+ "symfony/var-dumper": "^7.2.6",
"thecodingmachine/phpstan-strict-rules": "^1.0.0"
},
"type": "library",
@@ -4131,7 +4146,7 @@
],
"support": {
"issues": "https://github.com/nunomaduro/termwind/issues",
- "source": "https://github.com/nunomaduro/termwind/tree/v2.3.0"
+ "source": "https://github.com/nunomaduro/termwind/tree/v2.3.1"
},
"funding": [
{
@@ -4147,7 +4162,7 @@
"type": "github"
}
],
- "time": "2024-11-21T10:39:51+00:00"
+ "time": "2025-05-08T08:14:37+00:00"
},
{
"name": "nyholm/psr7",
@@ -4968,26 +4983,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 +5044,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,25 +5117,27 @@
},
{
"name": "predis/predis",
- "version": "v2.3.0",
+ "version": "v3.0.1",
"source": {
"type": "git",
"url": "https://github.com/predis/predis.git",
- "reference": "bac46bfdb78cd6e9c7926c697012aae740cb9ec9"
+ "reference": "34fb0a7da0330df1bab4280fcac4afdeeccc3edf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/predis/predis/zipball/bac46bfdb78cd6e9c7926c697012aae740cb9ec9",
- "reference": "bac46bfdb78cd6e9c7926c697012aae740cb9ec9",
+ "url": "https://api.github.com/repos/predis/predis/zipball/34fb0a7da0330df1bab4280fcac4afdeeccc3edf",
+ "reference": "34fb0a7da0330df1bab4280fcac4afdeeccc3edf",
"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/phpunit": "^8.0 || ^9.4"
+ "phpunit/phpcov": "^6.0 || ^8.0",
+ "phpunit/phpunit": "^8.0 || ~9.4.4"
},
"suggest": {
"ext-relay": "Faster connection with in-memory caching (>=0.6.2)"
@@ -5137,7 +5159,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 +5168,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/v3.0.1"
},
"funding": [
{
@@ -5154,7 +5176,7 @@
"type": "github"
}
],
- "time": "2024-11-21T20:00:02+00:00"
+ "time": "2025-05-16T18:30:32+00:00"
},
{
"name": "psr/cache",
@@ -5516,6 +5538,119 @@
},
"time": "2023-04-04T09:54:51+00:00"
},
+ {
+ "name": "psr/http-server-handler",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-server-handler.git",
+ "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/84c4fb66179be4caaf8e97bd239203245302e7d4",
+ "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.0",
+ "psr/http-message": "^1.0 || ^2.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Server\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for HTTP server-side request handler",
+ "keywords": [
+ "handler",
+ "http",
+ "http-interop",
+ "psr",
+ "psr-15",
+ "psr-7",
+ "request",
+ "response",
+ "server"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/http-server-handler/tree/1.0.2"
+ },
+ "time": "2023-04-10T20:06:20+00:00"
+ },
+ {
+ "name": "psr/http-server-middleware",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-server-middleware.git",
+ "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/c1481f747daaa6a0782775cd6a8c26a1bf4a3829",
+ "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.0",
+ "psr/http-message": "^1.0 || ^2.0",
+ "psr/http-server-handler": "^1.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Server\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for HTTP server-side middleware",
+ "keywords": [
+ "http",
+ "http-interop",
+ "middleware",
+ "psr",
+ "psr-15",
+ "psr-7",
+ "request",
+ "response"
+ ],
+ "support": {
+ "issues": "https://github.com/php-fig/http-server-middleware/issues",
+ "source": "https://github.com/php-fig/http-server-middleware/tree/1.0.2"
+ },
+ "time": "2023-04-11T06:14:47+00:00"
+ },
{
"name": "psr/log",
"version": "3.0.2",
@@ -5903,16 +6038,16 @@
},
{
"name": "spatie/backtrace",
- "version": "1.7.1",
+ "version": "1.7.4",
"source": {
"type": "git",
"url": "https://github.com/spatie/backtrace.git",
- "reference": "0f2477c520e3729de58e061b8192f161c99f770b"
+ "reference": "cd37a49fce7137359ac30ecc44ef3e16404cccbe"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/spatie/backtrace/zipball/0f2477c520e3729de58e061b8192f161c99f770b",
- "reference": "0f2477c520e3729de58e061b8192f161c99f770b",
+ "url": "https://api.github.com/repos/spatie/backtrace/zipball/cd37a49fce7137359ac30ecc44ef3e16404cccbe",
+ "reference": "cd37a49fce7137359ac30ecc44ef3e16404cccbe",
"shasum": ""
},
"require": {
@@ -5950,7 +6085,7 @@
"spatie"
],
"support": {
- "source": "https://github.com/spatie/backtrace/tree/1.7.1"
+ "source": "https://github.com/spatie/backtrace/tree/1.7.4"
},
"funding": [
{
@@ -5962,7 +6097,7 @@
"type": "other"
}
],
- "time": "2024-12-02T13:28:15+00:00"
+ "time": "2025-05-08T15:41:09+00:00"
},
{
"name": "spatie/error-solutions",
@@ -6359,67 +6494,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",
@@ -6476,16 +6550,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 +6628,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 +6644,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 +6798,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 +6871,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 +6887,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 +7555,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 +7613,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 +7629,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 +7727,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 +7743,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 +7807,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 +7823,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 +7896,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 +7960,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 +7976,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 +8047,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 +8106,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 +8126,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 +8184,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 +8204,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 +8267,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 +8283,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 +8348,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 +8368,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 +8429,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,7 +8445,7 @@
"type": "tidelift"
}
],
- "time": "2024-09-09T11:45:10+00:00"
+ "time": "2024-12-23T08:48:59+00:00"
},
{
"name": "symfony/polyfill-php80",
@@ -8454,7 +8529,7 @@
},
{
"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 +8585,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 +8605,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 +8664,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 +8992,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 +9059,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 +9075,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 +9154,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 +9170,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 +9326,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 +9389,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 +9405,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 +9465,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,50 +9481,35 @@
"type": "tidelift"
}
],
- "time": "2025-03-13T12:21:46+00:00"
+ "time": "2025-05-02T08:36:00+00:00"
},
{
"name": "thecodingmachine/safe",
- "version": "v2.5.0",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/thecodingmachine/safe.git",
- "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0"
+ "reference": "2cdd579eeaa2e78e51c7509b50cc9fb89a956236"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/3115ecd6b4391662b4931daac4eba6b07a2ac1f0",
- "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0",
+ "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/2cdd579eeaa2e78e51c7509b50cc9fb89a956236",
+ "reference": "2cdd579eeaa2e78e51c7509b50cc9fb89a956236",
"shasum": ""
},
"require": {
- "php": "^8.0"
+ "php": "^8.1"
},
"require-dev": {
- "phpstan/phpstan": "^1.5",
- "phpunit/phpunit": "^9.5",
- "squizlabs/php_codesniffer": "^3.2",
- "thecodingmachine/phpstan-strict-rules": "^1.0"
+ "php-parallel-lint/php-parallel-lint": "^1.4",
+ "phpstan/phpstan": "^2",
+ "phpunit/phpunit": "^10",
+ "squizlabs/php_codesniffer": "^3.2"
},
"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",
@@ -9489,6 +9549,7 @@
"generated/mbstring.php",
"generated/misc.php",
"generated/mysql.php",
+ "generated/mysqli.php",
"generated/network.php",
"generated/oci8.php",
"generated/opcache.php",
@@ -9501,6 +9562,7 @@
"generated/ps.php",
"generated/pspell.php",
"generated/readline.php",
+ "generated/rnp.php",
"generated/rpminfo.php",
"generated/rrd.php",
"generated/sem.php",
@@ -9532,7 +9594,6 @@
"lib/DateTime.php",
"lib/DateTimeImmutable.php",
"lib/Exceptions/",
- "deprecated/Exceptions/",
"generated/Exceptions/"
]
},
@@ -9543,9 +9604,23 @@
"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"
+ "source": "https://github.com/thecodingmachine/safe/tree/v3.3.0"
},
- "time": "2023-04-05T11:54:14+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/OskarStark",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/shish",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/staabm",
+ "type": "github"
+ }
+ ],
+ "time": "2025-05-14T06:15:44+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
@@ -9604,16 +9679,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 +9742,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,74 +9754,20 @@
"type": "tidelift"
}
],
- "time": "2025-02-13T08:34:43+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"
+ "time": "2025-05-03T07:21:55+00:00"
},
{
"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 +9826,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 +9838,7 @@
"type": "tidelift"
}
],
- "time": "2024-07-20T21:52:34+00:00"
+ "time": "2025-04-30T23:37:27+00:00"
},
{
"name": "voku/portable-ascii",
@@ -9950,81 +9971,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": [
@@ -10534,20 +10480,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 +10501,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 +10525,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",
@@ -10626,16 +10572,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 +10598,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 +10634,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 +10649,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",
@@ -10871,16 +10809,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": {
@@ -10919,7 +10857,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": [
{
@@ -10927,7 +10865,7 @@
"type": "tidelift"
}
],
- "time": "2025-02-12T12:17:51+00:00"
+ "time": "2025-04-29T12:36:36+00:00"
},
{
"name": "nikic/php-parser",
@@ -11225,16 +11163,16 @@
},
{
"name": "phpstan/phpstan",
- "version": "2.1.12",
+ "version": "2.1.17",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
- "reference": "96dde49e967c0c22812bcfa7bda4ff82c09f3b0c"
+ "reference": "89b5ef665716fa2a52ecd2633f21007a6a349053"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/96dde49e967c0c22812bcfa7bda4ff82c09f3b0c",
- "reference": "96dde49e967c0c22812bcfa7bda4ff82c09f3b0c",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/89b5ef665716fa2a52ecd2633f21007a6a349053",
+ "reference": "89b5ef665716fa2a52ecd2633f21007a6a349053",
"shasum": ""
},
"require": {
@@ -11279,25 +11217,25 @@
"type": "github"
}
],
- "time": "2025-04-16T13:19:18+00:00"
+ "time": "2025-05-21T20:55:28+00:00"
},
{
"name": "phpstan/phpstan-deprecation-rules",
- "version": "2.0.1",
+ "version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-deprecation-rules.git",
- "reference": "1cc1259cb91ee4cfbb5c39bca9f635f067c910b4"
+ "reference": "468e02c9176891cc901143da118f09dc9505fc2f"
},
"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/468e02c9176891cc901143da118f09dc9505fc2f",
+ "reference": "468e02c9176891cc901143da118f09dc9505fc2f",
"shasum": ""
},
"require": {
"php": "^7.4 || ^8.0",
- "phpstan/phpstan": "^2.0"
+ "phpstan/phpstan": "^2.1.15"
},
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.2",
@@ -11324,9 +11262,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.3"
},
- "time": "2024-11-28T21:56:36+00:00"
+ "time": "2025-05-14T10:56:57+00:00"
},
{
"name": "phpstan/phpstan-strict-rules",
@@ -11378,16 +11316,16 @@
},
{
"name": "phpunit/php-code-coverage",
- "version": "11.0.9",
+ "version": "12.3.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "14d63fbcca18457e49c6f8bebaa91a87e8e188d7"
+ "reference": "9075a8efc66e11bc55c319062e147bdb06777267"
},
"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/9075a8efc66e11bc55c319062e147bdb06777267",
+ "reference": "9075a8efc66e11bc55c319062e147bdb06777267",
"shasum": ""
},
"require": {
@@ -11395,18 +11333,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",
@@ -11415,7 +11352,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "11.0.x-dev"
+ "dev-main": "12.3.x-dev"
}
},
"autoload": {
@@ -11444,40 +11381,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.3.0"
},
"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-23T15:49:03+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": {
@@ -11505,7 +11454,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": [
{
@@ -11513,28 +11462,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": "*"
@@ -11542,7 +11491,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "5.0-dev"
+ "dev-main": "6.0-dev"
}
},
"autoload": {
@@ -11569,7 +11518,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": [
{
@@ -11577,32 +11526,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": {
@@ -11629,7 +11578,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": [
{
@@ -11637,32 +11586,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": {
@@ -11689,7 +11638,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": [
{
@@ -11697,20 +11646,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.17",
+ "version": "12.1.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "fd2e863a2995cdfd864fb514b5e0b28b09895b5c"
+ "reference": "2fdf0056c673c8f0f1eed00030be5f8243c1e6e0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fd2e863a2995cdfd864fb514b5e0b28b09895b5c",
- "reference": "fd2e863a2995cdfd864fb514b5e0b28b09895b5c",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2fdf0056c673c8f0f1eed00030be5f8243c1e6e0",
+ "reference": "2fdf0056c673c8f0f1eed00030be5f8243c1e6e0",
"shasum": ""
},
"require": {
@@ -11720,37 +11669,33 @@
"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",
- "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.2.1",
+ "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.1",
+ "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": {
@@ -11782,7 +11727,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/12.1.6"
},
"funding": [
{
@@ -11793,37 +11738,104 @@
"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-05-21T12:36:31+00:00"
},
{
- "name": "sebastian/cli-parser",
- "version": "3.0.2",
+ "name": "rector/rector",
+ "version": "2.0.16",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/cli-parser.git",
- "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180"
+ "url": "https://github.com/rectorphp/rector.git",
+ "reference": "f1366d1f8c7490541c8f7af6e5c7cef7cca1b5a2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/15c5dd40dc4f38794d383bb95465193f5e0ae180",
- "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180",
+ "url": "https://api.github.com/repos/rectorphp/rector/zipball/f1366d1f8c7490541c8f7af6e5c7cef7cca1b5a2",
+ "reference": "f1366d1f8c7490541c8f7af6e5c7cef7cca1b5a2",
"shasum": ""
},
"require": {
- "php": ">=8.2"
+ "php": "^7.4|^8.0",
+ "phpstan/phpstan": "^2.1.14"
+ },
+ "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.16"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/tomasvotruba",
+ "type": "github"
+ }
+ ],
+ "time": "2025-05-12T16:37:16+00:00"
+ },
+ {
+ "name": "sebastian/cli-parser",
+ "version": "4.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/cli-parser.git",
+ "reference": "6d584c727d9114bcdc14c86711cd1cad51778e7c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/6d584c727d9114bcdc14c86711cd1cad51778e7c",
+ "reference": "6d584c727d9114bcdc14c86711cd1cad51778e7c",
+ "shasum": ""
+ },
+ "require": {
+ "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": {
@@ -11847,7 +11859,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": [
{
@@ -11855,144 +11867,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"
@@ -12000,7 +11899,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "6.3-dev"
+ "dev-main": "7.0-dev"
}
},
"autoload": {
@@ -12040,7 +11939,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": [
{
@@ -12048,33 +11947,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": {
@@ -12098,7 +11997,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": [
{
@@ -12106,33 +12005,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": {
@@ -12165,7 +12064,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": [
{
@@ -12173,27 +12072,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.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5"
+ "reference": "d364b9e5d0d3b18a2573351a1786fbf96b7e0792"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5",
- "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d364b9e5d0d3b18a2573351a1786fbf96b7e0792",
+ "reference": "d364b9e5d0d3b18a2573351a1786fbf96b7e0792",
"shasum": ""
},
"require": {
- "php": ">=8.2"
+ "php": ">=8.3"
},
"require-dev": {
- "phpunit/phpunit": "^11.0"
+ "phpunit/phpunit": "^12.0"
},
"suggest": {
"ext-posix": "*"
@@ -12201,7 +12100,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "7.2-dev"
+ "dev-main": "8.0-dev"
}
},
"autoload": {
@@ -12229,42 +12128,54 @@
"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.2"
},
"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/sebastian/environment",
+ "type": "tidelift"
}
],
- "time": "2024-07-03T04:54:44+00:00"
+ "time": "2025-05-21T15:05:44+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": {
@@ -12307,7 +12218,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": [
{
@@ -12315,35 +12226,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": {
@@ -12369,7 +12280,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": [
{
@@ -12377,33 +12288,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": {
@@ -12427,7 +12338,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": [
{
@@ -12435,34 +12346,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": {
@@ -12485,7 +12396,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": [
{
@@ -12493,32 +12404,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": {
@@ -12541,7 +12452,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": [
{
@@ -12549,32 +12460,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": {
@@ -12605,7 +12516,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": [
{
@@ -12613,32 +12524,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": {
@@ -12662,7 +12573,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": [
{
@@ -12670,29 +12581,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": {
@@ -12716,7 +12627,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": [
{
@@ -12724,7 +12635,7 @@
"type": "github"
}
],
- "time": "2024-10-09T05:16:32+00:00"
+ "time": "2025-02-07T05:00:38+00:00"
},
{
"name": "staabm/side-effects-detector",
@@ -12778,6 +12689,64 @@
],
"time": "2024-10-20T05:08:20+00:00"
},
+ {
+ "name": "thecodingmachine/phpstan-safe-rule",
+ "version": "v1.4.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/thecodingmachine/phpstan-safe-rule.git",
+ "reference": "5f9795eae8891dffa475965463a4281633651768"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/thecodingmachine/phpstan-safe-rule/zipball/5f9795eae8891dffa475965463a4281633651768",
+ "reference": "5f9795eae8891dffa475965463a4281633651768",
+ "shasum": ""
+ },
+ "require": {
+ "nikic/php-parser": "^5",
+ "php": "^8.1",
+ "phpstan/phpstan": "^2.1.11",
+ "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.1"
+ },
+ "time": "2025-04-09T20:30:35+00:00"
+ },
{
"name": "theseer/tokenizer",
"version": "1.2.3",
@@ -12831,7 +12800,7 @@
],
"aliases": [],
"minimum-stability": "stable",
- "stability-flags": [],
+ "stability-flags": {},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
@@ -12852,6 +12821,6 @@
"ext-xml": "*",
"ext-xmlwriter": "*"
},
- "platform-dev": [],
- "plugin-api-version": "2.3.0"
+ "platform-dev": {},
+ "plugin-api-version": "2.6.0"
}
diff --git a/config/broadcasting.php b/config/broadcasting.php
index a7949f03ad..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' => 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/firefly.php b/config/firefly.php
index e16d645d92..d53cd6cfdb 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' => '6.2.13',
'api_version' => '2.1.0', // field is no longer used.
'db_version' => 25,
@@ -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'],
diff --git a/config/ide-helper.php b/config/ide-helper.php
index 1ec85c18d8..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', 'Illuminate\Database\Query\Builder'],
- 'Session' => ['Illuminate\Session\Store'],
+ 'Eloquent' => [Builder::class, Illuminate\Database\Query\Builder::class],
+ 'Session' => [Store::class],
],
'magic' => [
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/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],
diff --git a/package-lock.json b/package-lock.json
index ad049fa676..977088f92a 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.2",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.27.2.tgz",
+ "integrity": "sha512-TUtMJYRPyUb/9aU8f3K0mjmjf6M9N5Woshn2CS6nqJSeJtTtQcpLUXjGt9vbF8ZGff0El99sWkLgzwW3VXnxZQ==",
"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.2",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz",
+ "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@babel/compat-data": "^7.26.8",
- "@babel/helper-validator-option": "^7.25.9",
+ "@babel/compat-data": "^7.27.2",
+ "@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.2",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.2.tgz",
+ "integrity": "sha512-QYLs8299NA7WM/bZAdp+CviYYkVoYXlDW2rzliy3chxd1PQjej7JORuMJDJXJUb9g0TT+B99EwaVLKmX+sPXWw==",
"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,16 @@
}
},
"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.2",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.27.2.tgz",
+ "integrity": "sha512-AIUHD7xJ1mCrj3uPozvtngY3s0xpv7Nu7DoUSnzNY6Xam1Cy4rUznR//pvMHOhQ4AvbCexhbqXCtpxGHOGOO6g==",
"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.2",
+ "@babel/helper-plugin-utils": "^7.27.1",
+ "@babel/plugin-transform-destructuring": "^7.27.1",
+ "@babel/plugin-transform-parameters": "^7.27.1"
},
"engines": {
"node": ">=6.9.0"
@@ -1137,14 +1138,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 +1155,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 +1171,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 +1188,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 +1204,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 +1221,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 +1239,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 +1255,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 +1271,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 +1288,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 +1304,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 +1335,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 +1351,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 +1368,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 +1384,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 +1400,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 +1416,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 +1432,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 +1449,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 +1466,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 +1483,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.2",
+ "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.27.2.tgz",
+ "integrity": "sha512-Ma4zSuYSlGNRlCLO+EAzLnCmJK2vdstgv+n7aUP+/IKZrOfWHOJVdSJtuub8RzHTj3ahD37k5OKJWvzf16TQyQ==",
"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.2",
+ "@babel/helper-compilation-targets": "^7.27.2",
+ "@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.2",
+ "@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 +1592,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.2",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz",
+ "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==",
"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.2",
+ "@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 +1635,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 +1670,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.4.tgz",
+ "integrity": "sha512-1VCICWypeQKhVbE9oW/sJaAmjLxhVqacdkvPLEjwlttjfwENRSClS8EjBz0KzRyFSCPDIkuXW34Je/vk7zdB7Q==",
"cpu": [
"ppc64"
],
@@ -1690,9 +1687,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.4.tgz",
+ "integrity": "sha512-QNdQEps7DfFwE3hXiU4BZeOV68HHzYwGd0Nthhd3uCkkEKK7/R6MTgM0P7H7FAs5pU/DIWsviMmEGxEoxIZ+ZQ==",
"cpu": [
"arm"
],
@@ -1707,9 +1704,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.4.tgz",
+ "integrity": "sha512-bBy69pgfhMGtCnwpC/x5QhfxAz/cBgQ9enbtwjf6V9lnPI/hMyT9iWpR1arm0l3kttTr4L0KSLpKmLp/ilKS9A==",
"cpu": [
"arm64"
],
@@ -1724,9 +1721,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.4.tgz",
+ "integrity": "sha512-TVhdVtQIFuVpIIR282btcGC2oGQoSfZfmBdTip2anCaVYcqWlZXGcdcKIUklfX2wj0JklNYgz39OBqh2cqXvcQ==",
"cpu": [
"x64"
],
@@ -1741,9 +1738,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.4.tgz",
+ "integrity": "sha512-Y1giCfM4nlHDWEfSckMzeWNdQS31BQGs9/rouw6Ub91tkK79aIMTH3q9xHvzH8d0wDru5Ci0kWB8b3up/nl16g==",
"cpu": [
"arm64"
],
@@ -1758,9 +1755,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.4.tgz",
+ "integrity": "sha512-CJsry8ZGM5VFVeyUYB3cdKpd/H69PYez4eJh1W/t38vzutdjEjtP7hB6eLKBoOdxcAlCtEYHzQ/PJ/oU9I4u0A==",
"cpu": [
"x64"
],
@@ -1775,9 +1772,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.4.tgz",
+ "integrity": "sha512-yYq+39NlTRzU2XmoPW4l5Ifpl9fqSk0nAJYM/V/WUGPEFfek1epLHJIkTQM6bBs1swApjO5nWgvr843g6TjxuQ==",
"cpu": [
"arm64"
],
@@ -1792,9 +1789,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.4.tgz",
+ "integrity": "sha512-0FgvOJ6UUMflsHSPLzdfDnnBBVoCDtBTVyn/MrWloUNvq/5SFmh13l3dvgRPkDihRxb77Y17MbqbCAa2strMQQ==",
"cpu": [
"x64"
],
@@ -1809,9 +1806,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.4.tgz",
+ "integrity": "sha512-kro4c0P85GMfFYqW4TWOpvmF8rFShbWGnrLqlzp4X1TNWjRY3JMYUfDCtOxPKOIY8B0WC8HN51hGP4I4hz4AaQ==",
"cpu": [
"arm"
],
@@ -1826,9 +1823,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.4.tgz",
+ "integrity": "sha512-+89UsQTfXdmjIvZS6nUnOOLoXnkUTB9hR5QAeLrQdzOSWZvNSAXAtcRDHWtqAUtAmv7ZM1WPOOeSxDzzzMogiQ==",
"cpu": [
"arm64"
],
@@ -1843,9 +1840,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.4.tgz",
+ "integrity": "sha512-yTEjoapy8UP3rv8dB0ip3AfMpRbyhSN3+hY8mo/i4QXFeDxmiYbEKp3ZRjBKcOP862Ua4b1PDfwlvbuwY7hIGQ==",
"cpu": [
"ia32"
],
@@ -1860,9 +1857,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.4.tgz",
+ "integrity": "sha512-NeqqYkrcGzFwi6CGRGNMOjWGGSYOpqwCjS9fvaUlX5s3zwOtn1qwg1s2iE2svBe4Q/YOG1q6875lcAoQK/F4VA==",
"cpu": [
"loong64"
],
@@ -1877,9 +1874,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.4.tgz",
+ "integrity": "sha512-IcvTlF9dtLrfL/M8WgNI/qJYBENP3ekgsHbYUIzEzq5XJzzVEV/fXY9WFPfEEXmu3ck2qJP8LG/p3Q8f7Zc2Xg==",
"cpu": [
"mips64el"
],
@@ -1894,9 +1891,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.4.tgz",
+ "integrity": "sha512-HOy0aLTJTVtoTeGZh4HSXaO6M95qu4k5lJcH4gxv56iaycfz1S8GO/5Jh6X4Y1YiI0h7cRyLi+HixMR+88swag==",
"cpu": [
"ppc64"
],
@@ -1911,9 +1908,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.4.tgz",
+ "integrity": "sha512-i8JUDAufpz9jOzo4yIShCTcXzS07vEgWzyX3NH2G7LEFVgrLEhjwL3ajFE4fZI3I4ZgiM7JH3GQ7ReObROvSUA==",
"cpu": [
"riscv64"
],
@@ -1928,9 +1925,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.4.tgz",
+ "integrity": "sha512-jFnu+6UbLlzIjPQpWCNh5QtrcNfMLjgIavnwPQAfoGx4q17ocOU9MsQ2QVvFxwQoWpZT8DvTLooTvmOQXkO51g==",
"cpu": [
"s390x"
],
@@ -1945,9 +1942,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.4.tgz",
+ "integrity": "sha512-6e0cvXwzOnVWJHq+mskP8DNSrKBr1bULBvnFLpc1KY+d+irZSgZ02TGse5FsafKS5jg2e4pbvK6TPXaF/A6+CA==",
"cpu": [
"x64"
],
@@ -1962,9 +1959,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.4.tgz",
+ "integrity": "sha512-vUnkBYxZW4hL/ie91hSqaSNjulOnYXE1VSLusnvHg2u3jewJBz3YzB9+oCw8DABeVqZGg94t9tyZFoHma8gWZQ==",
"cpu": [
"arm64"
],
@@ -1979,9 +1976,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.4.tgz",
+ "integrity": "sha512-XAg8pIQn5CzhOB8odIcAm42QsOfa98SBeKUdo4xa8OvX8LbMZqEtgeWE9P/Wxt7MlG2QqvjGths+nq48TrUiKw==",
"cpu": [
"x64"
],
@@ -1996,9 +1993,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.4.tgz",
+ "integrity": "sha512-Ct2WcFEANlFDtp1nVAXSNBPDxyU+j7+tId//iHXU2f/lN5AmO4zLyhDcpR5Cz1r08mVxzt3Jpyt4PmXQ1O6+7A==",
"cpu": [
"arm64"
],
@@ -2013,9 +2010,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.4.tgz",
+ "integrity": "sha512-xAGGhyOQ9Otm1Xu8NT1ifGLnA6M3sJxZ6ixylb+vIUVzvvd6GOALpwQrYrtlPouMqd/vSbgehz6HaVk4+7Afhw==",
"cpu": [
"x64"
],
@@ -2030,9 +2027,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.4.tgz",
+ "integrity": "sha512-Mw+tzy4pp6wZEK0+Lwr76pWLjrtjmJyUB23tHKqEDP74R3q95luY/bXqXZeYl4NYlvwOqoRKlInQialgCKy67Q==",
"cpu": [
"x64"
],
@@ -2047,9 +2044,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.4.tgz",
+ "integrity": "sha512-AVUP428VQTSddguz9dO9ngb+E5aScyg7nOeJDrF1HPYu555gmza3bDGMPhmVXL8svDSoqPCsCPjb265yG/kLKQ==",
"cpu": [
"arm64"
],
@@ -2064,9 +2061,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.4.tgz",
+ "integrity": "sha512-i1sW+1i+oWvQzSgfRcxxG2k4I9n3O9NRqy8U+uugaT2Dy7kLO9Y7wI72haOahxceMX8hZAzgGou1FhndRldxRg==",
"cpu": [
"ia32"
],
@@ -2081,9 +2078,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.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.4.tgz",
+ "integrity": "sha512-nOT2vZNw6hJ+z43oP1SPea/G/6AbN6X+bGNhNuq8NtRHy4wsMhw765IKLNmnjek7GvjWBYQ8Q5VBoYTFg9y1UQ==",
"cpu": [
"x64"
],
@@ -2555,9 +2552,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.41.0.tgz",
+ "integrity": "sha512-KxN+zCjOYHGwCl4UCtSfZ6jrq/qi88JDUtiEFk8LELEHq2Egfc/FgW+jItZiOLRuQfb/3xJSgFuNPC9jzggX+A==",
"cpu": [
"arm"
],
@@ -2569,9 +2566,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.41.0.tgz",
+ "integrity": "sha512-yDvqx3lWlcugozax3DItKJI5j05B0d4Kvnjx+5mwiUpWramVvmAByYigMplaoAQ3pvdprGCTCE03eduqE/8mPQ==",
"cpu": [
"arm64"
],
@@ -2583,9 +2580,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.41.0.tgz",
+ "integrity": "sha512-2KOU574vD3gzcPSjxO0eyR5iWlnxxtmW1F5CkNOHmMlueKNCQkxR6+ekgWyVnz6zaZihpUNkGxjsYrkTJKhkaw==",
"cpu": [
"arm64"
],
@@ -2597,9 +2594,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.41.0.tgz",
+ "integrity": "sha512-gE5ACNSxHcEZyP2BA9TuTakfZvULEW4YAOtxl/A/YDbIir/wPKukde0BNPlnBiP88ecaN4BJI2TtAd+HKuZPQQ==",
"cpu": [
"x64"
],
@@ -2611,9 +2608,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.41.0.tgz",
+ "integrity": "sha512-GSxU6r5HnWij7FoSo7cZg3l5GPg4HFLkzsFFh0N/b16q5buW1NAWuCJ+HMtIdUEi6XF0qH+hN0TEd78laRp7Dg==",
"cpu": [
"arm64"
],
@@ -2625,9 +2622,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.41.0.tgz",
+ "integrity": "sha512-KGiGKGDg8qLRyOWmk6IeiHJzsN/OYxO6nSbT0Vj4MwjS2XQy/5emsmtoqLAabqrohbgLWJ5GV3s/ljdrIr8Qjg==",
"cpu": [
"x64"
],
@@ -2639,9 +2636,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.41.0.tgz",
+ "integrity": "sha512-46OzWeqEVQyX3N2/QdiU/CMXYDH/lSHpgfBkuhl3igpZiaB3ZIfSjKuOnybFVBQzjsLwkus2mjaESy8H41SzvA==",
"cpu": [
"arm"
],
@@ -2653,9 +2650,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.41.0.tgz",
+ "integrity": "sha512-lfgW3KtQP4YauqdPpcUZHPcqQXmTmH4nYU0cplNeW583CMkAGjtImw4PKli09NFi2iQgChk4e9erkwlfYem6Lg==",
"cpu": [
"arm"
],
@@ -2667,9 +2664,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.41.0.tgz",
+ "integrity": "sha512-nn8mEyzMbdEJzT7cwxgObuwviMx6kPRxzYiOl6o/o+ChQq23gfdlZcUNnt89lPhhz3BYsZ72rp0rxNqBSfqlqw==",
"cpu": [
"arm64"
],
@@ -2681,9 +2678,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.41.0.tgz",
+ "integrity": "sha512-l+QK99je2zUKGd31Gh+45c4pGDAqZSuWQiuRFCdHYC2CSiO47qUWsCcenrI6p22hvHZrDje9QjwSMAFL3iwXwQ==",
"cpu": [
"arm64"
],
@@ -2695,9 +2692,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.41.0.tgz",
+ "integrity": "sha512-WbnJaxPv1gPIm6S8O/Wg+wfE/OzGSXlBMbOe4ie+zMyykMOeqmgD1BhPxZQuDqwUN+0T/xOFtL2RUWBspnZj3w==",
"cpu": [
"loong64"
],
@@ -2709,9 +2706,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.41.0.tgz",
+ "integrity": "sha512-eRDWR5t67/b2g8Q/S8XPi0YdbKcCs4WQ8vklNnUYLaSWF+Cbv2axZsp4jni6/j7eKvMLYCYdcsv8dcU+a6QNFg==",
"cpu": [
"ppc64"
],
@@ -2723,9 +2720,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.41.0.tgz",
+ "integrity": "sha512-TWrZb6GF5jsEKG7T1IHwlLMDRy2f3DPqYldmIhnA2DVqvvhY2Ai184vZGgahRrg8k9UBWoSlHv+suRfTN7Ua4A==",
"cpu": [
"riscv64"
],
@@ -2737,9 +2734,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.41.0.tgz",
+ "integrity": "sha512-ieQljaZKuJpmWvd8gW87ZmSFwid6AxMDk5bhONJ57U8zT77zpZ/TPKkU9HpnnFrM4zsgr4kiGuzbIbZTGi7u9A==",
"cpu": [
"riscv64"
],
@@ -2751,9 +2748,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.41.0.tgz",
+ "integrity": "sha512-/L3pW48SxrWAlVsKCN0dGLB2bi8Nv8pr5S5ocSM+S0XCn5RCVCXqi8GVtHFsOBBCSeR+u9brV2zno5+mg3S4Aw==",
"cpu": [
"s390x"
],
@@ -2765,9 +2762,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.41.0.tgz",
+ "integrity": "sha512-XMLeKjyH8NsEDCRptf6LO8lJk23o9wvB+dJwcXMaH6ZQbbkHu2dbGIUindbMtRN6ux1xKi16iXWu6q9mu7gDhQ==",
"cpu": [
"x64"
],
@@ -2779,9 +2776,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.41.0.tgz",
+ "integrity": "sha512-m/P7LycHZTvSQeXhFmgmdqEiTqSV80zn6xHaQ1JSqwCtD1YGtwEK515Qmy9DcB2HK4dOUVypQxvhVSy06cJPEg==",
"cpu": [
"x64"
],
@@ -2793,9 +2790,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.41.0.tgz",
+ "integrity": "sha512-4yodtcOrFHpbomJGVEqZ8fzD4kfBeCbpsUy5Pqk4RluXOdsWdjLnjhiKy2w3qzcASWd04fp52Xz7JKarVJ5BTg==",
"cpu": [
"arm64"
],
@@ -2807,9 +2804,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.41.0.tgz",
+ "integrity": "sha512-tmazCrAsKzdkXssEc65zIE1oC6xPHwfy9d5Ta25SRCDOZS+I6RypVVShWALNuU9bxIfGA0aqrmzlzoM5wO5SPQ==",
"cpu": [
"ia32"
],
@@ -2821,9 +2818,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.41.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.41.0.tgz",
+ "integrity": "sha512-h1J+Yzjo/X+0EAvR2kIXJDuTuyT7drc+t2ALY0nIcGPbTatNOf0VWdhEA2Z4AAjv6X1NJV7SYo5oCTYRJhSlVA==",
"cpu": [
"x64"
],
@@ -2972,9 +2969,9 @@
"license": "MIT"
},
"node_modules/@types/express": {
- "version": "4.17.21",
- "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz",
- "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==",
+ "version": "4.17.22",
+ "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.22.tgz",
+ "integrity": "sha512-eZUmSnhRX9YRSkplpz0N+k6NljUUn5l3EWZIKZvYzhvMphEuNiyyy1viH/ejgt66JWgALwC/gtSUAeQKtSwW/w==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -3111,9 +3108,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.21",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.21.tgz",
+ "integrity": "sha512-EV/37Td6c+MgKAbkcLG6vqZ2zEYHD7bvSrzqqs2RIhbA6w3x+Dqz8MZM3sP6kGTeLrdoOgKZe+Xja7tUB2DNkQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -3138,9 +3135,9 @@
"license": "MIT"
},
"node_modules/@types/qs": {
- "version": "6.9.18",
- "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.18.tgz",
- "integrity": "sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==",
+ "version": "6.14.0",
+ "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.14.0.tgz",
+ "integrity": "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==",
"dev": true,
"license": "MIT"
},
@@ -3219,57 +3216,57 @@
}
},
"node_modules/@vue/compiler-core": {
- "version": "3.5.13",
- "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.13.tgz",
- "integrity": "sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==",
+ "version": "3.5.14",
+ "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.14.tgz",
+ "integrity": "sha512-k7qMHMbKvoCXIxPhquKQVw3Twid3Kg4s7+oYURxLGRd56LiuHJVrvFKI4fm2AM3c8apqODPfVJGoh8nePbXMRA==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@babel/parser": "^7.25.3",
- "@vue/shared": "3.5.13",
+ "@babel/parser": "^7.27.2",
+ "@vue/shared": "3.5.14",
"entities": "^4.5.0",
"estree-walker": "^2.0.2",
- "source-map-js": "^1.2.0"
+ "source-map-js": "^1.2.1"
}
},
"node_modules/@vue/compiler-dom": {
- "version": "3.5.13",
- "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.13.tgz",
- "integrity": "sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA==",
+ "version": "3.5.14",
+ "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.14.tgz",
+ "integrity": "sha512-1aOCSqxGOea5I80U2hQJvXYpPm/aXo95xL/m/mMhgyPUsKe9jhjwWpziNAw7tYRnbz1I61rd9Mld4W9KmmRoug==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@vue/compiler-core": "3.5.13",
- "@vue/shared": "3.5.13"
+ "@vue/compiler-core": "3.5.14",
+ "@vue/shared": "3.5.14"
}
},
"node_modules/@vue/compiler-sfc": {
- "version": "3.5.13",
- "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.13.tgz",
- "integrity": "sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ==",
+ "version": "3.5.14",
+ "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.14.tgz",
+ "integrity": "sha512-9T6m/9mMr81Lj58JpzsiSIjBgv2LiVoWjIVa7kuXHICUi8LiDSIotMpPRXYJsXKqyARrzjT24NAwttrMnMaCXA==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@babel/parser": "^7.25.3",
- "@vue/compiler-core": "3.5.13",
- "@vue/compiler-dom": "3.5.13",
- "@vue/compiler-ssr": "3.5.13",
- "@vue/shared": "3.5.13",
+ "@babel/parser": "^7.27.2",
+ "@vue/compiler-core": "3.5.14",
+ "@vue/compiler-dom": "3.5.14",
+ "@vue/compiler-ssr": "3.5.14",
+ "@vue/shared": "3.5.14",
"estree-walker": "^2.0.2",
- "magic-string": "^0.30.11",
- "postcss": "^8.4.48",
- "source-map-js": "^1.2.0"
+ "magic-string": "^0.30.17",
+ "postcss": "^8.5.3",
+ "source-map-js": "^1.2.1"
}
},
"node_modules/@vue/compiler-ssr": {
- "version": "3.5.13",
- "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.13.tgz",
- "integrity": "sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA==",
+ "version": "3.5.14",
+ "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.14.tgz",
+ "integrity": "sha512-Y0G7PcBxr1yllnHuS/NxNCSPWnRGH4Ogrp0tsLA5QemDZuJLs99YjAKQ7KqkHE0vCg4QTKlQzXLKCMF7WPSl7Q==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@vue/compiler-dom": "3.5.13",
- "@vue/shared": "3.5.13"
+ "@vue/compiler-dom": "3.5.14",
+ "@vue/shared": "3.5.14"
}
},
"node_modules/@vue/component-compiler-utils": {
@@ -3351,9 +3348,9 @@
"license": "MIT"
},
"node_modules/@vue/shared": {
- "version": "3.5.13",
- "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.13.tgz",
- "integrity": "sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==",
+ "version": "3.5.14",
+ "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.14.tgz",
+ "integrity": "sha512-oXTwNxVfc9EtP1zzXAlSlgARLXNC84frFYkS0HHz0h3E4WZSP9sywqjqzGCP9Y34M8ipNmd380pVgmMuwELDyQ==",
"dev": true,
"license": "MIT"
},
@@ -3782,9 +3779,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 +3869,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 +4018,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"
},
@@ -4104,9 +4101,9 @@
"license": "ISC"
},
"node_modules/bootstrap": {
- "version": "5.3.5",
- "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.5.tgz",
- "integrity": "sha512-ct1CHKtiobRimyGzmsSldEtM03E8fcEX4Tb3dGXz1V8faRwM50+vfHwTzOxB3IlKO7m+9vTH3s/3C6T2EAPeTA==",
+ "version": "5.3.6",
+ "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.6.tgz",
+ "integrity": "sha512-jX0GAcRzvdwISuvArXn3m7KZscWWFAf1MKBcnzaN02qWMb3jpMoUX4/qgeiGzqyIb4ojulRzs89UCUmGcFSzTA==",
"funding": [
{
"type": "github",
@@ -4136,9 +4133,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.15",
+ "resolved": "https://registry.npmjs.org/bootstrap5-tags/-/bootstrap5-tags-1.7.15.tgz",
+ "integrity": "sha512-UnHmJC9p0ei5rZG1/5qOFBoKFJ+ZyXiVTi1+fJnN/+6d/htZZ9M4cALxsjxQR53K2PrOSApMBOR2QZDbIkdK+g==",
"license": "MIT"
},
"node_modules/brace-expansion": {
@@ -4260,9 +4257,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 +4277,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 +4417,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.30001718",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001718.tgz",
+ "integrity": "sha512-AflseV1ahcSunK53NfEs9gFWgOEmzr0f+kaMFA4xiLZlr9Hzt7HxcSpIFcnNCUkz6R6dWKa54rUz3HUmI3nVcw==",
"dev": true,
"funding": [
{
@@ -4864,9 +4861,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 +4920,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"
},
@@ -5288,9 +5285,9 @@
"license": "MIT"
},
"node_modules/debug": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
- "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz",
+ "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -5440,9 +5437,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 +5632,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.157",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.157.tgz",
+ "integrity": "sha512-/0ybgsQd1muo8QlnuTpKwtl0oX5YMlUGbm8xyqgDU00motRkKFFbUJySAQBWcY79rVqNLWIWa87BGVGClwAB2w==",
"dev": true,
"license": "ISC"
},
@@ -5658,9 +5655,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 +5759,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 +5795,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.4",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.4.tgz",
+ "integrity": "sha512-8pgjLUcUjcgDg+2Q4NYXnPbo/vncAY4UmyaCm0jZevERqCHZIaWwdJHkf8XQtu4AxSKCdvrUbT0XUr1IdZzI8Q==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
@@ -5811,31 +5808,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.4",
+ "@esbuild/android-arm": "0.25.4",
+ "@esbuild/android-arm64": "0.25.4",
+ "@esbuild/android-x64": "0.25.4",
+ "@esbuild/darwin-arm64": "0.25.4",
+ "@esbuild/darwin-x64": "0.25.4",
+ "@esbuild/freebsd-arm64": "0.25.4",
+ "@esbuild/freebsd-x64": "0.25.4",
+ "@esbuild/linux-arm": "0.25.4",
+ "@esbuild/linux-arm64": "0.25.4",
+ "@esbuild/linux-ia32": "0.25.4",
+ "@esbuild/linux-loong64": "0.25.4",
+ "@esbuild/linux-mips64el": "0.25.4",
+ "@esbuild/linux-ppc64": "0.25.4",
+ "@esbuild/linux-riscv64": "0.25.4",
+ "@esbuild/linux-s390x": "0.25.4",
+ "@esbuild/linux-x64": "0.25.4",
+ "@esbuild/netbsd-arm64": "0.25.4",
+ "@esbuild/netbsd-x64": "0.25.4",
+ "@esbuild/openbsd-arm64": "0.25.4",
+ "@esbuild/openbsd-x64": "0.25.4",
+ "@esbuild/sunos-x64": "0.25.4",
+ "@esbuild/win32-arm64": "0.25.4",
+ "@esbuild/win32-ia32": "0.25.4",
+ "@esbuild/win32-x64": "0.25.4"
}
},
"node_modules/escalade": {
@@ -6979,9 +6976,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.2.0",
+ "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.2.0.tgz",
+ "integrity": "sha512-ERhJICsxkw1vE7G0lhCUYv4ZxdBEs03qblt1myJs94rYRK9loJF3xDj8mgQz3LmCyp0yYrNjbN/1/GWZTZDGCA==",
"funding": [
{
"type": "individual",
@@ -6998,7 +6995,7 @@
],
"license": "MIT",
"dependencies": {
- "@babel/runtime": "^7.26.10"
+ "@babel/runtime": "^7.27.1"
},
"peerDependencies": {
"typescript": "^5"
@@ -7157,9 +7154,9 @@
}
},
"node_modules/immutable": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.1.tgz",
- "integrity": "sha512-3jatXi9ObIsPGr3N5hGw/vWWcTkq6hUYhpQz4k0wLC+owqWi/LiugIw9x0EdNZ2yGedKN/HzePiBvaJRXa0Ujg==",
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.2.tgz",
+ "integrity": "sha512-qHKXW1q6liAk1Oys6umoaZbDRqjcjgSrbnrifHsfsttza7zcvRAsL7mMV6xWcyhwQy7Xj5v4hhbr6b+iDYwlmQ==",
"dev": true,
"license": "MIT"
},
@@ -7489,14 +7486,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 +8028,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 +9589,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 +9774,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 +9973,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.41.0",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.41.0.tgz",
+ "integrity": "sha512-HqMFpUbWlf/tvcxBFNKnJyzc7Lk+XO3FGc3pbNBLqEbOz0gPLRgcrlS3UF4MfUrVlstOaP/q0kM6GVvi+LrLRg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -10008,26 +9989,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.41.0",
+ "@rollup/rollup-android-arm64": "4.41.0",
+ "@rollup/rollup-darwin-arm64": "4.41.0",
+ "@rollup/rollup-darwin-x64": "4.41.0",
+ "@rollup/rollup-freebsd-arm64": "4.41.0",
+ "@rollup/rollup-freebsd-x64": "4.41.0",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.41.0",
+ "@rollup/rollup-linux-arm-musleabihf": "4.41.0",
+ "@rollup/rollup-linux-arm64-gnu": "4.41.0",
+ "@rollup/rollup-linux-arm64-musl": "4.41.0",
+ "@rollup/rollup-linux-loongarch64-gnu": "4.41.0",
+ "@rollup/rollup-linux-powerpc64le-gnu": "4.41.0",
+ "@rollup/rollup-linux-riscv64-gnu": "4.41.0",
+ "@rollup/rollup-linux-riscv64-musl": "4.41.0",
+ "@rollup/rollup-linux-s390x-gnu": "4.41.0",
+ "@rollup/rollup-linux-x64-gnu": "4.41.0",
+ "@rollup/rollup-linux-x64-musl": "4.41.0",
+ "@rollup/rollup-win32-arm64-msvc": "4.41.0",
+ "@rollup/rollup-win32-ia32-msvc": "4.41.0",
+ "@rollup/rollup-win32-x64-msvc": "4.41.0",
"fsevents": "~2.3.2"
}
},
@@ -10083,9 +10064,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.89.0",
+ "resolved": "https://registry.npmjs.org/sass/-/sass-1.89.0.tgz",
+ "integrity": "sha512-ld+kQU8YTdGNjOLfRWBzewJpU5cwEv/h5yyqlSeJcj6Yh8U4TDA9UA5FPicqDz/xgRPWRSYIQNiFks21TbA9KQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -10174,9 +10155,9 @@
}
},
"node_modules/semver": {
- "version": "7.7.1",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz",
- "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==",
+ "version": "7.7.2",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz",
+ "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==",
"dev": true,
"license": "ISC",
"bin": {
@@ -10867,9 +10848,9 @@
}
},
"node_modules/tapable": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
- "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==",
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.2.tgz",
+ "integrity": "sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==",
"dev": true,
"license": "MIT",
"engines": {
@@ -10877,14 +10858,14 @@
}
},
"node_modules/terser": {
- "version": "5.39.0",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.39.0.tgz",
- "integrity": "sha512-LBAhFyLho16harJoWMg/nZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw==",
+ "version": "5.39.2",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.39.2.tgz",
+ "integrity": "sha512-yEPUmWve+VA78bI71BW70Dh0TuV4HHd+I5SHOAfS1+QBOmvmCiiffgjR8ryyEd3KIfvPGFqoADt8LdQ6XpXIvg==",
"dev": true,
"license": "BSD-2-Clause",
"dependencies": {
"@jridgewell/source-map": "^0.3.3",
- "acorn": "^8.8.2",
+ "acorn": "^8.14.0",
"commander": "^2.20.0",
"source-map-support": "~0.5.20"
},
@@ -10968,9 +10949,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,9 +11330,9 @@
}
},
"node_modules/vite": {
- "version": "6.3.4",
- "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.4.tgz",
- "integrity": "sha512-BiReIiMS2fyFqbqNT/Qqt4CVITDU9M9vE+DKcVAsB+ZV0wvTKd+3hMbkpxz1b+NmEDMegpVbisKiAZOnvO92Sw==",
+ "version": "6.3.5",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz",
+ "integrity": "sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -11639,9 +11620,9 @@
}
},
"node_modules/watchpack": {
- "version": "2.4.2",
- "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz",
- "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==",
+ "version": "2.4.4",
+ "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.4.tgz",
+ "integrity": "sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -11669,14 +11650,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.9",
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.99.9.tgz",
+ "integrity": "sha512-brOPwM3JnmOa+7kd3NsmOUOwbDAj8FT9xDsG3IW0MgbN9yZV7Oi/s/+MNQ/EcSMqw7qfoRyXPoeEWT8zLVdVGg==",
"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 +11675,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 +11807,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 +11959,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 +12061,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": {
@@ -12099,9 +12081,9 @@
}
},
"node_modules/webpack/node_modules/webpack-sources": {
- "version": "3.2.3",
- "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz",
- "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.3.0.tgz",
+ "integrity": "sha512-77R0RDmJfj9dyv5p3bM5pOHa+X8/ZkO9c7kpDstigkC4nIDobadsfSGCwB4bKhMVxqAok8tajaoR8rirM7+VFQ==",
"dev": true,
"license": "MIT",
"engines": {
@@ -12211,9 +12193,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": {
@@ -12260,16 +12242,16 @@
"license": "ISC"
},
"node_modules/yaml": {
- "version": "2.7.1",
- "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.1.tgz",
- "integrity": "sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==",
+ "version": "2.8.0",
+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz",
+ "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==",
"dev": true,
"license": "ISC",
"bin": {
"yaml": "bin.mjs"
},
"engines": {
- "node": ">= 14"
+ "node": ">= 14.6"
}
},
"node_modules/yargs": {
@@ -12337,7 +12319,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/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(', '));
diff --git a/resources/assets/v1/src/components/transactions/EditTransaction.vue b/resources/assets/v1/src/components/transactions/EditTransaction.vue
index cdab12ba1f..1855355d7c 100644
--- a/resources/assets/v1/src/components/transactions/EditTransaction.vue
+++ b/resources/assets/v1/src/components/transactions/EditTransaction.vue
@@ -244,7 +244,7 @@