diff --git a/.ci/phpstan.neon b/.ci/phpstan.neon index 1b8e889c72..d145b09f80 100644 --- a/.ci/phpstan.neon +++ b/.ci/phpstan.neon @@ -28,5 +28,5 @@ parameters: # The level 8 is the highest level. original was 5 # 7 is more than enough, higher just leaves NULL things. - level: 7 + level: 6 diff --git a/THANKS.md b/THANKS.md index 6c53dc2c9d..2839b6f7f6 100755 --- a/THANKS.md +++ b/THANKS.md @@ -4,8 +4,8 @@ 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 +- Nicky De Maeyer - Denis Iskandarov -- = - Lompi - Jose Diaz-Gonzalez - SoftBrix diff --git a/app/Api/V1/Controllers/Autocomplete/AccountController.php b/app/Api/V1/Controllers/Autocomplete/AccountController.php index efd12f655e..c3f7cd9618 100644 --- a/app/Api/V1/Controllers/Autocomplete/AccountController.php +++ b/app/Api/V1/Controllers/Autocomplete/AccountController.php @@ -90,7 +90,7 @@ class AccountController extends Controller $timer->start(sprintf('AC accounts "%s"', $query)); $result = $this->repository->searchAccount((string) $query, $types, $this->parameters->get('limit')); - // set date to subday + end-of-day for account balance. so it is at $date 23:59:59 + // set date to end-of-day for account balance. so it is at $date 23:59:59 $date->endOfDay(); $allBalances = Steam::accountsBalancesOptimized($result, $date, $this->primaryCurrency, $this->convertToPrimary); diff --git a/app/Api/V1/Controllers/Autocomplete/TransactionController.php b/app/Api/V1/Controllers/Autocomplete/TransactionController.php index 4321479d26..d088427937 100644 --- a/app/Api/V1/Controllers/Autocomplete/TransactionController.php +++ b/app/Api/V1/Controllers/Autocomplete/TransactionController.php @@ -24,10 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Autocomplete; -use FireflyIII\Models\TransactionGroup; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest; use FireflyIII\Enums\UserRoleEnum; +use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepositoryInterface; diff --git a/app/Api/V1/Controllers/Chart/BudgetController.php b/app/Api/V1/Controllers/Chart/BudgetController.php index 726f4c78bd..6f0425d6fb 100644 --- a/app/Api/V1/Controllers/Chart/BudgetController.php +++ b/app/Api/V1/Controllers/Chart/BudgetController.php @@ -259,60 +259,6 @@ class BudgetController extends Controller return $return; } - // /** - // * Function that processes each budget limit (per budget). - // * - // * If you have a budget limit in EUR, only transactions in EUR will be considered. - // * If you have a budget limit in GBP, only transactions in GBP will be considered. - // * - // * If you have a budget limit in EUR, and a transaction in GBP, it will not be considered for the EUR budget limit. - // * - // * @throws FireflyException - // */ - // private function budgetLimits(Budget $budget, Collection $limits): array - // { - // Log::debug(sprintf('Now in budgetLimits(#%d)', $budget->id)); - // $data = []; - // - // /** @var BudgetLimit $limit */ - // foreach ($limits as $limit) { - // $data = array_merge($data, $this->processLimit($budget, $limit)); - // } - // - // return $data; - // } - - // /** - // * @throws FireflyException - // */ - // private function processLimit(Budget $budget, BudgetLimit $limit): array - // { - // Log::debug(sprintf('Created new ExchangeRateConverter in %s', __METHOD__)); - // $end = clone $limit->end_date; - // $end->endOfDay(); - // $spent = $this->opsRepository->listExpenses($limit->start_date, $end, null, new Collection()->push($budget)); - // $limitCurrencyId = $limit->transaction_currency_id; - // - // /** @var array $entry */ - // // only spent the entry where the entry's currency matches the budget limit's currency - // // so $filtered will only have 1 or 0 entries - // $filtered = array_filter($spent, fn ($entry) => $entry['currency_id'] === $limitCurrencyId); - // $result = $this->processExpenses($budget->id, $filtered, $limit->start_date, $end); - // if (1 === count($result)) { - // $compare = bccomp($limit->amount, (string)app('steam')->positive($result[$limitCurrencyId]['spent'])); - // $result[$limitCurrencyId]['budgeted'] = $limit->amount; - // if (1 === $compare) { - // // convert this amount into the primary currency: - // $result[$limitCurrencyId]['left'] = bcadd($limit->amount, (string)$result[$limitCurrencyId]['spent']); - // } - // if ($compare <= 0) { - // $result[$limitCurrencyId]['overspent'] = app('steam')->positive(bcadd($limit->amount, (string)$result[$limitCurrencyId]['spent'])); - // } - // } - // - // return $result; - // } - private function filterLimit(int $currencyId, Collection $limits): ?BudgetLimit { $amount = '0'; diff --git a/app/Api/V1/Controllers/Chart/CategoryController.php b/app/Api/V1/Controllers/Chart/CategoryController.php index 9626c447a5..a81261e3ea 100644 --- a/app/Api/V1/Controllers/Chart/CategoryController.php +++ b/app/Api/V1/Controllers/Chart/CategoryController.php @@ -107,11 +107,11 @@ class CategoryController extends Controller $type = $journal['transaction_type_type']; $currency = $currencies[$journalCurrencyId] ?? $this->currencyRepos->find($journalCurrencyId); $currencies[$journalCurrencyId] = $currency; - $currencyId = (int)$currency->id; - $currencyName = (string)$currency->name; - $currencyCode = (string)$currency->code; - $currencySymbol = (string)$currency->symbol; - $currencyDecimalPlaces = (int)$currency->decimal_places; + $currencyId = $currency->id; + $currencyName = $currency->name; + $currencyCode = $currency->code; + $currencySymbol = $currency->symbol; + $currencyDecimalPlaces = $currency->decimal_places; $amount = Steam::positive((string)$journal['amount']); $pcAmount = null; @@ -120,11 +120,11 @@ class CategoryController extends Controller $pcAmount = $amount; } if ($this->convertToPrimary && $journalCurrencyId !== $this->primaryCurrency->id) { - $currencyId = (int)$this->primaryCurrency->id; - $currencyName = (string)$this->primaryCurrency->name; - $currencyCode = (string)$this->primaryCurrency->code; - $currencySymbol = (string)$this->primaryCurrency->symbol; - $currencyDecimalPlaces = (int)$this->primaryCurrency->decimal_places; + $currencyId = $this->primaryCurrency->id; + $currencyName = $this->primaryCurrency->name; + $currencyCode = $this->primaryCurrency->code; + $currencySymbol = $this->primaryCurrency->symbol; + $currencyDecimalPlaces = $this->primaryCurrency->decimal_places; $pcAmount = $converter->convert($currency, $this->primaryCurrency, $journal['date'], $amount); Log::debug(sprintf('Converted %s %s to %s %s', $journal['currency_code'], $amount, $this->primaryCurrency->code, $pcAmount)); } @@ -141,10 +141,10 @@ class CategoryController extends Controller 'currency_symbol' => $currencySymbol, 'currency_decimal_places' => $currencyDecimalPlaces, 'primary_currency_id' => (string)$this->primaryCurrency->id, - 'primary_currency_name' => (string)$this->primaryCurrency->name, - 'primary_currency_code' => (string)$this->primaryCurrency->code, - 'primary_currency_symbol' => (string)$this->primaryCurrency->symbol, - 'primary_currency_decimal_places' => (int)$this->primaryCurrency->decimal_places, + 'primary_currency_name' => $this->primaryCurrency->name, + 'primary_currency_code' => $this->primaryCurrency->code, + 'primary_currency_symbol' => $this->primaryCurrency->symbol, + 'primary_currency_decimal_places' => $this->primaryCurrency->decimal_places, 'period' => null, 'start_date' => $start->toAtomString(), 'end_date' => $end->toAtomString(), diff --git a/app/Api/V1/Controllers/Data/Export/ExportController.php b/app/Api/V1/Controllers/Data/Export/ExportController.php index f65e23dfc0..7e78ca920e 100644 --- a/app/Api/V1/Controllers/Data/Export/ExportController.php +++ b/app/Api/V1/Controllers/Data/Export/ExportController.php @@ -61,6 +61,7 @@ class ExportController extends Controller } /** + * @throws DatetimeException * @throws FireflyException * * @SuppressWarnings("PHPMD.UnusedFormalParameter") @@ -100,6 +101,7 @@ class ExportController extends Controller } /** + * @throws DatetimeException * @throws FireflyException * * @SuppressWarnings("PHPMD.UnusedFormalParameter") @@ -112,6 +114,7 @@ class ExportController extends Controller } /** + * @throws DatetimeException * @throws FireflyException * * @SuppressWarnings("PHPMD.UnusedFormalParameter") @@ -124,6 +127,7 @@ class ExportController extends Controller } /** + * @throws DatetimeException * @throws FireflyException * * @SuppressWarnings("PHPMD.UnusedFormalParameter") @@ -136,6 +140,7 @@ class ExportController extends Controller } /** + * @throws DatetimeException * @throws FireflyException * * @SuppressWarnings("PHPMD.UnusedFormalParameter") @@ -148,6 +153,7 @@ class ExportController extends Controller } /** + * @throws DatetimeException * @throws FireflyException * * @SuppressWarnings("PHPMD.UnusedFormalParameter") @@ -160,6 +166,7 @@ class ExportController extends Controller } /** + * @throws DatetimeException * @throws FireflyException * * @SuppressWarnings("PHPMD.UnusedFormalParameter") @@ -172,6 +179,7 @@ class ExportController extends Controller } /** + * @throws DatetimeException * @throws FireflyException * * @SuppressWarnings("PHPMD.UnusedFormalParameter") @@ -184,6 +192,7 @@ class ExportController extends Controller } /** + * @throws DatetimeException * @throws FireflyException */ public function transactions(ExportRequest $request): LaravelResponse diff --git a/app/Api/V1/Controllers/Models/Account/ListController.php b/app/Api/V1/Controllers/Models/Account/ListController.php index eacc1824f1..b230572b93 100644 --- a/app/Api/V1/Controllers/Models/Account/ListController.php +++ b/app/Api/V1/Controllers/Models/Account/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Account; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\Account; use FireflyIII\Repositories\Account\AccountRepositoryInterface; @@ -70,9 +69,6 @@ class ListController extends Controller ); } - /** - * @throws FireflyException - */ public function attachments(Account $account): JsonResponse { $manager = $this->getManager(); @@ -96,9 +92,6 @@ class ListController extends Controller return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE); } - /** - * @throws FireflyException - */ public function piggyBanks(Account $account): JsonResponse { // create some objects: @@ -135,8 +128,6 @@ class ListController extends Controller /** * Show all transaction groups related to the account. - * - * @throws FireflyException */ public function transactions(Request $request, Account $account): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Account/ShowController.php b/app/Api/V1/Controllers/Models/Account/ShowController.php index d2d02ac82a..33c2e100d1 100644 --- a/app/Api/V1/Controllers/Models/Account/ShowController.php +++ b/app/Api/V1/Controllers/Models/Account/ShowController.php @@ -26,7 +26,6 @@ namespace FireflyIII\Api\V1\Controllers\Models\Account; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\Account\ShowRequest; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Support\Http\Api\AccountFilter; @@ -68,8 +67,6 @@ class ShowController extends Controller /** * Display a listing of the resource. - * - * @throws FireflyException */ public function index(ShowRequest $request): JsonResponse { @@ -90,6 +87,9 @@ class ShowController extends Controller // TODO still need to figure out how to do this easily. $accounts = $collection->slice(($this->parameters->get('page') - 1) * $params['limit'], $params['limit']); + // #11007 go to the end of the previous day. + $this->parameters->set('start', $this->parameters->get('start')->subSecond()); + // enrich /** @var User $admin */ $admin = auth()->user(); @@ -128,6 +128,9 @@ class ShowController extends Controller $account->refresh(); $manager = $this->getManager(); + // #11007 go to the end of the previous day. + $this->parameters->set('start', $this->parameters->get('start')->subSecond()); + // enrich /** @var User $admin */ $admin = auth()->user(); diff --git a/app/Api/V1/Controllers/Models/Attachment/ShowController.php b/app/Api/V1/Controllers/Models/Attachment/ShowController.php index bb8e267a11..273c8dc986 100644 --- a/app/Api/V1/Controllers/Models/Attachment/ShowController.php +++ b/app/Api/V1/Controllers/Models/Attachment/ShowController.php @@ -119,8 +119,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/attachments/listAttachment * * Display a listing of the resource. - * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/AvailableBudget/ShowController.php b/app/Api/V1/Controllers/Models/AvailableBudget/ShowController.php index 1fa1ed692d..ee0c01610f 100644 --- a/app/Api/V1/Controllers/Models/AvailableBudget/ShowController.php +++ b/app/Api/V1/Controllers/Models/AvailableBudget/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\AvailableBudget; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\AvailableBudget; use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface; use FireflyIII\Support\JsonApi\Enrichments\AvailableBudgetEnrichment; @@ -67,8 +66,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/available_budgets/getAvailableBudget * * Display a listing of the resource. - * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Bill/ListController.php b/app/Api/V1/Controllers/Models/Bill/ListController.php index e0e21e01cc..e33c6f5804 100644 --- a/app/Api/V1/Controllers/Models/Bill/ListController.php +++ b/app/Api/V1/Controllers/Models/Bill/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Bill; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\Bill; use FireflyIII\Repositories\Bill\BillRepositoryInterface; @@ -71,8 +70,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/bills/listAttachmentByBill * * Display a listing of the resource. - * - * @throws FireflyException */ public function attachments(Bill $bill): JsonResponse { @@ -102,8 +99,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/bills/listRuleByBill * * List all of them. - * - * @throws FireflyException */ public function rules(Bill $bill): JsonResponse { @@ -135,8 +130,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/bills/listTransactionByBill * * Show all transactions. - * - * @throws FireflyException */ public function transactions(Request $request, Bill $bill): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Bill/ShowController.php b/app/Api/V1/Controllers/Models/Bill/ShowController.php index 6c767f16a6..396c6e4db8 100644 --- a/app/Api/V1/Controllers/Models/Bill/ShowController.php +++ b/app/Api/V1/Controllers/Models/Bill/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Bill; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Bill; use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Support\JsonApi\Enrichments\SubscriptionEnrichment; @@ -65,8 +64,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/bills/listBill * * Display a listing of the resource. - * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Budget/ListController.php b/app/Api/V1/Controllers/Models/Budget/ListController.php index 036fa6d4ec..f2a80bbcb7 100644 --- a/app/Api/V1/Controllers/Models/Budget/ListController.php +++ b/app/Api/V1/Controllers/Models/Budget/ListController.php @@ -26,7 +26,6 @@ namespace FireflyIII\Api\V1\Controllers\Models\Budget; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Enums\TransactionTypeEnum; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\Budget; use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface; @@ -73,8 +72,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listAttachmentByBudget - * - * @throws FireflyException */ public function attachments(Budget $budget): JsonResponse { @@ -104,8 +101,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listBudgetLimitByBudget * * Display a listing of the resource. - * - * @throws FireflyException */ public function budgetLimits(Budget $budget): JsonResponse { @@ -140,8 +135,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listTransactionByBudget * * Show all transactions. - * - * @throws FireflyException */ public function transactions(Request $request, Budget $budget): JsonResponse { @@ -202,8 +195,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listTransactionWithoutBudget * * Show all transactions. - * - * @throws FireflyException */ public function withoutBudget(Request $request): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Budget/ShowController.php b/app/Api/V1/Controllers/Models/Budget/ShowController.php index e5062863b1..7b3dfde927 100644 --- a/app/Api/V1/Controllers/Models/Budget/ShowController.php +++ b/app/Api/V1/Controllers/Models/Budget/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Budget; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Budget; use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; @@ -69,8 +68,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listBudget * * Display a listing of the resource. - * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/BudgetLimit/ListController.php b/app/Api/V1/Controllers/Models/BudgetLimit/ListController.php index ee987eae8a..f21f276843 100644 --- a/app/Api/V1/Controllers/Models/BudgetLimit/ListController.php +++ b/app/Api/V1/Controllers/Models/BudgetLimit/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\BudgetLimit; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\Budget; use FireflyIII\Models\BudgetLimit; @@ -49,8 +48,6 @@ class ListController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listTransactionByBudgetLimit * Show all transactions. - * - * @throws FireflyException */ public function transactions(Request $request, Budget $budget, BudgetLimit $budgetLimit): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Category/ListController.php b/app/Api/V1/Controllers/Models/Category/ListController.php index 04af2f2c6c..fa71b0a631 100644 --- a/app/Api/V1/Controllers/Models/Category/ListController.php +++ b/app/Api/V1/Controllers/Models/Category/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Category; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\Category; use FireflyIII\Repositories\Category\CategoryRepositoryInterface; @@ -68,8 +67,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/categories/listAttachmentByCategory - * - * @throws FireflyException */ public function attachments(Category $category): JsonResponse { @@ -99,8 +96,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/categories/listTransactionByCategory * * Show all transactions. - * - * @throws FireflyException */ public function transactions(Request $request, Category $category): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Category/ShowController.php b/app/Api/V1/Controllers/Models/Category/ShowController.php index 9022eed9f9..2fc4137ad7 100644 --- a/app/Api/V1/Controllers/Models/Category/ShowController.php +++ b/app/Api/V1/Controllers/Models/Category/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Category; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Category; use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Support\JsonApi\Enrichments\CategoryEnrichment; @@ -65,8 +64,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/categories/listCategory * * Display a listing of the resource. - * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/ObjectGroup/ListController.php b/app/Api/V1/Controllers/Models/ObjectGroup/ListController.php index 78dab17658..86a5d8bac4 100644 --- a/app/Api/V1/Controllers/Models/ObjectGroup/ListController.php +++ b/app/Api/V1/Controllers/Models/ObjectGroup/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\ObjectGroup; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\ObjectGroup; use FireflyIII\Repositories\ObjectGroup\ObjectGroupRepositoryInterface; use FireflyIII\Support\JsonApi\Enrichments\PiggyBankEnrichment; @@ -68,8 +67,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/object_groups/listBillByObjectGroup * * List all bills in this object group - * - * @throws FireflyException */ public function bills(ObjectGroup $objectGroup): JsonResponse { @@ -109,8 +106,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/object_groups/listPiggyBankByObjectGroup * * List all piggies under the object group. - * - * @throws FireflyException */ public function piggyBanks(ObjectGroup $objectGroup): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/PiggyBank/ListController.php b/app/Api/V1/Controllers/Models/PiggyBank/ListController.php index 558255ceb4..e22e88337d 100644 --- a/app/Api/V1/Controllers/Models/PiggyBank/ListController.php +++ b/app/Api/V1/Controllers/Models/PiggyBank/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\PiggyBank; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\PiggyBank; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use FireflyIII\Support\JsonApi\Enrichments\AccountEnrichment; @@ -67,8 +66,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/piggy_banks/listAccountByPiggyBank * * List single resource. - * - * @throws FireflyException */ public function accounts(PiggyBank $piggyBank): JsonResponse { @@ -105,8 +102,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/piggy_banks/listAttachmentByPiggyBank - * - * @throws FireflyException */ public function attachments(PiggyBank $piggyBank): JsonResponse { @@ -136,8 +131,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/piggy_banks/listEventByPiggyBank * * List single resource. - * - * @throws FireflyException */ public function piggyBankEvents(PiggyBank $piggyBank): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/PiggyBank/ShowController.php b/app/Api/V1/Controllers/Models/PiggyBank/ShowController.php index c81d49bea5..7fb1fb5e71 100644 --- a/app/Api/V1/Controllers/Models/PiggyBank/ShowController.php +++ b/app/Api/V1/Controllers/Models/PiggyBank/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\PiggyBank; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\PiggyBank; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use FireflyIII\Support\JsonApi\Enrichments\PiggyBankEnrichment; @@ -65,8 +64,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/piggy_banks/listPiggyBank * * List all of them. - * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/PiggyBank/UpdateController.php b/app/Api/V1/Controllers/Models/PiggyBank/UpdateController.php index 94a6d2e022..ba53793505 100644 --- a/app/Api/V1/Controllers/Models/PiggyBank/UpdateController.php +++ b/app/Api/V1/Controllers/Models/PiggyBank/UpdateController.php @@ -68,10 +68,6 @@ class UpdateController extends Controller $data = $request->getAll(); $piggyBank = $this->repository->update($piggyBank, $data); - if (array_key_exists('current_amount', $data) && '' !== $data['current_amount']) { - $this->repository->setCurrentAmount($piggyBank, $data['current_amount']); - } - // enrich /** @var User $admin */ $admin = auth()->user(); diff --git a/app/Api/V1/Controllers/Models/Recurrence/ListController.php b/app/Api/V1/Controllers/Models/Recurrence/ListController.php index 867dc46e33..ce6a9d61a9 100644 --- a/app/Api/V1/Controllers/Models/Recurrence/ListController.php +++ b/app/Api/V1/Controllers/Models/Recurrence/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Recurrence; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\Recurrence; use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface; @@ -68,8 +67,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/recurrences/listTransactionByRecurrence * * Show transactions for this recurrence. - * - * @throws FireflyException */ public function transactions(Request $request, Recurrence $recurrence): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Recurrence/ShowController.php b/app/Api/V1/Controllers/Models/Recurrence/ShowController.php index 74f29cface..7b3b9a23b9 100644 --- a/app/Api/V1/Controllers/Models/Recurrence/ShowController.php +++ b/app/Api/V1/Controllers/Models/Recurrence/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Recurrence; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Recurrence; use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface; use FireflyIII\Support\JsonApi\Enrichments\RecurringEnrichment; @@ -65,8 +64,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/recurrences/listRecurrence * * List all of them. - * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Recurrence/TriggerController.php b/app/Api/V1/Controllers/Models/Recurrence/TriggerController.php index b00aa9767b..7f4ad30b60 100644 --- a/app/Api/V1/Controllers/Models/Recurrence/TriggerController.php +++ b/app/Api/V1/Controllers/Models/Recurrence/TriggerController.php @@ -87,9 +87,7 @@ class TriggerController extends Controller // enrich groups and return them: - if (0 === $groups->count()) { - $paginator = new LengthAwarePaginator(new Collection(), 0, 1); - } + $paginator = new LengthAwarePaginator(new Collection(), 0, 1); if ($groups->count() > 0) { /** @var User $admin */ $admin = auth()->user(); diff --git a/app/Api/V1/Controllers/Models/Rule/ShowController.php b/app/Api/V1/Controllers/Models/Rule/ShowController.php index d6ad0db7a5..045c61ad28 100644 --- a/app/Api/V1/Controllers/Models/Rule/ShowController.php +++ b/app/Api/V1/Controllers/Models/Rule/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Rule; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Rule; use FireflyIII\Repositories\Rule\RuleRepositoryInterface; use FireflyIII\Transformers\RuleTransformer; @@ -67,8 +66,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rules/listRule * * List all of them. - * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/RuleGroup/ListController.php b/app/Api/V1/Controllers/Models/RuleGroup/ListController.php index af419528a1..2d296ce903 100644 --- a/app/Api/V1/Controllers/Models/RuleGroup/ListController.php +++ b/app/Api/V1/Controllers/Models/RuleGroup/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\RuleGroup; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\RuleGroup; use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface; use FireflyIII\Transformers\RuleTransformer; @@ -64,8 +63,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rule_groups/listRuleByGroup - * - * @throws FireflyException */ public function rules(RuleGroup $group): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/RuleGroup/ShowController.php b/app/Api/V1/Controllers/Models/RuleGroup/ShowController.php index a906227340..b5f08d9d9a 100644 --- a/app/Api/V1/Controllers/Models/RuleGroup/ShowController.php +++ b/app/Api/V1/Controllers/Models/RuleGroup/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\RuleGroup; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\RuleGroup; use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface; use FireflyIII\Transformers\RuleGroupTransformer; @@ -66,8 +65,6 @@ class ShowController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rule_groups/listRuleGroup * List all of them. - * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Tag/ListController.php b/app/Api/V1/Controllers/Models/Tag/ListController.php index 1fc4629b05..aed5652f85 100644 --- a/app/Api/V1/Controllers/Models/Tag/ListController.php +++ b/app/Api/V1/Controllers/Models/Tag/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Tag; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\Tag; use FireflyIII\Repositories\Tag\TagRepositoryInterface; @@ -71,8 +70,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/tags/listAttachmentByTag - * - * @throws FireflyException */ public function attachments(Tag $tag): JsonResponse { @@ -102,8 +99,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/tags/listTransactionByTag * * Show all transactions. - * - * @throws FireflyException */ public function transactions(Request $request, Tag $tag): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Tag/ShowController.php b/app/Api/V1/Controllers/Models/Tag/ShowController.php index 5e59c4bf11..f239cb35c5 100644 --- a/app/Api/V1/Controllers/Models/Tag/ShowController.php +++ b/app/Api/V1/Controllers/Models/Tag/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Tag; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Tag; use FireflyIII\Repositories\Tag\TagRepositoryInterface; use FireflyIII\Transformers\TagTransformer; @@ -67,8 +66,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/tags/listTag * * List all of them. - * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Transaction/ListController.php b/app/Api/V1/Controllers/Models/Transaction/ListController.php index 560324e7ff..ab96a00af7 100644 --- a/app/Api/V1/Controllers/Models/Transaction/ListController.php +++ b/app/Api/V1/Controllers/Models/Transaction/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Transaction; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalAPIRepositoryInterface; @@ -69,8 +68,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listAttachmentByTransaction - * - * @throws FireflyException */ public function attachments(TransactionGroup $transactionGroup): JsonResponse { @@ -101,8 +98,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listEventByTransaction - * - * @throws FireflyException */ public function piggyBankEvents(TransactionGroup $transactionGroup): JsonResponse { @@ -144,8 +139,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listLinksByJournal - * - * @throws FireflyException */ public function transactionLinks(TransactionJournal $transactionJournal): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Transaction/ShowController.php b/app/Api/V1/Controllers/Models/Transaction/ShowController.php index b20fab792d..ee45ded96d 100644 --- a/app/Api/V1/Controllers/Models/Transaction/ShowController.php +++ b/app/Api/V1/Controllers/Models/Transaction/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Transaction; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; @@ -52,8 +51,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listTransaction * * Show all transactions. - * - * @throws FireflyException */ public function index(Request $request): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php index b7c7e69a34..b4aca8b763 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionCurrency; -use Illuminate\Support\Facades\Validator; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionCurrency; @@ -32,6 +31,7 @@ use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Http\JsonResponse; +use Illuminate\Support\Facades\Validator; use Illuminate\Validation\ValidationException; /** diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php index 3467046482..f2c45161bc 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionCurrency; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\Account; use FireflyIII\Models\Bill; @@ -71,8 +70,6 @@ class ListController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listAccountByCurrency * Display a list of accounts. - * - * @throws FireflyException */ public function accounts(Request $request, TransactionCurrency $currency): JsonResponse { @@ -131,8 +128,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listAvailableBudgetByCurrency * * Display a listing of the resource. - * - * @throws FireflyException */ public function availableBudgets(TransactionCurrency $currency): JsonResponse { @@ -166,8 +161,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listBillByCurrency * * List all bills - * - * @throws FireflyException */ public function bills(TransactionCurrency $currency): JsonResponse { @@ -213,8 +206,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listBudgetLimitByCurrency * * List all budget limits - * - * @throws FireflyException */ public function budgetLimits(TransactionCurrency $currency): JsonResponse { @@ -251,8 +242,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listRecurrenceByCurrency * * List all recurring transactions. - * - * @throws FireflyException */ public function recurrences(TransactionCurrency $currency): JsonResponse { @@ -304,8 +293,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listRuleByCurrency * * List all of them. - * - * @throws FireflyException */ public function rules(TransactionCurrency $currency): JsonResponse { @@ -349,8 +336,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listTransactionByCurrency * * Show all transactions. - * - * @throws FireflyException */ public function transactions(Request $request, TransactionCurrency $currency): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php index 481896505c..d0920b00f5 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionCurrency; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Support\Http\Api\AccountFilter; @@ -69,8 +68,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listCurrency * * Display a listing of the resource. - * - * @throws FireflyException */ public function index(): JsonResponse { @@ -99,8 +96,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/getCurrency * * Show a currency. - * - * @throws FireflyException */ public function show(TransactionCurrency $currency): JsonResponse { @@ -123,8 +118,6 @@ class ShowController extends Controller /** * Show a currency. - * - * @throws FireflyException */ public function showPrimary(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php index 5e4364043f..56b61b9c99 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php @@ -26,7 +26,6 @@ namespace FireflyIII\Api\V1\Controllers\Models\TransactionCurrency; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\TransactionCurrency\StoreRequest; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Support\Http\Api\AccountFilter; use FireflyIII\Support\Http\Api\TransactionFilter; @@ -66,8 +65,6 @@ class StoreController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/storeCurrency * * Store new currency. - * - * @throws FireflyException */ public function store(StoreRequest $request): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/UpdateController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/UpdateController.php index f9a45ffdee..f76bfaf8a2 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/UpdateController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/UpdateController.php @@ -98,9 +98,6 @@ class UpdateController extends Controller return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE); } - /** - * @throws FireflyException - */ public function makePrimary(TransactionCurrency $currency): JsonResponse { /** @var User $user */ @@ -127,8 +124,6 @@ class UpdateController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/enableCurrency * * Enable a currency. - * - * @throws FireflyException */ public function enable(TransactionCurrency $currency): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionLink/ShowController.php b/app/Api/V1/Controllers/Models/TransactionLink/ShowController.php index f5874f90ae..fb2e80204d 100644 --- a/app/Api/V1/Controllers/Models/TransactionLink/ShowController.php +++ b/app/Api/V1/Controllers/Models/TransactionLink/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLink; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionJournalLink; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; use FireflyIII\Transformers\TransactionLinkTransformer; @@ -69,8 +68,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/links/listTransactionLink * * List all transaction links there are. - * - * @throws FireflyException */ public function index(Request $request): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionLink/StoreController.php b/app/Api/V1/Controllers/Models/TransactionLink/StoreController.php index 89219ff30a..2d0b04cba8 100644 --- a/app/Api/V1/Controllers/Models/TransactionLink/StoreController.php +++ b/app/Api/V1/Controllers/Models/TransactionLink/StoreController.php @@ -24,10 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLink; -use FireflyIII\Models\TransactionJournal; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\TransactionLink\StoreRequest; use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; use FireflyIII\Support\Http\Api\TransactionFilter; diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/ListController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/ListController.php index 0cbaae2bea..03537cfe62 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/ListController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLinkType; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\LinkType; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; @@ -68,8 +67,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/links/listTransactionByLinkType - * - * @throws FireflyException */ public function transactions(Request $request, LinkType $linkType): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/ShowController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/ShowController.php index 9fa5e2e497..27c7a4eb15 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/ShowController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLinkType; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\LinkType; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; use FireflyIII\Support\Http\Api\TransactionFilter; @@ -67,8 +66,6 @@ class ShowController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/links/listLinkType - * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/StoreController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/StoreController.php index 7e534e3993..7901c88ec0 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/StoreController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/StoreController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLinkType; -use Illuminate\Support\Facades\Validator; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\TransactionLinkType\StoreRequest; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; @@ -33,6 +32,7 @@ use FireflyIII\Support\Http\Api\TransactionFilter; use FireflyIII\Transformers\LinkTypeTransformer; use FireflyIII\User; use Illuminate\Http\JsonResponse; +use Illuminate\Support\Facades\Validator; use Illuminate\Validation\ValidationException; use League\Fractal\Resource\Item; diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php index 2b43fa81df..cf964f259d 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLinkType; -use Illuminate\Support\Facades\Validator; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\TransactionLinkType\UpdateRequest; use FireflyIII\Exceptions\FireflyException; @@ -35,6 +34,7 @@ use FireflyIII\Support\Http\Api\TransactionFilter; use FireflyIII\Transformers\LinkTypeTransformer; use FireflyIII\User; use Illuminate\Http\JsonResponse; +use Illuminate\Support\Facades\Validator; use Illuminate\Validation\ValidationException; use League\Fractal\Resource\Item; diff --git a/app/Api/V1/Controllers/Search/TransactionController.php b/app/Api/V1/Controllers/Search/TransactionController.php index a68f44d8a6..d95daf8c37 100644 --- a/app/Api/V1/Controllers/Search/TransactionController.php +++ b/app/Api/V1/Controllers/Search/TransactionController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Search; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Support\JsonApi\Enrichments\TransactionGroupEnrichment; use FireflyIII\Support\Search\SearchInterface; use FireflyIII\Transformers\TransactionGroupTransformer; @@ -42,8 +41,6 @@ class TransactionController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/search/searchTransactions - * - * @throws FireflyException */ public function search(Request $request, SearchInterface $searcher): JsonResponse { diff --git a/app/Api/V1/Controllers/Summary/BasicController.php b/app/Api/V1/Controllers/Summary/BasicController.php index 7550d63fb7..6b2acc86eb 100644 --- a/app/Api/V1/Controllers/Summary/BasicController.php +++ b/app/Api/V1/Controllers/Summary/BasicController.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Summary; -use Exception; use Carbon\Carbon; +use Exception; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Data\DateRequest; use FireflyIII\Enums\AccountTypeEnum; diff --git a/app/Api/V1/Controllers/System/UserController.php b/app/Api/V1/Controllers/System/UserController.php index 0928c041a9..d08807ab52 100644 --- a/app/Api/V1/Controllers/System/UserController.php +++ b/app/Api/V1/Controllers/System/UserController.php @@ -90,8 +90,6 @@ class UserController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/users/listUser * * Display a listing of the resource. - * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/User/PreferencesController.php b/app/Api/V1/Controllers/User/PreferencesController.php index d2040588e3..e5a97f7628 100644 --- a/app/Api/V1/Controllers/User/PreferencesController.php +++ b/app/Api/V1/Controllers/User/PreferencesController.php @@ -49,8 +49,6 @@ class PreferencesController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/preferences/listPreference * * List all of them. - * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Webhook/MessageController.php b/app/Api/V1/Controllers/Webhook/MessageController.php index 6e14814f6f..475724f4c5 100644 --- a/app/Api/V1/Controllers/Webhook/MessageController.php +++ b/app/Api/V1/Controllers/Webhook/MessageController.php @@ -62,8 +62,6 @@ class MessageController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/webhooks/getWebhookMessages - * - * @throws FireflyException */ public function index(Webhook $webhook): JsonResponse { diff --git a/app/Api/V1/Controllers/Webhook/ShowController.php b/app/Api/V1/Controllers/Webhook/ShowController.php index 03249281c3..62c39258b4 100644 --- a/app/Api/V1/Controllers/Webhook/ShowController.php +++ b/app/Api/V1/Controllers/Webhook/ShowController.php @@ -27,7 +27,6 @@ namespace FireflyIII\Api\V1\Controllers\Webhook; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Enums\WebhookTrigger; use FireflyIII\Events\RequestedSendWebhookMessages; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Generator\Webhook\MessageGeneratorInterface; use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\Webhook; @@ -70,8 +69,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/webhooks/listWebhook * * Display a listing of the webhooks of the user. - * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Requests/Chart/ChartRequest.php b/app/Api/V1/Requests/Chart/ChartRequest.php index d298a89116..bf43fe47c2 100644 --- a/app/Api/V1/Requests/Chart/ChartRequest.php +++ b/app/Api/V1/Requests/Chart/ChartRequest.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Chart; -use Illuminate\Validation\Validator; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class ChartRequest diff --git a/app/Api/V1/Requests/Data/Bulk/MoveTransactionsRequest.php b/app/Api/V1/Requests/Data/Bulk/MoveTransactionsRequest.php index 6e8f9b285c..3ada80f591 100644 --- a/app/Api/V1/Requests/Data/Bulk/MoveTransactionsRequest.php +++ b/app/Api/V1/Requests/Data/Bulk/MoveTransactionsRequest.php @@ -24,12 +24,12 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Data\Bulk; -use Illuminate\Validation\Validator; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class MoveTransactionsRequest diff --git a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php index 46aea15783..902967a9c2 100644 --- a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php +++ b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php @@ -24,8 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Data\Bulk; -use Illuminate\Validation\Validator; -use JsonException; use FireflyIII\Enums\ClauseType; use FireflyIII\Rules\IsValidBulkClause; use FireflyIII\Support\Request\ChecksLogin; @@ -33,6 +31,8 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\Api\Data\Bulk\ValidatesBulkTransactionQuery; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; +use JsonException; use function Safe\json_decode; diff --git a/app/Api/V1/Requests/Data/DateRequest.php b/app/Api/V1/Requests/Data/DateRequest.php index 7ba1861086..7155994862 100644 --- a/app/Api/V1/Requests/Data/DateRequest.php +++ b/app/Api/V1/Requests/Data/DateRequest.php @@ -44,8 +44,18 @@ class DateRequest extends FormRequest */ public function getAll(): array { - $start = $this->getCarbonDate('start'); - $end = $this->getCarbonDate('end'); + $start = $this->getCarbonDate('start'); + $end = $this->getCarbonDate('end'); + if (null === $start) { + $start = now()->startOfMonth(); + } + if (null === $end) { + $end = now()->endOfMonth(); + } + // sanity check on dates: + [$start, $end] = $end < $start ? [$end, $start] : [$start, $end]; + + $start->startOfDay(); $end->endOfDay(); if ($start->diffInYears($end, true) > 5) { diff --git a/app/Api/V1/Requests/Models/Account/ShowRequest.php b/app/Api/V1/Requests/Models/Account/ShowRequest.php index 6d6dcb71c5..f4f7d73332 100644 --- a/app/Api/V1/Requests/Models/Account/ShowRequest.php +++ b/app/Api/V1/Requests/Models/Account/ShowRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Account; -use Illuminate\Validation\Validator; use Carbon\Carbon; use FireflyIII\Models\Account; use FireflyIII\Rules\IsValidSortInstruction; @@ -32,6 +31,7 @@ use FireflyIII\Support\Http\Api\AccountFilter; use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\User; use Illuminate\Foundation\Http\FormRequest; +use Illuminate\Validation\Validator; class ShowRequest extends FormRequest { diff --git a/app/Api/V1/Requests/Models/Account/UpdateRequest.php b/app/Api/V1/Requests/Models/Account/UpdateRequest.php index 473e5b8714..dbe30eab1b 100644 --- a/app/Api/V1/Requests/Models/Account/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Account/UpdateRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Account; -use Illuminate\Validation\Validator; use FireflyIII\Models\Account; use FireflyIII\Models\Location; use FireflyIII\Repositories\Account\AccountRepositoryInterface; @@ -36,6 +35,7 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/AvailableBudget/Request.php b/app/Api/V1/Requests/Models/AvailableBudget/Request.php index 02cbf088e6..c2ddea145c 100644 --- a/app/Api/V1/Requests/Models/AvailableBudget/Request.php +++ b/app/Api/V1/Requests/Models/AvailableBudget/Request.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\AvailableBudget; -use Illuminate\Validation\Validator; use Carbon\Carbon; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class Request diff --git a/app/Api/V1/Requests/Models/Bill/StoreRequest.php b/app/Api/V1/Requests/Models/Bill/StoreRequest.php index 4b35c5bb2e..393ff54ca3 100644 --- a/app/Api/V1/Requests/Models/Bill/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Bill/StoreRequest.php @@ -24,15 +24,15 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Bill; -use Illuminate\Validation\Validator; -use ValueError; -use TypeError; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; +use TypeError; +use ValueError; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Bill/UpdateRequest.php b/app/Api/V1/Requests/Models/Bill/UpdateRequest.php index f4dd92f9df..8b16cce5e3 100644 --- a/app/Api/V1/Requests/Models/Bill/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Bill/UpdateRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Bill; -use Illuminate\Validation\Validator; use FireflyIII\Models\Bill; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; @@ -32,6 +31,7 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/Budget/StoreRequest.php b/app/Api/V1/Requests/Models/Budget/StoreRequest.php index fd36873cbb..9d3a9bc883 100644 --- a/app/Api/V1/Requests/Models/Budget/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Budget/StoreRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Budget; -use Illuminate\Validation\Validator; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; @@ -32,6 +31,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\AutoBudget\ValidatesAutoBudgetRequest; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Budget/UpdateRequest.php b/app/Api/V1/Requests/Models/Budget/UpdateRequest.php index 870cc3294f..d028906aa4 100644 --- a/app/Api/V1/Requests/Models/Budget/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Budget/UpdateRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Budget; -use Illuminate\Validation\Validator; use FireflyIII\Models\Budget; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; @@ -33,6 +32,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\AutoBudget\ValidatesAutoBudgetRequest; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php b/app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php index 5262ab4427..f4ecfa9ac4 100644 --- a/app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php @@ -24,14 +24,14 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\BudgetLimit; -use FireflyIII\Rules\IsBoolean; -use Illuminate\Validation\Validator; use Carbon\Carbon; +use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreByCurrenciesRequest.php b/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreByCurrenciesRequest.php index be2bfe8584..b7a8d00159 100644 --- a/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreByCurrenciesRequest.php +++ b/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreByCurrenciesRequest.php @@ -28,8 +28,8 @@ use Carbon\Carbon; use Carbon\Exceptions\InvalidFormatException; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; -use Illuminate\Validation\Validator; use Illuminate\Foundation\Http\FormRequest; +use Illuminate\Validation\Validator; class StoreByCurrenciesRequest extends FormRequest { diff --git a/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreByDateRequest.php b/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreByDateRequest.php index aa1eb2a5b7..de5dbe94c9 100644 --- a/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreByDateRequest.php +++ b/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreByDateRequest.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\CurrencyExchangeRate; -use Illuminate\Validation\Validator; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Support\Facades\Amount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; +use Illuminate\Validation\Validator; class StoreByDateRequest extends FormRequest { diff --git a/app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php b/app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php index 0810b4ce4b..81acd25bd7 100644 --- a/app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php +++ b/app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php @@ -24,15 +24,15 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\PiggyBank; -use Illuminate\Validation\Validator; -use FireflyIII\Support\Facades\Amount; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Rules\IsValidZeroOrMoreAmount; +use FireflyIII\Support\Facades\Amount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php b/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php index 98b15ae55b..387f28f930 100644 --- a/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Recurrence; -use Illuminate\Validation\Validator; use FireflyIII\Rules\BelongsUser; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; @@ -36,6 +35,7 @@ use FireflyIII\Validation\RecurrenceValidation; use FireflyIII\Validation\TransactionValidation; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php b/app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php index 1b5c1590a4..ea5cbd0f9a 100644 --- a/app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Recurrence; -use Illuminate\Validation\Validator; use FireflyIII\Models\Recurrence; use FireflyIII\Rules\BelongsUser; use FireflyIII\Rules\IsBoolean; @@ -37,6 +36,7 @@ use FireflyIII\Validation\RecurrenceValidation; use FireflyIII\Validation\TransactionValidation; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/Rule/StoreRequest.php b/app/Api/V1/Requests/Models/Rule/StoreRequest.php index 5f9e0126c8..dd65d648a0 100644 --- a/app/Api/V1/Requests/Models/Rule/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Rule/StoreRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Rule; -use Illuminate\Validation\Validator; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidActionExpression; use FireflyIII\Support\Request\ChecksLogin; @@ -32,6 +31,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Support\Request\GetRuleConfiguration; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Rule/UpdateRequest.php b/app/Api/V1/Requests/Models/Rule/UpdateRequest.php index 22880b581a..13a8a97676 100644 --- a/app/Api/V1/Requests/Models/Rule/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Rule/UpdateRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Rule; -use Illuminate\Validation\Validator; use FireflyIII\Models\Rule; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidActionExpression; @@ -33,6 +32,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Support\Request\GetRuleConfiguration; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/Transaction/StoreRequest.php b/app/Api/V1/Requests/Models/Transaction/StoreRequest.php index 4ad8a851cb..2b54cb977c 100644 --- a/app/Api/V1/Requests/Models/Transaction/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Transaction/StoreRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Transaction; -use Illuminate\Validation\Validator; use FireflyIII\Models\Location; use FireflyIII\Rules\BelongsUser; use FireflyIII\Rules\IsBoolean; @@ -40,6 +39,7 @@ use FireflyIII\Validation\GroupValidation; use FireflyIII\Validation\TransactionValidation; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php b/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php index 7a2d0a7be4..af1b57cb29 100644 --- a/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Transaction; -use Illuminate\Validation\Validator; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionGroup; use FireflyIII\Rules\BelongsUser; @@ -38,6 +37,7 @@ use FireflyIII\Validation\GroupValidation; use FireflyIII\Validation\TransactionValidation; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UpdateRequest @@ -64,7 +64,7 @@ class UpdateRequest extends FormRequest */ public function getAll(): array { - app('log')->debug(sprintf('Now in %s', __METHOD__)); + Log::debug(sprintf('Now in %s', __METHOD__)); $this->integerFields = ['order', 'currency_id', 'foreign_currency_id', 'transaction_journal_id', 'source_id', 'destination_id', 'budget_id', 'category_id', 'bill_id', 'recurrence_id']; $this->dateFields = ['date', 'interest_date', 'book_date', 'process_date', 'due_date', 'payment_date', 'invoice_date']; $this->textareaFields = ['notes']; @@ -97,7 +97,7 @@ class UpdateRequest extends FormRequest */ private function getTransactionData(): array { - app('log')->debug(sprintf('Now in %s', __METHOD__)); + Log::debug(sprintf('Now in %s', __METHOD__)); $return = []; /** @var null|array $transactions */ @@ -181,7 +181,7 @@ class UpdateRequest extends FormRequest private function getDateData(array $current, array $transaction): array { foreach ($this->dateFields as $fieldName) { - app('log')->debug(sprintf('Now at date field %s', $fieldName)); + Log::debug(sprintf('Now at date field %s', $fieldName)); if (array_key_exists($fieldName, $transaction)) { Log::debug(sprintf('New value: "%s"', $transaction[$fieldName])); $current[$fieldName] = $this->dateFromValue((string) $transaction[$fieldName]); @@ -247,7 +247,7 @@ class UpdateRequest extends FormRequest */ public function rules(): array { - app('log')->debug(sprintf('Now in %s', __METHOD__)); + Log::debug(sprintf('Now in %s', __METHOD__)); $validProtocols = config('firefly.valid_url_protocols'); return [ @@ -330,7 +330,7 @@ class UpdateRequest extends FormRequest */ public function withValidator(Validator $validator): void { - app('log')->debug('Now in withValidator'); + Log::debug('Now in withValidator'); /** @var TransactionGroup $transactionGroup */ $transactionGroup = $this->route()->parameter('transactionGroup'); diff --git a/app/Api/V1/Requests/Models/TransactionLink/StoreRequest.php b/app/Api/V1/Requests/Models/TransactionLink/StoreRequest.php index 693c109d5d..638bda8306 100644 --- a/app/Api/V1/Requests/Models/TransactionLink/StoreRequest.php +++ b/app/Api/V1/Requests/Models/TransactionLink/StoreRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\TransactionLink; -use Illuminate\Validation\Validator; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; use FireflyIII\Support\Request\ChecksLogin; @@ -32,6 +31,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\User; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/TransactionLink/UpdateRequest.php b/app/Api/V1/Requests/Models/TransactionLink/UpdateRequest.php index 71a8090810..0ab51bccd0 100644 --- a/app/Api/V1/Requests/Models/TransactionLink/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/TransactionLink/UpdateRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\TransactionLink; -use Illuminate\Validation\Validator; use FireflyIII\Models\TransactionJournalLink; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; @@ -32,6 +31,7 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/System/UserUpdateRequest.php b/app/Api/V1/Requests/System/UserUpdateRequest.php index 03b201b6ad..553f8e54e4 100644 --- a/app/Api/V1/Requests/System/UserUpdateRequest.php +++ b/app/Api/V1/Requests/System/UserUpdateRequest.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\System; -use Illuminate\Validation\Validator; use FireflyIII\Rules\IsBoolean; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\User; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UserUpdateRequest diff --git a/app/Console/Commands/Correction/ConvertsDatesToUTC.php b/app/Console/Commands/Correction/ConvertsDatesToUTC.php index 63457c65f3..657d8a0a83 100644 --- a/app/Console/Commands/Correction/ConvertsDatesToUTC.php +++ b/app/Console/Commands/Correction/ConvertsDatesToUTC.php @@ -92,7 +92,6 @@ class ConvertsDatesToUTC extends Command $this->friendlyInfo(sprintf('Converting field "%s" of model "%s" to UTC.', $field, $shortModel)); $items->each( function ($item) use ($field, $timezoneField): void { - /** @var Carbon $date */ $date = Carbon::parse($item->{$field}, $item->{$timezoneField}); // @phpstan-ignore-line $date->setTimezone('UTC'); $item->{$field} = $date->format('Y-m-d H:i:s'); // @phpstan-ignore-line diff --git a/app/Console/Commands/Correction/CorrectsOpeningBalanceCurrencies.php b/app/Console/Commands/Correction/CorrectsOpeningBalanceCurrencies.php index 0383e72785..9857fa2209 100644 --- a/app/Console/Commands/Correction/CorrectsOpeningBalanceCurrencies.php +++ b/app/Console/Commands/Correction/CorrectsOpeningBalanceCurrencies.php @@ -34,6 +34,7 @@ use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Illuminate\Console\Command; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Log; class CorrectsOpeningBalanceCurrencies extends Command { @@ -78,7 +79,7 @@ class CorrectsOpeningBalanceCurrencies extends Command $account = $this->getAccount($journal); if (!$account instanceof Account) { $message = sprintf('Transaction journal #%d has no valid account. Can\'t fix this line.', $journal->id); - app('log')->warning($message); + Log::warning($message); $this->friendlyError($message); return 0; diff --git a/app/Console/Commands/Correction/CorrectsTransferBudgets.php b/app/Console/Commands/Correction/CorrectsTransferBudgets.php index 5098087f76..a717741833 100644 --- a/app/Console/Commands/Correction/CorrectsTransferBudgets.php +++ b/app/Console/Commands/Correction/CorrectsTransferBudgets.php @@ -28,6 +28,7 @@ use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Models\TransactionJournal; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Log; class CorrectsTransferBudgets extends Command { @@ -53,13 +54,13 @@ class CorrectsTransferBudgets extends Command foreach ($set as $entry) { $message = sprintf('Transaction journal #%d is a %s, so has no longer a budget.', $entry->id, $entry->transactionType->type); $this->friendlyInfo($message); - app('log')->debug($message); + Log::debug($message); $entry->budgets()->sync([]); ++$count; } if (0 !== $count) { $message = sprintf('Corrected %d invalid budget/journal entries (entry).', $count); - app('log')->debug($message); + Log::debug($message); $this->friendlyInfo($message); } diff --git a/app/Console/Commands/Correction/CorrectsUnevenAmount.php b/app/Console/Commands/Correction/CorrectsUnevenAmount.php index 4d1e527f3e..4f6519951c 100644 --- a/app/Console/Commands/Correction/CorrectsUnevenAmount.php +++ b/app/Console/Commands/Correction/CorrectsUnevenAmount.php @@ -35,8 +35,8 @@ use FireflyIII\Support\Models\AccountBalanceCalculator; use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; -use ValueError; use stdClass; +use ValueError; class CorrectsUnevenAmount extends Command { @@ -152,7 +152,7 @@ class CorrectsUnevenAmount extends Command $entry->the_sum ); $this->friendlyWarning($message); - app('log')->warning($message); + Log::warning($message); ++$this->count; continue; @@ -230,7 +230,7 @@ class CorrectsUnevenAmount extends Command $message = sprintf('Sum of journal #%d is not zero, journal is broken and now fixed.', $journal->id); $this->friendlyWarning($message); - app('log')->warning($message); + Log::warning($message); $destination->amount = $amount; $destination->save(); diff --git a/app/Console/Commands/Correction/CreatesAccessTokens.php b/app/Console/Commands/Correction/CreatesAccessTokens.php index f73e8d2258..92603c83a6 100644 --- a/app/Console/Commands/Correction/CreatesAccessTokens.php +++ b/app/Console/Commands/Correction/CreatesAccessTokens.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Correction; +use Exception; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Console\Command; -use Exception; class CreatesAccessTokens extends Command { diff --git a/app/Console/Commands/Correction/RemovesEmptyGroups.php b/app/Console/Commands/Correction/RemovesEmptyGroups.php index 2fac48e95b..9058b2f2ab 100644 --- a/app/Console/Commands/Correction/RemovesEmptyGroups.php +++ b/app/Console/Commands/Correction/RemovesEmptyGroups.php @@ -24,10 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Correction; +use Exception; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Models\TransactionGroup; use Illuminate\Console\Command; -use Exception; class RemovesEmptyGroups extends Command { diff --git a/app/Console/Commands/Correction/RemovesEmptyJournals.php b/app/Console/Commands/Correction/RemovesEmptyJournals.php index 4ea323c72c..1e850b4bda 100644 --- a/app/Console/Commands/Correction/RemovesEmptyJournals.php +++ b/app/Console/Commands/Correction/RemovesEmptyJournals.php @@ -30,6 +30,7 @@ use FireflyIII\Models\TransactionJournal; use Illuminate\Console\Command; use Illuminate\Database\QueryException; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Log; class RemovesEmptyJournals extends Command { @@ -68,8 +69,8 @@ class RemovesEmptyJournals extends Command $journal = TransactionJournal::find($row->transaction_journal_id); $journal?->delete(); } catch (QueryException $e) { - app('log')->info(sprintf('Could not delete journal: %s', $e->getMessage())); - app('log')->error($e->getTraceAsString()); + Log::info(sprintf('Could not delete journal: %s', $e->getMessage())); + Log::error($e->getTraceAsString()); } Transaction::where('transaction_journal_id', $row->transaction_journal_id)->delete(); @@ -96,8 +97,8 @@ class RemovesEmptyJournals extends Command $journal = TransactionJournal::find($entry->id); $journal?->delete(); } catch (QueryException $e) { - app('log')->info(sprintf('Could not delete entry: %s', $e->getMessage())); - app('log')->error($e->getTraceAsString()); + Log::info(sprintf('Could not delete entry: %s', $e->getMessage())); + Log::error($e->getTraceAsString()); } $this->friendlyInfo(sprintf('Deleted empty transaction journal #%d', $entry->id)); diff --git a/app/Console/Commands/Correction/RemovesOrphanedTransactions.php b/app/Console/Commands/Correction/RemovesOrphanedTransactions.php index f44ee5fb0d..2fd8e94dd2 100644 --- a/app/Console/Commands/Correction/RemovesOrphanedTransactions.php +++ b/app/Console/Commands/Correction/RemovesOrphanedTransactions.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Correction; +use Exception; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use Illuminate\Console\Command; -use Exception; use stdClass; /** @@ -135,9 +135,7 @@ class RemovesOrphanedTransactions extends Command // delete journals /** @var null|TransactionJournal $journal */ $journal = TransactionJournal::find($transaction->transaction_journal_id); - if (null !== $journal) { - $journal->delete(); - } + $journal?->delete(); Transaction::where('transaction_journal_id', $transaction->transaction_journal_id)->delete(); $this->friendlyWarning( sprintf( diff --git a/app/Console/Commands/Export/ExportsData.php b/app/Console/Commands/Export/ExportsData.php index d1189a2b40..90a8c9602b 100644 --- a/app/Console/Commands/Export/ExportsData.php +++ b/app/Console/Commands/Export/ExportsData.php @@ -24,20 +24,22 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Export; -use FireflyIII\Models\TransactionJournal; use Carbon\Carbon; +use Exception; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Console\Commands\VerifiesAccessToken; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\Export\ExportDataGenerator; use Illuminate\Console\Command; use Illuminate\Support\Collection; -use Exception; +use Illuminate\Support\Facades\Log; use InvalidArgumentException; +use Safe\Exceptions\FilesystemException; use function Safe\file_put_contents; @@ -189,7 +191,7 @@ class ExportsData extends Command try { $date = Carbon::createFromFormat('!Y-m-d', $this->option($field)); } catch (InvalidArgumentException $e) { - app('log')->error($e->getMessage()); + Log::error($e->getMessage()); $this->friendlyError(sprintf('%s date "%s" must be formatted YYYY-MM-DD. Field will be ignored.', $field, $this->option('start'))); $error = true; } @@ -200,7 +202,7 @@ class ExportsData extends Command } } if (null === $this->option($field)) { - app('log')->info(sprintf('No date given in field "%s"', $field)); + Log::info(sprintf('No date given in field "%s"', $field)); $error = true; } @@ -275,6 +277,7 @@ class ExportsData extends Command /** * @throws FireflyException + * @throws FilesystemException */ private function exportData(array $options, array $data): void { diff --git a/app/Console/Commands/Integrity/ReportsEmptyObjects.php b/app/Console/Commands/Integrity/ReportsEmptyObjects.php index b2d26ba555..936d8cede3 100644 --- a/app/Console/Commands/Integrity/ReportsEmptyObjects.php +++ b/app/Console/Commands/Integrity/ReportsEmptyObjects.php @@ -70,7 +70,7 @@ class ReportsEmptyObjects extends Command /** @var stdClass $entry */ foreach ($set as $entry) { $line = sprintf( - 'User #%d (%s) has budget #%d ("%s") which has no transaction journals.', + 'User #%d (%s) has budget #%d ("%s") which has no transactions.', $entry->user_id, $entry->email, $entry->id, @@ -96,7 +96,7 @@ class ReportsEmptyObjects extends Command /** @var stdClass $entry */ foreach ($set as $entry) { $line = sprintf( - 'User #%d (%s) has category #%d ("%s") which has no transaction journals.', + 'User #%d (%s) has category #%d ("%s") which has no transactions.', $entry->user_id, $entry->email, $entry->id, @@ -119,7 +119,7 @@ class ReportsEmptyObjects extends Command /** @var stdClass $entry */ foreach ($set as $entry) { $line = sprintf( - 'User #%d (%s) has tag #%d ("%s") which has no transaction journals.', + 'User #%d (%s) has tag #%d ("%s") which has no transactions.', $entry->user_id, $entry->email, $entry->id, diff --git a/app/Console/Commands/System/CallsLaravelPassportKeys.php b/app/Console/Commands/System/CallsLaravelPassportKeys.php index 22e1ebddd3..2d48051fe2 100644 --- a/app/Console/Commands/System/CallsLaravelPassportKeys.php +++ b/app/Console/Commands/System/CallsLaravelPassportKeys.php @@ -42,7 +42,7 @@ class CallsLaravelPassportKeys extends Command */ public function handle(): int { - Artisan::call('passport:keys --no-interaction', []); + Artisan::call('passport:keys --no-interaction'); $result = Artisan::output(); if (str_contains($result, 'Encryption keys already exist')) { $this->friendlyInfo('Encryption keys exist already.'); diff --git a/app/Console/Commands/System/ForcesDecimalSize.php b/app/Console/Commands/System/ForcesDecimalSize.php index 91884011ce..4cbbe5546c 100644 --- a/app/Console/Commands/System/ForcesDecimalSize.php +++ b/app/Console/Commands/System/ForcesDecimalSize.php @@ -40,11 +40,11 @@ use FireflyIII\Models\TransactionCurrency; use Illuminate\Console\Command; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; -use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Log; -use function Safe\mb_regex_encoding; use function Safe\json_encode; +use function Safe\mb_regex_encoding; /** * This command was inspired by https://github.com/elliot-gh. It will check all amount fields @@ -95,7 +95,7 @@ class ForcesDecimalSize extends Command */ public function handle(): int { - app('log')->debug('Now in ForceDecimalSize::handle()'); + Log::debug('Now in ForceDecimalSize::handle()'); $this->determineDatabaseType(); $this->friendlyError('Running this command is dangerous and can cause data loss.'); @@ -155,7 +155,6 @@ class ForcesDecimalSize extends Command */ private function correctAmountsByCurrency(): void { - /** @var Collection $enabled */ $enabled = TransactionCurrency::whereEnabled(1)->get(); /** @var TransactionCurrency $currency */ @@ -300,7 +299,7 @@ class ForcesDecimalSize extends Command } ); - $result = $query->get(['*']); + $result = $query->get(); if (0 === $result->count()) { $this->friendlyPositive(sprintf('All %s in %s are OK', $table, $currency->code)); @@ -532,7 +531,7 @@ class ForcesDecimalSize extends Command DB::raw(sprintf($this->regularExpression, $currency->decimal_places)) ); - $result = $query->get(['*']); + $result = $query->get(); if (0 === $result->count()) { $this->friendlyPositive(sprintf('All transactions in foreign currency %s are OK', $currency->code)); diff --git a/app/Console/Commands/System/OutputsInstructions.php b/app/Console/Commands/System/OutputsInstructions.php index fb99e99692..877576e4a4 100644 --- a/app/Console/Commands/System/OutputsInstructions.php +++ b/app/Console/Commands/System/OutputsInstructions.php @@ -26,12 +26,14 @@ namespace FireflyIII\Console\Commands\System; use Carbon\Carbon; use FireflyIII\Support\System\GeneratesInstallationId; +use FireflyIII\Support\System\IsOldVersion; use Illuminate\Console\Command; use Random\RandomException; class OutputsInstructions extends Command { use GeneratesInstallationId; + use IsOldVersion; protected $description = 'Instructions in case of upgrade trouble.'; @@ -58,7 +60,7 @@ class OutputsInstructions extends Command */ private function updateInstructions(): void { - $version = (string) config('firefly.version'); + $version = (string)config('firefly.version'); /** @var array $config */ $config = config('upgrade.text.upgrade'); @@ -68,12 +70,12 @@ class OutputsInstructions extends Command foreach (array_keys($config) as $compare) { // if string starts with: if (str_starts_with($version, $compare)) { - $text = (string) $config[$compare]; + $text = (string)$config[$compare]; } } // validate some settings. - if ('' === $text && 'local' === (string) config('app.env')) { + if ('' === $text && 'local' === (string)config('app.env')) { $text = 'Please set APP_ENV=production for a safer environment.'; } @@ -191,7 +193,7 @@ class OutputsInstructions extends Command */ private function installInstructions(): void { - $version = (string) config('firefly.version'); + $version = (string)config('firefly.version'); /** @var array $config */ $config = config('upgrade.text.install'); @@ -201,12 +203,12 @@ class OutputsInstructions extends Command foreach (array_keys($config) as $compare) { // if string starts with: if (str_starts_with($version, $compare)) { - $text = (string) $config[$compare]; + $text = (string)$config[$compare]; } } // validate some settings. - if ('' === $text && 'local' === (string) config('app.env')) { + if ('' === $text && 'local' === (string)config('app.env')) { $text = 'Please set APP_ENV=production for a safer environment.'; } @@ -242,14 +244,15 @@ class OutputsInstructions extends Command private function someQuote(): void { - $lines = [ - 'Forgive yourself for not being at peace.', - 'Doesn\'t look like anything to me.', - 'Be proud of what you make.', - 'Be there or forever wonder.', - 'A year from now you will wish you had started today.', + $lines = [ + '"Forgive yourself for not being at peace."', + '"Doesn\'t look like anything to me."', + '"Be proud of what you make."', + '"Be there or forever wonder."', + '"A year from now you will wish you had started today."', + '🇺🇦 Слава Україні!', + '🇺🇦 Slava Ukraini!', ]; - $addQuotes = true; // fuck the Russian aggression in Ukraine. @@ -260,8 +263,7 @@ class OutputsInstructions extends Command // going on, to allow that to happen. if ('ru_RU' === config('firefly.default_language')) { - $addQuotes = false; - $lines = [ + $lines = [ '🇺🇦 Слава Україні!', '🇺🇦 Slava Ukraini!', ]; @@ -272,11 +274,6 @@ class OutputsInstructions extends Command } catch (RandomException) { $random = 0; } - if ($addQuotes) { - $this->line(sprintf(' "%s"', $lines[$random])); - - return; - } $this->line(sprintf(' %s', $lines[$random])); } diff --git a/app/Console/Commands/System/SetsLatestVersion.php b/app/Console/Commands/System/SetsLatestVersion.php index f6207ee15a..3c6f6b5244 100644 --- a/app/Console/Commands/System/SetsLatestVersion.php +++ b/app/Console/Commands/System/SetsLatestVersion.php @@ -25,6 +25,7 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\System; use FireflyIII\Console\Commands\ShowsFriendlyMessages; +use FireflyIII\Support\Facades\FireflyConfig; use Illuminate\Console\Command; class SetsLatestVersion extends Command @@ -45,8 +46,7 @@ class SetsLatestVersion extends Command return 0; } - app('fireflyconfig')->set('db_version', config('firefly.db_version')); - app('fireflyconfig')->set('ff3_version', config('firefly.version')); + FireflyConfig::set('ff3_version', config('firefly.version')); $this->friendlyInfo('Updated version.'); return 0; diff --git a/app/Console/Commands/System/VerifySecurityAlerts.php b/app/Console/Commands/System/VerifySecurityAlerts.php index 920142d794..ff801050b9 100644 --- a/app/Console/Commands/System/VerifySecurityAlerts.php +++ b/app/Console/Commands/System/VerifySecurityAlerts.php @@ -27,8 +27,10 @@ namespace FireflyIII\Console\Commands\System; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use Illuminate\Console\Command; use Illuminate\Database\QueryException; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; use League\Flysystem\FilesystemException; +use Safe\Exceptions\JsonException; use function Safe\json_decode; @@ -44,6 +46,7 @@ class VerifySecurityAlerts extends Command * Execute the console command. * * @throws FilesystemException + * @throws JsonException */ public function handle(): int { @@ -54,7 +57,7 @@ class VerifySecurityAlerts extends Command $disk = Storage::disk('resources'); // Next line is ignored because it's a Laravel Facade. if (!$disk->has('alerts.json')) { // @phpstan-ignore-line - app('log')->debug('No alerts.json file present.'); + Log::debug('No alerts.json file present.'); return 0; } @@ -64,19 +67,19 @@ class VerifySecurityAlerts extends Command /** @var array $array */ foreach ($json as $array) { if ($version === $array['version'] && true === $array['advisory']) { - app('log')->debug(sprintf('Version %s has an alert!', $array['version'])); + Log::debug(sprintf('Version %s has an alert!', $array['version'])); // add advisory to configuration. $this->saveSecurityAdvisory($array); // depends on level if ('info' === $array['level']) { - app('log')->debug('INFO level alert'); + Log::debug('INFO level alert'); $this->friendlyInfo($array['message']); return 0; } if ('warning' === $array['level']) { - app('log')->debug('WARNING level alert'); + Log::debug('WARNING level alert'); $this->friendlyWarning('------------------------ :o'); $this->friendlyWarning($array['message']); $this->friendlyWarning('------------------------ :o'); @@ -84,7 +87,7 @@ class VerifySecurityAlerts extends Command return 0; } if ('danger' === $array['level']) { - app('log')->debug('DANGER level alert'); + Log::debug('DANGER level alert'); $this->friendlyError('------------------------ :-('); $this->friendlyError($array['message']); $this->friendlyError('------------------------ :-('); @@ -95,7 +98,7 @@ class VerifySecurityAlerts extends Command return 0; } } - app('log')->debug(sprintf('No security alerts for version %s', $version)); + Log::debug(sprintf('No security alerts for version %s', $version)); $this->friendlyPositive(sprintf('No security alerts for version %s', $version)); return 0; @@ -107,7 +110,7 @@ class VerifySecurityAlerts extends Command app('fireflyconfig')->delete('upgrade_security_message'); app('fireflyconfig')->delete('upgrade_security_level'); } catch (QueryException $e) { - app('log')->debug(sprintf('Could not delete old security advisory, but thats OK: %s', $e->getMessage())); + Log::debug(sprintf('Could not delete old security advisory, but thats OK: %s', $e->getMessage())); } } @@ -117,7 +120,7 @@ class VerifySecurityAlerts extends Command app('fireflyconfig')->set('upgrade_security_message', $array['message']); app('fireflyconfig')->set('upgrade_security_level', $array['level']); } catch (QueryException $e) { - app('log')->debug(sprintf('Could not save new security advisory, but thats OK: %s', $e->getMessage())); + Log::debug(sprintf('Could not save new security advisory, but thats OK: %s', $e->getMessage())); } } } diff --git a/app/Console/Commands/Tools/ApplyRules.php b/app/Console/Commands/Tools/ApplyRules.php index 6a42ac0990..0b07299ab1 100644 --- a/app/Console/Commands/Tools/ApplyRules.php +++ b/app/Console/Commands/Tools/ApplyRules.php @@ -315,7 +315,7 @@ class ApplyRules extends Command // if in rule selection, or group in selection or all rules, it's included. $test = $this->includeRule($rule, $group); if (true === $test) { - app('log')->debug(sprintf('Will include rule #%d "%s"', $rule->id, $rule->title)); + Log::debug(sprintf('Will include rule #%d "%s"', $rule->id, $rule->title)); $rulesToApply->push($rule); } } diff --git a/app/Console/Commands/Tools/Cron.php b/app/Console/Commands/Tools/Cron.php index 27a4e66a64..ec91c4ebde 100644 --- a/app/Console/Commands/Tools/Cron.php +++ b/app/Console/Commands/Tools/Cron.php @@ -76,8 +76,8 @@ class Cron extends Command try { $this->exchangeRatesCronJob($force, $date); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); $this->friendlyError($e->getMessage()); } } @@ -87,8 +87,8 @@ class Cron extends Command try { $this->checkForUpdates($force); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); $this->friendlyError($e->getMessage()); } } @@ -98,8 +98,8 @@ class Cron extends Command try { $this->recurringCronJob($force, $date); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); $this->friendlyError($e->getMessage()); } } @@ -109,8 +109,8 @@ class Cron extends Command try { $this->autoBudgetCronJob($force, $date); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); $this->friendlyError($e->getMessage()); } } @@ -120,8 +120,8 @@ class Cron extends Command try { $this->subscriptionWarningCronJob($force, $date); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); $this->friendlyError($e->getMessage()); } } @@ -130,8 +130,8 @@ class Cron extends Command try { $this->webhookCronJob($force, $date); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); $this->friendlyError($e->getMessage()); } } diff --git a/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php b/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php index af59ca61ce..baef09da3d 100644 --- a/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php +++ b/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php @@ -25,12 +25,12 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Upgrade; use FireflyIII\Console\Commands\ShowsFriendlyMessages; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalCLIRepositoryInterface; use Illuminate\Console\Command; use Illuminate\Database\QueryException; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Schema; class AddsTransactionIdentifiers extends Command @@ -52,8 +52,6 @@ class AddsTransactionIdentifiers extends Command * * When either of these are the same amount, FF3 can't keep them apart: +3/-3, +3/-3, +3/-3. This happens more * often than you would think. So each set gets a number (1,2,3) to keep them apart. - * - * @throws FireflyException */ public function handle(): int { @@ -100,11 +98,9 @@ class AddsTransactionIdentifiers extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } - return false; + return (bool)$configVar?->data; + } /** @@ -147,7 +143,7 @@ class AddsTransactionIdentifiers extends Command ->first() ; } catch (QueryException $e) { - app('log')->error($e->getMessage()); + Log::error($e->getMessage()); $this->friendlyError('Firefly III could not find the "identifier" field in the "transactions" table.'); $this->friendlyError(sprintf('This field is required for Firefly III version %s to run.', config('firefly.version'))); $this->friendlyError('Please run "php artisan migrate --force" to add this field to the table.'); diff --git a/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php b/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php index b1e3d198db..03070692ef 100644 --- a/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php +++ b/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php @@ -31,6 +31,7 @@ use Illuminate\Console\Command; use Illuminate\Contracts\Encryption\DecryptException; use Illuminate\Support\Facades\Crypt; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Log; use JsonException; use stdClass; @@ -96,13 +97,11 @@ class RemovesDatabaseDecryption extends Command try { $configVar = app('fireflyconfig')->get($configName, false); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - } - if (null !== $configVar) { - return (bool) $configVar->data; + Log::error($e->getMessage()); } - return false; + return (bool)$configVar?->data; + } private function decryptField(string $table, string $field): void @@ -129,8 +128,8 @@ class RemovesDatabaseDecryption extends Command } catch (FireflyException $e) { $message = sprintf('Could not decrypt field "%s" in row #%d of table "%s": %s', $field, $id, $table, $e->getMessage()); $this->friendlyError($message); - app('log')->error($message); - app('log')->error($e->getTraceAsString()); + Log::error($message); + Log::error($e->getTraceAsString()); } // A separate routine for preferences table: @@ -175,9 +174,9 @@ class RemovesDatabaseDecryption extends Command } 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); - app('log')->warning($message); - app('log')->warning($value); - app('log')->warning($e->getTraceAsString()); + Log::warning($message); + Log::warning($value); + Log::warning($e->getTraceAsString()); return; } diff --git a/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php b/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php index eef26f8608..cb1a35cc55 100644 --- a/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php +++ b/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php @@ -24,14 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Upgrade; -use FireflyIII\Models\TransactionJournal; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Enums\AccountTypeEnum; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; use FireflyIII\Models\AccountMeta; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionCurrency; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; @@ -99,9 +98,6 @@ class UpgradesAccountCurrencies extends Command } } - /** - * @throws FireflyException - */ private function updateCurrenciesForUser(User $user): void { $this->accountRepos->setUser($user); diff --git a/app/Console/Commands/Upgrade/UpgradesAccountMetaData.php b/app/Console/Commands/Upgrade/UpgradesAccountMetaData.php index d181e41e22..234fc3cba8 100644 --- a/app/Console/Commands/Upgrade/UpgradesAccountMetaData.php +++ b/app/Console/Commands/Upgrade/UpgradesAccountMetaData.php @@ -83,11 +83,9 @@ class UpgradesAccountMetaData extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } - return false; + return (bool)$configVar?->data; + } private function markAsExecuted(): void diff --git a/app/Console/Commands/Upgrade/UpgradesAttachments.php b/app/Console/Commands/Upgrade/UpgradesAttachments.php index c3e0d32eb9..5c8022345b 100644 --- a/app/Console/Commands/Upgrade/UpgradesAttachments.php +++ b/app/Console/Commands/Upgrade/UpgradesAttachments.php @@ -29,6 +29,7 @@ use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Attachment; use FireflyIII\Models\Note; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Log; class UpgradesAttachments extends Command { @@ -75,7 +76,7 @@ class UpgradesAttachments extends Command $att->description = ''; $att->save(); - app('log')->debug(sprintf('Migrated attachment #%s description to note #%d.', $att->id, $note->id)); + Log::debug(sprintf('Migrated attachment #%s description to note #%d.', $att->id, $note->id)); ++$count; } } @@ -92,11 +93,9 @@ class UpgradesAttachments extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } - return false; + return (bool)$configVar?->data; + } private function markAsExecuted(): void diff --git a/app/Console/Commands/Upgrade/UpgradesBillsToRules.php b/app/Console/Commands/Upgrade/UpgradesBillsToRules.php index b146f11e8b..a244f74738 100644 --- a/app/Console/Commands/Upgrade/UpgradesBillsToRules.php +++ b/app/Console/Commands/Upgrade/UpgradesBillsToRules.php @@ -99,17 +99,13 @@ class UpgradesBillsToRules extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } - return false; + return (bool)$configVar?->data; + } /** * Migrate bills to new rule structure for a specific user. - * - * @throws FireflyException */ private function migrateUser(User $user): void { diff --git a/app/Console/Commands/Upgrade/UpgradesBudgetLimitPeriods.php b/app/Console/Commands/Upgrade/UpgradesBudgetLimitPeriods.php index a43f05682d..d3581741b3 100644 --- a/app/Console/Commands/Upgrade/UpgradesBudgetLimitPeriods.php +++ b/app/Console/Commands/Upgrade/UpgradesBudgetLimitPeriods.php @@ -27,6 +27,7 @@ namespace FireflyIII\Console\Commands\Upgrade; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Models\BudgetLimit; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Log; class UpgradesBudgetLimitPeriods extends Command { @@ -84,7 +85,7 @@ class UpgradesBudgetLimitPeriods extends Command $limit->end_date->format('Y-m-d') ); $this->friendlyWarning($message); - app('log')->warning($message); + Log::warning($message); return; } @@ -98,7 +99,7 @@ class UpgradesBudgetLimitPeriods extends Command $limit->end_date->format('Y-m-d'), $period ); - app('log')->debug($msg); + Log::debug($msg); } private function getLimitPeriod(BudgetLimit $limit): ?string diff --git a/app/Console/Commands/Upgrade/UpgradesBudgetLimits.php b/app/Console/Commands/Upgrade/UpgradesBudgetLimits.php index 473247de6f..2b55dabfd5 100644 --- a/app/Console/Commands/Upgrade/UpgradesBudgetLimits.php +++ b/app/Console/Commands/Upgrade/UpgradesBudgetLimits.php @@ -85,11 +85,9 @@ class UpgradesBudgetLimits extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } - return false; + return (bool)$configVar?->data; + } private function markAsExecuted(): void diff --git a/app/Console/Commands/Upgrade/UpgradesCurrencyPreferences.php b/app/Console/Commands/Upgrade/UpgradesCurrencyPreferences.php index 6e2527c8f4..92b8b0445b 100644 --- a/app/Console/Commands/Upgrade/UpgradesCurrencyPreferences.php +++ b/app/Console/Commands/Upgrade/UpgradesCurrencyPreferences.php @@ -66,11 +66,9 @@ class UpgradesCurrencyPreferences extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool)$configVar->data; - } - return false; + return (bool)$configVar?->data; + } private function runUpgrade(): void diff --git a/app/Console/Commands/Upgrade/UpgradesDatabase.php b/app/Console/Commands/Upgrade/UpgradesDatabase.php index 92429a9a36..32ff857c9e 100644 --- a/app/Console/Commands/Upgrade/UpgradesDatabase.php +++ b/app/Console/Commands/Upgrade/UpgradesDatabase.php @@ -24,6 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Upgrade; +use FireflyIII\Console\Commands\ShowsFriendlyMessages; +use FireflyIII\Support\Facades\FireflyConfig; +use Illuminate\Console\Command; use Illuminate\Support\Facades\Log; use Safe\Exceptions\InfoException; @@ -35,9 +38,6 @@ try { 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; - class UpgradesDatabase extends Command { use ShowsFriendlyMessages; @@ -86,10 +86,8 @@ class UpgradesDatabase extends Command $this->friendlyLine(sprintf('Now executing %s', $command)); $this->call($command, $args); } - // set new DB version. - app('fireflyconfig')->set('db_version', (int) config('firefly.db_version')); // index will set FF3 version. - app('fireflyconfig')->set('ff3_version', (string) config('firefly.version')); + FireflyConfig::set('ff3_version', (string) config('firefly.version')); return 0; } diff --git a/app/Console/Commands/Upgrade/UpgradesJournalNotes.php b/app/Console/Commands/Upgrade/UpgradesJournalNotes.php index 788cf1f6c1..2190cea5e1 100644 --- a/app/Console/Commands/Upgrade/UpgradesJournalNotes.php +++ b/app/Console/Commands/Upgrade/UpgradesJournalNotes.php @@ -28,6 +28,7 @@ use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Models\Note; use FireflyIII\Models\TransactionJournalMeta; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Log; class UpgradesJournalNotes extends Command { @@ -66,7 +67,7 @@ class UpgradesJournalNotes extends Command $note->text = $meta->data; $note->save(); - app('log')->debug(sprintf('Migrated meta note #%d to Note #%d', $meta->id, $note->id)); + Log::debug(sprintf('Migrated meta note #%d to Note #%d', $meta->id, $note->id)); $meta->delete(); ++$count; @@ -86,11 +87,9 @@ class UpgradesJournalNotes extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } - return false; + return (bool)$configVar?->data; + } private function markAsExecuted(): void diff --git a/app/Console/Commands/Upgrade/UpgradesLiabilities.php b/app/Console/Commands/Upgrade/UpgradesLiabilities.php index 4a4074b1fb..23b94883f7 100644 --- a/app/Console/Commands/Upgrade/UpgradesLiabilities.php +++ b/app/Console/Commands/Upgrade/UpgradesLiabilities.php @@ -62,11 +62,9 @@ class UpgradesLiabilities extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } - return false; + return (bool)$configVar?->data; + } private function upgradeLiabilities(): void diff --git a/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php b/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php index 9a2bf9f048..26ecde2584 100644 --- a/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php +++ b/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php @@ -35,6 +35,7 @@ use FireflyIII\Services\Internal\Destroy\TransactionGroupDestroyService; use FireflyIII\Services\Internal\Support\CreditRecalculateService; use FireflyIII\User; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Log; class UpgradesLiabilitiesEight extends Command { @@ -63,11 +64,9 @@ class UpgradesLiabilitiesEight extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } - return false; + return (bool)$configVar?->data; + } private function upgradeLiabilities(): void @@ -186,7 +185,7 @@ class UpgradesLiabilitiesEight extends Command return; } - app('log')->warning('Did not find opening balance.'); + Log::warning('Did not find opening balance.'); } private function deleteTransactions(Account $account): int diff --git a/app/Console/Commands/Upgrade/UpgradesMultiPiggyBanks.php b/app/Console/Commands/Upgrade/UpgradesMultiPiggyBanks.php index d155510181..61f7ba4b0e 100644 --- a/app/Console/Commands/Upgrade/UpgradesMultiPiggyBanks.php +++ b/app/Console/Commands/Upgrade/UpgradesMultiPiggyBanks.php @@ -65,11 +65,9 @@ class UpgradesMultiPiggyBanks extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } - return false; + return (bool)$configVar?->data; + } private function upgradePiggyBanks(): void diff --git a/app/Console/Commands/Upgrade/UpgradesPrimaryCurrencyAmounts.php b/app/Console/Commands/Upgrade/UpgradesPrimaryCurrencyAmounts.php index 9cb26669ee..40e768aefc 100644 --- a/app/Console/Commands/Upgrade/UpgradesPrimaryCurrencyAmounts.php +++ b/app/Console/Commands/Upgrade/UpgradesPrimaryCurrencyAmounts.php @@ -61,11 +61,9 @@ class UpgradesPrimaryCurrencyAmounts extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } - return false; + return (bool)$configVar?->data; + } private function markAsExecuted(): void diff --git a/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php b/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php index d40f566a4c..c6126388ec 100644 --- a/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php +++ b/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php @@ -66,11 +66,9 @@ class UpgradesRecurrenceMetaData extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } - return false; + return (bool)$configVar?->data; + } private function migrateMetaData(): int diff --git a/app/Console/Commands/Upgrade/UpgradesRuleActions.php b/app/Console/Commands/Upgrade/UpgradesRuleActions.php index c3619be8f9..0be7c55811 100644 --- a/app/Console/Commands/Upgrade/UpgradesRuleActions.php +++ b/app/Console/Commands/Upgrade/UpgradesRuleActions.php @@ -64,11 +64,9 @@ class UpgradesRuleActions extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } - return false; + return (bool)$configVar?->data; + } private function replaceEqualSign(): void diff --git a/app/Console/Commands/Upgrade/UpgradesTagLocations.php b/app/Console/Commands/Upgrade/UpgradesTagLocations.php index a6fe336a49..c891de9982 100644 --- a/app/Console/Commands/Upgrade/UpgradesTagLocations.php +++ b/app/Console/Commands/Upgrade/UpgradesTagLocations.php @@ -58,11 +58,9 @@ class UpgradesTagLocations extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } - return false; + return (bool)$configVar?->data; + } private function migrateTagLocations(): void diff --git a/app/Console/Commands/Upgrade/UpgradesToGroups.php b/app/Console/Commands/Upgrade/UpgradesToGroups.php index 453c31e0d3..c5db2427ca 100644 --- a/app/Console/Commands/Upgrade/UpgradesToGroups.php +++ b/app/Console/Commands/Upgrade/UpgradesToGroups.php @@ -25,6 +25,7 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Upgrade; use Carbon\Carbon; +use Exception; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Factory\TransactionGroupFactory; use FireflyIII\Models\Budget; @@ -37,7 +38,7 @@ use FireflyIII\Services\Internal\Destroy\JournalDestroyService; use Illuminate\Console\Command; use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; -use Exception; +use Illuminate\Support\Facades\Log; class UpgradesToGroups extends Command { @@ -97,11 +98,9 @@ class UpgradesToGroups extends Command private function isMigrated(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } - return false; + return (bool)$configVar?->data; + } /** @@ -127,11 +126,11 @@ class UpgradesToGroups extends Command { // double check transaction count. if ($journal->transactions->count() <= 2) { - app('log')->debug(sprintf('Will not try to convert journal #%d because it has 2 or fewer transactions.', $journal->id)); + Log::debug(sprintf('Will not try to convert journal #%d because it has 2 or fewer transactions.', $journal->id)); return; } - app('log')->debug(sprintf('Will now try to convert journal #%d', $journal->id)); + Log::debug(sprintf('Will now try to convert journal #%d', $journal->id)); $this->journalRepository->setUser($journal->user); $this->groupFactory->setUser($journal->user); @@ -144,15 +143,15 @@ class UpgradesToGroups extends Command ]; $destTransactions = $this->getDestinationTransactions($journal); - app('log')->debug(sprintf('Will use %d positive transactions to create a new group.', $destTransactions->count())); + Log::debug(sprintf('Will use %d positive transactions to create a new group.', $destTransactions->count())); /** @var Transaction $transaction */ foreach ($destTransactions as $transaction) { $data['transactions'][] = $this->generateTransaction($journal, $transaction); } - app('log')->debug(sprintf('Now calling transaction journal factory (%d transactions in array)', count($data['transactions']))); + Log::debug(sprintf('Now calling transaction journal factory (%d transactions in array)', count($data['transactions']))); $group = $this->groupFactory->create($data); - app('log')->debug('Done calling transaction journal factory'); + Log::debug('Done calling transaction journal factory'); // delete the old transaction journal. $this->service->destroy($journal); @@ -160,7 +159,7 @@ class UpgradesToGroups extends Command ++$this->count; // report on result: - app('log')->debug( + Log::debug( sprintf( 'Migrated journal #%d into group #%d with these journals: #%s', $journal->id, @@ -190,7 +189,7 @@ class UpgradesToGroups extends Command */ private function generateTransaction(TransactionJournal $journal, Transaction $transaction): array { - app('log')->debug(sprintf('Now going to add transaction #%d to the array.', $transaction->id)); + Log::debug(sprintf('Now going to add transaction #%d to the array.', $transaction->id)); $opposingTr = $this->findOpposingTransaction($journal, $transaction); if (!$opposingTr instanceof Transaction) { @@ -282,8 +281,8 @@ class UpgradesToGroups extends Command static function (Transaction $subject) use ($transaction) { $amount = (float) $transaction->amount * -1 === (float) $subject->amount; // intentional float $identifier = $transaction->identifier === $subject->identifier; - app('log')->debug(sprintf('Amount the same? %s', var_export($amount, true))); - app('log')->debug(sprintf('ID the same? %s', var_export($identifier, true))); + Log::debug(sprintf('Amount the same? %s', var_export($amount, true))); + Log::debug(sprintf('ID the same? %s', var_export($identifier, true))); return $amount && $identifier; } @@ -294,13 +293,13 @@ class UpgradesToGroups extends Command private function getTransactionBudget(Transaction $left, Transaction $right): ?int { - app('log')->debug('Now in getTransactionBudget()'); + Log::debug('Now in getTransactionBudget()'); // try to get a budget ID from the left transaction: /** @var null|Budget $budget */ $budget = $left->budgets()->first(); if (null !== $budget) { - app('log')->debug(sprintf('Return budget #%d, from transaction #%d', $budget->id, $left->id)); + Log::debug(sprintf('Return budget #%d, from transaction #%d', $budget->id, $left->id)); return $budget->id; } @@ -309,11 +308,11 @@ class UpgradesToGroups extends Command /** @var null|Budget $budget */ $budget = $right->budgets()->first(); if (null !== $budget) { - app('log')->debug(sprintf('Return budget #%d, from transaction #%d', $budget->id, $right->id)); + Log::debug(sprintf('Return budget #%d, from transaction #%d', $budget->id, $right->id)); return $budget->id; } - app('log')->debug('Neither left or right have a budget, return NULL'); + Log::debug('Neither left or right have a budget, return NULL'); // if all fails, return NULL. return null; @@ -321,13 +320,13 @@ class UpgradesToGroups extends Command private function getTransactionCategory(Transaction $left, Transaction $right): ?int { - app('log')->debug('Now in getTransactionCategory()'); + Log::debug('Now in getTransactionCategory()'); // try to get a category ID from the left transaction: /** @var null|Category $category */ $category = $left->categories()->first(); if (null !== $category) { - app('log')->debug(sprintf('Return category #%d, from transaction #%d', $category->id, $left->id)); + Log::debug(sprintf('Return category #%d, from transaction #%d', $category->id, $left->id)); return $category->id; } @@ -336,11 +335,11 @@ class UpgradesToGroups extends Command /** @var null|Category $category */ $category = $right->categories()->first(); if (null !== $category) { - app('log')->debug(sprintf('Return category #%d, from transaction #%d', $category->id, $category->id)); + Log::debug(sprintf('Return category #%d, from transaction #%d', $category->id, $category->id)); return $category->id; } - app('log')->debug('Neither left or right have a category, return NULL'); + Log::debug('Neither left or right have a category, return NULL'); // if all fails, return NULL. return null; @@ -354,7 +353,7 @@ class UpgradesToGroups extends Command $orphanedJournals = $this->cliRepository->getJournalsWithoutGroup(); $total = count($orphanedJournals); if ($total > 0) { - app('log')->debug(sprintf('Going to convert %d transaction journals. Please hold..', $total)); + Log::debug(sprintf('Going to convert %d transaction journals. Please hold..', $total)); $this->friendlyInfo(sprintf('Going to convert %d transaction journals. Please hold..', $total)); /** @var array $array */ diff --git a/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php b/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php index d92813d6cd..2b4b566c8b 100644 --- a/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php +++ b/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php @@ -33,6 +33,7 @@ use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Journal\JournalCLIRepositoryInterface; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Log; class UpgradesTransferCurrencies extends Command { @@ -105,11 +106,9 @@ class UpgradesTransferCurrencies extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } - return false; + return (bool)$configVar?->data; + } /** @@ -262,7 +261,7 @@ class UpgradesTransferCurrencies extends Command // source account must have a currency preference. if (!$this->sourceCurrency instanceof TransactionCurrency) { $message = sprintf('Account #%d ("%s") must have currency preference but has none.', $this->sourceAccount->id, $this->sourceAccount->name); - app('log')->error($message); + Log::error($message); $this->friendlyError($message); return true; @@ -275,7 +274,7 @@ class UpgradesTransferCurrencies extends Command $this->destinationAccount->id, $this->destinationAccount->name ); - app('log')->error($message); + Log::error($message); $this->friendlyError($message); return true; diff --git a/app/Console/Commands/Upgrade/UpgradesVariousCurrencyInformation.php b/app/Console/Commands/Upgrade/UpgradesVariousCurrencyInformation.php index 648b34ed5e..2b47161771 100644 --- a/app/Console/Commands/Upgrade/UpgradesVariousCurrencyInformation.php +++ b/app/Console/Commands/Upgrade/UpgradesVariousCurrencyInformation.php @@ -87,11 +87,9 @@ class UpgradesVariousCurrencyInformation extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } - return false; + return (bool)$configVar?->data; + } /** diff --git a/app/Console/Commands/Upgrade/UpgradesWebhooks.php b/app/Console/Commands/Upgrade/UpgradesWebhooks.php index 46e39e11e7..e917b09596 100644 --- a/app/Console/Commands/Upgrade/UpgradesWebhooks.php +++ b/app/Console/Commands/Upgrade/UpgradesWebhooks.php @@ -64,11 +64,9 @@ class UpgradesWebhooks extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool)$configVar->data; - } - return false; + return (bool)$configVar?->data; + } private function upgradeWebhooks(): void diff --git a/app/Console/Commands/VerifiesAccessToken.php b/app/Console/Commands/VerifiesAccessToken.php index 9b9d3d06c2..906980df68 100644 --- a/app/Console/Commands/VerifiesAccessToken.php +++ b/app/Console/Commands/VerifiesAccessToken.php @@ -27,6 +27,7 @@ namespace FireflyIII\Console\Commands; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; +use Illuminate\Support\Facades\Log; /** * Trait VerifiesAccessToken. @@ -63,8 +64,6 @@ trait VerifiesAccessToken /** * Returns false when given token does not match given user token. - * - * @throws FireflyException */ protected function verifyAccessToken(): bool { @@ -76,19 +75,19 @@ trait VerifiesAccessToken $user = $repository->find($userId); if (null === $user) { - app('log')->error(sprintf('verifyAccessToken(): no such user for input "%d"', $userId)); + Log::error(sprintf('verifyAccessToken(): no such user for input "%d"', $userId)); return false; } $accessToken = app('preferences')->getForUser($user, 'access_token'); if (null === $accessToken) { - app('log')->error(sprintf('User #%d has no access token, so cannot access command line options.', $userId)); + Log::error(sprintf('User #%d has no access token, so cannot access command line options.', $userId)); return false; } if ($accessToken->data !== $token) { - app('log')->error(sprintf('Invalid access token for user #%d.', $userId)); - app('log')->error(sprintf('Token given is "%s", expected something else.', $token)); + Log::error(sprintf('Invalid access token for user #%d.', $userId)); + Log::error(sprintf('Token given is "%s", expected something else.', $token)); return false; } diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index bccbb2c3e5..071cdb65ca 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -26,6 +26,7 @@ namespace FireflyIII\Console; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; +use Illuminate\Support\Facades\Log; use Override; /** @@ -52,7 +53,7 @@ class Kernel extends ConsoleKernel { $schedule->call( static function (): void { - app('log')->error( + Log::error( 'Firefly III no longer users the Laravel scheduler to do cron jobs! Please read the instructions at https://docs.firefly-iii.org/' ); echo "\n"; diff --git a/app/Events/DestroyedTransactionGroup.php b/app/Events/DestroyedTransactionGroup.php index f6692981f9..80b2dbaf79 100644 --- a/app/Events/DestroyedTransactionGroup.php +++ b/app/Events/DestroyedTransactionGroup.php @@ -26,6 +26,7 @@ namespace FireflyIII\Events; use FireflyIII\Models\TransactionGroup; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Facades\Log; /** * Class DestroyedTransactionGroup. @@ -39,6 +40,6 @@ class DestroyedTransactionGroup extends Event */ public function __construct(public TransactionGroup $transactionGroup) { - app('log')->debug(sprintf('Now in %s', __METHOD__)); + Log::debug(sprintf('Now in %s', __METHOD__)); } } diff --git a/app/Events/Model/PiggyBank/ChangedAmount.php b/app/Events/Model/PiggyBank/ChangedAmount.php index f60e8a5113..ffcae27f76 100644 --- a/app/Events/Model/PiggyBank/ChangedAmount.php +++ b/app/Events/Model/PiggyBank/ChangedAmount.php @@ -29,6 +29,7 @@ use FireflyIII\Models\PiggyBank; use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Facades\Log; /** * Class ChangedAmount @@ -45,7 +46,7 @@ class ChangedAmount extends Event */ public function __construct(PiggyBank $piggyBank, string $amount, public ?TransactionJournal $transactionJournal, public ?TransactionGroup $transactionGroup) { - app('log')->debug(sprintf('Created piggy bank event for piggy bank #%d with amount %s', $piggyBank->id, $amount)); + Log::debug(sprintf('Created piggy bank event for piggy bank #%d with amount %s', $piggyBank->id, $amount)); $this->piggyBank = $piggyBank; $this->amount = $amount; } diff --git a/app/Events/Model/Rule/RuleActionFailedOnArray.php b/app/Events/Model/Rule/RuleActionFailedOnArray.php index fc537cb430..9cb80f7fe2 100644 --- a/app/Events/Model/Rule/RuleActionFailedOnArray.php +++ b/app/Events/Model/Rule/RuleActionFailedOnArray.php @@ -26,6 +26,7 @@ namespace FireflyIII\Events\Model\Rule; use FireflyIII\Models\RuleAction; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Facades\Log; /** * Class RuleActionFailedOnArray @@ -36,6 +37,6 @@ class RuleActionFailedOnArray public function __construct(public RuleAction $ruleAction, public array $journal, public string $error) { - app('log')->debug('Created new RuleActionFailedOnArray'); + Log::debug('Created new RuleActionFailedOnArray'); } } diff --git a/app/Events/Model/Rule/RuleActionFailedOnObject.php b/app/Events/Model/Rule/RuleActionFailedOnObject.php index bde5cacdec..d774160f5b 100644 --- a/app/Events/Model/Rule/RuleActionFailedOnObject.php +++ b/app/Events/Model/Rule/RuleActionFailedOnObject.php @@ -27,6 +27,7 @@ namespace FireflyIII\Events\Model\Rule; use FireflyIII\Models\RuleAction; use FireflyIII\Models\TransactionJournal; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Facades\Log; /** * Class RuleActionFailedOnObject @@ -37,6 +38,6 @@ class RuleActionFailedOnObject public function __construct(public RuleAction $ruleAction, public TransactionJournal $journal, public string $error) { - app('log')->debug('Created new RuleActionFailedOnObject'); + Log::debug('Created new RuleActionFailedOnObject'); } } diff --git a/app/Events/RequestedReportOnJournals.php b/app/Events/RequestedReportOnJournals.php index 8805776832..27df251eb3 100644 --- a/app/Events/RequestedReportOnJournals.php +++ b/app/Events/RequestedReportOnJournals.php @@ -29,6 +29,7 @@ use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Log; /** * Class RequestedReportOnJournals @@ -44,7 +45,7 @@ class RequestedReportOnJournals */ public function __construct(public int $userId, public Collection $groups) { - app('log')->debug('In event RequestedReportOnJournals.'); + Log::debug('In event RequestedReportOnJournals.'); } /** diff --git a/app/Events/Test/OwnerTestNotificationChannel.php b/app/Events/Test/OwnerTestNotificationChannel.php index efce1b2a80..759c0578fc 100644 --- a/app/Events/Test/OwnerTestNotificationChannel.php +++ b/app/Events/Test/OwnerTestNotificationChannel.php @@ -26,6 +26,7 @@ namespace FireflyIII\Events\Test; use FireflyIII\Notifications\Notifiables\OwnerNotifiable; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Facades\Log; class OwnerTestNotificationChannel { @@ -38,7 +39,7 @@ class OwnerTestNotificationChannel */ public function __construct(string $channel, public OwnerNotifiable $owner) { - app('log')->debug(sprintf('Triggered OwnerTestNotificationChannel("%s")', $channel)); + Log::debug(sprintf('Triggered OwnerTestNotificationChannel("%s")', $channel)); $this->channel = $channel; } } diff --git a/app/Events/Test/UserTestNotificationChannel.php b/app/Events/Test/UserTestNotificationChannel.php index 4d028459d1..6ee93f0190 100644 --- a/app/Events/Test/UserTestNotificationChannel.php +++ b/app/Events/Test/UserTestNotificationChannel.php @@ -26,6 +26,7 @@ namespace FireflyIII\Events\Test; use FireflyIII\User; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Facades\Log; class UserTestNotificationChannel { @@ -38,7 +39,7 @@ class UserTestNotificationChannel */ public function __construct(string $channel, public User $user) { - app('log')->debug(sprintf('Triggered UserTestNotificationChannel("%s")', $channel)); + Log::debug(sprintf('Triggered UserTestNotificationChannel("%s")', $channel)); $this->channel = $channel; } } diff --git a/app/Exceptions/GracefulNotFoundHandler.php b/app/Exceptions/GracefulNotFoundHandler.php index b2feef6ea6..6f905adb22 100644 --- a/app/Exceptions/GracefulNotFoundHandler.php +++ b/app/Exceptions/GracefulNotFoundHandler.php @@ -33,8 +33,9 @@ use FireflyIII\Models\TransactionJournal; use FireflyIII\User; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Http\Request; -use Symfony\Component\HttpFoundation\Response; +use Illuminate\Support\Facades\Log; use Override; +use Symfony\Component\HttpFoundation\Response; use Throwable; /** @@ -65,7 +66,7 @@ class GracefulNotFoundHandler extends ExceptionHandler switch ($name) { default: - app('log')->warning(sprintf('GracefulNotFoundHandler cannot handle route with name "%s"', $name)); + Log::warning(sprintf('GracefulNotFoundHandler cannot handle route with name "%s"', $name)); return parent::render($request, $e); @@ -152,7 +153,7 @@ class GracefulNotFoundHandler extends ExceptionHandler */ private function handleAccount(Request $request, Throwable $exception): Response { - app('log')->debug('404 page is probably a deleted account. Redirect to overview of account types.'); + Log::debug('404 page is probably a deleted account. Redirect to overview of account types.'); /** @var User $user */ $user = auth()->user(); @@ -169,7 +170,7 @@ class GracefulNotFoundHandler extends ExceptionHandler /** @var null|Account $account */ $account = $user->accounts()->withTrashed()->with(['accountType'])->find($accountId); if (null === $account) { - app('log')->error(sprintf('Could not find account %d, so give big fat error.', $accountId)); + Log::error(sprintf('Could not find account %d, so give big fat error.', $accountId)); return parent::render($request, $exception); } @@ -187,7 +188,7 @@ class GracefulNotFoundHandler extends ExceptionHandler */ private function handleGroup(Request $request, Throwable $exception) { - app('log')->debug('404 page is probably a deleted group. Redirect to overview of group types.'); + Log::debug('404 page is probably a deleted group. Redirect to overview of group types.'); /** @var User $user */ $user = auth()->user(); @@ -198,7 +199,7 @@ class GracefulNotFoundHandler extends ExceptionHandler /** @var null|TransactionGroup $group */ $group = $user->transactionGroups()->withTrashed()->find($groupId); if (null === $group) { - app('log')->error(sprintf('Could not find group %d, so give big fat error.', $groupId)); + Log::error(sprintf('Could not find group %d, so give big fat error.', $groupId)); return parent::render($request, $exception); } @@ -206,7 +207,7 @@ class GracefulNotFoundHandler extends ExceptionHandler /** @var null|TransactionJournal $journal */ $journal = $group->transactionJournals()->withTrashed()->first(); if (null === $journal) { - app('log')->error(sprintf('Could not find journal for group %d, so give big fat error.', $groupId)); + Log::error(sprintf('Could not find journal for group %d, so give big fat error.', $groupId)); return parent::render($request, $exception); } @@ -227,7 +228,7 @@ class GracefulNotFoundHandler extends ExceptionHandler */ private function handleAttachment(Request $request, Throwable $exception) { - app('log')->debug('404 page is probably a deleted attachment. Redirect to parent object.'); + Log::debug('404 page is probably a deleted attachment. Redirect to parent object.'); /** @var User $user */ $user = auth()->user(); @@ -238,7 +239,7 @@ class GracefulNotFoundHandler extends ExceptionHandler /** @var null|Attachment $attachment */ $attachment = $user->attachments()->withTrashed()->find($attachmentId); if (null === $attachment) { - app('log')->error(sprintf('Could not find attachment %d, so give big fat error.', $attachmentId)); + Log::error(sprintf('Could not find attachment %d, so give big fat error.', $attachmentId)); return parent::render($request, $exception); } @@ -260,7 +261,7 @@ class GracefulNotFoundHandler extends ExceptionHandler } } - app('log')->error(sprintf('Could not redirect attachment %d, its linked to a %s.', $attachmentId, $attachment->attachable_type)); + Log::error(sprintf('Could not redirect attachment %d, its linked to a %s.', $attachmentId, $attachment->attachable_type)); return parent::render($request, $exception); } diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index fbdde03e1c..bc010ba8fa 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -24,8 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Exceptions; -use Carbon\Carbon; use Brick\Math\Exception\NumberFormatException; +use Carbon\Carbon; +use ErrorException; use FireflyIII\Jobs\MailError; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Auth\AuthenticationException; @@ -36,17 +37,17 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Session\TokenMismatchException; use Illuminate\Support\Arr; +use Illuminate\Support\Facades\Log; use Illuminate\Validation\ValidationException as LaravelValidationException; use Laravel\Passport\Exceptions\OAuthServerException as LaravelOAuthException; use League\OAuth2\Server\Exception\OAuthServerException; +use Override; use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use ErrorException; -use Override; use Throwable; use function Safe\json_encode; @@ -98,51 +99,51 @@ class Handler extends ExceptionHandler { $expectsJson = $request->expectsJson(); - app('log')->debug('Now in Handler::render()'); + Log::debug('Now in Handler::render()'); if ($e instanceof LaravelValidationException && $expectsJson) { // ignore it: controller will handle it. - app('log')->debug(sprintf('Return to parent to handle LaravelValidationException(%d)', $e->status)); + Log::debug(sprintf('Return to parent to handle LaravelValidationException(%d)', $e->status)); return parent::render($request, $e); } if ($e instanceof NotFoundHttpException && $expectsJson) { // JSON error: - app('log')->debug('Return JSON not found error.'); + Log::debug('Return JSON not found error.'); return response()->json(['message' => 'Resource not found', 'exception' => 'NotFoundHttpException'], 404); } if ($e instanceof AuthorizationException && $expectsJson) { // somehow Laravel handler does not catch this: - app('log')->debug('Return JSON unauthorized error.'); + Log::debug('Return JSON unauthorized error.'); return response()->json(['message' => $e->getMessage(), 'exception' => 'AuthorizationException'], 401); } if ($e instanceof AuthenticationException && $expectsJson) { // somehow Laravel handler does not catch this: - app('log')->debug('Return JSON unauthenticated error.'); + Log::debug('Return JSON unauthenticated error.'); return response()->json(['message' => $e->getMessage(), 'exception' => 'AuthenticationException'], 401); } if ($e instanceof OAuthServerException && $expectsJson) { - app('log')->debug('Return JSON OAuthServerException.'); + Log::debug('Return JSON OAuthServerException.'); // somehow Laravel handler does not catch this: return response()->json(['message' => $e->getMessage(), 'exception' => 'OAuthServerException'], 401); } if ($e instanceof BadRequestHttpException) { - app('log')->debug('Return JSON BadRequestHttpException.'); + Log::debug('Return JSON BadRequestHttpException.'); return response()->json(['message' => $e->getMessage(), 'exception' => 'HttpException'], 400); } if ($e instanceof BadHttpHeaderException) { // is always API exception. - app('log')->debug('Return JSON BadHttpHeaderException.'); + Log::debug('Return JSON BadHttpHeaderException.'); return response()->json(['message' => $e->getMessage(), 'exception' => 'BadHttpHeaderException'], $e->statusCode); } @@ -161,7 +162,7 @@ class Handler extends ExceptionHandler $isDebug = (bool) config('app.debug', false); if ($isDebug) { - app('log')->debug(sprintf('Return JSON %s with debug.', $e::class)); + Log::debug(sprintf('Return JSON %s with debug.', $e::class)); return response()->json( [ @@ -174,7 +175,7 @@ class Handler extends ExceptionHandler $errorCode ); } - app('log')->debug(sprintf('Return JSON %s.', $e::class)); + Log::debug(sprintf('Return JSON %s.', $e::class)); return response()->json( ['message' => sprintf('Internal Firefly III Exception: %s', $e->getMessage()), 'exception' => 'UndisclosedException'], @@ -183,7 +184,7 @@ class Handler extends ExceptionHandler } if ($e instanceof NotFoundHttpException) { - app('log')->debug('Refer to GracefulNotFoundHandler'); + Log::debug('Refer to GracefulNotFoundHandler'); $handler = app(GracefulNotFoundHandler::class); return $handler->render($request, $e); @@ -191,20 +192,20 @@ class Handler extends ExceptionHandler // special view for database errors with extra instructions if ($e instanceof QueryException) { - app('log')->debug('Return Firefly III database exception view.'); + Log::debug('Return Firefly III database exception view.'); $isDebug = config('app.debug'); return response()->view('errors.DatabaseException', ['exception' => $e, 'debug' => $isDebug], 500); } if ($e instanceof FireflyException || $e instanceof ErrorException || $e instanceof OAuthServerException) { - app('log')->debug('Return Firefly III error view.'); + Log::debug('Return Firefly III error view.'); $isDebug = config('app.debug'); return response()->view('errors.FireflyException', ['exception' => $e, 'debug' => $isDebug], 500); } - app('log')->debug(sprintf('Error "%s" has no Firefly III treatment, parent will handle.', $e::class)); + Log::debug(sprintf('Error "%s" has no Firefly III treatment, parent will handle.', $e::class)); return parent::render($request, $e); } diff --git a/app/Exceptions/IntervalException.php b/app/Exceptions/IntervalException.php index 45fe7cddfb..4b6396ad19 100644 --- a/app/Exceptions/IntervalException.php +++ b/app/Exceptions/IntervalException.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Exceptions; -use FireflyIII\Support\Calendar\Periodicity; use Exception; +use FireflyIII\Support\Calendar\Periodicity; use Throwable; /** diff --git a/app/Factory/AccountFactory.php b/app/Factory/AccountFactory.php index 94e9f5a5d9..22df6a483e 100644 --- a/app/Factory/AccountFactory.php +++ b/app/Factory/AccountFactory.php @@ -72,16 +72,18 @@ class AccountFactory */ public function findOrCreate(string $accountName, string $accountType): Account { - app('log')->debug(sprintf('findOrCreate("%s", "%s")', $accountName, $accountType)); + Log::debug(sprintf('findOrCreate("%s", "%s")', $accountName, $accountType)); $type = $this->accountRepository->getAccountTypeByType($accountType); if (!$type instanceof AccountType) { throw new FireflyException(sprintf('Cannot find account type "%s"', $accountType)); } + + /** @var null|Account $return */ $return = $this->user->accounts->where('account_type_id', $type->id)->where('name', $accountName)->first(); if (null === $return) { - app('log')->debug('Found nothing. Will create a new one.'); + Log::debug('Found nothing. Will create a new one.'); $return = $this->create( [ 'user_id' => $this->user->id, @@ -104,7 +106,7 @@ class AccountFactory */ public function create(array $data): Account { - app('log')->debug('Now in AccountFactory::create()'); + Log::debug('Now in AccountFactory::create()'); $type = $this->getAccountType($data); $data['iban'] = $this->filterIban($data['iban'] ?? null); @@ -146,18 +148,18 @@ class AccountFactory } } if (null === $result) { - app('log')->warning(sprintf('Found NO account type based on %d and "%s"', $accountTypeId, $accountTypeName)); + Log::warning(sprintf('Found NO account type based on %d and "%s"', $accountTypeId, $accountTypeName)); throw new FireflyException(sprintf('AccountFactory::create() was unable to find account type #%d ("%s").', $accountTypeId, $accountTypeName)); } - app('log')->debug(sprintf('Found account type based on %d and "%s": "%s"', $accountTypeId, $accountTypeName, $result->type)); + Log::debug(sprintf('Found account type based on %d and "%s": "%s"', $accountTypeId, $accountTypeName, $result->type)); return $result; } public function find(string $accountName, string $accountType): ?Account { - app('log')->debug(sprintf('Now in AccountFactory::find("%s", "%s")', $accountName, $accountType)); + Log::debug(sprintf('Now in AccountFactory::find("%s", "%s")', $accountName, $accountType)); $type = AccountType::whereType($accountType)->first(); /** @var null|Account */ @@ -204,16 +206,16 @@ class AccountFactory try { $this->storeOpeningBalance($account, $data); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); } // create credit liability data (only liabilities) try { $this->storeCreditLiability($account, $data); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); } // create notes @@ -319,22 +321,22 @@ class AccountFactory */ private function storeCreditLiability(Account $account, array $data): void { - app('log')->debug('storeCreditLiability'); + Log::debug('storeCreditLiability'); $account->refresh(); $accountType = $account->accountType->type; $direction = $this->accountRepository->getMetaValue($account, 'liability_direction'); $valid = config('firefly.valid_liabilities'); if (in_array($accountType, $valid, true)) { - app('log')->debug('Is a liability with credit ("i am owed") direction.'); + Log::debug('Is a liability with credit ("i am owed") direction.'); if ($this->validOBData($data)) { - app('log')->debug('Has valid CL data.'); + Log::debug('Has valid CL data.'); $openingBalance = $data['opening_balance']; $openingBalanceDate = $data['opening_balance_date']; // store credit transaction. $this->updateCreditTransaction($account, $direction, $openingBalance, $openingBalanceDate); } if (!$this->validOBData($data)) { - app('log')->debug('Does NOT have valid CL data, deletr any CL transaction.'); + Log::debug('Does NOT have valid CL data, deletr any CL transaction.'); $this->deleteCreditTransaction($account); } } diff --git a/app/Factory/BillFactory.php b/app/Factory/BillFactory.php index 1fe4567134..fb284ae921 100644 --- a/app/Factory/BillFactory.php +++ b/app/Factory/BillFactory.php @@ -24,9 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Factory; -use FireflyIII\Models\ObjectGroup; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Bill; +use FireflyIII\Models\ObjectGroup; use FireflyIII\Repositories\ObjectGroup\CreatesObjectGroups; use FireflyIII\Services\Internal\Support\BillServiceTrait; use FireflyIII\User; diff --git a/app/Factory/PiggyBankFactory.php b/app/Factory/PiggyBankFactory.php index 40455001d3..dc6b401311 100644 --- a/app/Factory/PiggyBankFactory.php +++ b/app/Factory/PiggyBankFactory.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Factory; -use FireflyIII\Models\ObjectGroup; -use FireflyIII\Models\Account; use FireflyIII\Events\Model\PiggyBank\ChangedAmount; use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Models\Account; +use FireflyIII\Models\ObjectGroup; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Account\AccountRepositoryInterface; @@ -242,6 +242,7 @@ class PiggyBankFactory } } } + Log::debug('Looping all accounts.'); /** @var array $info */ foreach ($accounts as $info) { @@ -251,6 +252,7 @@ class PiggyBankFactory continue; } + Log::debug(sprintf('Working on account #%d', $account->id)); if (array_key_exists('current_amount', $info) && null !== $info['current_amount']) { // an amount is set, first check out if there is a difference with the previous amount. $previous = $toBeLinked[$account->id]['current_amount'] ?? '0'; @@ -258,22 +260,24 @@ class PiggyBankFactory // create event for difference. if (0 !== bccomp($diff, '0')) { + // 2025-10-01 for issue #10990 disable this event. Log::debug(sprintf('[a] Will save event for difference %s (previous value was %s)', $diff, $previous)); - event(new ChangedAmount($piggyBank, $diff, null, null)); + // event(new ChangedAmount($piggyBank, $diff, null, null)); } $toBeLinked[$account->id] = ['current_amount' => $info['current_amount']]; Log::debug(sprintf('[a] Will link account #%d with amount %s', $account->id, $info['current_amount'])); } if (array_key_exists('current_amount', $info) && null === $info['current_amount']) { - // an amount is set, first check out if there is a difference with the previous amount. + // no amount is set, first check out if there is a difference with the previous amount. $previous = $toBeLinked[$account->id]['current_amount'] ?? '0'; $diff = bcsub('0', $previous); // create event for difference. if (0 !== bccomp($diff, '0')) { + // 2025-10-01 for issue #10990 disable this event. Log::debug(sprintf('[b] Will save event for difference %s (previous value was %s)', $diff, $previous)); - event(new ChangedAmount($piggyBank, $diff, null, null)); + // event(new ChangedAmount($piggyBank, $diff, null, null)); } // no amount set, use previous amount or go to ZERO. @@ -282,7 +286,8 @@ class PiggyBankFactory // create event: Log::debug('linkToAccountIds: Trigger change for positive amount [b].'); - event(new ChangedAmount($piggyBank, $toBeLinked[$account->id]['current_amount'] ?? '0', null, null)); + // 2025-10-01 for issue #10990 disable this event. + // event(new ChangedAmount($piggyBank, $toBeLinked[$account->id]['current_amount'] ?? '0', null, null)); } if (!array_key_exists('current_amount', $info)) { $toBeLinked[$account->id] ??= []; diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php index dd2d9e6830..d11753a2bf 100644 --- a/app/Factory/TransactionJournalFactory.php +++ b/app/Factory/TransactionJournalFactory.php @@ -24,15 +24,16 @@ declare(strict_types=1); namespace FireflyIII\Factory; -use FireflyIII\Models\Bill; -use FireflyIII\Models\PiggyBank; use Carbon\Carbon; +use Exception; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\DuplicateTransactionException; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; +use FireflyIII\Models\Bill; use FireflyIII\Models\Location; +use FireflyIII\Models\PiggyBank; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\TransactionJournal; @@ -53,7 +54,6 @@ use FireflyIII\User; use FireflyIII\Validation\AccountValidator; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; -use Exception; use JsonException; use function Safe\json_encode; @@ -344,6 +344,8 @@ class TransactionJournalFactory * If this transaction already exists, throw an error. * * @throws DuplicateTransactionException + * @throws JsonException + * @throws \Safe\Exceptions\JsonException */ private function errorIfDuplicate(string $hash): void { @@ -477,9 +479,6 @@ class TransactionJournalFactory }; } - /** - * @throws FireflyException - */ private function getCurrency(?TransactionCurrency $currency, Account $account): TransactionCurrency { Log::debug(sprintf('Now in getCurrency(#%d, "%s")', $currency?->id, $account->name)); diff --git a/app/Handlers/Events/APIEventHandler.php b/app/Handlers/Events/APIEventHandler.php index 7d59a4b636..de67afd8e8 100644 --- a/app/Handlers/Events/APIEventHandler.php +++ b/app/Handlers/Events/APIEventHandler.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Handlers\Events; +use Exception; use FireflyIII\Notifications\User\NewAccessToken; use FireflyIII\Repositories\User\UserRepositoryInterface; use Illuminate\Support\Facades\Notification; use Laravel\Passport\Events\AccessTokenCreated; -use Exception; /** * Class APIEventHandler diff --git a/app/Handlers/Events/AdminEventHandler.php b/app/Handlers/Events/AdminEventHandler.php index 6619763806..d3a9a1e73e 100644 --- a/app/Handlers/Events/AdminEventHandler.php +++ b/app/Handlers/Events/AdminEventHandler.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Handlers\Events; +use Exception; use FireflyIII\Events\Admin\InvitationCreated; use FireflyIII\Events\NewVersionAvailable; use FireflyIII\Events\Security\UnknownUserAttemptedLogin; @@ -36,7 +37,6 @@ use FireflyIII\Notifications\Test\OwnerTestNotificationPushover; use FireflyIII\Notifications\Test\OwnerTestNotificationSlack; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Notification; -use Exception; /** * Class AdminEventHandler. diff --git a/app/Handlers/Events/AutomationHandler.php b/app/Handlers/Events/AutomationHandler.php index 11b11a7b65..7a59a78a10 100644 --- a/app/Handlers/Events/AutomationHandler.php +++ b/app/Handlers/Events/AutomationHandler.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Handlers\Events; +use Exception; use FireflyIII\Events\RequestedReportOnJournals; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionGroup; @@ -31,7 +32,6 @@ use FireflyIII\Notifications\User\TransactionCreation; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\Transformers\TransactionGroupTransformer; use Illuminate\Support\Facades\Notification; -use Exception; /** * Class AutomationHandler diff --git a/app/Handlers/Events/Model/PiggyBankEventHandler.php b/app/Handlers/Events/Model/PiggyBankEventHandler.php index cea67d76b0..b44c9e4741 100644 --- a/app/Handlers/Events/Model/PiggyBankEventHandler.php +++ b/app/Handlers/Events/Model/PiggyBankEventHandler.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Handlers\Events\Model; +use FireflyIII\Events\Model\PiggyBank\ChangedAmount; use FireflyIII\Events\Model\PiggyBank\ChangedName; use FireflyIII\Models\Account; +use FireflyIII\Models\PiggyBankEvent; use FireflyIII\Models\Rule; use FireflyIII\Models\RuleAction; use FireflyIII\Models\TransactionGroup; -use FireflyIII\Events\Model\PiggyBank\ChangedAmount; -use FireflyIII\Models\PiggyBankEvent; /** * Class PiggyBankEventHandler diff --git a/app/Handlers/Events/Security/MFAHandler.php b/app/Handlers/Events/Security/MFAHandler.php index a259a742e2..f3b6dab533 100644 --- a/app/Handlers/Events/Security/MFAHandler.php +++ b/app/Handlers/Events/Security/MFAHandler.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Handlers\Events\Security; +use Exception; use FireflyIII\Events\Security\DisabledMFA; use FireflyIII\Events\Security\EnabledMFA; use FireflyIII\Events\Security\MFABackupFewLeft; @@ -39,7 +40,6 @@ use FireflyIII\Notifications\Security\MFAManyFailedAttemptsNotification; use FireflyIII\Notifications\Security\MFAUsedBackupCodeNotification; use FireflyIII\Notifications\Security\NewBackupCodesNotification; use Illuminate\Support\Facades\Notification; -use Exception; class MFAHandler { diff --git a/app/Handlers/Events/StoredGroupEventHandler.php b/app/Handlers/Events/StoredGroupEventHandler.php index 50ce62f742..b960ff88df 100644 --- a/app/Handlers/Events/StoredGroupEventHandler.php +++ b/app/Handlers/Events/StoredGroupEventHandler.php @@ -105,16 +105,28 @@ class StoredGroupEventHandler /** @var TransactionJournal $journal */ foreach ($event->transactionGroup->transactionJournals as $journal) { - $source = $journal->transactions()->where('amount', '<', '0')->first(); - $dest = $journal->transactions()->where('amount', '>', '0')->first(); + $source = $journal->transactions()->where('amount', '<', '0')->first(); + $dest = $journal->transactions()->where('amount', '>', '0')->first(); $repository->deleteStatisticsForModel($source->account, $journal->date); $repository->deleteStatisticsForModel($dest->account, $journal->date); - foreach ($journal->categories as $category) { + $categories = $journal->categories; + $tags = $journal->tags; + $budgets = $journal->budgets; + foreach ($categories as $category) { $repository->deleteStatisticsForModel($category, $journal->date); } - foreach ($journal->tags as $tag) { + foreach ($tags as $tag) { $repository->deleteStatisticsForModel($tag, $journal->date); } + foreach ($budgets as $budget) { + $repository->deleteStatisticsForModel($budget, $journal->date); + } + if (0 === $categories->count()) { + $repository->deleteStatisticsForPrefix($journal->userGroup, 'no_category', $journal->date); + } + if (0 === $budgets->count()) { + $repository->deleteStatisticsForPrefix($journal->userGroup, 'no_budget', $journal->date); + } } } diff --git a/app/Handlers/Events/UpdatedGroupEventHandler.php b/app/Handlers/Events/UpdatedGroupEventHandler.php index e1393a3355..1fb89d2be6 100644 --- a/app/Handlers/Events/UpdatedGroupEventHandler.php +++ b/app/Handlers/Events/UpdatedGroupEventHandler.php @@ -68,16 +68,30 @@ class UpdatedGroupEventHandler /** @var TransactionJournal $journal */ foreach ($event->transactionGroup->transactionJournals as $journal) { - $source = $journal->transactions()->where('amount', '<', '0')->first(); - $dest = $journal->transactions()->where('amount', '>', '0')->first(); + $source = $journal->transactions()->where('amount', '<', '0')->first(); + $dest = $journal->transactions()->where('amount', '>', '0')->first(); $repository->deleteStatisticsForModel($source->account, $journal->date); $repository->deleteStatisticsForModel($dest->account, $journal->date); - foreach ($journal->categories as $category) { + + $categories = $journal->categories; + $tags = $journal->tags; + $budgets = $journal->budgets; + + foreach ($categories as $category) { $repository->deleteStatisticsForModel($category, $journal->date); } - foreach ($journal->tags as $tag) { + foreach ($tags as $tag) { $repository->deleteStatisticsForModel($tag, $journal->date); } + foreach ($budgets as $budget) { + $repository->deleteStatisticsForModel($budget, $journal->date); + } + if (0 === $categories->count()) { + $repository->deleteStatisticsForPrefix($journal->userGroup, 'no_category', $journal->date); + } + if (0 === $budgets->count()) { + $repository->deleteStatisticsForPrefix($journal->userGroup, 'no_budget', $journal->date); + } } } diff --git a/app/Handlers/Events/UserEventHandler.php b/app/Handlers/Events/UserEventHandler.php index 991f7751d9..db1fdd4134 100644 --- a/app/Handlers/Events/UserEventHandler.php +++ b/app/Handlers/Events/UserEventHandler.php @@ -25,6 +25,7 @@ namespace FireflyIII\Handlers\Events; use Carbon\Carbon; use Database\Seeders\ExchangeRateSeeder; +use Exception; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Events\ActuallyLoggedIn; use FireflyIII\Events\Admin\InvitationCreated; @@ -55,7 +56,6 @@ use Illuminate\Auth\Events\Login; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Notification; -use Exception; /** * Class UserEventHandler. @@ -164,8 +164,6 @@ class UserEventHandler /** * Set the demo user back to English. - * - * @throws FireflyException */ public function demoUserBackToEnglish(Login $event): void { @@ -182,9 +180,6 @@ class UserEventHandler } } - /** - * @throws FireflyException - */ public function notifyNewIPAddress(DetectedNewIPAddress $event): void { $user = $event->user; @@ -447,9 +442,6 @@ class UserEventHandler Log::debug(sprintf('If you see no errors above this line, test notification was sent over channel "%s"', $event->channel)); } - /** - * @throws FireflyException - */ public function storeUserIPAddress(ActuallyLoggedIn $event): void { app('log')->debug('Now in storeUserIPAddress'); diff --git a/app/Handlers/Events/VersionCheckEventHandler.php b/app/Handlers/Events/VersionCheckEventHandler.php index a7ac2c62c3..3a2d7c42d4 100644 --- a/app/Handlers/Events/VersionCheckEventHandler.php +++ b/app/Handlers/Events/VersionCheckEventHandler.php @@ -23,14 +23,16 @@ declare(strict_types=1); namespace FireflyIII\Handlers\Events; -use Deprecated; use Carbon\Carbon; +use Deprecated; use FireflyIII\Events\RequestedVersionCheckStatus; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Update\UpdateTrait; use FireflyIII\Models\Configuration; use FireflyIII\Repositories\User\UserRepositoryInterface; use Illuminate\Support\Facades\Log; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class VersionCheckEventHandler @@ -42,7 +44,9 @@ class VersionCheckEventHandler /** * Checks with GitHub to see if there is a new version. * + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface */ #[Deprecated(message: '?')] public function checkForUpdates(RequestedVersionCheckStatus $event): void @@ -88,6 +92,8 @@ class VersionCheckEventHandler /** * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ protected function warnToCheckForUpdates(RequestedVersionCheckStatus $event): void { diff --git a/app/Helpers/Attachments/AttachmentHelper.php b/app/Helpers/Attachments/AttachmentHelper.php index 145d39063a..c4d79ed8d2 100644 --- a/app/Helpers/Attachments/AttachmentHelper.php +++ b/app/Helpers/Attachments/AttachmentHelper.php @@ -27,7 +27,6 @@ use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Attachment; use FireflyIII\Models\PiggyBank; use Illuminate\Contracts\Encryption\DecryptException; -use Illuminate\Contracts\Encryption\EncryptException; use Illuminate\Contracts\Filesystem\Filesystem; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Collection; @@ -37,13 +36,14 @@ use Illuminate\Support\Facades\Storage; use Illuminate\Support\MessageBag; use Safe\Exceptions\FileinfoException; use Safe\Exceptions\FilesystemException; +use Safe\Exceptions\StringsException; use Symfony\Component\HttpFoundation\File\UploadedFile; -use function Safe\tmpfile; -use function Safe\fwrite; -use function Safe\finfo_open; use function Safe\fclose; +use function Safe\finfo_open; +use function Safe\fwrite; use function Safe\md5_file; +use function Safe\tmpfile; use const DIRECTORY_SEPARATOR; @@ -222,8 +222,7 @@ class AttachmentHelper implements AttachmentHelperInterface /** * Process the upload of a file. * - * @throws FireflyException - * @throws EncryptException + * @throws StringsException */ protected function processFile(UploadedFile $file, Model $model): ?Attachment { diff --git a/app/Helpers/Collector/Extensions/AccountCollection.php b/app/Helpers/Collector/Extensions/AccountCollection.php index 2328b5dabc..d56ee1de4b 100644 --- a/app/Helpers/Collector/Extensions/AccountCollection.php +++ b/app/Helpers/Collector/Extensions/AccountCollection.php @@ -43,7 +43,6 @@ trait AccountCollection Log::warning(sprintf('GroupCollector will be SLOW: accountBalanceIs: "%s" "%s" "%s"', $direction, $operator, $value)); /** - * @param int $index * @param array $object * * @return bool diff --git a/app/Helpers/Collector/Extensions/AttachmentCollection.php b/app/Helpers/Collector/Extensions/AttachmentCollection.php index f4993d2d18..b2b3ed0103 100644 --- a/app/Helpers/Collector/Extensions/AttachmentCollection.php +++ b/app/Helpers/Collector/Extensions/AttachmentCollection.php @@ -41,7 +41,6 @@ trait AttachmentCollection $this->withAttachmentInformation(); /** - * @param int $index * @param array $object * * @return bool @@ -120,7 +119,6 @@ trait AttachmentCollection $this->withAttachmentInformation(); /** - * @param int $index * @param array $object * * @return bool @@ -155,7 +153,6 @@ trait AttachmentCollection $this->withAttachmentInformation(); /** - * @param int $index * @param array $object * * @return bool @@ -190,7 +187,6 @@ trait AttachmentCollection $this->withAttachmentInformation(); /** - * @param int $index * @param array $object * * @return bool diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index 0d12819740..7a44ba5737 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -47,6 +47,7 @@ use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Override; +use Safe\Exceptions\JsonException; use function Safe\json_decode; @@ -565,6 +566,7 @@ class GroupCollector implements GroupCollectorInterface /** * @throws FireflyException + * @throws JsonException */ private function parseAugmentedJournal(TransactionJournal $augumentedJournal): array { diff --git a/app/Helpers/Fiscal/FiscalHelper.php b/app/Helpers/Fiscal/FiscalHelper.php index 13c9d14bdc..53aad1fef3 100644 --- a/app/Helpers/Fiscal/FiscalHelper.php +++ b/app/Helpers/Fiscal/FiscalHelper.php @@ -24,6 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Helpers\Fiscal; use Carbon\Carbon; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class FiscalHelper. @@ -63,6 +65,9 @@ class FiscalHelper implements FiscalHelperInterface /** * @return Carbon date object + * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function startOfFiscalYear(Carbon $date): Carbon { diff --git a/app/Helpers/Report/NetWorth.php b/app/Helpers/Report/NetWorth.php index bb58b8761b..0ea1ce6cfe 100644 --- a/app/Helpers/Report/NetWorth.php +++ b/app/Helpers/Report/NetWorth.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Helpers\Report; -use Deprecated; use Carbon\Carbon; +use Deprecated; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; diff --git a/app/Helpers/Report/NetWorthInterface.php b/app/Helpers/Report/NetWorthInterface.php index 466a055a4c..421caa9a74 100644 --- a/app/Helpers/Report/NetWorthInterface.php +++ b/app/Helpers/Report/NetWorthInterface.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Helpers\Report; -use Deprecated; use Carbon\Carbon; +use Deprecated; use FireflyIII\Models\UserGroup; use FireflyIII\User; use Illuminate\Contracts\Auth\Authenticatable; diff --git a/app/Helpers/Webhook/Sha3SignatureGenerator.php b/app/Helpers/Webhook/Sha3SignatureGenerator.php index 6d42a4ac56..06967cff04 100644 --- a/app/Helpers/Webhook/Sha3SignatureGenerator.php +++ b/app/Helpers/Webhook/Sha3SignatureGenerator.php @@ -68,7 +68,7 @@ class Sha3SignatureGenerator implements SignatureGeneratorInterface // The actual JSON payload (i.e., the request body) $timestamp = Carbon::now()->getTimestamp(); $payload = sprintf('%s.%s', $timestamp, $json); - $signature = hash_hmac('sha3-256', $payload, (string) $message->webhook->secret, false); + $signature = hash_hmac('sha3-256', $payload, (string) $message->webhook->secret); // signature string: // header included in each signed event contains a timestamp and one or more signatures. diff --git a/app/Http/Controllers/Account/CreateController.php b/app/Http/Controllers/Account/CreateController.php index 743c2fdc7a..bab54065d9 100644 --- a/app/Http/Controllers/Account/CreateController.php +++ b/app/Http/Controllers/Account/CreateController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Account; use FireflyIII\Enums\AccountTypeEnum; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\AccountFormRequest; @@ -37,6 +36,8 @@ use Illuminate\Http\Request; use Illuminate\Routing\Redirector; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class CreateController @@ -133,7 +134,8 @@ class CreateController extends Controller * * @return Redirector|RedirectResponse * - * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function store(AccountFormRequest $request) { diff --git a/app/Http/Controllers/Account/EditController.php b/app/Http/Controllers/Account/EditController.php index 7d172bead1..8c2d083b13 100644 --- a/app/Http/Controllers/Account/EditController.php +++ b/app/Http/Controllers/Account/EditController.php @@ -24,11 +24,11 @@ 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; use FireflyIII\Models\Account; +use FireflyIII\Models\Location; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Support\Http\Controllers\ModelInformation; use Illuminate\Contracts\View\Factory; diff --git a/app/Http/Controllers/Account/IndexController.php b/app/Http/Controllers/Account/IndexController.php index 1ee5f5cccf..4f34f0dd5f 100644 --- a/app/Http/Controllers/Account/IndexController.php +++ b/app/Http/Controllers/Account/IndexController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Account; use Carbon\Carbon; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Account; use FireflyIII\Repositories\Account\AccountRepositoryInterface; @@ -35,6 +34,8 @@ use Illuminate\Http\Request; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class IndexController @@ -68,8 +69,9 @@ class IndexController extends Controller /** * @return Factory|View * - * @throws FireflyException - * */ + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ public function inactive(Request $request, string $objectType) { $inactivePage = true; @@ -138,8 +140,9 @@ class IndexController extends Controller * * @return Factory|View * - * @throws FireflyException - * */ + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ public function index(Request $request, string $objectType) { app('log')->debug(sprintf('Now at %s', __METHOD__)); diff --git a/app/Http/Controllers/Account/ShowController.php b/app/Http/Controllers/Account/ShowController.php index 8c9ac76727..9b1a6922f6 100644 --- a/app/Http/Controllers/Account/ShowController.php +++ b/app/Http/Controllers/Account/ShowController.php @@ -40,6 +40,8 @@ use Illuminate\Routing\Redirector; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** @@ -78,8 +80,10 @@ class ShowController extends Controller * * @return Factory|Redirector|RedirectResponse|View * + * @throws ContainerExceptionInterface * @throws FireflyException - * */ + * @throws NotFoundExceptionInterface + */ public function show(Request $request, Account $account, ?Carbon $start = null, ?Carbon $end = null) { if (0 === $account->id) { @@ -195,8 +199,9 @@ class ShowController extends Controller * * @return Factory|Redirector|RedirectResponse|View * - * @throws FireflyException - * */ + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ public function showAll(Request $request, Account $account) { if (!$this->isEditableAccount($account)) { diff --git a/app/Http/Controllers/Admin/HomeController.php b/app/Http/Controllers/Admin/HomeController.php index 6f4fc059f2..bd14a9d51b 100644 --- a/app/Http/Controllers/Admin/HomeController.php +++ b/app/Http/Controllers/Admin/HomeController.php @@ -28,6 +28,8 @@ use FireflyIII\Http\Middleware\IsDemoUser; use Illuminate\Contracts\View\Factory; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class HomeController. @@ -47,6 +49,9 @@ class HomeController extends Controller * Index of the admin. * * @return Factory|View + * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function index() { diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 07abf76b4d..736ae8edf7 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Admin; use FireflyIII\Events\Admin\InvitationCreated; +use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Middleware\IsDemoUser; use FireflyIII\Http\Requests\InviteUserFormRequest; @@ -37,6 +38,8 @@ use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Routing\Redirector; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class UserController. @@ -151,6 +154,10 @@ class UserController extends Controller * Show index of user manager. * * @return Factory|View + * + * @throws ContainerExceptionInterface + * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function index() { diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.php index c45b947126..2741d94812 100644 --- a/app/Http/Controllers/AttachmentController.php +++ b/app/Http/Controllers/AttachmentController.php @@ -27,7 +27,6 @@ use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Requests\AttachmentFormRequest; use FireflyIII\Models\Attachment; use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface; -use Illuminate\Contracts\Container\BindingResolutionException; use Illuminate\Contracts\View\Factory; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; @@ -194,7 +193,6 @@ class AttachmentController extends Controller * View attachment in browser. * * @throws FireflyException - * @throws BindingResolutionException */ public function view(Attachment $attachment): LaravelResponse { diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 78fcc649db..a945fc7879 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -33,6 +33,8 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use Safe\Exceptions\UrlException; use function Safe\parse_url; @@ -61,6 +63,8 @@ class ForgotPasswordController extends Controller * Send a reset link to the given user. * * @return Factory|RedirectResponse|View + * + * @throws FireflyException */ public function sendResetLinkEmail(Request $request, UserRepositoryInterface $repository) { @@ -126,6 +130,8 @@ class ForgotPasswordController extends Controller * @return Factory|View * * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function showLinkRequestForm() { diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index c1566b5ed1..30b0bce73f 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -24,8 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Auth; 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; @@ -33,6 +31,7 @@ use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Providers\RouteServiceProvider; use FireflyIII\Repositories\User\UserRepositoryInterface; +use FireflyIII\User; use Illuminate\Contracts\Foundation\Application; use Illuminate\Contracts\View\Factory; use Illuminate\Contracts\View\View; @@ -43,9 +42,12 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Routing\Redirector; +use Illuminate\Support\Facades\Cookie; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use Illuminate\Validation\ValidationException; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use Symfony\Component\HttpFoundation\Response as ResponseAlias; /** @@ -151,7 +153,7 @@ class LoginController extends Controller $this->sendFailedLoginResponse($request); // @noinspection PhpUnreachableStatementInspection - return response()->json([]); + return response()->json(); } /** @@ -222,6 +224,8 @@ class LoginController extends Controller * @return Application|Factory|Redirector|RedirectResponse|View * * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function showLoginForm(Request $request) { diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 79701fe3f7..a36e65e8bc 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -142,7 +142,9 @@ class RegisterController extends Controller * * @return Factory|View * + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function showInviteForm(Request $request, string $code) { @@ -174,7 +176,9 @@ class RegisterController extends Controller * * @return Factory|View * + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function showRegistrationForm(?Request $request = null) { diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index 442d4956b4..714d98bf32 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -34,6 +34,8 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Password; use Illuminate\Validation\ValidationException; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class ResetPasswordController @@ -117,6 +119,8 @@ class ResetPasswordController extends Controller * @return Factory|View * * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function showResetForm(Request $request, $token = null) { diff --git a/app/Http/Controllers/Auth/TwoFactorController.php b/app/Http/Controllers/Auth/TwoFactorController.php index 1ebce31552..a651b7c50a 100644 --- a/app/Http/Controllers/Auth/TwoFactorController.php +++ b/app/Http/Controllers/Auth/TwoFactorController.php @@ -37,6 +37,8 @@ use Illuminate\Http\Request; use Illuminate\Routing\Redirector; use Illuminate\Support\Facades\Log; use PragmaRX\Google2FALaravel\Support\Authenticator; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class TwoFactorController. @@ -60,6 +62,9 @@ class TwoFactorController extends Controller /** * @return Redirector|RedirectResponse + * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function submitMFA(Request $request) { diff --git a/app/Http/Controllers/Bill/IndexController.php b/app/Http/Controllers/Bill/IndexController.php index 46f8514f14..fcc0ebeb0d 100644 --- a/app/Http/Controllers/Bill/IndexController.php +++ b/app/Http/Controllers/Bill/IndexController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Bill; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Bill; use FireflyIII\Repositories\Bill\BillRepositoryInterface; @@ -148,9 +147,6 @@ class IndexController extends Controller return view('bills.index', compact('bills', 'sums', 'total', 'totals', 'today')); } - /** - * @throws FireflyException - */ private function getSums(array $bills): array { $sums = []; diff --git a/app/Http/Controllers/Bill/ShowController.php b/app/Http/Controllers/Bill/ShowController.php index acfb3ab3aa..f102f5b5ac 100644 --- a/app/Http/Controllers/Bill/ShowController.php +++ b/app/Http/Controllers/Bill/ShowController.php @@ -44,6 +44,8 @@ use Illuminate\View\View; use League\Fractal\Manager; use League\Fractal\Resource\Item; use League\Fractal\Serializer\DataArraySerializer; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use Symfony\Component\HttpFoundation\ParameterBag; /** @@ -114,6 +116,9 @@ class ShowController extends Controller * Show a bill. * * @return Factory|View + * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function show(Request $request, Bill $bill) { diff --git a/app/Http/Controllers/Budget/BudgetLimitController.php b/app/Http/Controllers/Budget/BudgetLimitController.php index 63e0c93e7e..81087328c4 100644 --- a/app/Http/Controllers/Budget/BudgetLimitController.php +++ b/app/Http/Controllers/Budget/BudgetLimitController.php @@ -150,7 +150,7 @@ class BudgetLimitController extends Controller $end = Carbon::createFromFormat('Y-m-d', $request->get('end')); if (!$start instanceof Carbon || !$end instanceof Carbon) { - return response()->json([]); + return response()->json(); } $amount = (string) $request->get('amount'); @@ -158,7 +158,7 @@ class BudgetLimitController extends Controller $end->startOfDay(); if ('' === $amount) { - return response()->json([]); + return response()->json(); } app('log')->debug(sprintf('Start: %s, end: %s', $start->format('Y-m-d'), $end->format('Y-m-d'))); @@ -172,7 +172,7 @@ class BudgetLimitController extends Controller } // return empty=ish array: - return response()->json([]); + return response()->json(); } if ((int) $amount > 268435456) { // intentional cast to integer $amount = '268435456'; diff --git a/app/Http/Controllers/Budget/EditController.php b/app/Http/Controllers/Budget/EditController.php index a3969e6d7d..6b0f820e20 100644 --- a/app/Http/Controllers/Budget/EditController.php +++ b/app/Http/Controllers/Budget/EditController.php @@ -24,11 +24,11 @@ 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; use FireflyIII\Http\Requests\BudgetFormUpdateRequest; +use FireflyIII\Models\AutoBudget; use FireflyIII\Models\Budget; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use Illuminate\Contracts\View\Factory; diff --git a/app/Http/Controllers/Budget/IndexController.php b/app/Http/Controllers/Budget/IndexController.php index 2ba33347a1..08631b6bd3 100644 --- a/app/Http/Controllers/Budget/IndexController.php +++ b/app/Http/Controllers/Budget/IndexController.php @@ -174,7 +174,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, false); + $spentArr = $this->opsRepository->sumExpenses($entry->start_date, $entry->end_date, null, null, $entry->transactionCurrency); $array['spent'] = $spentArr[$entry->transaction_currency_id]['sum'] ?? '0'; $array['pc_spent'] = $this->convertToPrimary && $entry->transaction_currency_id !== $this->primaryCurrency->id ? $converter->convert($entry->transactionCurrency, $this->primaryCurrency, $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()->push($current), $currency, false); + $spentArr = $this->opsRepository->sumExpenses($start, $end, null, new Collection()->push($current), $currency); if (array_key_exists($currency->id, $spentArr) && array_key_exists('sum', $spentArr[$currency->id])) { $array['spent'][$currency->id]['spent'] = $spentArr[$currency->id]['sum']; $array['spent'][$currency->id]['currency_id'] = $currency->id; diff --git a/app/Http/Controllers/Budget/ShowController.php b/app/Http/Controllers/Budget/ShowController.php index ce344f13e8..4c31d2927a 100644 --- a/app/Http/Controllers/Budget/ShowController.php +++ b/app/Http/Controllers/Budget/ShowController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Budget; -use FireflyIII\Models\TransactionJournal; use Carbon\Carbon; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; @@ -32,6 +31,7 @@ use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Budget; use FireflyIII\Models\BudgetLimit; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\Http\Controllers\AugumentData; @@ -39,6 +39,8 @@ use FireflyIII\Support\Http\Controllers\PeriodOverview; use Illuminate\Contracts\View\Factory; use Illuminate\Http\Request; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class ShowController @@ -75,7 +77,9 @@ class ShowController extends Controller * * @return Factory|View * + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function noBudget(Request $request, ?Carbon $start = null, ?Carbon $end = null) { @@ -111,6 +115,9 @@ class ShowController extends Controller * Shows ALL transactions without a budget. * * @return Factory|View + * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function noBudgetAll(Request $request) { @@ -136,6 +143,9 @@ class ShowController extends Controller * Show a single budget. * * @return Factory|View + * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function show(Request $request, Budget $budget) { @@ -169,6 +179,8 @@ class ShowController extends Controller * @return Factory|View * * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function showByBudgetLimit(Request $request, Budget $budget, BudgetLimit $budgetLimit) { diff --git a/app/Http/Controllers/Category/IndexController.php b/app/Http/Controllers/Category/IndexController.php index 41b85c87a7..f91870a346 100644 --- a/app/Http/Controllers/Category/IndexController.php +++ b/app/Http/Controllers/Category/IndexController.php @@ -32,6 +32,8 @@ use Illuminate\Http\Request; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class IndexController @@ -63,6 +65,9 @@ class IndexController extends Controller * Show all categories. * * @return Factory|View + * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function index(Request $request) { diff --git a/app/Http/Controllers/Category/NoCategoryController.php b/app/Http/Controllers/Category/NoCategoryController.php index 11f6ade3a9..b2dade990d 100644 --- a/app/Http/Controllers/Category/NoCategoryController.php +++ b/app/Http/Controllers/Category/NoCategoryController.php @@ -24,12 +24,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Category; -use FireflyIII\Models\TransactionJournal; use Carbon\Carbon; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Http\Controllers\Controller; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\Http\Controllers\PeriodOverview; use Illuminate\Contracts\View\Factory; @@ -37,6 +37,8 @@ use Illuminate\Http\Request; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class NoCategoryController @@ -71,7 +73,9 @@ class NoCategoryController extends Controller * * @return Factory|View * + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function show(Request $request, ?Carbon $start = null, ?Carbon $end = null) { @@ -107,6 +111,9 @@ class NoCategoryController extends Controller * Show all transactions without a category. * * @return Factory|View + * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function showAll(Request $request) { diff --git a/app/Http/Controllers/Category/ShowController.php b/app/Http/Controllers/Category/ShowController.php index d9a03f2f4a..57fa33fc7a 100644 --- a/app/Http/Controllers/Category/ShowController.php +++ b/app/Http/Controllers/Category/ShowController.php @@ -35,6 +35,8 @@ use Illuminate\Contracts\View\Factory; use Illuminate\Http\Request; use Illuminate\Support\Collection; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class ShowController @@ -70,7 +72,9 @@ class ShowController extends Controller * * @return Factory|View * + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function show(Request $request, Category $category, ?Carbon $start = null, ?Carbon $end = null) { @@ -112,6 +116,9 @@ class ShowController extends Controller * Show all transactions within a category. * * @return Factory|View + * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function showAll(Request $request, Category $category) { diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index 1e48b0d65f..3df8e35845 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -44,6 +44,7 @@ use FireflyIII\Support\Http\Controllers\DateCalculation; use Illuminate\Http\JsonResponse; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; +use Safe\Exceptions\JsonException; use function Safe\json_encode; @@ -483,6 +484,7 @@ class AccountController extends Controller * Shows overview of account during a single period. * * @throws FireflyException + * @throws JsonException */ public function period(Account $account, Carbon $start, Carbon $end): JsonResponse { @@ -571,7 +573,7 @@ class AccountController extends Controller $label = $current->isoFormat($format); $return[$key]['entries'][$label] = $amount; } - $current = app('navigation')->addPeriod($current, $step, 0); + $current = app('navigation')->addPeriod($current, $step); // here too, to fix #8041, the data is corrected to the end of the period. $current = app('navigation')->endOfX($current, $step, null); } diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index e22a6bd4d5..6e195311b3 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; use Carbon\Carbon; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Generator\Chart\Basic\GeneratorInterface; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Category; @@ -40,6 +39,8 @@ use FireflyIII\Support\Http\Controllers\ChartGeneration; use FireflyIII\Support\Http\Controllers\DateCalculation; use Illuminate\Http\JsonResponse; use Illuminate\Support\Collection; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class CategoryController. @@ -65,8 +66,6 @@ class CategoryController extends Controller /** * Show an overview for a category for all time, per month/week/year. * TODO test method, for category refactor. - * - * @throws FireflyException */ public function all(Category $category): JsonResponse { @@ -256,7 +255,8 @@ class CategoryController extends Controller * Chart for a specific period. * TODO test me, for category refactor. * - * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function specificPeriod(Category $category, Carbon $date): JsonResponse { diff --git a/app/Http/Controllers/Chart/PiggyBankController.php b/app/Http/Controllers/Chart/PiggyBankController.php index 920c3a9301..c0db48f026 100644 --- a/app/Http/Controllers/Chart/PiggyBankController.php +++ b/app/Http/Controllers/Chart/PiggyBankController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; use Carbon\Carbon; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Generator\Chart\Basic\GeneratorInterface; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\PiggyBank; @@ -58,8 +57,6 @@ class PiggyBankController extends Controller * Shows the piggy bank history. * * TODO this chart is not multi currency aware. - * - * @throws FireflyException */ public function history(PiggyBankRepositoryInterface $repository, PiggyBank $piggyBank): JsonResponse { @@ -95,7 +92,7 @@ class PiggyBankController extends Controller $currentSum = $filtered->sum('amount'); $label = $oldest->isoFormat((string) trans('config.month_and_day_js', [], $locale)); $chartData[$label] = $currentSum; - $oldest = app('navigation')->addPeriod($oldest, $step, 0); + $oldest = app('navigation')->addPeriod($oldest, $step); } $finalFiltered = $set->filter( static fn (PiggyBankEvent $event) => $event->date->lte($today) diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.php index 9809c24140..4517b002fc 100644 --- a/app/Http/Controllers/Chart/ReportController.php +++ b/app/Http/Controllers/Chart/ReportController.php @@ -260,7 +260,7 @@ class ReportController extends Controller $expense['entries'][$title] = '0'; } - $currentStart = app('navigation')->addPeriod($currentStart, $preferredRange, 0); + $currentStart = app('navigation')->addPeriod($currentStart, $preferredRange); } Log::debug('End of sub-loop'); diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 0919f8c199..534acf8488 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -36,11 +36,11 @@ use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Routing\Controller as BaseController; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Log; -use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\Route; +use Illuminate\Support\Facades\View; -use function Safe\realpath; use function Safe\ini_get; +use function Safe\realpath; /** * Class Controller. diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.php index 377bacd735..1ed00b4710 100644 --- a/app/Http/Controllers/DebugController.php +++ b/app/Http/Controllers/DebugController.php @@ -49,6 +49,7 @@ use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Route; use Illuminate\View\View; use Monolog\Handler\RotatingFileHandler; +use Safe\Exceptions\FilesystemException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use function Safe\file_get_contents; @@ -131,7 +132,7 @@ class DebugController extends Controller * * @return Factory|View * - * @throws FireflyException + * @throws FilesystemException */ public function index() { @@ -184,7 +185,6 @@ class DebugController extends Controller $currentDriver = DB::getDriverName(); return [ - 'db_version' => app('fireflyconfig')->get('db_version', 1)->data, 'php_version' => PHP_VERSION, 'php_os' => PHP_OS, 'uname' => php_uname('m'), diff --git a/app/Http/Controllers/Export/IndexController.php b/app/Http/Controllers/Export/IndexController.php index 3167f65525..3089c4ac35 100644 --- a/app/Http/Controllers/Export/IndexController.php +++ b/app/Http/Controllers/Export/IndexController.php @@ -25,10 +25,10 @@ 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; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\Export\ExportDataGenerator; use Illuminate\Contracts\View\Factory; diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 3ab394545e..e72c691d41 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -23,9 +23,9 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; -use Exception; use Carbon\Carbon; use Carbon\Exceptions\InvalidFormatException; +use Exception; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Events\RequestedVersionCheckStatus; use FireflyIII\Exceptions\FireflyException; diff --git a/app/Http/Controllers/JavascriptController.php b/app/Http/Controllers/JavascriptController.php index bccff306d9..c5beecfeb4 100644 --- a/app/Http/Controllers/JavascriptController.php +++ b/app/Http/Controllers/JavascriptController.php @@ -33,6 +33,8 @@ use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Support\Http\Controllers\GetConfigurationData; use Illuminate\Http\Request; use Illuminate\Http\Response; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class JavascriptController. @@ -91,7 +93,9 @@ class JavascriptController extends Controller * Show some common variables to be used in scripts. * * @throws FireflyException - * */ + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ public function variables(Request $request, AccountRepositoryInterface $repository): Response { $account = $repository->find((int) $request->get('account')); diff --git a/app/Http/Controllers/Json/BoxController.php b/app/Http/Controllers/Json/BoxController.php index ce5f520180..d202a80af0 100644 --- a/app/Http/Controllers/Json/BoxController.php +++ b/app/Http/Controllers/Json/BoxController.php @@ -23,8 +23,8 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; -use Deprecated; use Carbon\Carbon; +use Deprecated; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Helpers\Collector\GroupCollectorInterface; @@ -52,7 +52,7 @@ class BoxController extends Controller #[Deprecated] public function available(): JsonResponse { - return response()->json([]); + return response()->json(); } /** diff --git a/app/Http/Controllers/Json/BudgetController.php b/app/Http/Controllers/Json/BudgetController.php index 23a687ed46..6a0b494194 100644 --- a/app/Http/Controllers/Json/BudgetController.php +++ b/app/Http/Controllers/Json/BudgetController.php @@ -24,9 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; -use FireflyIII\Models\AvailableBudget; use Carbon\Carbon; use FireflyIII\Http\Controllers\Controller; +use FireflyIII\Models\AvailableBudget; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface; diff --git a/app/Http/Controllers/Json/FrontpageController.php b/app/Http/Controllers/Json/FrontpageController.php index f66864866b..a51499cfc2 100644 --- a/app/Http/Controllers/Json/FrontpageController.php +++ b/app/Http/Controllers/Json/FrontpageController.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; -use Throwable; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\PiggyBank; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use Illuminate\Http\JsonResponse; +use Throwable; /** * Class FrontpageController. diff --git a/app/Http/Controllers/Json/IntroController.php b/app/Http/Controllers/Json/IntroController.php index f3bd44b660..7a55bca8c1 100644 --- a/app/Http/Controllers/Json/IntroController.php +++ b/app/Http/Controllers/Json/IntroController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Support\Http\Controllers\GetConfigurationData; use Illuminate\Http\JsonResponse; @@ -88,8 +87,6 @@ class IntroController extends Controller /** * Enable the boxes for a specific page again. - * - * @throws FireflyException */ public function postEnable(string $route, ?string $specialPage = null): JsonResponse { @@ -108,8 +105,6 @@ class IntroController extends Controller /** * Set that you saw them. - * - * @throws FireflyException */ public function postFinished(string $route, ?string $specialPage = null): JsonResponse { diff --git a/app/Http/Controllers/Json/ReconcileController.php b/app/Http/Controllers/Json/ReconcileController.php index a1208182e8..3d88bb0a88 100644 --- a/app/Http/Controllers/Json/ReconcileController.php +++ b/app/Http/Controllers/Json/ReconcileController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; -use Throwable; use Carbon\Carbon; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; @@ -38,6 +37,7 @@ use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; +use Throwable; /** * Class ReconcileController diff --git a/app/Http/Controllers/Json/RuleController.php b/app/Http/Controllers/Json/RuleController.php index a555015150..1826cd0a80 100644 --- a/app/Http/Controllers/Json/RuleController.php +++ b/app/Http/Controllers/Json/RuleController.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; -use Throwable; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; +use Throwable; /** * Class RuleController diff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.php index 271c70e692..5bfbc6815e 100644 --- a/app/Http/Controllers/NewUserController.php +++ b/app/Http/Controllers/NewUserController.php @@ -23,10 +23,9 @@ 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; +use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Support\Http\Controllers\CreateStuff; @@ -86,8 +85,6 @@ class NewUserController extends Controller * Store his new settings. * * @return Redirector|RedirectResponse - * - * @throws FireflyException */ public function submit(NewUserFormRequest $request, CurrencyRepositoryInterface $currencyRepository) { diff --git a/app/Http/Controllers/ObjectGroup/IndexController.php b/app/Http/Controllers/ObjectGroup/IndexController.php index 6cddb20792..91fc370f35 100644 --- a/app/Http/Controllers/ObjectGroup/IndexController.php +++ b/app/Http/Controllers/ObjectGroup/IndexController.php @@ -80,6 +80,6 @@ class IndexController extends Controller $newOrder = (int) $request->get('order'); $this->repository->setOrder($objectGroup, $newOrder); - return response()->json([]); + return response()->json(); } } diff --git a/app/Http/Controllers/PiggyBank/IndexController.php b/app/Http/Controllers/PiggyBank/IndexController.php index 64cab7c4ed..60c089fee0 100644 --- a/app/Http/Controllers/PiggyBank/IndexController.php +++ b/app/Http/Controllers/PiggyBank/IndexController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\PiggyBank; use Carbon\Carbon; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Account; use FireflyIII\Models\PiggyBank; @@ -77,8 +76,6 @@ class IndexController extends Controller * TODO very complicated function. * * @return Factory|View - * - * @throws FireflyException */ public function index() { diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index d6f0435eed..f1c2ac8658 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -23,8 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; -use FireflyIII\Support\Singleton\PreferencesSingleton; -use JsonException; use Carbon\Carbon; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Events\Preferences\UserGroupChangedPrimaryCurrency; @@ -35,6 +33,7 @@ use FireflyIII\Models\Account; use FireflyIII\Models\Preference; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Support\Facades\Preferences; +use FireflyIII\Support\Singleton\PreferencesSingleton; use FireflyIII\User; use Illuminate\Contracts\View\Factory; use Illuminate\Http\RedirectResponse; @@ -42,9 +41,11 @@ use Illuminate\Http\Request; use Illuminate\Routing\Redirector; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use JsonException; +use Safe\Exceptions\FilesystemException; -use function Safe\json_decode; use function Safe\file_get_contents; +use function Safe\json_decode; /** * Class PreferencesController. @@ -74,6 +75,7 @@ class PreferencesController extends Controller * @return Factory|View * * @throws FireflyException + * @throws FilesystemException */ public function index(AccountRepositoryInterface $repository) { diff --git a/app/Http/Controllers/Profile/MfaController.php b/app/Http/Controllers/Profile/MfaController.php index 333801c380..123680e2c3 100644 --- a/app/Http/Controllers/Profile/MfaController.php +++ b/app/Http/Controllers/Profile/MfaController.php @@ -24,13 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Profile; -use Illuminate\Support\Facades\Cookie; -use PragmaRX\Google2FALaravel\Facade as Google2FA; use Carbon\Carbon; use FireflyIII\Events\Security\DisabledMFA; use FireflyIII\Events\Security\EnabledMFA; use FireflyIII\Events\Security\MFANewBackupCodes; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Middleware\IsDemoUser; use FireflyIII\Http\Requests\ExistingTokenFormRequest; @@ -41,9 +38,13 @@ use Illuminate\Contracts\View\Factory; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Routing\Redirector; +use Illuminate\Support\Facades\Cookie; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use PragmaRX\Google2FALaravel\Facade as Google2FA; use PragmaRX\Recovery\Recovery; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class MfaController @@ -83,9 +84,6 @@ class MfaController extends Controller } - /** - * @throws FireflyException - */ public function backupCodes(Request $request): Factory|RedirectResponse|View { if (!$this->internalAuth) { @@ -232,7 +230,8 @@ class MfaController extends Controller * * @return Redirector|RedirectResponse * - * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function enableMFAPost(TokenFormRequest $request) { @@ -290,7 +289,8 @@ class MfaController extends Controller /** * TODO duplicate code. * - * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ private function addToMFAHistory(string $mfaCode): void { diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index b63ab5d86b..26e1509103 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -24,8 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; use Exception; -use Illuminate\Support\Facades\Auth; -use Illuminate\Support\Facades\Hash; use FireflyIII\Events\UserChangedEmail; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\ValidationException; @@ -45,9 +43,13 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Routing\Redirector; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Hash; use Illuminate\View\View; use Laravel\Passport\ClientRepository; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class ProfileController. @@ -136,7 +138,8 @@ class ProfileController extends Controller /** * Index for profile. * - * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function index(): Factory|View { diff --git a/app/Http/Controllers/Recurring/IndexController.php b/app/Http/Controllers/Recurring/IndexController.php index d6c7e41d7f..be4d9e527c 100644 --- a/app/Http/Controllers/Recurring/IndexController.php +++ b/app/Http/Controllers/Recurring/IndexController.php @@ -36,6 +36,8 @@ use Illuminate\Contracts\View\Factory; use Illuminate\Http\Request; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use Symfony\Component\HttpFoundation\ParameterBag; /** @@ -74,6 +76,8 @@ class IndexController extends Controller * @return Factory|View * * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function index(Request $request) { diff --git a/app/Http/Controllers/Report/AccountController.php b/app/Http/Controllers/Report/AccountController.php index dcd9464ce3..c6818cd9c6 100644 --- a/app/Http/Controllers/Report/AccountController.php +++ b/app/Http/Controllers/Report/AccountController.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; -use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Repositories\Account\AccountTaskerInterface; use FireflyIII\Support\CacheProperties; use Illuminate\Support\Collection; +use Throwable; /** * Class AccountController. diff --git a/app/Http/Controllers/Report/BalanceController.php b/app/Http/Controllers/Report/BalanceController.php index 41b3010a4a..3764008f2a 100644 --- a/app/Http/Controllers/Report/BalanceController.php +++ b/app/Http/Controllers/Report/BalanceController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; -use Throwable; use Carbon\Carbon; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; @@ -33,6 +32,7 @@ use FireflyIII\Models\Account; use FireflyIII\Models\Budget; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use Illuminate\Support\Collection; +use Throwable; /** * Class BalanceController. diff --git a/app/Http/Controllers/Report/BillController.php b/app/Http/Controllers/Report/BillController.php index 1fd70e3c48..9cea9f5edd 100644 --- a/app/Http/Controllers/Report/BillController.php +++ b/app/Http/Controllers/Report/BillController.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; -use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Report\ReportHelperInterface; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Support\CacheProperties; use Illuminate\Support\Collection; +use Throwable; /** * Class BillController diff --git a/app/Http/Controllers/Report/BudgetController.php b/app/Http/Controllers/Report/BudgetController.php index a59076ab9a..29c802bb96 100644 --- a/app/Http/Controllers/Report/BudgetController.php +++ b/app/Http/Controllers/Report/BudgetController.php @@ -23,8 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; -use FireflyIII\Support\Facades\Navigation; -use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -32,11 +30,13 @@ use FireflyIII\Models\Account; use FireflyIII\Models\Budget; use FireflyIII\Repositories\Budget\OperationsRepositoryInterface; use FireflyIII\Support\CacheProperties; +use FireflyIII\Support\Facades\Navigation; use FireflyIII\Support\Http\Controllers\BasicDataSupport; use FireflyIII\Support\Report\Budget\BudgetReportGenerator; use Illuminate\Contracts\View\Factory; use Illuminate\Support\Collection; use Illuminate\View\View; +use Throwable; /** * Class BudgetController. diff --git a/app/Http/Controllers/Report/CategoryController.php b/app/Http/Controllers/Report/CategoryController.php index fc8d17421a..1ae30d59e8 100644 --- a/app/Http/Controllers/Report/CategoryController.php +++ b/app/Http/Controllers/Report/CategoryController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; -use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -37,6 +36,7 @@ use FireflyIII\Support\Report\Category\CategoryReportGenerator; use Illuminate\Contracts\View\Factory; use Illuminate\Support\Collection; use Illuminate\View\View; +use Throwable; /** * Class CategoryController. diff --git a/app/Http/Controllers/Report/DoubleController.php b/app/Http/Controllers/Report/DoubleController.php index 32a1736844..ffe0545273 100644 --- a/app/Http/Controllers/Report/DoubleController.php +++ b/app/Http/Controllers/Report/DoubleController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; -use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -34,6 +33,7 @@ use FireflyIII\Support\Http\Controllers\AugumentData; use Illuminate\Contracts\View\Factory; use Illuminate\Support\Collection; use Illuminate\View\View; +use Throwable; /** * Class DoubleController diff --git a/app/Http/Controllers/Report/OperationsController.php b/app/Http/Controllers/Report/OperationsController.php index d2aaeaa3dd..e4f10fc574 100644 --- a/app/Http/Controllers/Report/OperationsController.php +++ b/app/Http/Controllers/Report/OperationsController.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; -use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Repositories\Account\AccountTaskerInterface; use FireflyIII\Support\CacheProperties; use Illuminate\Support\Collection; +use Throwable; /** * Class OperationsController. diff --git a/app/Http/Controllers/Report/TagController.php b/app/Http/Controllers/Report/TagController.php index 22bca3fd99..4eaeb46e90 100644 --- a/app/Http/Controllers/Report/TagController.php +++ b/app/Http/Controllers/Report/TagController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; -use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -34,6 +33,7 @@ use FireflyIII\Repositories\Tag\OperationsRepositoryInterface; use Illuminate\Contracts\View\Factory; use Illuminate\Support\Collection; use Illuminate\View\View; +use Throwable; /** * Class TagController diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 017aa4d9fe..eb82e859d9 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -39,6 +39,8 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Routing\Redirector; use Illuminate\Support\Collection; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class ReportController. @@ -226,6 +228,9 @@ class ReportController extends Controller * Show index. * * @return Factory|View + * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function index(AccountRepositoryInterface $repository) { diff --git a/app/Http/Controllers/Rule/CreateController.php b/app/Http/Controllers/Rule/CreateController.php index 107042d458..24c9c8bd64 100644 --- a/app/Http/Controllers/Rule/CreateController.php +++ b/app/Http/Controllers/Rule/CreateController.php @@ -24,11 +24,11 @@ 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; use FireflyIII\Models\Bill; +use FireflyIII\Models\Rule; use FireflyIII\Models\RuleGroup; use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Rule\RuleRepositoryInterface; diff --git a/app/Http/Controllers/Rule/EditController.php b/app/Http/Controllers/Rule/EditController.php index 848fa259a3..f1888c425d 100644 --- a/app/Http/Controllers/Rule/EditController.php +++ b/app/Http/Controllers/Rule/EditController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Rule; -use Throwable; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\RuleFormRequest; @@ -39,6 +38,7 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Routing\Redirector; use Illuminate\View\View; +use Throwable; /** * Class EditController diff --git a/app/Http/Controllers/Rule/IndexController.php b/app/Http/Controllers/Rule/IndexController.php index 5d53c38e9c..7273a72e56 100644 --- a/app/Http/Controllers/Rule/IndexController.php +++ b/app/Http/Controllers/Rule/IndexController.php @@ -82,7 +82,7 @@ class IndexController extends Controller $order = (int) $request->get('order'); $this->ruleRepos->moveRule($rule, $ruleGroup, $order); - return response()->json([]); + return response()->json(); } public function search(Rule $rule): RedirectResponse diff --git a/app/Http/Controllers/Rule/SelectController.php b/app/Http/Controllers/Rule/SelectController.php index 4d85f8ae3d..1084a9f2c8 100644 --- a/app/Http/Controllers/Rule/SelectController.php +++ b/app/Http/Controllers/Rule/SelectController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Rule; -use Throwable; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\SelectTransactionsRequest; @@ -39,6 +38,7 @@ use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Support\Collection; use Illuminate\View\View; +use Throwable; /** * Class SelectController. diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index b30d1eefad..39fa3cea10 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; -use Throwable; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Repositories\Rule\RuleRepositoryInterface; use FireflyIII\Support\Search\SearchInterface; @@ -31,6 +30,7 @@ use Illuminate\Contracts\View\Factory; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\View\View; +use Throwable; /** * Class SearchController. diff --git a/app/Http/Controllers/System/InstallController.php b/app/Http/Controllers/System/InstallController.php index e2acfb680f..6e1e168d0a 100644 --- a/app/Http/Controllers/System/InstallController.php +++ b/app/Http/Controllers/System/InstallController.php @@ -24,15 +24,16 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\System; -use Illuminate\Support\Facades\Artisan; -use Illuminate\Support\Facades\Cache; use Exception; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; +use FireflyIII\Support\Facades\FireflyConfig; use FireflyIII\Support\Http\Controllers\GetConfigurationData; use Illuminate\Contracts\View\Factory; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Artisan; +use Illuminate\Support\Facades\Cache; use Illuminate\View\View; use Laravel\Passport\Passport; use phpseclib3\Crypt\RSA; @@ -81,10 +82,7 @@ class InstallController extends Controller { app('view')->share('FF_VERSION', config('firefly.version')); // index will set FF3 version. - app('fireflyconfig')->set('ff3_version', (string) config('firefly.version')); - - // set new DB version. - app('fireflyconfig')->set('db_version', (int) config('firefly.db_version')); + FireflyConfig::set('ff3_version', (string) config('firefly.version')); return view('install.index'); } diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index f69cd62c24..53372408ae 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; -use FireflyIII\Models\Location; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Http\Requests\TagFormRequest; +use FireflyIII\Models\Location; use FireflyIII\Models\Tag; use FireflyIII\Repositories\Tag\TagRepositoryInterface; use FireflyIII\Support\Http\Controllers\PeriodOverview; @@ -37,6 +37,8 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class TagController. @@ -220,7 +222,9 @@ class TagController extends Controller * * @return Factory|View * + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function show(Request $request, Tag $tag, ?Carbon $start = null, ?Carbon $end = null) { @@ -262,6 +266,9 @@ class TagController extends Controller * Show a single tag over all time. * * @return Factory|View + * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function showAll(Request $request, Tag $tag) { diff --git a/app/Http/Controllers/Transaction/ConvertController.php b/app/Http/Controllers/Transaction/ConvertController.php index ec211a9b0d..bb5aa6f7d6 100644 --- a/app/Http/Controllers/Transaction/ConvertController.php +++ b/app/Http/Controllers/Transaction/ConvertController.php @@ -23,8 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; -use FireflyIII\Models\Transaction; -use FireflyIII\Models\TransactionCurrency; use Exception; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\TransactionTypeEnum; @@ -32,6 +30,8 @@ use FireflyIII\Events\UpdatedTransactionGroup; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Account; +use FireflyIII\Models\Transaction; +use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; diff --git a/app/Http/Controllers/Transaction/CreateController.php b/app/Http/Controllers/Transaction/CreateController.php index c69ddfc2ce..054a94ec23 100644 --- a/app/Http/Controllers/Transaction/CreateController.php +++ b/app/Http/Controllers/Transaction/CreateController.php @@ -24,10 +24,9 @@ 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; +use FireflyIII\Models\TransactionGroup; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepositoryInterface; use FireflyIII\Services\Internal\Update\GroupCloneService; @@ -36,6 +35,9 @@ use Illuminate\Contracts\View\Factory; use Illuminate\Contracts\View\View; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; +use Safe\Exceptions\UrlException; use function Safe\parse_url; @@ -100,8 +102,10 @@ class CreateController extends Controller * * @return Factory|View * - * @throws FireflyException - * */ + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + * @throws UrlException + */ public function create(?string $objectType) { Preferences::mark(); diff --git a/app/Http/Controllers/Transaction/EditController.php b/app/Http/Controllers/Transaction/EditController.php index 5b30ec7a9f..d349a9e18c 100644 --- a/app/Http/Controllers/Transaction/EditController.php +++ b/app/Http/Controllers/Transaction/EditController.php @@ -34,6 +34,9 @@ use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Routing\Redirector; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; +use Safe\Exceptions\UrlException; use function Safe\parse_url; @@ -66,6 +69,10 @@ class EditController extends Controller /** * @return Factory|Redirector|RedirectResponse|View + * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + * @throws UrlException */ public function edit(TransactionGroup $transactionGroup) { diff --git a/app/Http/Controllers/Transaction/IndexController.php b/app/Http/Controllers/Transaction/IndexController.php index 54e6a6e967..efb29a1236 100644 --- a/app/Http/Controllers/Transaction/IndexController.php +++ b/app/Http/Controllers/Transaction/IndexController.php @@ -24,16 +24,18 @@ 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; use FireflyIII\Http\Controllers\Controller; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\Http\Controllers\PeriodOverview; use Illuminate\Contracts\View\Factory; use Illuminate\Http\Request; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class IndexController @@ -69,7 +71,9 @@ class IndexController extends Controller * * @return Factory|View * + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function index(Request $request, string $objectType, ?Carbon $start = null, ?Carbon $end = null) { @@ -124,6 +128,9 @@ class IndexController extends Controller * Index for ALL transactions. * * @return Factory|View + * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function indexAll(Request $request, string $objectType) { diff --git a/app/Http/Controllers/Transaction/MassController.php b/app/Http/Controllers/Transaction/MassController.php index bb7f4609ae..7fde459a35 100644 --- a/app/Http/Controllers/Transaction/MassController.php +++ b/app/Http/Controllers/Transaction/MassController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; -use InvalidArgumentException; use Carbon\Carbon; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\TransactionTypeEnum; @@ -42,6 +41,7 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Routing\Redirector; use Illuminate\Support\Facades\Log; use Illuminate\View\View as IlluminateView; +use InvalidArgumentException; /** * Class MassController. diff --git a/app/Http/Controllers/TransactionCurrency/CreateController.php b/app/Http/Controllers/TransactionCurrency/CreateController.php index 2e7372b213..89febb82b5 100644 --- a/app/Http/Controllers/TransactionCurrency/CreateController.php +++ b/app/Http/Controllers/TransactionCurrency/CreateController.php @@ -24,10 +24,10 @@ 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\Models\TransactionCurrency; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; diff --git a/app/Http/Controllers/TransactionCurrency/DeleteController.php b/app/Http/Controllers/TransactionCurrency/DeleteController.php index c7cc7fb83a..7a2348cdff 100644 --- a/app/Http/Controllers/TransactionCurrency/DeleteController.php +++ b/app/Http/Controllers/TransactionCurrency/DeleteController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\TransactionCurrency; +use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; @@ -67,6 +68,8 @@ class DeleteController extends Controller * Deletes a currency. * * @return Factory|Redirector|RedirectResponse|View + * + * @throws FireflyException */ public function delete(Request $request, TransactionCurrency $currency) { @@ -100,6 +103,8 @@ class DeleteController extends Controller * Destroys a currency. * * @return Redirector|RedirectResponse + * + * @throws FireflyException */ public function destroy(Request $request, TransactionCurrency $currency) { diff --git a/app/Http/Controllers/TransactionCurrency/EditController.php b/app/Http/Controllers/TransactionCurrency/EditController.php index 926e973f44..d079b5ec8e 100644 --- a/app/Http/Controllers/TransactionCurrency/EditController.php +++ b/app/Http/Controllers/TransactionCurrency/EditController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\TransactionCurrency; +use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\CurrencyFormRequest; use FireflyIII\Models\TransactionCurrency; @@ -107,6 +108,8 @@ class EditController extends Controller * Updates a currency. * * @return Redirector|RedirectResponse + * + * @throws FireflyException */ public function update(CurrencyFormRequest $request, TransactionCurrency $currency) { diff --git a/app/Http/Controllers/TransactionCurrency/IndexController.php b/app/Http/Controllers/TransactionCurrency/IndexController.php index d63ffe5897..a24f1123d2 100644 --- a/app/Http/Controllers/TransactionCurrency/IndexController.php +++ b/app/Http/Controllers/TransactionCurrency/IndexController.php @@ -33,6 +33,8 @@ use Illuminate\Contracts\View\Factory; use Illuminate\Http\Request; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; class IndexController extends Controller { @@ -62,6 +64,9 @@ class IndexController extends Controller * Show overview of currencies. * * @return Factory|View + * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function index(Request $request) { diff --git a/app/Http/Middleware/AcceptHeaders.php b/app/Http/Middleware/AcceptHeaders.php index 0f797dea01..9cd43dc583 100644 --- a/app/Http/Middleware/AcceptHeaders.php +++ b/app/Http/Middleware/AcceptHeaders.php @@ -27,6 +27,7 @@ namespace FireflyIII\Http\Middleware; use FireflyIII\Exceptions\BadHttpHeaderException; use Illuminate\Http\Request; use Illuminate\Http\Response; +use Safe\Exceptions\PcreException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use function Safe\preg_match; @@ -39,6 +40,7 @@ class AcceptHeaders * @return Response * * @throws BadHttpHeaderException + * @throws PcreException */ public function handle(Request $request, callable $next): mixed { diff --git a/app/Http/Middleware/Installer.php b/app/Http/Middleware/Installer.php index f7d38232ca..852c523c4c 100644 --- a/app/Http/Middleware/Installer.php +++ b/app/Http/Middleware/Installer.php @@ -26,6 +26,7 @@ namespace FireflyIII\Http\Middleware; use Closure; use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Support\System\IsOldVersion; use FireflyIII\Support\System\OAuthKeys; use Illuminate\Database\QueryException; use Illuminate\Http\Request; @@ -37,6 +38,8 @@ use Illuminate\Support\Facades\Log; */ class Installer { + use IsOldVersion; + /** * Handle an incoming request. * @@ -65,7 +68,7 @@ class Installer // run installer when no tables are present, // or when old scheme version // or when old firefly version - if ($this->hasNoTables() || $this->oldDBVersion() || $this->oldVersion()) { + if ($this->hasNoTables() || $this->isOldVersionInstalled()) { return response()->redirectTo(route('installer.index')); } OAuthKeys::verifyKeysRoutine(); @@ -126,59 +129,4 @@ class Installer { return false !== stripos($message, 'Base table or view not found'); } - - /** - * Check if the "db_version" variable is correct. - */ - private function oldDBVersion(): bool - { - // older version in config than database? - $configVersion = (int) config('firefly.db_version'); - $dbVersion = (int) app('fireflyconfig')->getFresh('db_version', 1)->data; - if ($configVersion > $dbVersion) { - Log::warning( - sprintf( - 'The current configured version (%d) is older than the required version (%d). Redirect to migrate routine.', - $dbVersion, - $configVersion - ) - ); - - return true; - } - - // Log::info(sprintf('Configured DB version (%d) equals expected DB version (%d)', $dbVersion, $configVersion)); - - return false; - } - - /** - * Check if the "firefly_version" variable is correct. - */ - private function oldVersion(): bool - { - // version compare thing. - $configVersion = (string) config('firefly.version'); - $dbVersion = (string) app('fireflyconfig')->getFresh('ff3_version', '1.0')->data; - if (str_starts_with($configVersion, 'develop')) { - Log::debug('Skipping version check for develop version.'); - - return false; - } - if (1 === version_compare($configVersion, $dbVersion)) { - Log::warning( - sprintf( - 'The current configured Firefly III version (%s) is older than the required version (%s). Redirect to migrate routine.', - $dbVersion, - $configVersion - ) - ); - - return true; - } - - // Log::info(sprintf('Installed Firefly III version (%s) equals expected Firefly III version (%s)', $dbVersion, $configVersion)); - - return false; - } } diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index a9e7a705cd..47bcf126e2 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -23,14 +23,14 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Closure; -use FireflyIII\Support\Facades\Steam; -use Illuminate\Support\Facades\App; use Carbon\Carbon; +use Closure; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\Facades\Amount; +use FireflyIII\Support\Facades\Steam; use FireflyIII\Support\Http\Controllers\RequestInformation; use Illuminate\Http\Request; +use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Log; /** diff --git a/app/Http/Middleware/SecureHeaders.php b/app/Http/Middleware/SecureHeaders.php index 5f8b104992..246a9bf4a3 100644 --- a/app/Http/Middleware/SecureHeaders.php +++ b/app/Http/Middleware/SecureHeaders.php @@ -24,9 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; +use Barryvdh\Debugbar\Facades\Debugbar; use Closure; use Exception; -use Barryvdh\Debugbar\Facades\Debugbar; use Illuminate\Http\Request; use Illuminate\Support\Facades\Vite; diff --git a/app/Http/Middleware/StartFireflySession.php b/app/Http/Middleware/StartFireflySession.php index 922bc3ad8c..02aab37b34 100644 --- a/app/Http/Middleware/StartFireflySession.php +++ b/app/Http/Middleware/StartFireflySession.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Override; use Illuminate\Contracts\Session\Session; use Illuminate\Http\Request; use Illuminate\Session\Middleware\StartSession; +use Override; /** * Class StartFireflySession. diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php index 4446201045..e41086a8db 100644 --- a/app/Http/Middleware/TrustHosts.php +++ b/app/Http/Middleware/TrustHosts.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Override; use Illuminate\Http\Middleware\TrustHosts as Middleware; +use Override; class TrustHosts extends Middleware { diff --git a/app/Http/Requests/AccountFormRequest.php b/app/Http/Requests/AccountFormRequest.php index ced11547e0..9cd8d51163 100644 --- a/app/Http/Requests/AccountFormRequest.php +++ b/app/Http/Requests/AccountFormRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Models\Account; use FireflyIII\Models\Location; @@ -34,6 +33,7 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class AccountFormRequest. diff --git a/app/Http/Requests/AttachmentFormRequest.php b/app/Http/Requests/AttachmentFormRequest.php index f2b4beb568..f481510ee6 100644 --- a/app/Http/Requests/AttachmentFormRequest.php +++ b/app/Http/Requests/AttachmentFormRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class AttachmentFormRequest. diff --git a/app/Http/Requests/BillStoreRequest.php b/app/Http/Requests/BillStoreRequest.php index 46436a7c9d..37e9f7ef02 100644 --- a/app/Http/Requests/BillStoreRequest.php +++ b/app/Http/Requests/BillStoreRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class BillStoreRequest. diff --git a/app/Http/Requests/BillUpdateRequest.php b/app/Http/Requests/BillUpdateRequest.php index 2f70b26df3..cde6978364 100644 --- a/app/Http/Requests/BillUpdateRequest.php +++ b/app/Http/Requests/BillUpdateRequest.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\Bill; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class BillUpdateRequest. diff --git a/app/Http/Requests/BudgetFormStoreRequest.php b/app/Http/Requests/BudgetFormStoreRequest.php index ac4edf6e69..86779d3794 100644 --- a/app/Http/Requests/BudgetFormStoreRequest.php +++ b/app/Http/Requests/BudgetFormStoreRequest.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\AutoBudget\ValidatesAutoBudgetRequest; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class BudgetFormStoreRequest diff --git a/app/Http/Requests/BudgetFormUpdateRequest.php b/app/Http/Requests/BudgetFormUpdateRequest.php index 539e613fff..cdebd759e7 100644 --- a/app/Http/Requests/BudgetFormUpdateRequest.php +++ b/app/Http/Requests/BudgetFormUpdateRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\Budget; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; @@ -31,6 +30,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\AutoBudget\ValidatesAutoBudgetRequest; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class BudgetFormUpdateRequest diff --git a/app/Http/Requests/BudgetIncomeRequest.php b/app/Http/Requests/BudgetIncomeRequest.php index 49ed18de14..d75f81faa9 100644 --- a/app/Http/Requests/BudgetIncomeRequest.php +++ b/app/Http/Requests/BudgetIncomeRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class BudgetIncomeRequest. diff --git a/app/Http/Requests/BulkEditJournalRequest.php b/app/Http/Requests/BulkEditJournalRequest.php index 169d1bc6ce..4bbaafa77b 100644 --- a/app/Http/Requests/BulkEditJournalRequest.php +++ b/app/Http/Requests/BulkEditJournalRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class MassEditBulkJournalRequest. diff --git a/app/Http/Requests/CategoryFormRequest.php b/app/Http/Requests/CategoryFormRequest.php index a4e5112669..8ca3455168 100644 --- a/app/Http/Requests/CategoryFormRequest.php +++ b/app/Http/Requests/CategoryFormRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\Category; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class CategoryFormRequest. diff --git a/app/Http/Requests/ConfigurationRequest.php b/app/Http/Requests/ConfigurationRequest.php index 712d2be5a4..57f8a969b4 100644 --- a/app/Http/Requests/ConfigurationRequest.php +++ b/app/Http/Requests/ConfigurationRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class ConfigurationRequest. diff --git a/app/Http/Requests/CurrencyFormRequest.php b/app/Http/Requests/CurrencyFormRequest.php index 60ce09cbba..959678e64c 100644 --- a/app/Http/Requests/CurrencyFormRequest.php +++ b/app/Http/Requests/CurrencyFormRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class CurrencyFormRequest. diff --git a/app/Http/Requests/DeleteAccountFormRequest.php b/app/Http/Requests/DeleteAccountFormRequest.php index eb36622b3a..31222e084a 100644 --- a/app/Http/Requests/DeleteAccountFormRequest.php +++ b/app/Http/Requests/DeleteAccountFormRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class DeleteAccountFormRequest. diff --git a/app/Http/Requests/EmailFormRequest.php b/app/Http/Requests/EmailFormRequest.php index 1f499245eb..cd4369f3ec 100644 --- a/app/Http/Requests/EmailFormRequest.php +++ b/app/Http/Requests/EmailFormRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class EmailFormRequest. diff --git a/app/Http/Requests/ExistingTokenFormRequest.php b/app/Http/Requests/ExistingTokenFormRequest.php index f3222a8d57..b843012fba 100644 --- a/app/Http/Requests/ExistingTokenFormRequest.php +++ b/app/Http/Requests/ExistingTokenFormRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class ExistingTokenFormRequest. diff --git a/app/Http/Requests/InviteUserFormRequest.php b/app/Http/Requests/InviteUserFormRequest.php index 70ebad1f19..2c31d965ce 100644 --- a/app/Http/Requests/InviteUserFormRequest.php +++ b/app/Http/Requests/InviteUserFormRequest.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class InviteUserFormRequest diff --git a/app/Http/Requests/JournalLinkRequest.php b/app/Http/Requests/JournalLinkRequest.php index 487b47f91c..185aaea191 100644 --- a/app/Http/Requests/JournalLinkRequest.php +++ b/app/Http/Requests/JournalLinkRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\LinkType; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class JournalLink. diff --git a/app/Http/Requests/LinkTypeFormRequest.php b/app/Http/Requests/LinkTypeFormRequest.php index bc0a56c933..3fb7511c6a 100644 --- a/app/Http/Requests/LinkTypeFormRequest.php +++ b/app/Http/Requests/LinkTypeFormRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class LinkTypeFormRequest. diff --git a/app/Http/Requests/MassDeleteJournalRequest.php b/app/Http/Requests/MassDeleteJournalRequest.php index fc1c5e93f8..603e8a7d51 100644 --- a/app/Http/Requests/MassDeleteJournalRequest.php +++ b/app/Http/Requests/MassDeleteJournalRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class MassDeleteJournalRequest. diff --git a/app/Http/Requests/MassEditJournalRequest.php b/app/Http/Requests/MassEditJournalRequest.php index ccf00f8988..7f217aaf67 100644 --- a/app/Http/Requests/MassEditJournalRequest.php +++ b/app/Http/Requests/MassEditJournalRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class MassEditJournalRequest. diff --git a/app/Http/Requests/NewUserFormRequest.php b/app/Http/Requests/NewUserFormRequest.php index 967d7fe461..bed1e3def7 100644 --- a/app/Http/Requests/NewUserFormRequest.php +++ b/app/Http/Requests/NewUserFormRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Rules\IsValidAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class NewUserFormRequest. diff --git a/app/Http/Requests/ObjectGroupFormRequest.php b/app/Http/Requests/ObjectGroupFormRequest.php index ccc0cf24f5..8d8dcb1b8a 100644 --- a/app/Http/Requests/ObjectGroupFormRequest.php +++ b/app/Http/Requests/ObjectGroupFormRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\ObjectGroup; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class ObjectGroupFormRequest. diff --git a/app/Http/Requests/PiggyBankStoreRequest.php b/app/Http/Requests/PiggyBankStoreRequest.php index 868b1cc4bd..87a13140da 100644 --- a/app/Http/Requests/PiggyBankStoreRequest.php +++ b/app/Http/Requests/PiggyBankStoreRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Account\AccountRepositoryInterface; @@ -33,6 +32,7 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class PiggyBankStoreRequest. diff --git a/app/Http/Requests/PiggyBankUpdateRequest.php b/app/Http/Requests/PiggyBankUpdateRequest.php index e0ecaf9614..a93fcada2f 100644 --- a/app/Http/Requests/PiggyBankUpdateRequest.php +++ b/app/Http/Requests/PiggyBankUpdateRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\TransactionCurrency; @@ -34,6 +33,7 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class PiggyBankFormRequest. diff --git a/app/Http/Requests/ProfileFormRequest.php b/app/Http/Requests/ProfileFormRequest.php index 1a7956d647..bf741778e6 100644 --- a/app/Http/Requests/ProfileFormRequest.php +++ b/app/Http/Requests/ProfileFormRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class ProfileFormRequest. diff --git a/app/Http/Requests/ReconciliationStoreRequest.php b/app/Http/Requests/ReconciliationStoreRequest.php index e8c8b1a9be..75a1a6d8e3 100644 --- a/app/Http/Requests/ReconciliationStoreRequest.php +++ b/app/Http/Requests/ReconciliationStoreRequest.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Rules\IsValidAmount; use FireflyIII\Rules\ValidJournals; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class ReconciliationStoreRequest diff --git a/app/Http/Requests/RecurrenceFormRequest.php b/app/Http/Requests/RecurrenceFormRequest.php index a4f9014078..d7340dd793 100644 --- a/app/Http/Requests/RecurrenceFormRequest.php +++ b/app/Http/Requests/RecurrenceFormRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Factory\CategoryFactory; @@ -37,6 +36,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\AccountValidator; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class RecurrenceFormRequest diff --git a/app/Http/Requests/ReportFormRequest.php b/app/Http/Requests/ReportFormRequest.php index 7a4fcd3cf9..eda973b3fb 100644 --- a/app/Http/Requests/ReportFormRequest.php +++ b/app/Http/Requests/ReportFormRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use Carbon\Carbon; use Exception; use FireflyIII\Exceptions\FireflyException; @@ -35,6 +34,8 @@ use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; +use Safe\Exceptions\PcreException; use function Safe\preg_match; @@ -134,6 +135,7 @@ class ReportFormRequest extends FormRequest * Validate end date. * * @throws FireflyException + * @throws PcreException */ public function getEndDate(): Carbon { @@ -172,6 +174,7 @@ class ReportFormRequest extends FormRequest * Validate start date. * * @throws FireflyException + * @throws PcreException */ public function getStartDate(): Carbon { diff --git a/app/Http/Requests/RuleFormRequest.php b/app/Http/Requests/RuleFormRequest.php index f47f4b7c3f..8b7d9ca061 100644 --- a/app/Http/Requests/RuleFormRequest.php +++ b/app/Http/Requests/RuleFormRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\Rule; use FireflyIII\Rules\IsValidActionExpression; use FireflyIII\Support\Request\ChecksLogin; @@ -31,6 +30,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Support\Request\GetRuleConfiguration; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class RuleFormRequest. diff --git a/app/Http/Requests/RuleGroupFormRequest.php b/app/Http/Requests/RuleGroupFormRequest.php index 6ebc1a6233..8f5c4af01b 100644 --- a/app/Http/Requests/RuleGroupFormRequest.php +++ b/app/Http/Requests/RuleGroupFormRequest.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\RuleGroup; use FireflyIII\Rules\IsBoolean; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class RuleGroupFormRequest. diff --git a/app/Http/Requests/SelectTransactionsRequest.php b/app/Http/Requests/SelectTransactionsRequest.php index 6b27652abc..fdd9e0ecf8 100644 --- a/app/Http/Requests/SelectTransactionsRequest.php +++ b/app/Http/Requests/SelectTransactionsRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class SelectTransactionsRequest. diff --git a/app/Http/Requests/TagFormRequest.php b/app/Http/Requests/TagFormRequest.php index 28a733b78c..a156257b78 100644 --- a/app/Http/Requests/TagFormRequest.php +++ b/app/Http/Requests/TagFormRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\Location; use FireflyIII\Models\Tag; use FireflyIII\Support\Request\AppendsLocationData; @@ -31,6 +30,7 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class TagFormRequest. diff --git a/app/Http/Requests/TestRuleFormRequest.php b/app/Http/Requests/TestRuleFormRequest.php index 880c45625e..0cf0524667 100644 --- a/app/Http/Requests/TestRuleFormRequest.php +++ b/app/Http/Requests/TestRuleFormRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\GetRuleConfiguration; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class TestRuleFormRequest. diff --git a/app/Http/Requests/TokenFormRequest.php b/app/Http/Requests/TokenFormRequest.php index a54a1e786b..3a53cbe7ab 100644 --- a/app/Http/Requests/TokenFormRequest.php +++ b/app/Http/Requests/TokenFormRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class TokenFormRequest. diff --git a/app/Http/Requests/TriggerRecurrenceRequest.php b/app/Http/Requests/TriggerRecurrenceRequest.php index 4b929adaa7..c03e531a00 100644 --- a/app/Http/Requests/TriggerRecurrenceRequest.php +++ b/app/Http/Requests/TriggerRecurrenceRequest.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class TriggerRecurrenceRequest diff --git a/app/Http/Requests/UserFormRequest.php b/app/Http/Requests/UserFormRequest.php index b53be02934..409cfba453 100644 --- a/app/Http/Requests/UserFormRequest.php +++ b/app/Http/Requests/UserFormRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UserFormRequest. diff --git a/app/Http/Requests/UserRegistrationRequest.php b/app/Http/Requests/UserRegistrationRequest.php index 64df7a021b..6e26763831 100644 --- a/app/Http/Requests/UserRegistrationRequest.php +++ b/app/Http/Requests/UserRegistrationRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UserRegistrationRequest. diff --git a/app/Jobs/DownloadExchangeRates.php b/app/Jobs/DownloadExchangeRates.php index 8d22837468..e5be322d09 100644 --- a/app/Jobs/DownloadExchangeRates.php +++ b/app/Jobs/DownloadExchangeRates.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Jobs; -use FireflyIII\Models\CurrencyExchangeRate; use Carbon\Carbon; +use FireflyIII\Models\CurrencyExchangeRate; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Repositories\User\UserRepositoryInterface; @@ -40,6 +40,7 @@ use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; +use Safe\Exceptions\JsonException; use function Safe\json_decode; @@ -95,6 +96,7 @@ class DownloadExchangeRates implements ShouldQueue /** * @throws GuzzleException + * @throws JsonException */ private function downloadRates(TransactionCurrency $currency): void { diff --git a/app/Jobs/MailError.php b/app/Jobs/MailError.php index 57cfaf7feb..ecc8c24b5d 100644 --- a/app/Jobs/MailError.php +++ b/app/Jobs/MailError.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Jobs; use Carbon\Carbon; +use Exception; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Message; use Illuminate\Queue\InteractsWithQueue; @@ -31,12 +32,11 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Mail; use Symfony\Component\Mailer\Exception\TransportException; -use Exception; -use function Safe\json_encode; +use function Safe\file_get_contents; use function Safe\file_put_contents; use function Safe\json_decode; -use function Safe\file_get_contents; +use function Safe\json_encode; /** * Class MailError. diff --git a/app/Mail/ReportNewJournalsMail.php b/app/Mail/ReportNewJournalsMail.php index e0a492fa47..c8b51a782d 100644 --- a/app/Mail/ReportNewJournalsMail.php +++ b/app/Mail/ReportNewJournalsMail.php @@ -52,6 +52,8 @@ class ReportNewJournalsMail extends Mailable * Build the message. * * @return $this + * + * @throws FireflyException */ public function build(): self { diff --git a/app/Models/Budget.php b/app/Models/Budget.php index 4375c6c2a7..481ad1c6dc 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -128,4 +128,9 @@ class Budget extends Model get: static fn ($value) => (int)$value, ); } + + public function primaryPeriodStatistics(): MorphMany + { + return $this->morphMany(PeriodStatistic::class, 'primary_statable'); + } } diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.php index 66f12753c6..6ac0d049f3 100644 --- a/app/Models/BudgetLimit.php +++ b/app/Models/BudgetLimit.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Models; +use Carbon\Carbon; use FireflyIII\Casts\SeparateTimezoneCaster; use FireflyIII\Handlers\Observer\BudgetLimitObserver; use FireflyIII\Support\Models\ReturnsIntegerIdTrait; @@ -33,6 +34,13 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphMany; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +/** + * Class BudgetLimit + * + * @property TransactionCurrency $transactionCurrency + * @property Carbon $start_date + * @property Carbon $end_date + */ #[ObservedBy([BudgetLimitObserver::class])] class BudgetLimit extends Model { diff --git a/app/Models/Category.php b/app/Models/Category.php index 55c9c7ebcf..5eb63dbcba 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -81,7 +81,7 @@ class Category extends Model } /** - * Get all of the category's notes. + * Get all the category's notes. */ public function notes(): MorphMany { diff --git a/app/Models/Recurrence.php b/app/Models/Recurrence.php index b3fa7a3a8c..1893fa023e 100644 --- a/app/Models/Recurrence.php +++ b/app/Models/Recurrence.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Models; +use Carbon\Carbon; use FireflyIII\Casts\SeparateTimezoneCaster; use FireflyIII\Handlers\Observer\RecurrenceObserver; use FireflyIII\Support\Models\ReturnsIntegerIdTrait; @@ -38,6 +39,10 @@ use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +/** + * @property Carbon $first_date + * @property null|Carbon $latest_date + */ #[ObservedBy([RecurrenceObserver::class])] class Recurrence extends Model { diff --git a/app/Models/Rule.php b/app/Models/Rule.php index 7755e00984..d2c235f532 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -35,6 +35,9 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +/** + * @property User $user + */ #[ObservedBy([RuleObserver::class])] class Rule extends Model { diff --git a/app/Models/RuleGroup.php b/app/Models/RuleGroup.php index 99f6655f63..514d4d222e 100644 --- a/app/Models/RuleGroup.php +++ b/app/Models/RuleGroup.php @@ -35,6 +35,9 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +/** + * @property User $user + */ #[ObservedBy([RuleGroupObserver::class])] class RuleGroup extends Model { diff --git a/app/Models/TransactionGroup.php b/app/Models/TransactionGroup.php index 81e7aac2e6..ee6911ee37 100644 --- a/app/Models/TransactionGroup.php +++ b/app/Models/TransactionGroup.php @@ -32,8 +32,15 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\SoftDeletes; +use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Log; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +/** + * @property User $user + * @property UserGroup $userGroup + * @property Collection $transactionJournals + */ #[ObservedBy([TransactionGroupObserver::class])] class TransactionGroup extends Model { @@ -50,13 +57,13 @@ class TransactionGroup extends Model */ public static function routeBinder(string $value): self { - app('log')->debug(sprintf('Now in %s("%s")', __METHOD__, $value)); + Log::debug(sprintf('Now in %s("%s")', __METHOD__, $value)); if (auth()->check()) { $groupId = (int)$value; /** @var User $user */ $user = auth()->user(); - app('log')->debug(sprintf('User authenticated as %s', $user->email)); + Log::debug(sprintf('User authenticated as %s', $user->email)); /** @var null|TransactionGroup $group */ $group = $user->transactionGroups() @@ -64,12 +71,12 @@ class TransactionGroup extends Model ->where('transaction_groups.id', $groupId)->first(['transaction_groups.*']) ; if (null !== $group) { - app('log')->debug(sprintf('Found group #%d.', $group->id)); + Log::debug(sprintf('Found group #%d.', $group->id)); return $group; } } - app('log')->debug('Found no group.'); + Log::debug('Found no group.'); throw new NotFoundHttpException(); } diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index 3aa0099446..f6bd140648 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -47,6 +47,8 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @method EloquentBuilder|static before() * @method EloquentBuilder|static after() * @method static EloquentBuilder|static query() + * + * @property TransactionGroup $transactionGroup */ #[ObservedBy([TransactionJournalObserver::class])] class TransactionJournal extends Model diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php index e900b72f9e..cb9bebbbf4 100644 --- a/app/Providers/FireflyServiceProvider.php +++ b/app/Providers/FireflyServiceProvider.php @@ -77,8 +77,8 @@ use FireflyIII\Validation\FireflyValidator; use Illuminate\Foundation\Application; use Illuminate\Support\Facades\Validator; use Illuminate\Support\ServiceProvider; -use Symfony\Component\ExpressionLanguage\ExpressionLanguage; use Override; +use Symfony\Component\ExpressionLanguage\ExpressionLanguage; /** * Class FireflyServiceProvider. diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.php index 1b3b7ff1ee..63260b6643 100644 --- a/app/Repositories/Account/AccountTasker.php +++ b/app/Repositories/Account/AccountTasker.php @@ -143,9 +143,6 @@ class AccountTasker implements AccountTaskerInterface, UserGroupInterface return $report; } - /** - * @throws FireflyException - */ private function groupExpenseByDestination(array $array): array { $primaryCurrency = app('amount')->getPrimaryCurrencyByUserGroup($this->user->userGroup); @@ -231,9 +228,6 @@ class AccountTasker implements AccountTaskerInterface, UserGroupInterface return $report; } - /** - * @throws FireflyException - */ private function groupIncomeBySource(array $array): array { $primaryCurrency = app('amount')->getPrimaryCurrencyByUserGroup($this->user->userGroup); diff --git a/app/Repositories/Attachment/AttachmentRepository.php b/app/Repositories/Attachment/AttachmentRepository.php index 0e41c59cf4..cd0d3ea249 100644 --- a/app/Repositories/Attachment/AttachmentRepository.php +++ b/app/Repositories/Attachment/AttachmentRepository.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Attachment; +use Exception; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Factory\AttachmentFactory; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; @@ -35,7 +36,6 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\Crypt; use Illuminate\Support\Facades\Storage; use League\Flysystem\UnableToDeleteFile; -use Exception; use LogicException; /** diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index 99c484f4a8..daa88a5a65 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Bill; -use FireflyIII\Models\ObjectGroup; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Factory\BillFactory; use FireflyIII\Models\Attachment; use FireflyIII\Models\Bill; use FireflyIII\Models\Note; +use FireflyIII\Models\ObjectGroup; use FireflyIII\Models\Rule; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; diff --git a/app/Repositories/Budget/AvailableBudgetRepository.php b/app/Repositories/Budget/AvailableBudgetRepository.php index 177900d154..e992bff82d 100644 --- a/app/Repositories/Budget/AvailableBudgetRepository.php +++ b/app/Repositories/Budget/AvailableBudgetRepository.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Budget; -use Deprecated; use Carbon\Carbon; +use Deprecated; use FireflyIII\Models\AvailableBudget; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Support\Facades\Amount; @@ -113,6 +113,7 @@ class AvailableBudgetRepository implements AvailableBudgetRepositoryInterface, U ; } + #[Deprecated] public function getAvailableBudget(TransactionCurrency $currency, Carbon $start, Carbon $end): string { $amount = '0'; diff --git a/app/Repositories/Budget/AvailableBudgetRepositoryInterface.php b/app/Repositories/Budget/AvailableBudgetRepositoryInterface.php index 3d54e3f20b..46251e79d2 100644 --- a/app/Repositories/Budget/AvailableBudgetRepositoryInterface.php +++ b/app/Repositories/Budget/AvailableBudgetRepositoryInterface.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Budget; -use Deprecated; use Carbon\Carbon; +use Deprecated; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Models\AvailableBudget; use FireflyIII\Models\TransactionCurrency; diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 8aaaa40b8a..0b2d41395d 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -377,9 +377,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface return; } - if (null !== $dbNote) { - $dbNote->delete(); - } + $dbNote?->delete(); } public function getAutoBudget(Budget $budget): ?AutoBudget @@ -388,9 +386,6 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface return $budget->autoBudgets()->first(); } - /** - * @throws FireflyException - */ private function updateAutoBudget(Budget $budget, array $data): void { // update or create auto-budget: @@ -527,11 +522,9 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface public function firstUseDate(Budget $budget): ?Carbon { $journal = $budget->transactionJournals()->orderBy('date', 'ASC')->first(); - if (null !== $journal) { - return $journal->date; - } - return null; + return $journal?->date; + } public function getAttachments(Budget $budget): Collection @@ -570,11 +563,9 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface public function getNoteText(Budget $budget): ?string { $note = $budget->notes()->first(); - if (null === $note) { - return null; - } - return $note->text; + return $note?->text; + } public function searchBudget(string $query, int $limit): Collection diff --git a/app/Repositories/Budget/NoBudgetRepository.php b/app/Repositories/Budget/NoBudgetRepository.php index f48176ab9a..3b5709b18b 100644 --- a/app/Repositories/Budget/NoBudgetRepository.php +++ b/app/Repositories/Budget/NoBudgetRepository.php @@ -33,6 +33,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface; use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait; use Illuminate\Support\Collection; use Override; +use Deprecated; /** * Class NoBudgetRepository @@ -41,6 +42,7 @@ class NoBudgetRepository implements NoBudgetRepositoryInterface, UserGroupInterf { use UserGroupTrait; + #[Deprecated] public function getNoBudgetPeriodReport(Collection $accounts, Carbon $start, Carbon $end): array { $carbonFormat = app('navigation')->preferredCarbonFormat($start, $end); diff --git a/app/Repositories/Budget/NoBudgetRepositoryInterface.php b/app/Repositories/Budget/NoBudgetRepositoryInterface.php index 01b42c3396..13d12a1122 100644 --- a/app/Repositories/Budget/NoBudgetRepositoryInterface.php +++ b/app/Repositories/Budget/NoBudgetRepositoryInterface.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Budget; -use Deprecated; use Carbon\Carbon; +use Deprecated; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\UserGroup; diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index 894690e9e6..6b1f75a91c 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Category; use Carbon\Carbon; +use Exception; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Factory\CategoryFactory; use FireflyIII\Models\Attachment; @@ -39,7 +40,6 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; -use Exception; /** * Class CategoryRepository. @@ -213,11 +213,8 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf $query = $category->transactionJournals()->orderBy('date', 'ASC'); $result = $query->first(['transaction_journals.*']); - if (null !== $result) { - return $result->date; - } + return $result?->date; - return null; } private function getFirstTransactionDate(Category $category): ?Carbon @@ -264,11 +261,9 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf public function getNoteText(Category $category): ?string { $dbNote = $category->notes()->first(); - if (null === $dbNote) { - return null; - } - return $dbNote->text; + return $dbNote?->text; + } /** @@ -307,11 +302,8 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf $result = $query->first(['transaction_journals.*']); - if (null !== $result) { - return $result->date; - } + return $result?->date; - return null; } /** diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index cb5e24858b..eacd820c34 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -44,6 +44,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Override; +use Safe\Exceptions\JsonException; use function Safe\json_encode; @@ -65,7 +66,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf } /** - * @throws FireflyException + * @throws JsonException */ public function currencyInUseAt(TransactionCurrency $currency): ?string { @@ -233,8 +234,6 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf /** * Find by object, ID or code. Returns user default or system default. - * - * @throws FireflyException */ public function findCurrency(?int $currencyId, ?string $currencyCode): TransactionCurrency { diff --git a/app/Repositories/Journal/JournalCLIRepository.php b/app/Repositories/Journal/JournalCLIRepository.php index ea923bfffc..eaaaf600b4 100644 --- a/app/Repositories/Journal/JournalCLIRepository.php +++ b/app/Repositories/Journal/JournalCLIRepository.php @@ -166,11 +166,9 @@ class JournalCLIRepository implements JournalCLIRepositoryInterface, UserGroupIn public function getNoteText(TransactionJournal $journal): ?string { $note = $journal->notes()->first(); - if (null === $note) { - return null; - } - return $note->text; + return $note?->text; + } /** diff --git a/app/Repositories/PeriodStatistic/PeriodStatisticRepository.php b/app/Repositories/PeriodStatistic/PeriodStatisticRepository.php index ad294b9fcb..e2d6649064 100644 --- a/app/Repositories/PeriodStatistic/PeriodStatisticRepository.php +++ b/app/Repositories/PeriodStatistic/PeriodStatisticRepository.php @@ -25,6 +25,7 @@ namespace FireflyIII\Repositories\PeriodStatistic; use Carbon\Carbon; use FireflyIII\Models\PeriodStatistic; +use FireflyIII\Models\UserGroup; use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface; use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait; use Illuminate\Database\Eloquent\Model; @@ -133,4 +134,10 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U return $stat; } + + #[Override] + public function deleteStatisticsForPrefix(UserGroup $userGroup, string $prefix, Carbon $date): void + { + $userGroup->periodStatistics()->where('start', '<=', $date)->where('end', '>=', $date)->where('type', 'LIKE', sprintf('%s%%', $prefix))->delete(); + } } diff --git a/app/Repositories/PeriodStatistic/PeriodStatisticRepositoryInterface.php b/app/Repositories/PeriodStatistic/PeriodStatisticRepositoryInterface.php index 22f17d8f2d..c4a9574d29 100644 --- a/app/Repositories/PeriodStatistic/PeriodStatisticRepositoryInterface.php +++ b/app/Repositories/PeriodStatistic/PeriodStatisticRepositoryInterface.php @@ -25,6 +25,7 @@ namespace FireflyIII\Repositories\PeriodStatistic; use Carbon\Carbon; use FireflyIII\Models\PeriodStatistic; +use FireflyIII\Models\UserGroup; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Collection; @@ -43,4 +44,6 @@ interface PeriodStatisticRepositoryInterface public function allInRangeForPrefix(string $prefix, Carbon $start, Carbon $end): Collection; public function deleteStatisticsForModel(Model $model, Carbon $date): void; + + public function deleteStatisticsForPrefix(UserGroup $userGroup, string $prefix, Carbon $date): void; } diff --git a/app/Repositories/PiggyBank/ModifiesPiggyBanks.php b/app/Repositories/PiggyBank/ModifiesPiggyBanks.php index e63da28927..734cfe8b0f 100644 --- a/app/Repositories/PiggyBank/ModifiesPiggyBanks.php +++ b/app/Repositories/PiggyBank/ModifiesPiggyBanks.php @@ -36,6 +36,7 @@ use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\ObjectGroup\CreatesObjectGroups; use FireflyIII\Support\Facades\Amount; +use FireflyIII\Support\Facades\Steam; use FireflyIII\Support\Http\Api\ExchangeRateConverter; use Illuminate\Support\Facades\Log; @@ -227,7 +228,6 @@ trait ModifiesPiggyBanks $factory->user = $this->user; // the piggy bank currency is set or updated FIRST, if it exists. - $factory->linkToAccountIds($piggyBank, $data['accounts'] ?? []); @@ -244,7 +244,7 @@ trait ModifiesPiggyBanks // question is, from which account(s) to remove the difference? // solution: just start from the top until there is no more money left to remove. - $this->removeAmountFromAll($piggyBank, app('steam')->positive($difference)); + $this->removeAmountFromAll($piggyBank, Steam::positive($difference)); } // update using name: diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php index 8ca1f14723..056825e7d8 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepository.php +++ b/app/Repositories/PiggyBank/PiggyBankRepository.php @@ -23,9 +23,8 @@ declare(strict_types=1); namespace FireflyIII\Repositories\PiggyBank; -use FireflyIII\Events\Model\PiggyBank\ChangedAmount; -use FireflyIII\User; use Carbon\Carbon; +use FireflyIII\Events\Model\PiggyBank\ChangedAmount; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Factory\PiggyBankFactory; use FireflyIII\Models\Account; @@ -40,6 +39,7 @@ use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\Facades\Steam; use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface; use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait; +use FireflyIII\User; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; diff --git a/app/Repositories/Recurring/RecurringRepository.php b/app/Repositories/Recurring/RecurringRepository.php index c8ee7b89c1..4e8a67ec0d 100644 --- a/app/Repositories/Recurring/RecurringRepository.php +++ b/app/Repositories/Recurring/RecurringRepository.php @@ -51,8 +51,8 @@ use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; -use function Safe\json_encode; use function Safe\json_decode; +use function Safe\json_encode; /** * Class RecurringRepository @@ -430,8 +430,6 @@ class RecurringRepository implements RecurringRepositoryInterface, UserGroupInte /** * Parse the repetition in a string that is user readable. - * - * @throws FireflyException */ public function repetitionDescription(RecurrenceRepetition $repetition): string { diff --git a/app/Repositories/Rule/RuleRepository.php b/app/Repositories/Rule/RuleRepository.php index 5774e84e9e..e8435dc6c2 100644 --- a/app/Repositories/Rule/RuleRepository.php +++ b/app/Repositories/Rule/RuleRepository.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Rule; +use Exception; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Rule; use FireflyIII\Models\RuleAction; @@ -33,7 +34,6 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface; use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait; use FireflyIII\Support\Search\OperatorQuerySearch; use Illuminate\Support\Collection; -use Exception; /** * Class RuleRepository. diff --git a/app/Repositories/RuleGroup/RuleGroupRepository.php b/app/Repositories/RuleGroup/RuleGroupRepository.php index 3e1694baee..a3256ccf50 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepository.php +++ b/app/Repositories/RuleGroup/RuleGroupRepository.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Repositories\RuleGroup; +use Exception; use FireflyIII\Models\Rule; use FireflyIII\Models\RuleAction; use FireflyIII\Models\RuleGroup; @@ -32,7 +33,6 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; -use Exception; /** * Class RuleGroupRepository. diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index eb50e2ef8f..b900e9143a 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -23,8 +23,8 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Tag; -use Override; use Carbon\Carbon; +use Exception; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Factory\TagFactory; use FireflyIII\Helpers\Collector\GroupCollectorInterface; @@ -39,7 +39,7 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; -use Exception; +use Override; /** * Class TagRepository. diff --git a/app/Repositories/TransactionGroup/TransactionGroupRepository.php b/app/Repositories/TransactionGroup/TransactionGroupRepository.php index c8c03b7a38..fbf45efb73 100644 --- a/app/Repositories/TransactionGroup/TransactionGroupRepository.php +++ b/app/Repositories/TransactionGroup/TransactionGroupRepository.php @@ -177,11 +177,9 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface, ->where('noteable_type', TransactionJournal::class) ->first() ; - if (null === $note) { - return null; - } - return $note->text; + return $note?->text; + } /** diff --git a/app/Repositories/User/UserRepository.php b/app/Repositories/User/UserRepository.php index e6dbb7ec52..da82fe44ad 100644 --- a/app/Repositories/User/UserRepository.php +++ b/app/Repositories/User/UserRepository.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Repositories\User; use Carbon\Carbon; +use Exception; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\BudgetLimit; use FireflyIII\Models\GroupMembership; @@ -35,7 +36,6 @@ use Illuminate\Contracts\Auth\Authenticatable; use Illuminate\Database\QueryException; use Illuminate\Support\Collection; use Illuminate\Support\Str; -use Exception; use Override; /** @@ -161,11 +161,9 @@ class UserRepository implements UserRepositoryInterface { /** @var null|Role $role */ $role = $user->roles()->first(); - if (null !== $role) { - return $role->name; - } - return null; + return $role?->name; + } /** @@ -379,8 +377,6 @@ class UserRepository implements UserRepositoryInterface * This updates the users email address. Same as changeEmail just without most logging. This makes sure that the * undo/confirm routine can't catch this one. The user is NOT blocked. * - * @throws FireflyException - * * @see changeEmail */ public function updateEmail(User $user, string $newEmail): bool diff --git a/app/Repositories/UserGroup/UserGroupRepository.php b/app/Repositories/UserGroup/UserGroupRepository.php index 3f9bcdace1..80b3fc459c 100644 --- a/app/Repositories/UserGroup/UserGroupRepository.php +++ b/app/Repositories/UserGroup/UserGroupRepository.php @@ -96,8 +96,6 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte /** * Returns all groups the user is member in. - * - * {@inheritDoc} */ public function get(): Collection { @@ -137,7 +135,6 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte if (!$existingGroup instanceof UserGroup) { $exists = false; - /** @var UserGroup $existingGroup */ $existingGroup = $this->store(['user' => $user, 'title' => $groupName]); } $groupName = sprintf('%s-%s', $user->email, substr(sha1(random_int(1000, 9999).microtime()), 0, 4)); @@ -167,8 +164,6 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte /** * Returns all groups. - * - * {@inheritDoc} */ public function getAll(): Collection { diff --git a/app/Rules/Account/IsValidAccountType.php b/app/Rules/Account/IsValidAccountType.php index 52042572f1..d2ac0603cf 100644 --- a/app/Rules/Account/IsValidAccountType.php +++ b/app/Rules/Account/IsValidAccountType.php @@ -24,9 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Rules\Account; +use Closure; use FireflyIII\Support\Http\Api\AccountFilter; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; use Override; class IsValidAccountType implements ValidationRule @@ -46,7 +46,6 @@ class IsValidAccountType implements ValidationRule $filtered = []; $keys = array_keys($this->types); - /** @var mixed $entry */ foreach ($value as $entry) { $entry = (string) $entry; if (!in_array($entry, $keys, true)) { diff --git a/app/Rules/Admin/IsValidDiscordUrl.php b/app/Rules/Admin/IsValidDiscordUrl.php index ccb4800935..a45bb12a4f 100644 --- a/app/Rules/Admin/IsValidDiscordUrl.php +++ b/app/Rules/Admin/IsValidDiscordUrl.php @@ -25,10 +25,10 @@ declare(strict_types=1); namespace FireflyIII\Rules\Admin; +use Closure; use FireflyIII\Support\Validation\ValidatesAmountsTrait; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Log; -use Closure; class IsValidDiscordUrl implements ValidationRule { diff --git a/app/Rules/Admin/IsValidSlackOrDiscordUrl.php b/app/Rules/Admin/IsValidSlackOrDiscordUrl.php index 5b9f6063da..8efbf682c9 100644 --- a/app/Rules/Admin/IsValidSlackOrDiscordUrl.php +++ b/app/Rules/Admin/IsValidSlackOrDiscordUrl.php @@ -25,10 +25,10 @@ declare(strict_types=1); namespace FireflyIII\Rules\Admin; +use Closure; use FireflyIII\Support\Validation\ValidatesAmountsTrait; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Log; -use Closure; class IsValidSlackOrDiscordUrl implements ValidationRule { diff --git a/app/Rules/Admin/IsValidSlackUrl.php b/app/Rules/Admin/IsValidSlackUrl.php index 90fc1dafcd..0355b03f97 100644 --- a/app/Rules/Admin/IsValidSlackUrl.php +++ b/app/Rules/Admin/IsValidSlackUrl.php @@ -25,10 +25,10 @@ declare(strict_types=1); namespace FireflyIII\Rules\Admin; +use Closure; use FireflyIII\Support\Validation\ValidatesAmountsTrait; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Log; -use Closure; class IsValidSlackUrl implements ValidationRule { diff --git a/app/Rules/BelongsUser.php b/app/Rules/BelongsUser.php index 2e1fa3a9c2..48e44ddcbc 100644 --- a/app/Rules/BelongsUser.php +++ b/app/Rules/BelongsUser.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; use FireflyIII\Models\Bill; @@ -32,7 +33,6 @@ use FireflyIII\Models\Category; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\TransactionJournal; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; /** * Class BelongsUser diff --git a/app/Rules/BelongsUserGroup.php b/app/Rules/BelongsUserGroup.php index fe29b1fbef..488080a176 100644 --- a/app/Rules/BelongsUserGroup.php +++ b/app/Rules/BelongsUserGroup.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; use FireflyIII\Models\Bill; @@ -33,7 +34,6 @@ use FireflyIII\Models\PiggyBank; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\UserGroup; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; /** * Class BelongsUserGroup diff --git a/app/Rules/IsAllowedGroupAction.php b/app/Rules/IsAllowedGroupAction.php index f3a197f113..7e30cd30ec 100644 --- a/app/Rules/IsAllowedGroupAction.php +++ b/app/Rules/IsAllowedGroupAction.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Models\Account; use FireflyIII\Repositories\UserGroup\UserGroupRepositoryInterface; @@ -31,7 +32,6 @@ use FireflyIII\User; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Log; -use Closure; use Override; class IsAllowedGroupAction implements ValidationRule diff --git a/app/Rules/IsAssetAccountId.php b/app/Rules/IsAssetAccountId.php index e8d26937fd..eadc485442 100644 --- a/app/Rules/IsAssetAccountId.php +++ b/app/Rules/IsAssetAccountId.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Models\Account; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; /** * Class IsAssetAccountId diff --git a/app/Rules/IsBoolean.php b/app/Rules/IsBoolean.php index 28c1ca3781..7c2b31c99f 100644 --- a/app/Rules/IsBoolean.php +++ b/app/Rules/IsBoolean.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Rules; -use Illuminate\Contracts\Validation\ValidationRule; use Closure; +use Illuminate\Contracts\Validation\ValidationRule; /** * Class IsBoolean diff --git a/app/Rules/IsDateOrTime.php b/app/Rules/IsDateOrTime.php index 64d711ec99..ae732d0ab3 100644 --- a/app/Rules/IsDateOrTime.php +++ b/app/Rules/IsDateOrTime.php @@ -27,8 +27,8 @@ namespace FireflyIII\Rules; use Carbon\Carbon; use Carbon\Exceptions\InvalidDateException; use Carbon\Exceptions\InvalidFormatException; -use Illuminate\Contracts\Validation\ValidationRule; use Closure; +use Illuminate\Contracts\Validation\ValidationRule; /** * Class IsDateOrTime diff --git a/app/Rules/IsDefaultUserGroupName.php b/app/Rules/IsDefaultUserGroupName.php index 81b366a2e6..f59ff49327 100644 --- a/app/Rules/IsDefaultUserGroupName.php +++ b/app/Rules/IsDefaultUserGroupName.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Models\UserGroup; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; /** * Class IsDefaultUserGroupName diff --git a/app/Rules/IsDuplicateTransaction.php b/app/Rules/IsDuplicateTransaction.php index 1f9a125205..bceb22b95f 100644 --- a/app/Rules/IsDuplicateTransaction.php +++ b/app/Rules/IsDuplicateTransaction.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Rules; -use Illuminate\Contracts\Validation\ValidationRule; use Closure; +use Illuminate\Contracts\Validation\ValidationRule; /** * TODO not sure where this is used. diff --git a/app/Rules/IsFilterValueIn.php b/app/Rules/IsFilterValueIn.php index e167bdb79c..f7f41eb545 100644 --- a/app/Rules/IsFilterValueIn.php +++ b/app/Rules/IsFilterValueIn.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Rules; -use Illuminate\Contracts\Validation\ValidationRule; use Closure; +use Illuminate\Contracts\Validation\ValidationRule; class IsFilterValueIn implements ValidationRule { diff --git a/app/Rules/IsTransferAccount.php b/app/Rules/IsTransferAccount.php index 22f1fc5d8c..d64f30fa38 100644 --- a/app/Rules/IsTransferAccount.php +++ b/app/Rules/IsTransferAccount.php @@ -24,10 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Validation\AccountValidator; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; /** * Class IsTransferAccount diff --git a/app/Rules/IsValidActionExpression.php b/app/Rules/IsValidActionExpression.php index d12b507bd3..f6080a0903 100644 --- a/app/Rules/IsValidActionExpression.php +++ b/app/Rules/IsValidActionExpression.php @@ -25,10 +25,10 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\TransactionRules\Expressions\ActionExpression; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Translation\PotentiallyTranslatedString; -use Closure; class IsValidActionExpression implements ValidationRule { diff --git a/app/Rules/IsValidAmount.php b/app/Rules/IsValidAmount.php index 208d60c696..26b06c8ac0 100644 --- a/app/Rules/IsValidAmount.php +++ b/app/Rules/IsValidAmount.php @@ -25,10 +25,10 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Support\Validation\ValidatesAmountsTrait; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Log; -use Closure; class IsValidAmount implements ValidationRule { diff --git a/app/Rules/IsValidAttachmentModel.php b/app/Rules/IsValidAttachmentModel.php index 093e650cf2..69d09b708c 100644 --- a/app/Rules/IsValidAttachmentModel.php +++ b/app/Rules/IsValidAttachmentModel.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Models\Account; use FireflyIII\Models\Bill; use FireflyIII\Models\Budget; @@ -41,7 +42,6 @@ use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use FireflyIII\Repositories\Tag\TagRepositoryInterface; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; /** * Class IsValidAttachmentModel diff --git a/app/Rules/IsValidBulkClause.php b/app/Rules/IsValidBulkClause.php index 7d5ed57290..df93b82a50 100644 --- a/app/Rules/IsValidBulkClause.php +++ b/app/Rules/IsValidBulkClause.php @@ -24,9 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Validator; -use Closure; use JsonException; use function Safe\json_decode; diff --git a/app/Rules/IsValidDateRange.php b/app/Rules/IsValidDateRange.php index faf4b4343e..75a6846fab 100644 --- a/app/Rules/IsValidDateRange.php +++ b/app/Rules/IsValidDateRange.php @@ -27,8 +27,8 @@ namespace FireflyIII\Rules; use Carbon\Carbon; use Carbon\Exceptions\InvalidDateException; use Carbon\Exceptions\InvalidFormatException; -use Illuminate\Contracts\Validation\ValidationRule; use Closure; +use Illuminate\Contracts\Validation\ValidationRule; class IsValidDateRange implements ValidationRule { diff --git a/app/Rules/IsValidPositiveAmount.php b/app/Rules/IsValidPositiveAmount.php index 2c6eeb63cd..157307a3f8 100644 --- a/app/Rules/IsValidPositiveAmount.php +++ b/app/Rules/IsValidPositiveAmount.php @@ -25,10 +25,10 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Support\Validation\ValidatesAmountsTrait; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Log; -use Closure; use function Safe\json_encode; diff --git a/app/Rules/IsValidZeroOrMoreAmount.php b/app/Rules/IsValidZeroOrMoreAmount.php index 3c93762333..f5880fa78a 100644 --- a/app/Rules/IsValidZeroOrMoreAmount.php +++ b/app/Rules/IsValidZeroOrMoreAmount.php @@ -25,10 +25,10 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Support\Validation\ValidatesAmountsTrait; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Log; -use Closure; class IsValidZeroOrMoreAmount implements ValidationRule { diff --git a/app/Rules/LessThanPiggyTarget.php b/app/Rules/LessThanPiggyTarget.php index 78df186875..3f34ab068a 100644 --- a/app/Rules/LessThanPiggyTarget.php +++ b/app/Rules/LessThanPiggyTarget.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Rules; -use Illuminate\Contracts\Validation\ValidationRule; use Closure; +use Illuminate\Contracts\Validation\ValidationRule; /** * Class LessThanPiggyTarget diff --git a/app/Rules/UniqueAccountNumber.php b/app/Rules/UniqueAccountNumber.php index 9cfae9d359..467c5e6c83 100644 --- a/app/Rules/UniqueAccountNumber.php +++ b/app/Rules/UniqueAccountNumber.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Models\Account; use FireflyIII\Models\AccountMeta; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; use function Safe\json_encode; diff --git a/app/Rules/UniqueIban.php b/app/Rules/UniqueIban.php index 9246326c15..3f83ab76bf 100644 --- a/app/Rules/UniqueIban.php +++ b/app/Rules/UniqueIban.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Models\Account; use FireflyIII\Support\Facades\Steam; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; /** * Class UniqueIban diff --git a/app/Rules/ValidJournals.php b/app/Rules/ValidJournals.php index 2e2b6c6230..221bef831d 100644 --- a/app/Rules/ValidJournals.php +++ b/app/Rules/ValidJournals.php @@ -24,9 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Models\TransactionJournal; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; /** * Class ValidJournals diff --git a/app/Rules/ValidRecurrenceRepetitionType.php b/app/Rules/ValidRecurrenceRepetitionType.php index f8e0fe3606..a9a923c892 100644 --- a/app/Rules/ValidRecurrenceRepetitionType.php +++ b/app/Rules/ValidRecurrenceRepetitionType.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Rules; -use Illuminate\Contracts\Validation\ValidationRule; use Closure; +use Illuminate\Contracts\Validation\ValidationRule; /** * Class ValidRecurrenceRepetitionType diff --git a/app/Rules/ValidRecurrenceRepetitionValue.php b/app/Rules/ValidRecurrenceRepetitionValue.php index 5a1a4b9031..9cd29b261b 100644 --- a/app/Rules/ValidRecurrenceRepetitionValue.php +++ b/app/Rules/ValidRecurrenceRepetitionValue.php @@ -25,8 +25,8 @@ declare(strict_types=1); namespace FireflyIII\Rules; use Carbon\Carbon; -use Illuminate\Contracts\Validation\ValidationRule; use Closure; +use Illuminate\Contracts\Validation\ValidationRule; use InvalidArgumentException; /** diff --git a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php index 9516071ddb..ad55aee903 100644 --- a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php +++ b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php @@ -26,6 +26,7 @@ namespace FireflyIII\Services\FireflyIIIOrg\Update; use Carbon\Carbon; use FireflyIII\Events\NewVersionAvailable; +use FireflyIII\Support\System\IsOldVersion; use GuzzleHttp\Client; use GuzzleHttp\Exception\GuzzleException; use Illuminate\Support\Facades\Log; @@ -38,6 +39,8 @@ use function Safe\json_decode; */ class UpdateRequest implements UpdateRequestInterface { + use IsOldVersion; + public function getUpdateInformation(string $channel): array { Log::debug(sprintf('Now in getUpdateInformation(%s)', $channel)); @@ -183,20 +186,15 @@ class UpdateRequest implements UpdateRequestInterface private function parseResultDevelop(string $current, string $latest, array $information): array { Log::debug(sprintf('User is running develop version "%s"', $current)); - $parts = explode('/', $current); + $compare = $this->compareDevelopVersions($current, $latest); $return = []; - /** @var Carbon $devDate */ - $devDate = Carbon::createFromFormat('Y-m-d', $parts[1]); - - if ($devDate->lte($information['date'])) { - Log::debug(sprintf('This development release is older, release = %s, latest version %s = %s', $devDate->format('Y-m-d'), $latest, $information['date']->format('Y-m-d'))); + if (-1 === $compare) { $return['level'] = 'info'; $return['message'] = (string) trans('firefly.update_current_dev_older', ['version' => $current, 'new_version' => $latest]); return $return; } - Log::debug(sprintf('This development release is newer, release = %s, latest version %s = %s', $devDate->format('Y-m-d'), $latest, $information['date']->format('Y-m-d'))); $return['level'] = 'info'; $return['message'] = (string) trans('firefly.update_current_dev_newer', ['version' => $current, 'new_version' => $latest]); diff --git a/app/Services/Internal/Support/AccountServiceTrait.php b/app/Services/Internal/Support/AccountServiceTrait.php index f3225155c7..15cb35f760 100644 --- a/app/Services/Internal/Support/AccountServiceTrait.php +++ b/app/Services/Internal/Support/AccountServiceTrait.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Services\Internal\Support; -use Deprecated; use Carbon\Carbon; +use Deprecated; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Exceptions\DuplicateTransactionException; use FireflyIII\Exceptions\FireflyException; @@ -155,9 +155,7 @@ trait AccountServiceTrait { $dbNote = $account->notes()->first(); if ('' === $note) { - if (null !== $dbNote) { - $dbNote->delete(); - } + $dbNote?->delete(); return true; } @@ -341,9 +339,6 @@ trait AccountServiceTrait return $this->accountRepository->getOpeningBalanceGroup($account); } - /** - * @throws FireflyException - */ protected function getCurrency(int $currencyId, string $currencyCode): TransactionCurrency { // find currency, or use default currency instead. @@ -377,7 +372,7 @@ trait AccountServiceTrait throw new FireflyException('Amount for update liability credit/debit was unexpectedly 0.'); } - // if direction is "debit" (i owe this debt), amount is negative. + // if direction is "debit" (I owe this debt), amount is negative. // which means the liability will have a negative balance which the user must fill. $openingBalance = app('steam')->negative($openingBalance); diff --git a/app/Services/Internal/Support/BillServiceTrait.php b/app/Services/Internal/Support/BillServiceTrait.php index c3a73b1e83..a9217f347d 100644 --- a/app/Services/Internal/Support/BillServiceTrait.php +++ b/app/Services/Internal/Support/BillServiceTrait.php @@ -56,9 +56,7 @@ trait BillServiceTrait { if ('' === $note) { $dbNote = $bill->notes()->first(); - if (null !== $dbNote) { - $dbNote->delete(); - } + $dbNote?->delete(); return true; } diff --git a/app/Services/Internal/Support/JournalServiceTrait.php b/app/Services/Internal/Support/JournalServiceTrait.php index 8cd15203ca..a4ce044ebf 100644 --- a/app/Services/Internal/Support/JournalServiceTrait.php +++ b/app/Services/Internal/Support/JournalServiceTrait.php @@ -38,6 +38,7 @@ use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Rules\UniqueIban; use FireflyIII\Support\NullArrayObject; use Illuminate\Support\Facades\Log; +use Safe\Exceptions\JsonException; use function Safe\json_encode; @@ -266,6 +267,7 @@ trait JournalServiceTrait /** * @throws FireflyException + * @throws JsonException */ private function createAccount(?Account $account, array $data, string $preferredType): ?Account { diff --git a/app/Services/Internal/Support/RecurringTransactionTrait.php b/app/Services/Internal/Support/RecurringTransactionTrait.php index 6ac399f6e5..ebb7aad99f 100644 --- a/app/Services/Internal/Support/RecurringTransactionTrait.php +++ b/app/Services/Internal/Support/RecurringTransactionTrait.php @@ -54,9 +54,7 @@ trait RecurringTransactionTrait { if ('' === $note) { $dbNote = $recurrence->notes()->first(); - if (null !== $dbNote) { - $dbNote->delete(); - } + $dbNote?->delete(); return true; } diff --git a/app/Services/Internal/Update/AccountUpdateService.php b/app/Services/Internal/Update/AccountUpdateService.php index 5e1f230b4d..9f38297e42 100644 --- a/app/Services/Internal/Update/AccountUpdateService.php +++ b/app/Services/Internal/Update/AccountUpdateService.php @@ -284,9 +284,6 @@ class AccountUpdateService } } - /** - * @throws FireflyException - */ private function updatePreferences(Account $account): void { $account->refresh(); diff --git a/app/Services/Internal/Update/BillUpdateService.php b/app/Services/Internal/Update/BillUpdateService.php index a4aca38ce4..20825af2f2 100644 --- a/app/Services/Internal/Update/BillUpdateService.php +++ b/app/Services/Internal/Update/BillUpdateService.php @@ -24,10 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Services\Internal\Update; -use FireflyIII\Models\ObjectGroup; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Factory\TransactionCurrencyFactory; use FireflyIII\Models\Bill; +use FireflyIII\Models\ObjectGroup; use FireflyIII\Models\Rule; use FireflyIII\Models\RuleTrigger; use FireflyIII\Repositories\Bill\BillRepositoryInterface; @@ -46,9 +45,6 @@ class BillUpdateService protected User $user; - /** - * @throws FireflyException - */ public function update(Bill $bill, array $data): Bill { $this->user = $bill->user; diff --git a/app/Services/Internal/Update/CategoryUpdateService.php b/app/Services/Internal/Update/CategoryUpdateService.php index 28b5f36f00..b04c06686e 100644 --- a/app/Services/Internal/Update/CategoryUpdateService.php +++ b/app/Services/Internal/Update/CategoryUpdateService.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Services\Internal\Update; +use Exception; use FireflyIII\Models\Category; use FireflyIII\Models\Note; use FireflyIII\Models\RecurrenceTransactionMeta; use FireflyIII\Models\RuleAction; use FireflyIII\Models\RuleTrigger; use FireflyIII\User; -use Exception; /** * Class CategoryUpdateService @@ -139,9 +139,7 @@ class CategoryUpdateService } if ('' === $note) { $dbNote = $category->notes()->first(); - if (null !== $dbNote) { - $dbNote->delete(); - } + $dbNote?->delete(); return; } diff --git a/app/Support/Binder/CLIToken.php b/app/Support/Binder/CLIToken.php index d55e5dceca..09c54de3f0 100644 --- a/app/Support/Binder/CLIToken.php +++ b/app/Support/Binder/CLIToken.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Binder; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Repositories\User\UserRepositoryInterface; use Illuminate\Routing\Route; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -36,8 +35,6 @@ class CLIToken implements BinderInterface { /** * @return mixed - * - * @throws FireflyException */ public static function routeBinder(string $value, Route $route) { diff --git a/app/Support/Chart/Category/WholePeriodChartGenerator.php b/app/Support/Chart/Category/WholePeriodChartGenerator.php index ce43b1d16e..27d6026c2f 100644 --- a/app/Support/Chart/Category/WholePeriodChartGenerator.php +++ b/app/Support/Chart/Category/WholePeriodChartGenerator.php @@ -62,7 +62,7 @@ class WholePeriodChartGenerator $currentEnd = app('navigation')->endOfPeriod($current, $step); $spent[$key] = $opsRepository->sumExpenses($current, $currentEnd, $accounts, $collection); $earned[$key] = $opsRepository->sumIncome($current, $currentEnd, $accounts, $collection); - $current = app('navigation')->addPeriod($current, $step, 0); + $current = app('navigation')->addPeriod($current, $step); } $currencies = $this->extractCurrencies($spent) + $this->extractCurrencies($earned); @@ -104,7 +104,7 @@ class WholePeriodChartGenerator $chartData[$spentInfoKey]['entries'][$label] = app('steam')->bcround($spentAmount, $currency['currency_decimal_places']); $chartData[$earnedInfoKey]['entries'][$label] = app('steam')->bcround($earnedAmount, $currency['currency_decimal_places']); } - $current = app('navigation')->addPeriod($current, $step, 0); + $current = app('navigation')->addPeriod($current, $step); } return $chartData; diff --git a/app/Support/Export/ExportDataGenerator.php b/app/Support/Export/ExportDataGenerator.php index 926f371108..c9f25e12a5 100644 --- a/app/Support/Export/ExportDataGenerator.php +++ b/app/Support/Export/ExportDataGenerator.php @@ -62,6 +62,8 @@ use Illuminate\Support\Facades\Log; use League\Csv\CannotInsertRecord; use League\Csv\Exception; use League\Csv\Writer; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class ExportDataGenerator @@ -105,7 +107,11 @@ class ExportDataGenerator } /** + * @throws CannotInsertRecord + * @throws ContainerExceptionInterface + * @throws Exception * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function export(): array { @@ -750,6 +756,8 @@ class ExportDataGenerator * @throws CannotInsertRecord * @throws Exception * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ private function exportTags(): string { diff --git a/app/Support/Form/CurrencyForm.php b/app/Support/Form/CurrencyForm.php index bf748c6097..5bf2e0ba77 100644 --- a/app/Support/Form/CurrencyForm.php +++ b/app/Support/Form/CurrencyForm.php @@ -165,8 +165,6 @@ class CurrencyForm } /** - * @phpstan-param view-string $view - * * @throws FireflyException */ protected function currencyField(string $name, string $view, mixed $value = null, ?array $options = null): string diff --git a/app/Support/Http/Api/ExchangeRateConverter.php b/app/Support/Http/Api/ExchangeRateConverter.php index d92313907a..6f6728e825 100644 --- a/app/Support/Http/Api/ExchangeRateConverter.php +++ b/app/Support/Http/Api/ExchangeRateConverter.php @@ -243,7 +243,7 @@ class ExchangeRateConverter private function getRate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date): string { $key = $this->getCacheKey($from, $to, $date); - $res = Cache::get($key, null); + $res = Cache::get($key); // find in cache if (null !== $res) { diff --git a/app/Support/Http/Controllers/AugumentData.php b/app/Support/Http/Controllers/AugumentData.php index 2046b7e5b2..d7422f34c2 100644 --- a/app/Support/Http/Controllers/AugumentData.php +++ b/app/Support/Http/Controllers/AugumentData.php @@ -219,7 +219,7 @@ trait AugumentData $entry->pc_spent = $spent; // normal amount: - $expenses = $opsRepository->sumExpenses($currentStart, $currentEnd, null, $budgetCollection, $entry->transactionCurrency, false); + $expenses = $opsRepository->sumExpenses($currentStart, $currentEnd, null, $budgetCollection, $entry->transactionCurrency); $spent = $expenses[$entry->transactionCurrency->id]['sum'] ?? '0'; $entry->spent = $spent; diff --git a/app/Support/Http/Controllers/GetConfigurationData.php b/app/Support/Http/Controllers/GetConfigurationData.php index b0bb16b3f1..097204bd83 100644 --- a/app/Support/Http/Controllers/GetConfigurationData.php +++ b/app/Support/Http/Controllers/GetConfigurationData.php @@ -118,7 +118,7 @@ trait GetConfigurationData $previousEnd = app('navigation')->endOfPeriod($previousStart, $viewRange); $ranges[$index] = [$previousStart, $previousEnd]; - $nextDate = app('navigation')->addPeriod($start, $viewRange, 0); + $nextDate = app('navigation')->addPeriod($start, $viewRange); $index = app('navigation')->periodShow($nextDate, $viewRange); $nextStart = app('navigation')->startOfPeriod($nextDate, $viewRange); $nextEnd = app('navigation')->endOfPeriod($nextStart, $viewRange); diff --git a/app/Support/Http/Controllers/PeriodOverview.php b/app/Support/Http/Controllers/PeriodOverview.php index 5209eab2fe..caa114007b 100644 --- a/app/Support/Http/Controllers/PeriodOverview.php +++ b/app/Support/Http/Controllers/PeriodOverview.php @@ -263,13 +263,13 @@ trait PeriodOverview $entry = [ - 'title' => $title, - 'route' => route(sprintf('%s.no-%s', Str::plural($model), $model), [$start->format('Y-m-d'), $end->format('Y-m-d')]), - 'total_transactions' => 0, - 'spent' => [], - 'earned' => [], - 'transferred' => [], - ]; + 'title' => $title, + 'route' => route(sprintf('%s.no-%s', Str::plural($model), $model), [$start->format('Y-m-d'), $end->format('Y-m-d')]), + 'total_transactions' => 0, + 'spent' => [], + 'earned' => [], + 'transferred' => [], + ]; $grouped = []; /** @var PeriodStatistic $statistic */ @@ -325,30 +325,26 @@ trait PeriodOverview private function filterStatistics(Carbon $start, Carbon $end, string $type): Collection { if (0 === $this->statistics->count()) { - Log::warning('Have no statistic to filter!'); + Log::debug('Have no statistic to filter!'); return new Collection(); } return $this->statistics->filter( - function (PeriodStatistic $statistic) use ($start, $end, $type) { - return $statistic->start->eq($start) && $statistic->end->eq($end) && $statistic->type === $type; - } + fn (PeriodStatistic $statistic) => $statistic->start->eq($start) && $statistic->end->eq($end) && $statistic->type === $type ); } private function filterPrefixedStatistics(Carbon $start, Carbon $end, string $prefix): Collection { if (0 === $this->statistics->count()) { - Log::warning('Have no statistic to filter!'); + Log::debug('Have no statistic to filter!'); return new Collection(); } return $this->statistics->filter( - function (PeriodStatistic $statistic) use ($start, $end, $prefix) { - return $statistic->start->eq($start) && $statistic->end->eq($end) && str_starts_with($statistic->type, $prefix); - } + fn (PeriodStatistic $statistic) => $statistic->start->eq($start) && $statistic->end->eq($end) && str_starts_with($statistic->type, $prefix) ); } @@ -515,13 +511,13 @@ trait PeriodOverview } $entries[] = [ - 'title' => $title, - 'route' => route('transactions.index', [$transactionType, $currentDate['start']->format('Y-m-d'), $currentDate['end']->format('Y-m-d')]), - 'total_transactions' => count($spent) + count($earned) + count($transferred), - 'spent' => $this->groupByCurrency($spent), - 'earned' => $this->groupByCurrency($earned), - 'transferred' => $this->groupByCurrency($transferred), - ]; + 'title' => $title, + 'route' => route('transactions.index', [$transactionType, $currentDate['start']->format('Y-m-d'), $currentDate['end']->format('Y-m-d')]), + 'total_transactions' => count($spent) + count($earned) + count($transferred), + 'spent' => $this->groupByCurrency($spent), + 'earned' => $this->groupByCurrency($earned), + 'transferred' => $this->groupByCurrency($transferred), + ]; ++$loops; } diff --git a/app/Support/JsonApi/Enrichments/AvailableBudgetEnrichment.php b/app/Support/JsonApi/Enrichments/AvailableBudgetEnrichment.php index a6a8823368..b794275706 100644 --- a/app/Support/JsonApi/Enrichments/AvailableBudgetEnrichment.php +++ b/app/Support/JsonApi/Enrichments/AvailableBudgetEnrichment.php @@ -153,8 +153,8 @@ class AvailableBudgetEnrichment implements EnrichmentInterface $id = (int)$availableBudget->id; $currencyId = $this->currencyIds[$id]; $currency = $this->currencies[$currencyId]; - $filteredSpentInBudgets = $this->opsRepository->sumCollectedExpenses($spentInBudgets, $availableBudget->start_date, $availableBudget->end_date, $currency, false); - $filteredSpentOutsideBudgets = $this->opsRepository->sumCollectedExpenses($spentOutsideBudgets, $availableBudget->start_date, $availableBudget->end_date, $currency, false); + $filteredSpentInBudgets = $this->opsRepository->sumCollectedExpenses($spentInBudgets, $availableBudget->start_date, $availableBudget->end_date, $currency); + $filteredSpentOutsideBudgets = $this->opsRepository->sumCollectedExpenses($spentOutsideBudgets, $availableBudget->start_date, $availableBudget->end_date, $currency); $this->spentInBudgets[$id] = array_values($filteredSpentInBudgets); $this->spentOutsideBudgets[$id] = array_values($filteredSpentOutsideBudgets); diff --git a/app/Support/JsonApi/Enrichments/BudgetEnrichment.php b/app/Support/JsonApi/Enrichments/BudgetEnrichment.php index cb875aca78..8d548405d2 100644 --- a/app/Support/JsonApi/Enrichments/BudgetEnrichment.php +++ b/app/Support/JsonApi/Enrichments/BudgetEnrichment.php @@ -156,10 +156,10 @@ class BudgetEnrichment implements EnrichmentInterface $opsRepository->setUserGroup($this->userGroup); // $spent = $this->beautify(); // $set = $this->opsRepository->sumExpenses($start, $end, null, new Collection()->push($budget)) - $expenses = $opsRepository->collectExpenses($this->start, $this->end, null, $this->collection, null); + $expenses = $opsRepository->collectExpenses($this->start, $this->end, null, $this->collection); foreach ($this->collection as $item) { $id = (int)$item->id; - $this->spent[$id] = array_values($opsRepository->sumCollectedExpensesByBudget($expenses, $item, false)); + $this->spent[$id] = array_values($opsRepository->sumCollectedExpensesByBudget($expenses, $item)); $this->pcSpent[$id] = array_values($opsRepository->sumCollectedExpensesByBudget($expenses, $item, true)); } } diff --git a/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php b/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php index db1e248708..e1a6be6a94 100644 --- a/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php +++ b/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php @@ -41,14 +41,14 @@ use Illuminate\Support\Facades\Log; class BudgetLimitEnrichment implements EnrichmentInterface { private Collection $collection; - private bool $convertToPrimary = true; // @phpstan-ignore-line - private array $currencies = []; - private array $currencyIds = []; + private bool $convertToPrimary; // @phpstan-ignore-line + private array $currencies = []; + private array $currencyIds = []; private Carbon $end; - private array $expenses = []; - private array $ids = []; - private array $notes = []; - private array $pcExpenses = []; + private array $expenses = []; + private array $ids = []; + private array $notes = []; + private array $pcExpenses = []; private readonly TransactionCurrency $primaryCurrency; private Carbon $start; private User $user; @@ -120,14 +120,14 @@ class BudgetLimitEnrichment implements EnrichmentInterface $repository = app(OperationsRepository::class); $repository->setUser($this->user); - $expenses = $repository->collectExpenses($this->start, $this->end, null, $budgets, null); + $expenses = $repository->collectExpenses($this->start, $this->end, null, $budgets); /** @var BudgetLimit $budgetLimit */ foreach ($this->collection as $budgetLimit) { Log::debug(sprintf('Filtering expenses for budget limit #%d (budget #%d)', $budgetLimit->id, $budgetLimit->budget_id)); $id = (int)$budgetLimit->id; $filteredExpenses = $this->filterToBudget($expenses, $budgetLimit->budget_id); - $filteredExpenses = $repository->sumCollectedExpenses($filteredExpenses, $budgetLimit->start_date, $budgetLimit->end_date, $budgetLimit->transactionCurrency, false); + $filteredExpenses = $repository->sumCollectedExpenses($filteredExpenses, $budgetLimit->start_date, $budgetLimit->end_date, $budgetLimit->transactionCurrency); $this->expenses[$id] = array_values($filteredExpenses); if (true === $this->convertToPrimary && $budgetLimit->transactionCurrency->id !== $this->primaryCurrency->id) { diff --git a/app/Support/JsonApi/Enrichments/CategoryEnrichment.php b/app/Support/JsonApi/Enrichments/CategoryEnrichment.php index b5ddd22c52..f470e1c111 100644 --- a/app/Support/JsonApi/Enrichments/CategoryEnrichment.php +++ b/app/Support/JsonApi/Enrichments/CategoryEnrichment.php @@ -145,11 +145,11 @@ class CategoryEnrichment implements EnrichmentInterface $transfers = $opsRepository->collectTransfers($this->start, $this->end, null, $this->collection); foreach ($this->collection as $item) { $id = (int)$item->id; - $this->spent[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($expenses, $item, 'negative', false)); + $this->spent[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($expenses, $item, 'negative')); $this->pcSpent[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($expenses, $item, 'negative', true)); - $this->earned[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($income, $item, 'positive', false)); + $this->earned[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($income, $item, 'positive')); $this->pcEarned[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($income, $item, 'positive', true)); - $this->transfers[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($transfers, $item, 'positive', false)); + $this->transfers[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($transfers, $item, 'positive')); $this->pcTransfers[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($transfers, $item, 'positive', true)); } } diff --git a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php index 7c6a8a8a5b..23f7b2d2d3 100644 --- a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php +++ b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php @@ -57,10 +57,12 @@ class PiggyBankEnrichment implements EnrichmentInterface private readonly TransactionCurrency $primaryCurrency; private User $user; private UserGroup $userGroup; + private ?Carbon $date; public function __construct() { $this->primaryCurrency = Amount::getPrimaryCurrency(); + $this->date = now(config('app.timezone')); } public function enrich(Collection $collection): Collection @@ -69,7 +71,6 @@ class PiggyBankEnrichment implements EnrichmentInterface $this->collectIds(); $this->collectObjectGroups(); $this->collectNotes(); - $this->collectCurrentAmounts(); $this->appendCollectedData(); @@ -157,8 +158,10 @@ class PiggyBankEnrichment implements EnrichmentInterface } // get suggested per month. - $meta['save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($item->start_date, $item->target_date, $meta['target_amount'], $meta['current_amount']), $currency->decimal_places); - $meta['pc_save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($item->start_date, $item->target_date, $meta['pc_target_amount'], $meta['pc_current_amount']), $currency->decimal_places); + $meta['save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($this->date, $item->target_date, $meta['target_amount'], $meta['current_amount']), $currency->decimal_places); + if (null !== $meta['pc_current_amount']) { + $meta['pc_save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($this->date, $item->target_date, $meta['pc_target_amount'], $meta['pc_current_amount']), $currency->decimal_places); + } $item->meta = $meta; @@ -166,7 +169,10 @@ class PiggyBankEnrichment implements EnrichmentInterface }); } - private function collectCurrentAmounts(): void {} + public function setDate(?Carbon $date): void + { + $this->date = $date; + } private function collectIds(): void { diff --git a/app/Support/JsonApi/Enrichments/RecurringEnrichment.php b/app/Support/JsonApi/Enrichments/RecurringEnrichment.php index 7fdfc1c5dc..fb5115136a 100644 --- a/app/Support/JsonApi/Enrichments/RecurringEnrichment.php +++ b/app/Support/JsonApi/Enrichments/RecurringEnrichment.php @@ -60,8 +60,8 @@ class RecurringEnrichment implements EnrichmentInterface private Collection $collection; // private array $transactionTypeIds = []; // private array $transactionTypes = []; - private bool $convertToPrimary = false; - private array $currencies = []; + private bool $convertToPrimary; + private array $currencies = []; private array $currencyIds = []; private array $destinationAccountIds = []; private array $foreignCurrencyIds = []; diff --git a/app/Support/Models/BillDateCalculator.php b/app/Support/Models/BillDateCalculator.php index 3d49c867a3..6b7cbd2243 100644 --- a/app/Support/Models/BillDateCalculator.php +++ b/app/Support/Models/BillDateCalculator.php @@ -98,7 +98,7 @@ class BillDateCalculator $diffEOM = $daysUntilEOM - $nextUntilEOM; if ($diffEOM > 0) { Log::debug(sprintf('Bill start is %d days from the end of the month. nextExceptedMatch is %d days from the end of the month.', $daysUntilEOM, $nextUntilEOM)); - $nextExpectedMatch->subDays(1); + $nextExpectedMatch->subDays(); Log::debug(sprintf('Subtract %d days from next expected match, which is now %s', $diffEOM, $nextExpectedMatch->format('Y-m-d'))); } } diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index cb9ac29d9f..dd5981e327 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -413,19 +413,20 @@ class Navigation { $date = clone $theDate; $formatMap = [ - '1D' => (string)trans('config.specific_day_js'), - 'daily' => (string)trans('config.specific_day_js'), - 'custom' => (string)trans('config.specific_day_js'), - '1W' => (string)trans('config.week_in_year_js'), - 'week' => (string)trans('config.week_in_year_js'), - 'weekly' => (string)trans('config.week_in_year_js'), - '1M' => (string)trans('config.month_js'), - 'month' => (string)trans('config.month_js'), - 'monthly' => (string)trans('config.month_js'), - '1Y' => (string)trans('config.year_js'), - 'year' => (string)trans('config.year_js'), - 'yearly' => (string)trans('config.year_js'), - '6M' => (string)trans('config.half_year_js'), + '1D' => (string)trans('config.specific_day_js'), + 'daily' => (string)trans('config.specific_day_js'), + 'custom' => (string)trans('config.specific_day_js'), + '1W' => (string)trans('config.week_in_year_js'), + 'week' => (string)trans('config.week_in_year_js'), + 'weekly' => (string)trans('config.week_in_year_js'), + '1M' => (string)trans('config.month_js'), + 'month' => (string)trans('config.month_js'), + 'monthly' => (string)trans('config.month_js'), + '1Y' => (string)trans('config.year_js'), + 'YTD' => (string)trans('config.year_js'), + 'year' => (string)trans('config.year_js'), + 'yearly' => (string)trans('config.year_js'), + '6M' => (string)trans('config.half_year_js'), ]; if (array_key_exists($repeatFrequency, $formatMap)) { @@ -441,8 +442,6 @@ class Navigation Log::error(sprintf('No date formats for frequency "%s"!', $repeatFrequency)); throw new FireflyException(sprintf('No date formats for frequency "%s"!', $repeatFrequency)); - - return $date->format('Y-m-d'); } /** diff --git a/app/Support/Observers/RecalculatesAvailableBudgetsTrait.php b/app/Support/Observers/RecalculatesAvailableBudgetsTrait.php index 0c77493667..b4a774ea95 100644 --- a/app/Support/Observers/RecalculatesAvailableBudgetsTrait.php +++ b/app/Support/Observers/RecalculatesAvailableBudgetsTrait.php @@ -227,7 +227,7 @@ trait RecalculatesAvailableBudgetsTrait } // prep for next loop - $current = app('navigation')->addPeriod($current, $viewRange, 0); + $current = app('navigation')->addPeriod($current, $viewRange); } } } diff --git a/app/Support/ParseDateString.php b/app/Support/ParseDateString.php index df60be3d1d..46df80c290 100644 --- a/app/Support/ParseDateString.php +++ b/app/Support/ParseDateString.php @@ -29,6 +29,7 @@ use Carbon\CarbonInterface; use Carbon\Exceptions\InvalidFormatException; use FireflyIII\Exceptions\FireflyException; use Illuminate\Support\Facades\Log; +use Safe\Exceptions\PcreException; use function Safe\preg_match; @@ -73,6 +74,7 @@ class ParseDateString /** * @throws FireflyException + * @throws PcreException * * @SuppressWarnings("PHPMD.NPathComplexity") */ diff --git a/app/Support/Preferences.php b/app/Support/Preferences.php index d622f1f66f..943d48b117 100644 --- a/app/Support/Preferences.php +++ b/app/Support/Preferences.php @@ -230,9 +230,6 @@ class Preferences return $this->getForUser($user, $name, $default); } - /** - * @throws FireflyException - */ public function lastActivity(): string { $instance = PreferencesSingleton::getInstance(); diff --git a/app/Support/Report/Budget/BudgetReportGenerator.php b/app/Support/Report/Budget/BudgetReportGenerator.php index 4de1c9d9a6..42f58a2728 100644 --- a/app/Support/Report/Budget/BudgetReportGenerator.php +++ b/app/Support/Report/Budget/BudgetReportGenerator.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Report\Budget; use Carbon\Carbon; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; use FireflyIII\Models\Budget; use FireflyIII\Models\BudgetLimit; @@ -132,9 +131,6 @@ class BudgetReportGenerator $this->start = $start; } - /** - * @throws FireflyException - */ public function setUser(User $user): void { $this->repository->setUser($user); diff --git a/app/Support/Repositories/Recurring/CalculateXOccurrencesSince.php b/app/Support/Repositories/Recurring/CalculateXOccurrencesSince.php index 2fc216493d..9587ccc0f7 100644 --- a/app/Support/Repositories/Recurring/CalculateXOccurrencesSince.php +++ b/app/Support/Repositories/Recurring/CalculateXOccurrencesSince.php @@ -80,7 +80,7 @@ trait CalculateXOccurrencesSince while ($total < $count) { $domCorrected = min($dayOfMonth, $mutator->daysInMonth); $mutator->day = $domCorrected; - $mutator->setTime(0, 0, 0); + $mutator->setTime(0, 0); if (0 === $attempts % $skipMod && $mutator->gte($afterDate)) { Log::debug(sprintf('Mutator is now %s and is added to the list.', $mutator->toAtomString())); $return[] = clone $mutator; diff --git a/app/Support/Request/ConvertsDataTypes.php b/app/Support/Request/ConvertsDataTypes.php index 5293a6f804..a57c45a320 100644 --- a/app/Support/Request/ConvertsDataTypes.php +++ b/app/Support/Request/ConvertsDataTypes.php @@ -314,7 +314,8 @@ trait ConvertsDataTypes // is an atom string, I hope? try { - $carbon = Carbon::parse($value, $value, config('app.timezone')); + $carbon = Carbon::parse($value); + $carbon->setTimezone(config('app.timezone')); } catch (InvalidDateException $e) { // @phpstan-ignore-line Log::error(sprintf('[3] "%s" is not a valid date or time: %s', $value, $e->getMessage())); diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php index 5b2cc0776c..5546fbc8c9 100644 --- a/app/Support/Search/OperatorQuerySearch.php +++ b/app/Support/Search/OperatorQuerySearch.php @@ -369,9 +369,6 @@ class OperatorQuerySearch implements SearchInterface } } - /** - * @throws FireflyException - */ private function parseDateRange(string $type, string $value): array { $parser = new ParseDateString(); diff --git a/app/Support/Search/QueryParser/GdbotsQueryParser.php b/app/Support/Search/QueryParser/GdbotsQueryParser.php index e532901696..209b09721a 100644 --- a/app/Support/Search/QueryParser/GdbotsQueryParser.php +++ b/app/Support/Search/QueryParser/GdbotsQueryParser.php @@ -31,6 +31,7 @@ use Gdbots\QueryParser\Node as GdbotsNode; use Gdbots\QueryParser\QueryParser as BaseQueryParser; use Illuminate\Support\Facades\Log; use LogicException; +use Safe\Exceptions\FilesystemException; use TypeError; use function Safe\fwrite; @@ -46,6 +47,7 @@ class GdbotsQueryParser implements QueryParserInterface /** * @throws FireflyException + * @throws FilesystemException */ public function parse(string $query): NodeGroup { diff --git a/app/Support/Steam.php b/app/Support/Steam.php index 71d5e788f3..10a8061153 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -37,6 +37,8 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use Illuminate\Support\Str; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use ValueError; use function Safe\parse_url; @@ -533,9 +535,6 @@ class Steam return Amount::getTransactionCurrencyById((int)$result->data); } - /** - * @throws FireflyException - */ public function getHostName(string $ipAddress): string { $host = ''; @@ -558,6 +557,8 @@ class Steam * Get user's language. * * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function getLanguage(): string // get preference { diff --git a/app/Support/System/IsOldVersion.php b/app/Support/System/IsOldVersion.php new file mode 100644 index 0000000000..2499debbe8 --- /dev/null +++ b/app/Support/System/IsOldVersion.php @@ -0,0 +1,99 @@ +. + */ + +namespace FireflyIII\Support\System; + +use Carbon\Carbon; +use FireflyIII\Support\Facades\FireflyConfig; +use Illuminate\Support\Facades\Log; + +trait IsOldVersion +{ + /** + * By default, version_compare() returns -1 if the first version is lower than the second, 0 if they are equal, and + * 1 if the second is lower. + */ + protected function compareDevelopVersions(string $current, string $latest): int + { + $currentParts = explode('/', $current); + $latestParts = explode('/', $latest); + if (2 !== count($currentParts) || 2 !== count($latestParts)) { + Log::error(sprintf('Version "%s" or "%s" is not a valid develop-version.', $current, $latest)); + + return 0; + } + + $currentDate = Carbon::createFromFormat('!Y-m-d', $currentParts[1]); + $latestDate = Carbon::createFromFormat('!Y-m-d', $latestParts[1]); + + if ($currentDate->lt($latestDate)) { + Log::debug(sprintf('This current version is older, current = %s, latest version %s.', $current, $latest)); + + return -1; + } + if ($currentDate->gt($latestDate)) { + Log::debug(sprintf('This current version is newer, current = %s, latest version %s.', $current, $latest)); + + return 1; + } + Log::debug(sprintf('This current version is of the same age, current = %s, latest version %s.', $current, $latest)); + + return 0; + } + + /** + * Check if the "firefly_version" variable is correct. + */ + protected function isOldVersionInstalled(): bool + { + // version compare thing. + $configVersion = (string)config('firefly.version'); + $dbVersion = (string)FireflyConfig::getFresh('ff3_version', '1.0')->data; + $compare = 0; + // compare develop to develop + if (str_starts_with($configVersion, 'develop') && str_starts_with($dbVersion, 'develop')) { + $compare = $this->compareDevelopVersions($configVersion, $dbVersion); + } + // user has develop installed, goes to normal version. + if (!str_starts_with($configVersion, 'develop') && str_starts_with($dbVersion, 'develop')) { + return true; + } + + // user has normal, goes to develop version. + if (str_starts_with($configVersion, 'develop') && !str_starts_with($dbVersion, 'develop')) { + return true; + } + + // compare normal with normal. + if (!str_starts_with($configVersion, 'develop') && !str_starts_with($dbVersion, 'develop')) { + $compare = version_compare($configVersion, $dbVersion); + } + if (-1 === $compare) { + Log::warning(sprintf('The current configured Firefly III version (%s) is older than the required version (%s). Redirect to migrate routine.', $dbVersion, $configVersion)); + + return true; + } + + return false; + } +} diff --git a/app/Support/System/OAuthKeys.php b/app/Support/System/OAuthKeys.php index 97bd74bd19..afb028180a 100644 --- a/app/Support/System/OAuthKeys.php +++ b/app/Support/System/OAuthKeys.php @@ -31,6 +31,7 @@ use Illuminate\Support\Facades\Crypt; use Laravel\Passport\Console\KeysCommand; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; +use Safe\Exceptions\FilesystemException; use function Safe\file_get_contents; use function Safe\file_put_contents; @@ -79,7 +80,10 @@ class OAuthKeys } /** + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface + * @throws FilesystemException */ public static function restoreKeysFromDB(): bool { diff --git a/app/TransactionRules/Actions/UpdatePiggyBank.php b/app/TransactionRules/Actions/UpdatePiggyBank.php index 64fe735e6a..9e21497d97 100644 --- a/app/TransactionRules/Actions/UpdatePiggyBank.php +++ b/app/TransactionRules/Actions/UpdatePiggyBank.php @@ -31,7 +31,9 @@ use FireflyIII\Models\PiggyBank; use FireflyIII\Models\RuleAction; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; +use FireflyIII\Support\Facades\Amount; use FireflyIII\User; use Illuminate\Support\Facades\Log; @@ -175,15 +177,17 @@ class UpdatePiggyBank implements ActionInterface private function removeAmount(PiggyBank $piggyBank, array $array, TransactionJournal $journal, Account $account, string $amount): void { - $repository = app(PiggyBankRepositoryInterface::class); + $repository = app(PiggyBankRepositoryInterface::class); + $accountRepository = app(AccountRepositoryInterface::class); $repository->setUser($journal->user); + $accountRepository->setUser($account->user); // how much can we remove from this piggy bank? - $toRemove = $repository->getCurrentAmount($piggyBank, $account); + $toRemove = $repository->getCurrentAmount($piggyBank, $account); Log::debug(sprintf('Amount is %s, max to remove is %s', $amount, $toRemove)); // if $amount is bigger than $toRemove, shrink it. - $amount = -1 === bccomp($amount, $toRemove) ? $amount : $toRemove; + $amount = -1 === bccomp($amount, $toRemove) ? $amount : $toRemove; Log::debug(sprintf('Amount is now %s', $amount)); // if amount is zero, stop. @@ -196,7 +200,8 @@ class UpdatePiggyBank implements ActionInterface if (false === $repository->canRemoveAmount($piggyBank, $account, $amount)) { Log::warning(sprintf('Cannot remove %s from piggy bank.', $amount)); - event(new RuleActionFailedOnArray($this->action, $array, trans('rules.cannot_remove_from_piggy', ['amount' => $amount, 'name' => $piggyBank->name]))); + $currency = $accountRepository->getAccountCurrency($account) ?? Amount::getPrimaryCurrency(); + event(new RuleActionFailedOnArray($this->action, $array, trans('rules.cannot_remove_from_piggy', ['amount' => Amount::formatAnything($amount, $currency, false), 'name' => $piggyBank->name]))); return; } @@ -207,8 +212,10 @@ class UpdatePiggyBank implements ActionInterface private function addAmount(PiggyBank $piggyBank, array $array, TransactionJournal $journal, Account $account, string $amount): void { - $repository = app(PiggyBankRepositoryInterface::class); + $repository = app(PiggyBankRepositoryInterface::class); + $accountRepository = app(AccountRepositoryInterface::class); $repository->setUser($journal->user); + $accountRepository->setUser($account->user); // how much can we add to the piggy bank? if (0 !== bccomp($piggyBank->target_amount, '0')) { @@ -233,7 +240,8 @@ class UpdatePiggyBank implements ActionInterface if (false === $repository->canAddAmount($piggyBank, $account, $amount)) { Log::warning(sprintf('Cannot add %s to piggy bank.', $amount)); - event(new RuleActionFailedOnArray($this->action, $array, trans('rules.cannot_add_to_piggy', ['amount' => $amount, 'name' => $piggyBank->name]))); + $currency = $accountRepository->getAccountCurrency($account) ?? Amount::getPrimaryCurrency(); + event(new RuleActionFailedOnArray($this->action, $array, trans('rules.cannot_add_to_piggy', ['amount' => Amount::formatAnything($amount, $currency, false), 'name' => $piggyBank->name]))); return; } diff --git a/app/Transformers/PiggyBankEventTransformer.php b/app/Transformers/PiggyBankEventTransformer.php index a0a43ecc59..d5097b6136 100644 --- a/app/Transformers/PiggyBankEventTransformer.php +++ b/app/Transformers/PiggyBankEventTransformer.php @@ -36,7 +36,7 @@ use FireflyIII\Support\Facades\Steam; class PiggyBankEventTransformer extends AbstractTransformer { private readonly TransactionCurrency $primaryCurrency; - private bool $convertToPrimary = false; + private bool $convertToPrimary; /** * PiggyBankEventTransformer constructor. diff --git a/app/Transformers/PiggyBankTransformer.php b/app/Transformers/PiggyBankTransformer.php index 10c3379441..9088044890 100644 --- a/app/Transformers/PiggyBankTransformer.php +++ b/app/Transformers/PiggyBankTransformer.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Transformers; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Support\Facades\Amount; @@ -46,8 +45,6 @@ class PiggyBankTransformer extends AbstractTransformer /** * Transform the piggy bank. - * - * @throws FireflyException */ public function transform(PiggyBank $piggyBank): array { diff --git a/app/Transformers/RecurrenceTransformer.php b/app/Transformers/RecurrenceTransformer.php index 9f3ce0c5f0..d2e1bb914c 100644 --- a/app/Transformers/RecurrenceTransformer.php +++ b/app/Transformers/RecurrenceTransformer.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Transformers; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Recurrence; use Illuminate\Support\Facades\Log; @@ -40,8 +39,6 @@ class RecurrenceTransformer extends AbstractTransformer /** * Transform the recurring transaction. - * - * @throws FireflyException */ public function transform(Recurrence $recurrence): array { diff --git a/app/Transformers/UserTransformer.php b/app/Transformers/UserTransformer.php index 18dc74d4b6..d4a06aefb0 100644 --- a/app/Transformers/UserTransformer.php +++ b/app/Transformers/UserTransformer.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Transformers; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; @@ -37,8 +36,6 @@ class UserTransformer extends AbstractTransformer /** * Transform user. - * - * @throws FireflyException */ public function transform(User $user): array { diff --git a/app/User.php b/app/User.php index 3e2eccddf0..445ef22f77 100644 --- a/app/User.php +++ b/app/User.php @@ -25,6 +25,7 @@ declare(strict_types=1); namespace FireflyIII; use Deprecated; +use Exception; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Events\RequestedNewPassword; use FireflyIII\Exceptions\FireflyException; @@ -67,7 +68,6 @@ use Illuminate\Support\Str; use Laravel\Passport\HasApiTokens; use NotificationChannels\Pushover\PushoverReceiver; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Exception; class User extends Authenticatable { @@ -259,7 +259,6 @@ class User extends Authenticatable $dbRolesIds = $dbRoles->pluck('id')->toArray(); $dbRolesTitles = $dbRoles->pluck('title')->toArray(); - /** @var Collection $groupMemberships */ $groupMemberships = $this->groupMemberships()->whereIn('user_role_id', $dbRolesIds)->where('user_group_id', $userGroup->id)->get(); if (0 === $groupMemberships->count()) { app('log')->error(sprintf( diff --git a/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php b/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php index a218f323ee..8f8cffba91 100644 --- a/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php +++ b/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Validation\Api\Data\Bulk; -use Illuminate\Validation\Validator; use FireflyIII\Repositories\Account\AccountRepositoryInterface; +use Illuminate\Validation\Validator; use function Safe\json_decode; diff --git a/app/Validation/CurrencyValidation.php b/app/Validation/CurrencyValidation.php index 2bdc1357d1..52bad8ff61 100644 --- a/app/Validation/CurrencyValidation.php +++ b/app/Validation/CurrencyValidation.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Validation; -use Illuminate\Validation\Validator; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Trait CurrencyValidation diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index bb9bbd3198..e420a44f50 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Validation; +use Config; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; @@ -45,12 +46,14 @@ use PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException; use PragmaRX\Google2FA\Exceptions\InvalidCharactersException; use PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException; use PragmaRX\Google2FALaravel\Facade; -use Config; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; +use Safe\Exceptions\JsonException; use ValueError; -use function Safe\preg_match; use function Safe\iconv; use function Safe\json_encode; +use function Safe\preg_match; /** * Class FireflyValidator. @@ -65,6 +68,8 @@ class FireflyValidator extends Validator * @throws IncompatibleWithGoogleAuthenticatorException * @throws InvalidCharactersException * @throws SecretKeyTooShortException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface * * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ @@ -628,6 +633,8 @@ class FireflyValidator extends Validator * @param mixed $value * @param mixed $parameters * + * @throws JsonException + * * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function validateUniqueAccountNumberForUser($attribute, $value, $parameters): bool diff --git a/app/Validation/GroupValidation.php b/app/Validation/GroupValidation.php index bf4801856f..84c32cfc90 100644 --- a/app/Validation/GroupValidation.php +++ b/app/Validation/GroupValidation.php @@ -24,10 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Validation; -use Illuminate\Validation\Validator; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionGroup; +use Illuminate\Validation\Validator; /** * Trait GroupValidation. diff --git a/app/Validation/RecurrenceValidation.php b/app/Validation/RecurrenceValidation.php index 2ba6e58a95..52b829203e 100644 --- a/app/Validation/RecurrenceValidation.php +++ b/app/Validation/RecurrenceValidation.php @@ -24,10 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Validation; -use Illuminate\Validation\Validator; use Carbon\Carbon; use FireflyIII\Models\Recurrence; use FireflyIII\Models\RecurrenceTransaction; +use Illuminate\Validation\Validator; use InvalidArgumentException; /** diff --git a/app/Validation/TransactionValidation.php b/app/Validation/TransactionValidation.php index 944b9372d2..b44333bd90 100644 --- a/app/Validation/TransactionValidation.php +++ b/app/Validation/TransactionValidation.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Validation; -use Illuminate\Validation\Validator; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; @@ -37,6 +36,7 @@ use FireflyIII\Repositories\Account\AccountRepository; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\User; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Trait TransactionValidation diff --git a/changelog.md b/changelog.md index aecba981e0..acd62c1168 100644 --- a/changelog.md +++ b/changelog.md @@ -5,17 +5,37 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## 6.4.1 - 2025-09-15 +### Added + +- [PR 10979](https://github.com/firefly-iii/firefly-iii/pull/10979) (Add Kazakhstani Tenge (KZT) currency) reported by @maksimkurb + ### Fixed - Fixed a missing filter from [issue 10803](https://github.com/firefly-iii/firefly-iii/issues/10803). -- #10891 -- #10920 -- #10921 -- #10833 +- [Issue 10833](https://github.com/firefly-iii/firefly-iii/issues/10833) (Can't open transaction after assigning a tag to it) reported by @zynexiz +- [Issue 10854](https://github.com/firefly-iii/firefly-iii/issues/10854) (string / null in budget causes budget page to not render) reported by @4e868df3 +- [Discussion 10891](https://github.com/orgs/firefly-iii/discussions/10891) (User group id is null when downloading new exchange rates) started by @dakennguyen +- [Discussion 10916](https://github.com/orgs/firefly-iii/discussions/10916) (Errors/Warnings in Logs after Batch API Import) started by @Mr-Kanister +- [Issue 10920](https://github.com/firefly-iii/firefly-iii/issues/10920) (Liability transaction with same source and destination possible) reported by @Mr-Kanister +- [Issue 10921](https://github.com/firefly-iii/firefly-iii/issues/10921) (Transaction type between asset and liability not correctly enforced using API) reported by @Mr-Kanister +- [Issue 10924](https://github.com/firefly-iii/firefly-iii/issues/10924) (Recurring transactions don't save (or show) selected subscription) reported by @SteffoSpieler +- [Discussion 10938](https://github.com/orgs/firefly-iii/discussions/10938) (Unable to apply default rule group to certain transactions) started by @praemon +- [Issue 10940](https://github.com/firefly-iii/firefly-iii/issues/10940) (Internal Server Error when trying to open piggy banks) reported by @mattephi +- [Issue 10954](https://github.com/firefly-iii/firefly-iii/issues/10954) (Internal Server Error when trying to access (default) account) reported by @thomaschristory +- [Issue 10956](https://github.com/firefly-iii/firefly-iii/issues/10956) (Manual webhook trigger fail) reported by @dudu7731 +- [Issue 10960](https://github.com/firefly-iii/firefly-iii/issues/10960) (404 after deleting subscription) reported by @lindely +- [Issue 10965](https://github.com/firefly-iii/firefly-iii/issues/10965) (Fix running balance on liability overview) reported by @JC5 +- [Discussion 10974](https://github.com/orgs/firefly-iii/discussions/10974) (Big webhook_messages table) started by @Billos +- [Discussion 10988](https://github.com/orgs/firefly-iii/discussions/10988) (Call to a member function startOfDay() on null.) started by @molnarti +- [Issue 10990](https://github.com/firefly-iii/firefly-iii/issues/10990) (duplicate piggy event via API) reported by @4e868df3 +- [Discussion 10994](https://github.com/orgs/firefly-iii/discussions/10994) (How does the save per month attribute from a piggy bank is calculated?) started by @AdriDevelopsThings +- #11005 +- #11007 ### API -- #10908 +- [Issue 10803](https://github.com/firefly-iii/firefly-iii/issues/10803) (Issue in /v1/budget-limits spent attribute) reported by @Billos +- [Discussion 10908](https://github.com/orgs/firefly-iii/discussions/10908) (New fields for BudgetLimit object) started by @Billos ## 6.4.0 - 2025-09-14 diff --git a/composer.lock b/composer.lock index f7341ff02a..7199fbf526 100644 --- a/composer.lock +++ b/composer.lock @@ -1878,16 +1878,16 @@ }, { "name": "laravel/framework", - "version": "v12.31.1", + "version": "v12.32.5", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "281b711710c245dd8275d73132e92635be3094df" + "reference": "77b2740391cd2a825ba59d6fada45e9b8b9bcc5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/281b711710c245dd8275d73132e92635be3094df", - "reference": "281b711710c245dd8275d73132e92635be3094df", + "url": "https://api.github.com/repos/laravel/framework/zipball/77b2740391cd2a825ba59d6fada45e9b8b9bcc5a", + "reference": "77b2740391cd2a825ba59d6fada45e9b8b9bcc5a", "shasum": "" }, "require": { @@ -1915,7 +1915,6 @@ "monolog/monolog": "^3.0", "nesbot/carbon": "^3.8.4", "nunomaduro/termwind": "^2.0", - "phiki/phiki": "^2.0.0", "php": "^8.2", "psr/container": "^1.1.1|^2.0.1", "psr/log": "^1.0|^2.0|^3.0", @@ -2094,7 +2093,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2025-09-23T15:33:04+00:00" + "time": "2025-09-30T17:39:22+00:00" }, { "name": "laravel/passport", @@ -2812,16 +2811,16 @@ }, { "name": "league/csv", - "version": "9.25.0", + "version": "9.26.0", "source": { "type": "git", "url": "https://github.com/thephpleague/csv.git", - "reference": "f856f532866369fb1debe4e7c5a1db185f40ef86" + "reference": "7fce732754d043f3938899e5183e2d0f3d31b571" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/csv/zipball/f856f532866369fb1debe4e7c5a1db185f40ef86", - "reference": "f856f532866369fb1debe4e7c5a1db185f40ef86", + "url": "https://api.github.com/repos/thephpleague/csv/zipball/7fce732754d043f3938899e5183e2d0f3d31b571", + "reference": "7fce732754d043f3938899e5183e2d0f3d31b571", "shasum": "" }, "require": { @@ -2899,7 +2898,7 @@ "type": "github" } ], - "time": "2025-09-11T08:29:08+00:00" + "time": "2025-10-01T11:24:54+00:00" }, { "name": "league/event", @@ -4352,77 +4351,6 @@ }, "time": "2020-10-15T08:29:30+00:00" }, - { - "name": "phiki/phiki", - "version": "v2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phikiphp/phiki.git", - "reference": "160785c50c01077780ab217e5808f00ab8f05a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phikiphp/phiki/zipball/160785c50c01077780ab217e5808f00ab8f05a13", - "reference": "160785c50c01077780ab217e5808f00ab8f05a13", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "league/commonmark": "^2.5.3", - "php": "^8.2", - "psr/simple-cache": "^3.0" - }, - "require-dev": { - "illuminate/support": "^11.45", - "laravel/pint": "^1.18.1", - "orchestra/testbench": "^9.15", - "pestphp/pest": "^3.5.1", - "phpstan/extension-installer": "^1.4.3", - "phpstan/phpstan": "^2.0", - "symfony/var-dumper": "^7.1.6" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Phiki\\Adapters\\Laravel\\PhikiServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Phiki\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ryan Chandler", - "email": "support@ryangjchandler.co.uk", - "homepage": "https://ryangjchandler.co.uk", - "role": "Developer" - } - ], - "description": "Syntax highlighting using TextMate grammars in PHP.", - "support": { - "issues": "https://github.com/phikiphp/phiki/issues", - "source": "https://github.com/phikiphp/phiki/tree/v2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sponsors/ryangjchandler", - "type": "github" - }, - { - "url": "https://buymeacoffee.com/ryangjchandler", - "type": "other" - } - ], - "time": "2025-09-20T17:21:02+00:00" - }, { "name": "php-http/client-common", "version": "2.7.2", @@ -4885,16 +4813,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.46", + "version": "3.0.47", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6" + "reference": "9d6ca36a6c2dd434765b1071b2644a1c683b385d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6", - "reference": "56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/9d6ca36a6c2dd434765b1071b2644a1c683b385d", + "reference": "9d6ca36a6c2dd434765b1071b2644a1c683b385d", "shasum": "" }, "require": { @@ -4975,7 +4903,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.46" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.47" }, "funding": [ { @@ -4991,7 +4919,7 @@ "type": "tidelift" } ], - "time": "2025-06-26T16:29:55+00:00" + "time": "2025-10-06T01:07:24+00:00" }, { "name": "pragmarx/google2fa", @@ -6265,16 +6193,16 @@ }, { "name": "spatie/laravel-html", - "version": "3.12.0", + "version": "3.12.1", "source": { "type": "git", "url": "https://github.com/spatie/laravel-html.git", - "reference": "3655f335609d853f51e431698179ddfe05851126" + "reference": "72af3cad24d153c230ff6e1da9fa3b7b702834c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-html/zipball/3655f335609d853f51e431698179ddfe05851126", - "reference": "3655f335609d853f51e431698179ddfe05851126", + "url": "https://api.github.com/repos/spatie/laravel-html/zipball/72af3cad24d153c230ff6e1da9fa3b7b702834c9", + "reference": "72af3cad24d153c230ff6e1da9fa3b7b702834c9", "shasum": "" }, "require": { @@ -6331,7 +6259,7 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/laravel-html/tree/3.12.0" + "source": "https://github.com/spatie/laravel-html/tree/3.12.1" }, "funding": [ { @@ -6339,7 +6267,7 @@ "type": "custom" } ], - "time": "2025-03-21T08:58:06+00:00" + "time": "2025-10-02T07:26:38+00:00" }, { "name": "spatie/laravel-ignition", @@ -11405,16 +11333,11 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.29", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan-phar-composer-source.git", - "reference": "git" - }, + "version": "2.1.30", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d618573eed4a1b6b75e37b2e0b65ac65c885d88e", - "reference": "d618573eed4a1b6b75e37b2e0b65ac65c885d88e", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a4a7f159927983dd4f7c8020ed227d80b7f39d7d", + "reference": "a4a7f159927983dd4f7c8020ed227d80b7f39d7d", "shasum": "" }, "require": { @@ -11459,7 +11382,7 @@ "type": "github" } ], - "time": "2025-09-25T06:58:18+00:00" + "time": "2025-10-02T16:07:52+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -11892,16 +11815,16 @@ }, { "name": "phpunit/phpunit", - "version": "12.3.15", + "version": "12.4.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b035ee2cd8ecad4091885b61017ebb1d80eb0e57" + "reference": "f62aab5794e36ccd26860db2d1bbf89ac19028d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b035ee2cd8ecad4091885b61017ebb1d80eb0e57", - "reference": "b035ee2cd8ecad4091885b61017ebb1d80eb0e57", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f62aab5794e36ccd26860db2d1bbf89ac19028d9", + "reference": "f62aab5794e36ccd26860db2d1bbf89ac19028d9", "shasum": "" }, "require": { @@ -11937,7 +11860,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "12.3-dev" + "dev-main": "12.4-dev" } }, "autoload": { @@ -11969,7 +11892,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/12.3.15" + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.4.0" }, "funding": [ { @@ -11993,7 +11916,7 @@ "type": "tidelift" } ], - "time": "2025-09-28T12:10:54+00:00" + "time": "2025-10-03T04:28:03+00:00" }, { "name": "rector/rector", diff --git a/config/firefly.php b/config/firefly.php index d3ff9f679b..733841fa2b 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -78,10 +78,10 @@ return [ 'running_balance_column' => env('USE_RUNNING_BALANCE', false), // see cer.php for exchange rates feature flag. ], - 'version' => 'develop/2025-09-29', - 'build_time' => 1759116036, + 'version' => 'develop/2025-10-06', + 'build_time' => 1759720765, 'api_version' => '2.1.0', // field is no longer used. - 'db_version' => 27, + 'db_version' => 28, // field is no longer used. // generic settings 'maxUploadSize' => 1073741824, // 1 GB diff --git a/package-lock.json b/package-lock.json index 91344ae85e..7469f14c92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2135,9 +2135,9 @@ } }, "node_modules/@fortawesome/fontawesome-free": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-7.0.1.tgz", - "integrity": "sha512-RLmb9U6H2rJDnGxEqXxzy7ANPrQz7WK2/eTjdZqyU9uRU5W+FkAec9uU5gTYzFBH7aoXIw2WTJSCJR4KPlReQw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-7.1.0.tgz", + "integrity": "sha512-+WxNld5ZCJHvPQCr/GnzCTVREyStrAJjisUPtUxG5ngDA8TMlPnKp6dddlTpai4+1GNmltAeuk1hJEkBohwZYA==", "license": "(CC-BY-4.0 AND OFL-1.1 AND MIT)", "engines": { "node": ">=6" @@ -2589,9 +2589,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.52.3.tgz", - "integrity": "sha512-h6cqHGZ6VdnwliFG1NXvMPTy/9PS3h8oLh7ImwR+kl+oYnQizgjxsONmmPSb2C66RksfkfIxEVtDSEcJiO0tqw==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.52.4.tgz", + "integrity": "sha512-BTm2qKNnWIQ5auf4deoetINJm2JzvihvGb9R6K/ETwKLql/Bb3Eg2H1FBp1gUb4YGbydMA3jcmQTR73q7J+GAA==", "cpu": [ "arm" ], @@ -2603,9 +2603,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.52.3.tgz", - "integrity": "sha512-wd+u7SLT/u6knklV/ifG7gr5Qy4GUbH2hMWcDauPFJzmCZUAJ8L2bTkVXC2niOIxp8lk3iH/QX8kSrUxVZrOVw==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.52.4.tgz", + "integrity": "sha512-P9LDQiC5vpgGFgz7GSM6dKPCiqR3XYN1WwJKA4/BUVDjHpYsf3iBEmVz62uyq20NGYbiGPR5cNHI7T1HqxNs2w==", "cpu": [ "arm64" ], @@ -2617,9 +2617,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.52.3.tgz", - "integrity": "sha512-lj9ViATR1SsqycwFkJCtYfQTheBdvlWJqzqxwc9f2qrcVrQaF/gCuBRTiTolkRWS6KvNxSk4KHZWG7tDktLgjg==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.52.4.tgz", + "integrity": "sha512-QRWSW+bVccAvZF6cbNZBJwAehmvG9NwfWHwMy4GbWi/BQIA/laTIktebT2ipVjNncqE6GLPxOok5hsECgAxGZg==", "cpu": [ "arm64" ], @@ -2631,9 +2631,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.52.3.tgz", - "integrity": "sha512-+Dyo7O1KUmIsbzx1l+4V4tvEVnVQqMOIYtrxK7ncLSknl1xnMHLgn7gddJVrYPNZfEB8CIi3hK8gq8bDhb3h5A==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.52.4.tgz", + "integrity": "sha512-hZgP05pResAkRJxL1b+7yxCnXPGsXU0fG9Yfd6dUaoGk+FhdPKCJ5L1Sumyxn8kvw8Qi5PvQ8ulenUbRjzeCTw==", "cpu": [ "x64" ], @@ -2645,9 +2645,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.52.3.tgz", - "integrity": "sha512-u9Xg2FavYbD30g3DSfNhxgNrxhi6xVG4Y6i9Ur1C7xUuGDW3banRbXj+qgnIrwRN4KeJ396jchwy9bCIzbyBEQ==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.52.4.tgz", + "integrity": "sha512-xmc30VshuBNUd58Xk4TKAEcRZHaXlV+tCxIXELiE9sQuK3kG8ZFgSPi57UBJt8/ogfhAF5Oz4ZSUBN77weM+mQ==", "cpu": [ "arm64" ], @@ -2659,9 +2659,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.52.3.tgz", - "integrity": "sha512-5M8kyi/OX96wtD5qJR89a/3x5x8x5inXBZO04JWhkQb2JWavOWfjgkdvUqibGJeNNaz1/Z1PPza5/tAPXICI6A==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.52.4.tgz", + "integrity": "sha512-WdSLpZFjOEqNZGmHflxyifolwAiZmDQzuOzIq9L27ButpCVpD7KzTRtEG1I0wMPFyiyUdOO+4t8GvrnBLQSwpw==", "cpu": [ "x64" ], @@ -2673,9 +2673,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.52.3.tgz", - "integrity": "sha512-IoerZJ4l1wRMopEHRKOO16e04iXRDyZFZnNZKrWeNquh5d6bucjezgd+OxG03mOMTnS1x7hilzb3uURPkJ0OfA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.52.4.tgz", + "integrity": "sha512-xRiOu9Of1FZ4SxVbB0iEDXc4ddIcjCv2aj03dmW8UrZIW7aIQ9jVJdLBIhxBI+MaTnGAKyvMwPwQnoOEvP7FgQ==", "cpu": [ "arm" ], @@ -2687,9 +2687,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.52.3.tgz", - "integrity": "sha512-ZYdtqgHTDfvrJHSh3W22TvjWxwOgc3ThK/XjgcNGP2DIwFIPeAPNsQxrJO5XqleSlgDux2VAoWQ5iJrtaC1TbA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.52.4.tgz", + "integrity": "sha512-FbhM2p9TJAmEIEhIgzR4soUcsW49e9veAQCziwbR+XWB2zqJ12b4i/+hel9yLiD8pLncDH4fKIPIbt5238341Q==", "cpu": [ "arm" ], @@ -2701,9 +2701,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.52.3.tgz", - "integrity": "sha512-NcViG7A0YtuFDA6xWSgmFb6iPFzHlf5vcqb2p0lGEbT+gjrEEz8nC/EeDHvx6mnGXnGCC1SeVV+8u+smj0CeGQ==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.52.4.tgz", + "integrity": "sha512-4n4gVwhPHR9q/g8lKCyz0yuaD0MvDf7dV4f9tHt0C73Mp8h38UCtSCSE6R9iBlTbXlmA8CjpsZoujhszefqueg==", "cpu": [ "arm64" ], @@ -2715,9 +2715,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.52.3.tgz", - "integrity": "sha512-d3pY7LWno6SYNXRm6Ebsq0DJGoiLXTb83AIPCXl9fmtIQs/rXoS8SJxxUNtFbJ5MiOvs+7y34np77+9l4nfFMw==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.52.4.tgz", + "integrity": "sha512-u0n17nGA0nvi/11gcZKsjkLj1QIpAuPFQbR48Subo7SmZJnGxDpspyw2kbpuoQnyK+9pwf3pAoEXerJs/8Mi9g==", "cpu": [ "arm64" ], @@ -2729,9 +2729,9 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.52.3.tgz", - "integrity": "sha512-3y5GA0JkBuirLqmjwAKwB0keDlI6JfGYduMlJD/Rl7fvb4Ni8iKdQs1eiunMZJhwDWdCvrcqXRY++VEBbvk6Eg==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.52.4.tgz", + "integrity": "sha512-0G2c2lpYtbTuXo8KEJkDkClE/+/2AFPdPAbmaHoE870foRFs4pBrDehilMcrSScrN/fB/1HTaWO4bqw+ewBzMQ==", "cpu": [ "loong64" ], @@ -2743,9 +2743,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.52.3.tgz", - "integrity": "sha512-AUUH65a0p3Q0Yfm5oD2KVgzTKgwPyp9DSXc3UA7DtxhEb/WSPfbG4wqXeSN62OG5gSo18em4xv6dbfcUGXcagw==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.52.4.tgz", + "integrity": "sha512-teSACug1GyZHmPDv14VNbvZFX779UqWTsd7KtTM9JIZRDI5NUwYSIS30kzI8m06gOPB//jtpqlhmraQ68b5X2g==", "cpu": [ "ppc64" ], @@ -2757,9 +2757,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.52.3.tgz", - "integrity": "sha512-1makPhFFVBqZE+XFg3Dkq+IkQ7JvmUrwwqaYBL2CE+ZpxPaqkGaiWFEWVGyvTwZace6WLJHwjVh/+CXbKDGPmg==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.52.4.tgz", + "integrity": "sha512-/MOEW3aHjjs1p4Pw1Xk4+3egRevx8Ji9N6HUIA1Ifh8Q+cg9dremvFCUbOX2Zebz80BwJIgCBUemjqhU5XI5Eg==", "cpu": [ "riscv64" ], @@ -2771,9 +2771,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.52.3.tgz", - "integrity": "sha512-OOFJa28dxfl8kLOPMUOQBCO6z3X2SAfzIE276fwT52uXDWUS178KWq0pL7d6p1kz7pkzA0yQwtqL0dEPoVcRWg==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.52.4.tgz", + "integrity": "sha512-1HHmsRyh845QDpEWzOFtMCph5Ts+9+yllCrREuBR/vg2RogAQGGBRC8lDPrPOMnrdOJ+mt1WLMOC2Kao/UwcvA==", "cpu": [ "riscv64" ], @@ -2785,9 +2785,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.52.3.tgz", - "integrity": "sha512-jMdsML2VI5l+V7cKfZx3ak+SLlJ8fKvLJ0Eoa4b9/vCUrzXKgoKxvHqvJ/mkWhFiyp88nCkM5S2v6nIwRtPcgg==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.52.4.tgz", + "integrity": "sha512-seoeZp4L/6D1MUyjWkOMRU6/iLmCU2EjbMTyAG4oIOs1/I82Y5lTeaxW0KBfkUdHAWN7j25bpkt0rjnOgAcQcA==", "cpu": [ "s390x" ], @@ -2799,9 +2799,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.52.3.tgz", - "integrity": "sha512-tPgGd6bY2M2LJTA1uGq8fkSPK8ZLYjDjY+ZLK9WHncCnfIz29LIXIqUgzCR0hIefzy6Hpbe8Th5WOSwTM8E7LA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.52.4.tgz", + "integrity": "sha512-Wi6AXf0k0L7E2gteNsNHUs7UMwCIhsCTs6+tqQ5GPwVRWMaflqGec4Sd8n6+FNFDw9vGcReqk2KzBDhCa1DLYg==", "cpu": [ "x64" ], @@ -2813,9 +2813,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.52.3.tgz", - "integrity": "sha512-BCFkJjgk+WFzP+tcSMXq77ymAPIxsX9lFJWs+2JzuZTLtksJ2o5hvgTdIcZ5+oKzUDMwI0PfWzRBYAydAHF2Mw==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.52.4.tgz", + "integrity": "sha512-dtBZYjDmCQ9hW+WgEkaffvRRCKm767wWhxsFW3Lw86VXz/uJRuD438/XvbZT//B96Vs8oTA8Q4A0AfHbrxP9zw==", "cpu": [ "x64" ], @@ -2827,9 +2827,9 @@ ] }, "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.52.3.tgz", - "integrity": "sha512-KTD/EqjZF3yvRaWUJdD1cW+IQBk4fbQaHYJUmP8N4XoKFZilVL8cobFSTDnjTtxWJQ3JYaMgF4nObY/+nYkumA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.52.4.tgz", + "integrity": "sha512-1ox+GqgRWqaB1RnyZXL8PD6E5f7YyRUJYnCqKpNzxzP0TkaUh112NDrR9Tt+C8rJ4x5G9Mk8PQR3o7Ku2RKqKA==", "cpu": [ "arm64" ], @@ -2841,9 +2841,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.52.3.tgz", - "integrity": "sha512-+zteHZdoUYLkyYKObGHieibUFLbttX2r+58l27XZauq0tcWYYuKUwY2wjeCN9oK1Um2YgH2ibd6cnX/wFD7DuA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.52.4.tgz", + "integrity": "sha512-8GKr640PdFNXwzIE0IrkMWUNUomILLkfeHjXBi/nUvFlpZP+FA8BKGKpacjW6OUUHaNI6sUURxR2U2g78FOHWQ==", "cpu": [ "arm64" ], @@ -2855,9 +2855,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.52.3.tgz", - "integrity": "sha512-of1iHkTQSo3kr6dTIRX6t81uj/c/b15HXVsPcEElN5sS859qHrOepM5p9G41Hah+CTqSh2r8Bm56dL2z9UQQ7g==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.52.4.tgz", + "integrity": "sha512-AIy/jdJ7WtJ/F6EcfOb2GjR9UweO0n43jNObQMb6oGxkYTfLcnN7vYYpG+CN3lLxrQkzWnMOoNSHTW54pgbVxw==", "cpu": [ "ia32" ], @@ -2869,9 +2869,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.52.3.tgz", - "integrity": "sha512-s0hybmlHb56mWVZQj8ra9048/WZTPLILKxcvcq+8awSZmyiSUZjjem1AhU3Tf4ZKpYhK4mg36HtHDOe8QJS5PQ==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.52.4.tgz", + "integrity": "sha512-UF9KfsH9yEam0UjTwAgdK0anlQ7c8/pWPU2yVjyWcF1I1thABt6WXE47cI71pGiZ8wGvxohBoLnxM04L/wj8mQ==", "cpu": [ "x64" ], @@ -2883,9 +2883,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.52.3.tgz", - "integrity": "sha512-zGIbEVVXVtauFgl3MRwGWEN36P5ZGenHRMgNw88X5wEhEBpq0XrMEZwOn07+ICrwM17XO5xfMZqh0OldCH5VTA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.52.4.tgz", + "integrity": "sha512-bf9PtUa0u8IXDVxzRToFQKsNCRz9qLYfR/MpECxl4mRoWYjAeFjgxj1XdZr2M/GNVpT05p+LgQOHopYDlUu6/w==", "cpu": [ "x64" ], @@ -3173,13 +3173,13 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "24.5.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.5.2.tgz", - "integrity": "sha512-FYxk1I7wPv3K2XBaoyH2cTnocQEu8AOZ60hPbsyukMPLv5/5qr7V1i8PLHdl6Zf87I+xZXFvPCXYjiTFq+YSDQ==", + "version": "24.6.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.6.2.tgz", + "integrity": "sha512-d2L25Y4j+W3ZlNAeMKcy7yDsK425ibcAOO2t7aPTz6gNMH0z2GThtwENCDc0d/Pw9wgyRqE5Px1wkV7naz8ang==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~7.12.0" + "undici-types": "~7.13.0" } }, "node_modules/@types/node-forge": { @@ -3221,13 +3221,12 @@ "license": "MIT" }, "node_modules/@types/send": { - "version": "0.17.5", - "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.5.tgz", - "integrity": "sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/send/-/send-1.2.0.tgz", + "integrity": "sha512-zBF6vZJn1IaMpg3xUF25VK3gd3l8zwE0ZLRX7dsQyQi+jp4E8mMDJNGDYnYse+bQhYwWERTxVwHpi3dMOq7RKQ==", "dev": true, "license": "MIT", "dependencies": { - "@types/mime": "^1", "@types/node": "*" } }, @@ -3242,15 +3241,26 @@ } }, "node_modules/@types/serve-static": { - "version": "1.15.8", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.8.tgz", - "integrity": "sha512-roei0UY3LhpOJvjbIP6ZZFngyLKl5dskOtDhxY5THRSpO+ZI+nzJ+m5yUMzGrp89YRa7lvknKkMYjqQFGwA7Sg==", + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.9.tgz", + "integrity": "sha512-dOTIuqpWLyl3BBXU3maNQsS4A3zuuoYRNIvYSxxhebPfXg2mzWQEPne/nlJ37yOse6uGgR386uTpdsx4D0QZWA==", "dev": true, "license": "MIT", "dependencies": { "@types/http-errors": "*", "@types/node": "*", - "@types/send": "*" + "@types/send": "<1" + } + }, + "node_modules/@types/serve-static/node_modules/@types/send": { + "version": "0.17.5", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.5.tgz", + "integrity": "sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" } }, "node_modules/@types/sockjs": { @@ -3898,16 +3908,6 @@ "dev": true, "license": "MIT" }, - "node_modules/at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/autoprefixer": { "version": "10.4.21", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.21.tgz", @@ -4075,9 +4075,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.9.tgz", - "integrity": "sha512-hY/u2lxLrbecMEWSB0IpGzGyDyeoMFQhCvZd2jGFSE5I17Fh01sYUBPCJtkWERw7zrac9+cIghxm/ytJa2X8iA==", + "version": "2.8.12", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.12.tgz", + "integrity": "sha512-vAPMQdnyKCBtkmQA6FMCBvU9qFIppS3nzyXnEM+Lo2IAhG4Mpjv9cCxMudhgV3YdNNJv6TNqXy97dfRVL2LmaQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -4360,9 +4360,9 @@ } }, "node_modules/browserslist": { - "version": "4.26.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.26.2.tgz", - "integrity": "sha512-ECFzp6uFOSB+dcZ5BK/IBaGWssbSYBHvuMeMt3MMFyhI0Z8SqGgEkBLARgpRH3hutIgPVsALcMwbDrJqPxQ65A==", + "version": "4.26.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.26.3.tgz", + "integrity": "sha512-lAUU+02RFBuCKQPj/P6NgjlbCnLBMp4UtgTx7vNHd3XSIJF87s9a5rA3aH2yw3GS9DqZAUbOtZdCCiZeVRqt0w==", "dev": true, "funding": [ { @@ -4380,9 +4380,9 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.8.3", - "caniuse-lite": "^1.0.30001741", - "electron-to-chromium": "^1.5.218", + "baseline-browser-mapping": "^2.8.9", + "caniuse-lite": "^1.0.30001746", + "electron-to-chromium": "^1.5.227", "node-releases": "^2.0.21", "update-browserslist-db": "^1.1.3" }, @@ -4521,9 +4521,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001745", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001745.tgz", - "integrity": "sha512-ywt6i8FzvdgrrrGbr1jZVObnVv6adj+0if2/omv9cmR2oiZs30zL4DIyaptKcbOrBdOIc74QTMoJvSE2QHh5UQ==", + "version": "1.0.30001748", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001748.tgz", + "integrity": "sha512-5P5UgAr0+aBmNiplks08JLw+AW/XG/SurlgZLgB1dDLfAw7EfRGxIwzPHxdSCGY/BTKDqIVyJL87cCN6s0ZR0w==", "dev": true, "funding": [ { @@ -5061,9 +5061,9 @@ } }, "node_modules/cross-env": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-10.0.0.tgz", - "integrity": "sha512-aU8qlEK/nHYtVuN4p7UQgAwVljzMg8hB4YK5ThRqD2l/ziSnryncPNn7bMLt5cFYsKVKBh8HqLqyCoTupEUu7Q==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-10.1.0.tgz", + "integrity": "sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==", "dev": true, "license": "MIT", "dependencies": { @@ -5736,9 +5736,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.227", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.227.tgz", - "integrity": "sha512-ITxuoPfJu3lsNWUi2lBM2PaBPYgH3uqmxut5vmBxgYvyI4AlJ6P3Cai1O76mOrkJCBzq0IxWg/NtqOrpu/0gKA==", + "version": "1.5.230", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.230.tgz", + "integrity": "sha512-A6A6Fd3+gMdaed9wX83CvHYJb4UuapPD5X5SLq72VZJzxHSY0/LUweGXRWmQlh2ln7KV7iw7jnwXK7dlPoOnHQ==", "dev": true, "license": "ISC" }, @@ -5820,9 +5820,9 @@ } }, "node_modules/envinfo": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.15.0.tgz", - "integrity": "sha512-chR+t7exF6y59kelhXw5I3849nTy7KIRO+ePdLMhCD+JRP/JvmkenDWP7QSFGlsHX+kxGxdDutOPrmj5j1HR6g==", + "version": "7.16.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.16.1.tgz", + "integrity": "sha512-IugkinfKJlINIece0m1tAtjn4LGNP3APqchokVe090oSI5E3mixxKuc34ZiDHO17MTPODwjHWEt7QdC8Y+xtyQ==", "dev": true, "license": "MIT", "bin": { @@ -7088,9 +7088,9 @@ } }, "node_modules/i18next": { - "version": "25.5.2", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.5.2.tgz", - "integrity": "sha512-lW8Zeh37i/o0zVr+NoCHfNnfvVw+M6FQbRp36ZZ/NyHDJ3NJVpp2HhAUyU9WafL5AssymNoOjMRB48mmx2P6Hw==", + "version": "25.5.3", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.5.3.tgz", + "integrity": "sha512-joFqorDeQ6YpIXni944upwnuHBf5IoPMuqAchGVeQLdWC2JOjxgM9V8UGLhNIIH/Q8QleRxIi0BSRQehSrDLcg==", "funding": [ { "type": "individual", @@ -8464,9 +8464,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.21", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.21.tgz", - "integrity": "sha512-5b0pgg78U3hwXkCM8Z9b2FJdPZlr9Psr9V2gQPESdGHqbntyFJKFW4r5TeWGFzafGY3hzs1JC62VEQMbl1JFkw==", + "version": "2.0.23", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.23.tgz", + "integrity": "sha512-cCmFDMSm26S6tQSDpBCg/NR8NENrVPhAJSf+XbxBG4rPFaaonlEoE9wHQmun+cls499TQGSb7ZyPBRlzgKfpeg==", "dev": true, "license": "MIT" }, @@ -8653,16 +8653,6 @@ "dev": true, "license": "MIT" }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -8818,9 +8808,9 @@ } }, "node_modules/patch-package": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz", - "integrity": "sha512-da8BVIhzjtgScwDJ2TtKsfT5JFWz1hYoBl9rUQ1f38MC2HwnEIkK8VN3dKMKcP7P7bvvgzNDbfNHtx3MsQb5vA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.1.tgz", + "integrity": "sha512-VsKRIA8f5uqHQ7NGhwIna6Bx6D9s/1iXlA1hthBVBEbkq+t4kXD0HHt+rJhf/Z+Ci0F/HCB2hvn0qLdLG+Qxlw==", "dev": true, "license": "MIT", "dependencies": { @@ -8829,15 +8819,14 @@ "ci-info": "^3.7.0", "cross-spawn": "^7.0.3", "find-yarn-workspace-root": "^2.0.0", - "fs-extra": "^9.0.0", + "fs-extra": "^10.0.0", "json-stable-stringify": "^1.0.2", "klaw-sync": "^6.0.0", "minimist": "^1.2.6", "open": "^7.4.2", - "rimraf": "^2.6.3", "semver": "^7.5.3", "slash": "^2.0.0", - "tmp": "^0.0.33", + "tmp": "^0.2.4", "yaml": "^2.2.2" }, "bin": { @@ -8848,22 +8837,6 @@ "npm": ">5" } }, - "node_modules/patch-package/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/patch-package/node_modules/slash": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", @@ -10086,9 +10059,9 @@ } }, "node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, "license": "ISC", @@ -10097,6 +10070,9 @@ }, "bin": { "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/ripemd160": { @@ -10130,9 +10106,9 @@ } }, "node_modules/rollup": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.3.tgz", - "integrity": "sha512-RIDh866U8agLgiIcdpB+COKnlCreHJLfIhWC3LVflku5YHfpnsIKigRZeFfMfCc4dVcqNVfQQ5gO/afOck064A==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.4.tgz", + "integrity": "sha512-CLEVl+MnPAiKh5pl4dEWSyMTpuflgNQiLGhMv8ezD5W/qP8AKvmYpCOKRRNOh7oRKnauBZ4SyeYkMS+1VSyKwQ==", "dev": true, "license": "MIT", "dependencies": { @@ -10146,28 +10122,28 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.52.3", - "@rollup/rollup-android-arm64": "4.52.3", - "@rollup/rollup-darwin-arm64": "4.52.3", - "@rollup/rollup-darwin-x64": "4.52.3", - "@rollup/rollup-freebsd-arm64": "4.52.3", - "@rollup/rollup-freebsd-x64": "4.52.3", - "@rollup/rollup-linux-arm-gnueabihf": "4.52.3", - "@rollup/rollup-linux-arm-musleabihf": "4.52.3", - "@rollup/rollup-linux-arm64-gnu": "4.52.3", - "@rollup/rollup-linux-arm64-musl": "4.52.3", - "@rollup/rollup-linux-loong64-gnu": "4.52.3", - "@rollup/rollup-linux-ppc64-gnu": "4.52.3", - "@rollup/rollup-linux-riscv64-gnu": "4.52.3", - "@rollup/rollup-linux-riscv64-musl": "4.52.3", - "@rollup/rollup-linux-s390x-gnu": "4.52.3", - "@rollup/rollup-linux-x64-gnu": "4.52.3", - "@rollup/rollup-linux-x64-musl": "4.52.3", - "@rollup/rollup-openharmony-arm64": "4.52.3", - "@rollup/rollup-win32-arm64-msvc": "4.52.3", - "@rollup/rollup-win32-ia32-msvc": "4.52.3", - "@rollup/rollup-win32-x64-gnu": "4.52.3", - "@rollup/rollup-win32-x64-msvc": "4.52.3", + "@rollup/rollup-android-arm-eabi": "4.52.4", + "@rollup/rollup-android-arm64": "4.52.4", + "@rollup/rollup-darwin-arm64": "4.52.4", + "@rollup/rollup-darwin-x64": "4.52.4", + "@rollup/rollup-freebsd-arm64": "4.52.4", + "@rollup/rollup-freebsd-x64": "4.52.4", + "@rollup/rollup-linux-arm-gnueabihf": "4.52.4", + "@rollup/rollup-linux-arm-musleabihf": "4.52.4", + "@rollup/rollup-linux-arm64-gnu": "4.52.4", + "@rollup/rollup-linux-arm64-musl": "4.52.4", + "@rollup/rollup-linux-loong64-gnu": "4.52.4", + "@rollup/rollup-linux-ppc64-gnu": "4.52.4", + "@rollup/rollup-linux-riscv64-gnu": "4.52.4", + "@rollup/rollup-linux-riscv64-musl": "4.52.4", + "@rollup/rollup-linux-s390x-gnu": "4.52.4", + "@rollup/rollup-linux-x64-gnu": "4.52.4", + "@rollup/rollup-linux-x64-musl": "4.52.4", + "@rollup/rollup-openharmony-arm64": "4.52.4", + "@rollup/rollup-win32-arm64-msvc": "4.52.4", + "@rollup/rollup-win32-ia32-msvc": "4.52.4", + "@rollup/rollup-win32-x64-gnu": "4.52.4", + "@rollup/rollup-win32-x64-msvc": "4.52.4", "fsevents": "~2.3.2" } }, @@ -11014,9 +10990,9 @@ } }, "node_modules/tapable": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.3.tgz", - "integrity": "sha512-ZL6DDuAlRlLGghwcfmSn9sK3Hr6ArtyudlSAiCqQ6IfE+b+HHbydbYDIG15IfS5do+7XQQBdBiubF/cV2dnDzg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", + "integrity": "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==", "dev": true, "license": "MIT", "engines": { @@ -11119,9 +11095,9 @@ "license": "MIT" }, "node_modules/terser-webpack-plugin/node_modules/schema-utils": { - "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==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", + "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", "dev": true, "license": "MIT", "dependencies": { @@ -11214,16 +11190,13 @@ } }, "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", + "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", "dev": true, "license": "MIT", - "dependencies": { - "os-tmpdir": "~1.0.2" - }, "engines": { - "node": ">=0.6.0" + "node": ">=14.14" } }, "node_modules/to-arraybuffer": { @@ -11343,9 +11316,9 @@ } }, "node_modules/undici-types": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.12.0.tgz", - "integrity": "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.13.0.tgz", + "integrity": "sha512-Ov2Rr9Sx+fRgagJ5AX0qvItZG/JKKoBRAVITs1zk7IqZGTJUwgUr7qoYBpWwakpWilTZFM98rG/AFRocu10iIQ==", "dev": true, "license": "MIT" }, @@ -11540,9 +11513,9 @@ } }, "node_modules/vite": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.7.tgz", - "integrity": "sha512-VbA8ScMvAISJNJVbRDTJdCwqQoAareR/wutevKanhR2/1EkoXVZVkkORaYm/tNVCjP/UDTKtcw3bAkwOUdedmA==", + "version": "7.1.9", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.9.tgz", + "integrity": "sha512-4nVGliEpxmhCL8DslSAUdxlB6+SMrhB0a1v5ijlh1xB1nEPuy1mxaHxysVucLHuWryAxLWg6a5ei+U4TLn/rFg==", "dev": true, "license": "MIT", "dependencies": { @@ -11863,9 +11836,9 @@ "license": "BSD-2-Clause" }, "node_modules/webpack": { - "version": "5.101.3", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.101.3.tgz", - "integrity": "sha512-7b0dTKR3Ed//AD/6kkx/o7duS8H3f1a4w3BYpIriX4BzIhjkn4teo05cptsxvLesHFKK5KObnadmCHBwGc+51A==", + "version": "5.102.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.102.0.tgz", + "integrity": "sha512-hUtqAR3ZLVEYDEABdBioQCIqSoguHbFn1K7WlPPWSuXmx0031BD73PSE35jKyftdSh4YLDoQNgK4pqBt5Q82MA==", "dev": true, "license": "MIT", "dependencies": { @@ -11877,7 +11850,7 @@ "@webassemblyjs/wasm-parser": "^1.14.1", "acorn": "^8.15.0", "acorn-import-phases": "^1.0.3", - "browserslist": "^4.24.0", + "browserslist": "^4.24.5", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.17.3", "es-module-lexer": "^1.2.1", @@ -11890,9 +11863,9 @@ "mime-types": "^2.1.27", "neo-async": "^2.6.2", "schema-utils": "^4.3.2", - "tapable": "^2.1.1", + "tapable": "^2.2.3", "terser-webpack-plugin": "^5.3.11", - "watchpack": "^2.4.1", + "watchpack": "^2.4.4", "webpack-sources": "^3.3.3" }, "bin": { @@ -12021,9 +11994,9 @@ "license": "MIT" }, "node_modules/webpack-dev-middleware/node_modules/schema-utils": { - "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==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", + "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", "dev": true, "license": "MIT", "dependencies": { @@ -12155,27 +12128,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/webpack-dev-server/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/webpack-dev-server/node_modules/schema-utils": { - "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==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", + "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", "dev": true, "license": "MIT", "dependencies": { @@ -12275,9 +12231,9 @@ "license": "MIT" }, "node_modules/webpack/node_modules/schema-utils": { - "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==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", + "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", "dev": true, "license": "MIT", "dependencies": { diff --git a/resources/assets/v1/src/locales/ro.json b/resources/assets/v1/src/locales/ro.json index 118eaf015b..eec1bf47de 100644 --- a/resources/assets/v1/src/locales/ro.json +++ b/resources/assets/v1/src/locales/ro.json @@ -160,7 +160,7 @@ "url": "URL", "active": "Activ", "interest_date": "Data de interes", - "administration_currency": "Primary currency", + "administration_currency": "Moneda principala", "title": "Titlu", "date": "Dat\u0103", "book_date": "Rezerv\u0103 dat\u0103", diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 4a2ab3d092..f530ea76e0 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -909,6 +909,7 @@ return [ 'rule_trigger_tag_is' => 'Any tag is ":trigger_value"', 'rule_trigger_tag_contains_choice' => 'Any tag contains..', 'rule_trigger_tag_contains' => 'Any tag contains ":trigger_value"', + 'rule_trigger_not_tag_contains' => 'No tag contains ":trigger_value"', 'rule_trigger_tag_ends_choice' => 'Any tag ends with..', 'rule_trigger_tag_ends' => 'Any tag ends with ":trigger_value"', 'rule_trigger_tag_starts_choice' => 'Any tag starts with..', diff --git a/resources/lang/en_US/rules.php b/resources/lang/en_US/rules.php index ce60269015..405b13cb01 100644 --- a/resources/lang/en_US/rules.php +++ b/resources/lang/en_US/rules.php @@ -75,7 +75,7 @@ return [ 'cannot_set_budget' => 'Firefly III can\'t set budget ":name" to a transaction of type ":type"', 'journal_invalid_amount' => 'Firefly III can\'t set amount ":amount" because it is not a valid number.', 'cannot_remove_zero_piggy' => 'Cannot remove zero amount from piggy bank ":name"', - 'cannot_remove_from_piggy' => 'Cannot remove ":amount" from piggy bank ":name"', + 'cannot_remove_from_piggy' => 'Cannot remove :amount from piggy bank ":name"', 'cannot_add_zero_piggy' => 'Cannot add zero amount to piggy bank ":name"', - 'cannot_add_to_piggy' => 'Cannot add ":amount" to piggy bank ":name"', + 'cannot_add_to_piggy' => 'Cannot add :amount to piggy bank ":name"', ]; diff --git a/resources/views/list/groups.twig b/resources/views/list/groups.twig index a53f271fd8..fe4ab310d5 100644 --- a/resources/views/list/groups.twig +++ b/resources/views/list/groups.twig @@ -270,7 +270,12 @@ {% if (null == transaction.balance_dirty or false == transaction.balance_dirty) and null != transaction.destination_balance_after and null != transaction.source_balance_after %} {% if transaction.transaction_type_type == 'Deposit' %} - {{ formatAmountBySymbol(transaction.destination_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }} + {% if transaction.source_account_id == account.id %} + {{ formatAmountBySymbol(transaction.source_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }} + {% else %} + {{ formatAmountBySymbol(transaction.destination_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }} + {% endif %} + {% elseif transaction.transaction_type_type == 'Withdrawal' %} {% if 'Loan' == transaction.destination_account_type or 'Mortgage' == transaction.destination_account_type or 'Debt' == transaction.destination_account_type %} {% if currency.id == transaction.currency_id %} diff --git a/resources/views/partials/debug-table.twig b/resources/views/partials/debug-table.twig index 6dd268a04e..2e498a162a 100644 --- a/resources/views/partials/debug-table.twig +++ b/resources/views/partials/debug-table.twig @@ -12,8 +12,7 @@ {# Firefly III version #} Firefly III - {% if FF_IS_DEVELOP %}{% endif %}{% if not FF_IS_DEVELOP %}v{% endif %}{{ FF_VERSION }} / #{{ system.db_version }} (expects #{{ config('firefly.db_version') }}) - + {% if FF_IS_DEVELOP %}{% endif %}{% if not FF_IS_DEVELOP %}v{% endif %}{{ FF_VERSION }} {# PHP version + settings #} diff --git a/resources/views/reports/category/partials/avg-income.twig b/resources/views/reports/category/partials/avg-income.twig index b859f13a09..f473a8011b 100644 --- a/resources/views/reports/category/partials/avg-income.twig +++ b/resources/views/reports/category/partials/avg-income.twig @@ -2,7 +2,7 @@ {{ 'account'|_ }} - {{ 'spent_average'|_ }} + {{ 'income_average'|_ }} {{ 'total'|_ }} {{ 'transaction_count'|_ }} diff --git a/routes/web.php b/routes/web.php index 4d86235d14..b37e68c5bc 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1427,7 +1427,7 @@ Route::group( static function (): void { Route::get('', ['uses' => 'UserGroup\IndexController@index', 'as' => 'index']); Route::get('create', ['uses' => 'UserGroup\CreateController@create', 'as' => 'create']); - Route::get('edit/{userGroup}', ['uses' => 'UserGroup\EditController@edit', 'as' => 'edit']); + Route::get('edit/{userGroup?}', ['uses' => 'UserGroup\EditController@edit', 'as' => 'edit']); // Route::get('show/{userGroup}', ['uses' => 'UserGroup\ShowController@show', 'as' => 'show']); // Route::post('rescan/{bill}', ['uses' => 'Bill\ShowController@rescan', 'as' => 'rescan']);