From 7ca5e0375258f0603620f75f2e2dd230394f2013 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 24 May 2025 06:36:06 +0200 Subject: [PATCH 01/14] Fix access rights in Sonar test --- .github/workflows/sonarcloud.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 8fdbe4897a..727a12d91b 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -48,6 +48,8 @@ jobs: - name: "Create database file" run: | touch storage/database/database.sqlite + chmod 600 storage/oauth-public.key + chmod 600 storage/oauth-private.key wget -q https://github.com/firefly-iii/test-fixtures/raw/refs/heads/main/test-database.sqlite -O storage/database/database.sqlite - name: "Upgrades the database to the latest version" From 967f7cb01509b17b2e3a64b8b5c3b9abc76e2dae Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 24 May 2025 06:37:19 +0200 Subject: [PATCH 02/14] Move fix around --- .github/workflows/sonarcloud.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 727a12d91b..f6e37abef2 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -48,12 +48,13 @@ jobs: - name: "Create database file" run: | touch storage/database/database.sqlite - chmod 600 storage/oauth-public.key - chmod 600 storage/oauth-private.key wget -q https://github.com/firefly-iii/test-fixtures/raw/refs/heads/main/test-database.sqlite -O storage/database/database.sqlite - name: "Upgrades the database to the latest version" - run: php artisan firefly-iii:upgrade-database + run: | + php artisan firefly-iii:upgrade-database + chmod 600 storage/oauth-public.key + chmod 600 storage/oauth-private.key - name: "Integrity Database Report" run: php artisan firefly-iii:report-integrity From 7992ecf7f66dbd706c1c771fb985b374ae448429 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 24 May 2025 07:22:18 +0200 Subject: [PATCH 03/14] Use other workflow thing. --- .github/workflows/sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index f6e37abef2..c582b575ba 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -66,7 +66,7 @@ jobs: run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master + uses: SonarSource/sonarqube-scan-action@5 env: GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_PERSONAL_ACCESS_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From 6a82a813e05ad13463d2b3d0b98629ece7948a88 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 24 May 2025 07:24:28 +0200 Subject: [PATCH 04/14] Fix version, I guess. --- .github/workflows/sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index c582b575ba..e3260c0370 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -66,7 +66,7 @@ jobs: run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml - name: SonarCloud Scan - uses: SonarSource/sonarqube-scan-action@5 + uses: SonarSource/sonarqube-scan-action@v5.2.0 env: GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_PERSONAL_ACCESS_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From 6e5a08245caae4382c1a328a056635b9ed2832f9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 24 May 2025 16:39:20 +0200 Subject: [PATCH 05/14] Rector code cleanup --- .ci/rector.php | 1 + .../Autocomplete/TransactionController.php | 3 ++- .../V1/Controllers/Chart/AccountController.php | 3 ++- .../CurrencyExchangeRate/DestroyController.php | 5 +++-- .../CurrencyExchangeRate/StoreController.php | 5 +++-- .../Models/RuleGroup/TriggerController.php | 3 ++- .../TransactionCurrency/DestroyController.php | 7 ++++--- .../Models/TransactionLink/StoreController.php | 3 ++- .../TransactionLinkType/StoreController.php | 3 ++- .../TransactionLinkType/UpdateController.php | 3 ++- .../V1/Controllers/Summary/BasicController.php | 12 ++++++------ .../System/ConfigurationController.php | 3 ++- app/Api/V1/Middleware/ApiDemoUser.php | 3 ++- .../V1/Requests/Data/Bulk/TransactionRequest.php | 3 ++- app/Api/V1/Requests/Models/Bill/StoreRequest.php | 6 ++++-- app/Api/V1/Requests/System/CronRequest.php | 3 ++- .../Autocomplete/AccountController.php | 2 +- .../V2/Controllers/Chart/AccountController.php | 2 +- app/Api/V2/Controllers/Controller.php | 2 +- .../V2/Controllers/Summary/BasicController.php | 10 +++++----- .../Transaction/List/AccountController.php | 5 +++-- .../Model/Transaction/InfiniteListRequest.php | 2 +- .../V2/Request/Model/Transaction/ListRequest.php | 2 +- .../Request/Model/Transaction/UpdateRequest.php | 7 ++++--- app/Api/V2/Response/Sum/AutoSum.php | 3 ++- app/Http/Controllers/DebugController.php | 6 +++--- app/Http/Controllers/HomeController.php | 3 ++- app/Http/Controllers/Json/FrontpageController.php | 3 ++- app/Http/Controllers/Json/ReconcileController.php | 5 +++-- app/Http/Controllers/Json/RuleController.php | 5 +++-- app/Http/Controllers/PreferencesController.php | 3 ++- app/Http/Controllers/Profile/MfaController.php | 10 ++++++---- app/Http/Controllers/ProfileController.php | 15 +++++++++------ app/Http/Controllers/Report/AccountController.php | 3 ++- app/Http/Controllers/Report/BalanceController.php | 3 ++- app/Http/Controllers/Report/BillController.php | 3 ++- app/Http/Controllers/Report/BudgetController.php | 7 ++++--- .../Controllers/Report/CategoryController.php | 15 ++++++++------- app/Http/Controllers/Report/DoubleController.php | 9 +++++---- .../Controllers/Report/OperationsController.php | 7 ++++--- app/Http/Controllers/Report/TagController.php | 9 +++++---- app/Http/Controllers/Rule/EditController.php | 3 ++- app/Http/Controllers/Rule/SelectController.php | 5 +++-- .../Controllers/RuleGroup/ExecutionController.php | 3 ++- app/Http/Controllers/SearchController.php | 3 ++- app/Http/Controllers/System/InstallController.php | 9 +++++---- .../Controllers/Transaction/ConvertController.php | 6 +++--- .../Controllers/Transaction/MassController.php | 3 ++- app/Http/Middleware/Authenticate.php | 3 ++- app/Http/Middleware/Binder.php | 3 ++- app/Http/Middleware/InstallationId.php | 3 ++- app/Http/Middleware/Installer.php | 3 ++- app/Http/Middleware/InterestingMessage.php | 3 ++- app/Http/Middleware/IsAdmin.php | 3 ++- app/Http/Middleware/IsDemoUser.php | 3 ++- app/Http/Middleware/Range.php | 6 ++++-- app/Http/Middleware/RedirectIfAuthenticated.php | 3 ++- app/Http/Middleware/SecureHeaders.php | 6 ++++-- app/Http/Middleware/StartFireflySession.php | 3 ++- app/Http/Middleware/TrustHosts.php | 3 ++- app/Http/Requests/ReportFormRequest.php | 4 ++-- config/session.php | 2 +- 62 files changed, 172 insertions(+), 115 deletions(-) diff --git a/.ci/rector.php b/.ci/rector.php index 3ba2f28d41..ca37bf1431 100644 --- a/.ci/rector.php +++ b/.ci/rector.php @@ -32,6 +32,7 @@ return RectorConfig::configure() ]) ->withPaths([ // __DIR__ . '/../app', +__DIR__ . '/../app/Api', __DIR__ . '/../app/Http', // __DIR__ . '/../bootstrap', // __DIR__ . '/../config', diff --git a/app/Api/V1/Controllers/Autocomplete/TransactionController.php b/app/Api/V1/Controllers/Autocomplete/TransactionController.php index 3cba382e52..a6785dbc38 100644 --- a/app/Api/V1/Controllers/Autocomplete/TransactionController.php +++ b/app/Api/V1/Controllers/Autocomplete/TransactionController.php @@ -24,6 +24,7 @@ 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; @@ -102,7 +103,7 @@ class TransactionController extends Controller if (is_numeric($data['query'])) { // search for group, not journal. $firstResult = $this->groupRepository->find((int) $data['query']); - if (null !== $firstResult) { + if ($firstResult instanceof TransactionGroup) { // group may contain multiple journals, each a result: foreach ($firstResult->transactionJournals as $journal) { $result->push($journal); diff --git a/app/Api/V1/Controllers/Chart/AccountController.php b/app/Api/V1/Controllers/Chart/AccountController.php index 21150047c0..dcd85072b9 100644 --- a/app/Api/V1/Controllers/Chart/AccountController.php +++ b/app/Api/V1/Controllers/Chart/AccountController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Chart; +use FireflyIII\Models\TransactionCurrency; use Carbon\Carbon; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Chart\ChartRequest; @@ -99,7 +100,7 @@ class AccountController extends Controller private function renderAccountData(array $params, Account $account): void { $currency = $this->repository->getAccountCurrency($account); - if (null === $currency) { + if (!$currency instanceof TransactionCurrency) { $currency = $this->default; } $currentSet = [ diff --git a/app/Api/V1/Controllers/Models/CurrencyExchangeRate/DestroyController.php b/app/Api/V1/Controllers/Models/CurrencyExchangeRate/DestroyController.php index 9deedea808..30a3b79677 100644 --- a/app/Api/V1/Controllers/Models/CurrencyExchangeRate/DestroyController.php +++ b/app/Api/V1/Controllers/Models/CurrencyExchangeRate/DestroyController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\CurrencyExchangeRate; +use Carbon\Carbon; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\CurrencyExchangeRate\DestroyRequest; use FireflyIII\Enums\UserRoleEnum; @@ -59,11 +60,11 @@ class DestroyController extends Controller public function destroy(DestroyRequest $request, TransactionCurrency $from, TransactionCurrency $to): JsonResponse { $date = $request->getDate(); - if (null === $date) { + if (!$date instanceof Carbon) { throw new ValidationException('Date is required'); } $rate = $this->repository->getSpecificRateOnDate($from, $to, $date); - if (null === $rate) { + if (!$rate instanceof CurrencyExchangeRate) { throw new NotFoundHttpException(); } $this->repository->deleteRate($rate); diff --git a/app/Api/V1/Controllers/Models/CurrencyExchangeRate/StoreController.php b/app/Api/V1/Controllers/Models/CurrencyExchangeRate/StoreController.php index fcfb36ab6a..0a88531834 100644 --- a/app/Api/V1/Controllers/Models/CurrencyExchangeRate/StoreController.php +++ b/app/Api/V1/Controllers/Models/CurrencyExchangeRate/StoreController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\CurrencyExchangeRate; +use FireflyIII\Models\CurrencyExchangeRate; use FireflyIII\Api\V1\Requests\Models\CurrencyExchangeRate\StoreRequest; use FireflyIII\Api\V2\Controllers\Controller; use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepositoryInterface; @@ -61,11 +62,11 @@ class StoreController extends Controller // already has rate? $object = $this->repository->getSpecificRateOnDate($from, $to, $date); - if (null !== $object) { + if ($object instanceof CurrencyExchangeRate) { // just update it, no matter. $rate = $this->repository->updateExchangeRate($object, $rate, $date); } - if (null === $object) { + if (!$object instanceof CurrencyExchangeRate) { // store new $rate = $this->repository->storeExchangeRate($from, $to, $rate, $date); } diff --git a/app/Api/V1/Controllers/Models/RuleGroup/TriggerController.php b/app/Api/V1/Controllers/Models/RuleGroup/TriggerController.php index 14c480577a..4a4ef9eb69 100644 --- a/app/Api/V1/Controllers/Models/RuleGroup/TriggerController.php +++ b/app/Api/V1/Controllers/Models/RuleGroup/TriggerController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\RuleGroup; +use Exception; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\RuleGroup\TestRequest; use FireflyIII\Api\V1\Requests\Models\RuleGroup\TriggerRequest; @@ -128,7 +129,7 @@ class TriggerController extends Controller * * Execute the given rule group on a set of existing transactions. * - * @throws \Exception + * @throws Exception */ public function triggerGroup(TriggerRequest $request, RuleGroup $group): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php index 7da589703f..263d6bc350 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionCurrency; +use Validator; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionCurrency; @@ -74,15 +75,15 @@ class DestroyController extends Controller if (!$this->userRepository->hasRole($admin, 'owner')) { // access denied: $messages = ['currency_code' => '200005: You need the "owner" role to do this.']; - \Validator::make([], $rules, $messages)->validate(); + Validator::make([], $rules, $messages)->validate(); } if ($this->repository->currencyInUse($currency)) { $messages = ['currency_code' => '200006: Currency in use.']; - \Validator::make([], $rules, $messages)->validate(); + Validator::make([], $rules, $messages)->validate(); } if ($this->repository->isFallbackCurrency($currency)) { $messages = ['currency_code' => '200026: Currency is fallback.']; - \Validator::make([], $rules, $messages)->validate(); + Validator::make([], $rules, $messages)->validate(); } $this->repository->destroy($currency); diff --git a/app/Api/V1/Controllers/Models/TransactionLink/StoreController.php b/app/Api/V1/Controllers/Models/TransactionLink/StoreController.php index f3083cb7fe..89219ff30a 100644 --- a/app/Api/V1/Controllers/Models/TransactionLink/StoreController.php +++ b/app/Api/V1/Controllers/Models/TransactionLink/StoreController.php @@ -24,6 +24,7 @@ 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; @@ -81,7 +82,7 @@ class StoreController extends Controller $data = $request->getAll(); $inward = $this->journalRepository->find($data['inward_id'] ?? 0); $outward = $this->journalRepository->find($data['outward_id'] ?? 0); - if (null === $inward || null === $outward) { + if (!$inward instanceof TransactionJournal || !$outward instanceof TransactionJournal) { throw new FireflyException('200024: Source or destination does not exist.'); } $data['direction'] = 'inward'; diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/StoreController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/StoreController.php index c915dd6589..b779934ea6 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/StoreController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/StoreController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLinkType; +use Validator; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\TransactionLinkType\StoreRequest; use FireflyIII\Exceptions\FireflyException; @@ -81,7 +82,7 @@ class StoreController extends Controller if (!$this->userRepository->hasRole($admin, 'owner')) { // access denied: $messages = ['name' => '200005: You need the "owner" role to do this.']; - \Validator::make([], $rules, $messages)->validate(); + Validator::make([], $rules, $messages)->validate(); } $data = $request->getAll(); // if currency ID is 0, find the currency by the code: diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php index 0b79bd30a1..b1f06549ce 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLinkType; +use Validator; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\TransactionLinkType\UpdateRequest; use FireflyIII\Exceptions\FireflyException; @@ -85,7 +86,7 @@ class UpdateController extends Controller if (!$this->userRepository->hasRole($admin, 'owner')) { $messages = ['name' => '200005: You need the "owner" role to do this.']; - \Validator::make([], $rules, $messages)->validate(); + Validator::make([], $rules, $messages)->validate(); } $data = $request->getAll(); diff --git a/app/Api/V1/Controllers/Summary/BasicController.php b/app/Api/V1/Controllers/Summary/BasicController.php index 25d2346ea2..1878812a27 100644 --- a/app/Api/V1/Controllers/Summary/BasicController.php +++ b/app/Api/V1/Controllers/Summary/BasicController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Summary; +use Exception; use Carbon\Carbon; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Data\DateRequest; @@ -91,7 +92,7 @@ class BasicController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/summary/getBasicSummary * - * @throws \Exception + * @throws Exception */ public function basic(DateRequest $request): JsonResponse { @@ -467,7 +468,7 @@ class BasicController extends Controller } /** - * @throws \Exception + * @throws Exception */ private function getLeftToSpendInfo(Carbon $start, Carbon $end): array { @@ -674,15 +675,14 @@ class BasicController extends Controller */ protected function notInDateRange(Carbon $date, Carbon $start, Carbon $end): bool // Validate a preference { - $result = false; if ($start->greaterThanOrEqualTo($date) && $end->greaterThanOrEqualTo($date)) { - $result = true; + return true; } // start and end in the past? use $end if ($start->lessThanOrEqualTo($date) && $end->lessThanOrEqualTo($date)) { - $result = true; + return true; } - return $result; + return false; } } diff --git a/app/Api/V1/Controllers/System/ConfigurationController.php b/app/Api/V1/Controllers/System/ConfigurationController.php index 661b6e457e..35e84f41b9 100644 --- a/app/Api/V1/Controllers/System/ConfigurationController.php +++ b/app/Api/V1/Controllers/System/ConfigurationController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\System; +use Validator; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\System\UpdateRequest; use FireflyIII\Exceptions\FireflyException; @@ -158,7 +159,7 @@ class ConfigurationController extends Controller $rules = ['value' => 'required']; if (!$this->repository->hasRole(auth()->user(), 'owner')) { $messages = ['value' => '200005: You need the "owner" role to do this.']; - \Validator::make([], $rules, $messages)->validate(); + Validator::make([], $rules, $messages)->validate(); } $data = $request->getAll(); $shortName = str_replace('configuration.', '', $name); diff --git a/app/Api/V1/Middleware/ApiDemoUser.php b/app/Api/V1/Middleware/ApiDemoUser.php index e031bfa039..cd85e94879 100644 --- a/app/Api/V1/Middleware/ApiDemoUser.php +++ b/app/Api/V1/Middleware/ApiDemoUser.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Middleware; +use Closure; use FireflyIII\User; use Illuminate\Http\Request; @@ -36,7 +37,7 @@ class ApiDemoUser * * @return mixed */ - public function handle(Request $request, \Closure $next) + public function handle(Request $request, Closure $next) { /** @var null|User $user */ $user = $request->user(); diff --git a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php index b9319e0240..da2bfb3d7c 100644 --- a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php +++ b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Data\Bulk; +use JsonException; use FireflyIII\Enums\ClauseType; use FireflyIII\Rules\IsValidBulkClause; use FireflyIII\Support\Request\ChecksLogin; @@ -52,7 +53,7 @@ class TransactionRequest extends FormRequest $data = [ 'query' => json_decode($this->get('query'), true, 8, JSON_THROW_ON_ERROR), ]; - } catch (\JsonException $e) { + } catch (JsonException $e) { // dont really care. the validation should catch invalid json. app('log')->error($e->getMessage()); } diff --git a/app/Api/V1/Requests/Models/Bill/StoreRequest.php b/app/Api/V1/Requests/Models/Bill/StoreRequest.php index 40194a33f4..e773942ca3 100644 --- a/app/Api/V1/Requests/Models/Bill/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Bill/StoreRequest.php @@ -24,6 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Bill; +use ValueError; +use TypeError; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; @@ -109,7 +111,7 @@ class StoreRequest extends FormRequest try { $result = bccomp($min, $max); - } catch (\ValueError $e) { + } catch (ValueError $e) { Log::error($e->getMessage()); $validator->errors()->add('amount_min', (string) trans('validation.generic_invalid')); $validator->errors()->add('amount_max', (string) trans('validation.generic_invalid')); @@ -124,7 +126,7 @@ class StoreRequest extends FormRequest try { $failed = $validator->fails(); - } catch (\TypeError $e) { + } catch (TypeError $e) { Log::error($e->getMessage()); $failed = false; } diff --git a/app/Api/V1/Requests/System/CronRequest.php b/app/Api/V1/Requests/System/CronRequest.php index f5d03d4cf6..ec57cfeb96 100644 --- a/app/Api/V1/Requests/System/CronRequest.php +++ b/app/Api/V1/Requests/System/CronRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\System; +use Carbon\Carbon; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; @@ -58,7 +59,7 @@ class CronRequest extends FormRequest $data['date'] = $this->getCarbonDate('date'); } // catch NULL. - if (null === $data['date']) { + if (!$data['date'] instanceof Carbon) { $data['date'] = today(config('app.timezone')); } diff --git a/app/Api/V2/Controllers/Autocomplete/AccountController.php b/app/Api/V2/Controllers/Autocomplete/AccountController.php index ab52c9bddc..b267c1a09c 100644 --- a/app/Api/V2/Controllers/Autocomplete/AccountController.php +++ b/app/Api/V2/Controllers/Autocomplete/AccountController.php @@ -90,7 +90,7 @@ class AccountController extends Controller 'meta' => [ 'type' => $account->accountType->type, // TODO is multi currency property. - 'currency_id' => null === $currency ? null : (string) $currency->id, + 'currency_id' => $currency instanceof TransactionCurrency ? (string) $currency->id : null, 'currency_code' => $currency?->code, 'currency_symbol' => $currency?->symbol, 'currency_decimal_places' => $currency?->decimal_places, diff --git a/app/Api/V2/Controllers/Chart/AccountController.php b/app/Api/V2/Controllers/Chart/AccountController.php index 49c59cc26b..7f273cae3f 100644 --- a/app/Api/V2/Controllers/Chart/AccountController.php +++ b/app/Api/V2/Controllers/Chart/AccountController.php @@ -94,7 +94,7 @@ class AccountController extends Controller private function renderAccountData(array $params, Account $account): void { $currency = $this->repository->getAccountCurrency($account); - if (null === $currency) { + if (!$currency instanceof TransactionCurrency) { $currency = $this->default; } $currentSet = [ diff --git a/app/Api/V2/Controllers/Controller.php b/app/Api/V2/Controllers/Controller.php index d3c5207fe2..0a2afcfac5 100644 --- a/app/Api/V2/Controllers/Controller.php +++ b/app/Api/V2/Controllers/Controller.php @@ -117,7 +117,7 @@ class Controller extends BaseController app('log')->warning(sprintf('Ignored invalid date "%s" in API v2 controller parameter check: %s', substr((string) $date, 0, 20), $e->getMessage())); } // out of range? set to null. - if (null !== $obj && ($obj->year <= 1900 || $obj->year > 2099)) { + if ($obj instanceof Carbon && ($obj->year <= 1900 || $obj->year > 2099)) { app('log')->warning(sprintf('Refuse to use date "%s" in API v2 controller parameter check: %s', $field, $obj->toAtomString())); $obj = null; } diff --git a/app/Api/V2/Controllers/Summary/BasicController.php b/app/Api/V2/Controllers/Summary/BasicController.php index 079f7f7305..feb3798cef 100644 --- a/app/Api/V2/Controllers/Summary/BasicController.php +++ b/app/Api/V2/Controllers/Summary/BasicController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V2\Controllers\Summary; +use Exception; use Carbon\Carbon; use FireflyIII\Api\V2\Controllers\Controller; use FireflyIII\Api\V2\Request\Generic\DateRequest; @@ -92,7 +93,7 @@ class BasicController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/summary/getBasicSummary * - * @throws \Exception + * @throws Exception * * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ @@ -398,15 +399,14 @@ class BasicController extends Controller */ protected function notInDateRange(Carbon $date, Carbon $start, Carbon $end): bool // Validate a preference { - $result = false; if ($start->greaterThanOrEqualTo($date) && $end->greaterThanOrEqualTo($date)) { - $result = true; + return true; } // start and end in the past? use $end if ($start->lessThanOrEqualTo($date) && $end->lessThanOrEqualTo($date)) { - $result = true; + return true; } - return $result; + return false; } } diff --git a/app/Api/V2/Controllers/Transaction/List/AccountController.php b/app/Api/V2/Controllers/Transaction/List/AccountController.php index 1ab79af7a9..7ba12c9940 100644 --- a/app/Api/V2/Controllers/Transaction/List/AccountController.php +++ b/app/Api/V2/Controllers/Transaction/List/AccountController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V2\Controllers\Transaction\List; +use Carbon\Carbon; use FireflyIII\Api\V2\Controllers\Controller; use FireflyIII\Api\V2\Request\Model\Transaction\ListRequest; use FireflyIII\Helpers\Collector\GroupCollectorInterface; @@ -62,11 +63,11 @@ class AccountController extends Controller $start = $request->getStartDate(); $end = $request->getEndDate(); - if (null !== $start) { + if ($start instanceof Carbon) { app('log')->debug(sprintf('Set start date to %s', $start->toIso8601String())); $collector->setStart($start); } - if (null !== $end) { + if ($end instanceof Carbon) { app('log')->debug(sprintf('Set end date to %s', $start->toIso8601String())); $collector->setEnd($end); } diff --git a/app/Api/V2/Request/Model/Transaction/InfiniteListRequest.php b/app/Api/V2/Request/Model/Transaction/InfiniteListRequest.php index 9f083d3935..a66e960f82 100644 --- a/app/Api/V2/Request/Model/Transaction/InfiniteListRequest.php +++ b/app/Api/V2/Request/Model/Transaction/InfiniteListRequest.php @@ -53,7 +53,7 @@ class InfiniteListRequest extends FormRequest $start = $this->getStartDate(); $end = $this->getEndDate(); - if (null !== $start && null !== $end) { + if ($start instanceof Carbon && $end instanceof Carbon) { $array['start'] = $start->format('Y-m-d'); $array['end'] = $end->format('Y-m-d'); } diff --git a/app/Api/V2/Request/Model/Transaction/ListRequest.php b/app/Api/V2/Request/Model/Transaction/ListRequest.php index ff6f767e30..17cf22b78a 100644 --- a/app/Api/V2/Request/Model/Transaction/ListRequest.php +++ b/app/Api/V2/Request/Model/Transaction/ListRequest.php @@ -49,7 +49,7 @@ class ListRequest extends FormRequest $start = $this->getStartDate(); $end = $this->getEndDate(); - if (null !== $start && null !== $end) { + if ($start instanceof Carbon && $end instanceof Carbon) { $array['start'] = $start->format('Y-m-d'); $array['end'] = $end->format('Y-m-d'); } diff --git a/app/Api/V2/Request/Model/Transaction/UpdateRequest.php b/app/Api/V2/Request/Model/Transaction/UpdateRequest.php index c4d8140c79..3aeda0e3c3 100644 --- a/app/Api/V2/Request/Model/Transaction/UpdateRequest.php +++ b/app/Api/V2/Request/Model/Transaction/UpdateRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V2\Request\Model\Transaction; +use Override; use FireflyIII\Api\V1\Requests\Models\AvailableBudget\Request; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionGroup; @@ -64,7 +65,7 @@ class UpdateRequest extends Request * * @throws FireflyException */ - #[\Override] + #[Override] public function getAll(): array { app('log')->debug(sprintf('Now in %s', __METHOD__)); @@ -248,7 +249,7 @@ class UpdateRequest extends Request /** * The rules that the incoming request must be matched against. */ - #[\Override] + #[Override] public function rules(): array { app('log')->debug(sprintf('Now in %s', __METHOD__)); @@ -332,7 +333,7 @@ class UpdateRequest extends Request /** * Configure the validator instance. */ - #[\Override] + #[Override] public function withValidator(Validator $validator): void { app('log')->debug('Now in withValidator'); diff --git a/app/Api/V2/Response/Sum/AutoSum.php b/app/Api/V2/Response/Sum/AutoSum.php index c4ca249fbb..0f1d601f7c 100644 --- a/app/Api/V2/Response/Sum/AutoSum.php +++ b/app/Api/V2/Response/Sum/AutoSum.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V2\Response\Sum; +use Closure; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionCurrency; use Illuminate\Database\Eloquent\Model; @@ -39,7 +40,7 @@ class AutoSum /** * @throws FireflyException */ - public function autoSum(Collection $objects, \Closure $getCurrency, \Closure $getSum): array + public function autoSum(Collection $objects, Closure $getCurrency, Closure $getSum): array { $return = []; diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.php index 761070bd46..dd570b63a9 100644 --- a/app/Http/Controllers/DebugController.php +++ b/app/Http/Controllers/DebugController.php @@ -111,7 +111,7 @@ class DebugController extends Controller try { Artisan::call('twig:clean'); - } catch (\Exception $e) { // intentional generic exception + } catch (Exception $e) { // intentional generic exception throw new FireflyException($e->getMessage(), 0, $e); } @@ -203,7 +203,7 @@ class DebugController extends Controller $return['build'] = trim((string) file_get_contents('/var/www/counter-main.txt')); app('log')->debug(sprintf('build is now "%s"', $return['build'])); } - } catch (\Exception $e) { + } catch (Exception $e) { app('log')->debug('Could not check build counter, but thats ok.'); app('log')->warning($e->getMessage()); } @@ -212,7 +212,7 @@ class DebugController extends Controller if (file_exists('/var/www/build-date-main.txt')) { $return['build_date'] = trim((string) file_get_contents('/var/www/build-date-main.txt')); } - } catch (\Exception $e) { + } catch (Exception $e) { app('log')->debug('Could not check build date, but thats ok.'); app('log')->warning($e->getMessage()); } diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 4f300d8924..b829724308 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; +use Exception; use Carbon\Carbon; use Carbon\Exceptions\InvalidFormatException; use FireflyIII\Enums\AccountTypeEnum; @@ -57,7 +58,7 @@ class HomeController extends Controller /** * Change index date range. * - * @throws \Exception + * @throws Exception */ public function dateRange(Request $request): JsonResponse { diff --git a/app/Http/Controllers/Json/FrontpageController.php b/app/Http/Controllers/Json/FrontpageController.php index 08ed98cd53..f508c66763 100644 --- a/app/Http/Controllers/Json/FrontpageController.php +++ b/app/Http/Controllers/Json/FrontpageController.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; +use Throwable; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\PiggyBank; @@ -89,7 +90,7 @@ class FrontpageController extends Controller if (0 !== count($info)) { try { $html = view('json.piggy-banks', compact('info', 'convertToNative', 'native'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Cannot render json.piggy-banks: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $html = 'Could not render view.'; diff --git a/app/Http/Controllers/Json/ReconcileController.php b/app/Http/Controllers/Json/ReconcileController.php index f2122dc310..db7642cfe8 100644 --- a/app/Http/Controllers/Json/ReconcileController.php +++ b/app/Http/Controllers/Json/ReconcileController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; +use Throwable; use Carbon\Carbon; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; @@ -130,7 +131,7 @@ class ReconcileController extends Controller try { $view = view('accounts.reconcile.overview', compact('account', 'start', 'diffCompare', 'difference', 'end', 'clearedAmount', 'startBalance', 'endBalance', 'amount', 'route', 'countCleared', 'reconSum', 'selectedIds'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->debug(sprintf('View error: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $view = sprintf('Could not render accounts.reconcile.overview: %s', $e->getMessage()); @@ -228,7 +229,7 @@ class ReconcileController extends Controller 'accounts.reconcile.transactions', compact('account', 'journals', 'currency', 'start', 'end', 'selectionStart', 'selectionEnd') )->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->debug(sprintf('Could not render: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $html = sprintf('Could not render accounts.reconcile.transactions: %s', $e->getMessage()); diff --git a/app/Http/Controllers/Json/RuleController.php b/app/Http/Controllers/Json/RuleController.php index c91fb1c1e3..a555015150 100644 --- a/app/Http/Controllers/Json/RuleController.php +++ b/app/Http/Controllers/Json/RuleController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; +use Throwable; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use Illuminate\Http\JsonResponse; @@ -50,7 +51,7 @@ class RuleController extends Controller try { $view = view('rules.partials.action', compact('actions', 'count'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Cannot render rules.partials.action: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $view = 'Could not render view.'; @@ -80,7 +81,7 @@ class RuleController extends Controller try { $view = view('rules.partials.trigger', compact('triggers', 'count'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Cannot render rules.partials.trigger: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $view = 'Could not render view.'; diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index 4f2526083c..3031037624 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; +use JsonException; use Carbon\Carbon; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Events\Preferences\UserGroupChangedDefaultCurrency; @@ -155,7 +156,7 @@ class PreferencesController extends Controller try { $locales = json_decode((string) file_get_contents(resource_path(sprintf('locales/%s/locales.json', $language))), true, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $e) { + } catch (JsonException $e) { app('log')->error($e->getMessage()); $locales = []; } diff --git a/app/Http/Controllers/Profile/MfaController.php b/app/Http/Controllers/Profile/MfaController.php index 675b95d6f3..5d70a3b3f4 100644 --- a/app/Http/Controllers/Profile/MfaController.php +++ b/app/Http/Controllers/Profile/MfaController.php @@ -24,6 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Profile; +use Cookie; +use Google2FA; use Carbon\Carbon; use FireflyIII\Events\Security\DisabledMFA; use FireflyIII\Events\Security\EnabledMFA; @@ -182,7 +184,7 @@ class MfaController extends Controller // also logout current 2FA tokens. $cookieName = config('google2fa.cookie_name', 'google2fa_token'); - \Cookie::forget($cookieName); + Cookie::forget($cookieName); // send user notification. Log::channel('audit')->info(sprintf('User "%s" has disabled MFA', $user->email)); @@ -215,8 +217,8 @@ class MfaController extends Controller } $domain = $this->getDomain(); - $secret = \Google2FA::generateSecretKey(); - $image = \Google2FA::getQRCodeInline($domain, auth()->user()->email, $secret); + $secret = Google2FA::generateSecretKey(); + $image = Google2FA::getQRCodeInline($domain, auth()->user()->email, $secret); app('preferences')->set('temp-mfa-secret', $secret); @@ -272,7 +274,7 @@ class MfaController extends Controller // make sure MFA is logged out. if ('testing' !== config('app.env')) { - \Google2FA::logout(); + Google2FA::logout(); } // drop all info from session: diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 74b9dad6f3..1437138037 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -23,6 +23,9 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; +use Auth; +use Hash; +use Exception; use FireflyIII\Events\UserChangedEmail; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\ValidationException; @@ -203,7 +206,7 @@ class ProfileController extends Controller $existing = $repository->findByEmail($newEmail); if ($existing instanceof User) { // force user logout. - \Auth::guard()->logout(); // @phpstan-ignore-line (does not recognize function) + Auth::guard()->logout(); // @phpstan-ignore-line (does not recognize function) $request->session()->invalidate(); session()->flash('success', (string) trans('firefly.email_changed')); @@ -217,7 +220,7 @@ class ProfileController extends Controller event(new UserChangedEmail($user, $newEmail, $oldEmail)); // force user logout. - \Auth::guard()->logout(); // @phpstan-ignore-line (does not recognize function) + Auth::guard()->logout(); // @phpstan-ignore-line (does not recognize function) $request->session()->invalidate(); session()->flash('success', (string) trans('firefly.email_changed')); @@ -310,7 +313,7 @@ class ProfileController extends Controller return redirect(route('profile.index')); } - if (!\Hash::check($request->get('password'), auth()->user()->password)) { + if (!Hash::check($request->get('password'), auth()->user()->password)) { session()->flash('error', (string) trans('firefly.invalid_password')); return redirect(route('profile.delete-account')); @@ -343,8 +346,8 @@ class ProfileController extends Controller 'email' => auth()->user()->email, 'password' => $request->get('password'), ]; - if (\Auth::once($creds)) { - \Auth::logoutOtherDevices($request->get('password')); + if (Auth::once($creds)) { + Auth::logoutOtherDevices($request->get('password')); session()->flash('info', (string) trans('firefly.other_sessions_logged_out')); return redirect(route('profile.index')); @@ -359,7 +362,7 @@ class ProfileController extends Controller * * @return Redirector|RedirectResponse * - * @throws \Exception + * @throws Exception */ public function regenerate(Request $request) { diff --git a/app/Http/Controllers/Report/AccountController.php b/app/Http/Controllers/Report/AccountController.php index d99ec61237..dcd9464ce3 100644 --- a/app/Http/Controllers/Report/AccountController.php +++ b/app/Http/Controllers/Report/AccountController.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; +use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -58,7 +59,7 @@ class AccountController extends Controller try { $result = view('reports.partials.accounts', compact('accountReport'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.accounts: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $result = 'Could not render view.'; diff --git a/app/Http/Controllers/Report/BalanceController.php b/app/Http/Controllers/Report/BalanceController.php index 914f12061c..41b3010a4a 100644 --- a/app/Http/Controllers/Report/BalanceController.php +++ b/app/Http/Controllers/Report/BalanceController.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; +use Throwable; use Carbon\Carbon; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; @@ -140,7 +141,7 @@ class BalanceController extends Controller try { $result = view('reports.partials.balance', compact('report'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.balance: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $result = 'Could not render view.'; diff --git a/app/Http/Controllers/Report/BillController.php b/app/Http/Controllers/Report/BillController.php index afbb68362c..1fd70e3c48 100644 --- a/app/Http/Controllers/Report/BillController.php +++ b/app/Http/Controllers/Report/BillController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; +use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Report\ReportHelperInterface; @@ -58,7 +59,7 @@ class BillController extends Controller try { $result = view('reports.partials.bills', compact('report'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budgets: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $result = 'Could not render view.'; diff --git a/app/Http/Controllers/Report/BudgetController.php b/app/Http/Controllers/Report/BudgetController.php index 67c316891d..f24dd2b551 100644 --- a/app/Http/Controllers/Report/BudgetController.php +++ b/app/Http/Controllers/Report/BudgetController.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; +use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -176,7 +177,7 @@ class BudgetController extends Controller try { $result = view('reports.budget.partials.avg-expenses', compact('result'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); app('log')->error($e->getTraceAsString()); @@ -326,7 +327,7 @@ class BudgetController extends Controller try { $result = view('reports.partials.budget-period', compact('report', 'periods'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $result = 'Could not render view.'; @@ -377,7 +378,7 @@ class BudgetController extends Controller try { $result = view('reports.budget.partials.top-expenses', compact('result'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); diff --git a/app/Http/Controllers/Report/CategoryController.php b/app/Http/Controllers/Report/CategoryController.php index 0168fdd75e..fc8d17421a 100644 --- a/app/Http/Controllers/Report/CategoryController.php +++ b/app/Http/Controllers/Report/CategoryController.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; +use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -295,7 +296,7 @@ class CategoryController extends Controller try { $result = view('reports.category.partials.avg-expenses', compact('result'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -345,7 +346,7 @@ class CategoryController extends Controller try { $result = view('reports.category.partials.avg-income', compact('result'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -527,7 +528,7 @@ class CategoryController extends Controller try { $result = view('reports.partials.category-period', compact('report', 'periods'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render category::expenses: %s', $e->getMessage())); $result = sprintf('An error prevented Firefly III from rendering: %s. Apologies.', $e->getMessage()); @@ -599,7 +600,7 @@ class CategoryController extends Controller try { $result = view('reports.partials.category-period', compact('report', 'periods'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render category::expenses: %s', $e->getMessage())); $result = sprintf('An error prevented Firefly III from rendering: %s. Apologies.', $e->getMessage()); @@ -639,7 +640,7 @@ class CategoryController extends Controller try { $result = view('reports.partials.categories', compact('report'))->render(); $cache->store($result); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render category::expenses: %s', $e->getMessage())); $result = sprintf('An error prevented Firefly III from rendering: %s. Apologies.', $e->getMessage()); @@ -687,7 +688,7 @@ class CategoryController extends Controller try { $result = view('reports.category.partials.top-expenses', compact('result'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->debug(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -735,7 +736,7 @@ class CategoryController extends Controller try { $result = view('reports.category.partials.top-income', compact('result'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->debug(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); diff --git a/app/Http/Controllers/Report/DoubleController.php b/app/Http/Controllers/Report/DoubleController.php index 79d9d5fc1e..32a1736844 100644 --- a/app/Http/Controllers/Report/DoubleController.php +++ b/app/Http/Controllers/Report/DoubleController.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; +use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -102,7 +103,7 @@ class DoubleController extends Controller try { $result = view('reports.double.partials.avg-expenses', compact('result'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -152,7 +153,7 @@ class DoubleController extends Controller try { $result = view('reports.double.partials.avg-income', compact('result'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -429,7 +430,7 @@ class DoubleController extends Controller try { $result = view('reports.double.partials.top-expenses', compact('result'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -477,7 +478,7 @@ class DoubleController extends Controller try { $result = view('reports.double.partials.top-income', compact('result'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); diff --git a/app/Http/Controllers/Report/OperationsController.php b/app/Http/Controllers/Report/OperationsController.php index de27b13d04..d2aaeaa3dd 100644 --- a/app/Http/Controllers/Report/OperationsController.php +++ b/app/Http/Controllers/Report/OperationsController.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; +use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -78,7 +79,7 @@ class OperationsController extends Controller try { $result = view('reports.partials.income-expenses', compact('report', 'type'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.income-expense: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $result = 'Could not render view.'; @@ -112,7 +113,7 @@ class OperationsController extends Controller try { $result = view('reports.partials.income-expenses', compact('report', 'type'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.income-expenses: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $result = 'Could not render view.'; @@ -167,7 +168,7 @@ class OperationsController extends Controller try { $result = view('reports.partials.operations', compact('sums'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.operations: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $result = 'Could not render view.'; diff --git a/app/Http/Controllers/Report/TagController.php b/app/Http/Controllers/Report/TagController.php index 0b8f8cde7b..22bca3fd99 100644 --- a/app/Http/Controllers/Report/TagController.php +++ b/app/Http/Controllers/Report/TagController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; +use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -292,7 +293,7 @@ class TagController extends Controller try { $result = view('reports.tag.partials.avg-expenses', compact('result'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->debug(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -342,7 +343,7 @@ class TagController extends Controller try { $result = view('reports.tag.partials.avg-income', compact('result'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->debug(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -490,7 +491,7 @@ class TagController extends Controller try { $result = view('reports.tag.partials.top-expenses', compact('result'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->debug(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -538,7 +539,7 @@ class TagController extends Controller try { $result = view('reports.tag.partials.top-income', compact('result'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->debug(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); diff --git a/app/Http/Controllers/Rule/EditController.php b/app/Http/Controllers/Rule/EditController.php index c6f50d48ec..848fa259a3 100644 --- a/app/Http/Controllers/Rule/EditController.php +++ b/app/Http/Controllers/Rule/EditController.php @@ -24,6 +24,7 @@ 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; @@ -177,7 +178,7 @@ class EditController extends Controller 'triggers' => $triggers, ] )->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { $message = sprintf('Throwable was thrown in getPreviousTriggers(): %s', $e->getMessage()); app('log')->debug($message); app('log')->error($e->getTraceAsString()); diff --git a/app/Http/Controllers/Rule/SelectController.php b/app/Http/Controllers/Rule/SelectController.php index d6dae9d5fa..24c7dc0860 100644 --- a/app/Http/Controllers/Rule/SelectController.php +++ b/app/Http/Controllers/Rule/SelectController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Rule; +use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -174,7 +175,7 @@ class SelectController extends Controller try { $view = view('list.journals-array-tiny', ['groups' => $collection])->render(); - } catch (\Throwable $exception) { + } catch (Throwable $exception) { app('log')->error(sprintf('Could not render view in testTriggers(): %s', $exception->getMessage())); app('log')->error($exception->getTraceAsString()); $view = sprintf('Could not render list.journals-tiny: %s', $exception->getMessage()); @@ -216,7 +217,7 @@ class SelectController extends Controller try { $view = view('list.journals-array-tiny', ['groups' => $collection])->render(); - } catch (\Throwable $exception) { + } catch (Throwable $exception) { $message = sprintf('Could not render view in testTriggersByRule(): %s', $exception->getMessage()); app('log')->error($message); app('log')->error($exception->getTraceAsString()); diff --git a/app/Http/Controllers/RuleGroup/ExecutionController.php b/app/Http/Controllers/RuleGroup/ExecutionController.php index 542d38d0a7..40419e9656 100644 --- a/app/Http/Controllers/RuleGroup/ExecutionController.php +++ b/app/Http/Controllers/RuleGroup/ExecutionController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\RuleGroup; +use Exception; use Carbon\Carbon; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\SelectTransactionsRequest; @@ -64,7 +65,7 @@ class ExecutionController extends Controller /** * Execute the given rulegroup on a set of existing transactions. * - * @throws \Exception + * @throws Exception */ public function execute(SelectTransactionsRequest $request, RuleGroup $ruleGroup): RedirectResponse { diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index ceab9169c5..b30d1eefad 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; +use Throwable; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Repositories\Rule\RuleRepositoryInterface; use FireflyIII\Support\Search\SearchInterface; @@ -118,7 +119,7 @@ class SearchController extends Controller try { $html = view('search.search', compact('groups', 'hasPages', 'searchTime'))->render(); - } catch (\Throwable $e) { + } catch (Throwable $e) { app('log')->error(sprintf('Cannot render search.search: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $html = 'Could not render view.'; diff --git a/app/Http/Controllers/System/InstallController.php b/app/Http/Controllers/System/InstallController.php index 55a0054632..b20228becc 100644 --- a/app/Http/Controllers/System/InstallController.php +++ b/app/Http/Controllers/System/InstallController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\System; +use Artisan; use Cache; use Exception; use FireflyIII\Exceptions\FireflyException; @@ -142,14 +143,14 @@ class InstallController extends Controller $this->keys(); } if ('generate-keys' !== $command) { - \Artisan::call($command, $args); - app('log')->debug(\Artisan::output()); + Artisan::call($command, $args); + app('log')->debug(Artisan::output()); } - } catch (\Exception $e) { // intentional generic exception + } catch (Exception $e) { // intentional generic exception throw new FireflyException($e->getMessage(), 0, $e); } // clear cache as well. - \Cache::clear(); + Cache::clear(); app('preferences')->mark(); return true; diff --git a/app/Http/Controllers/Transaction/ConvertController.php b/app/Http/Controllers/Transaction/ConvertController.php index 929d46ede7..d3b00a5738 100644 --- a/app/Http/Controllers/Transaction/ConvertController.php +++ b/app/Http/Controllers/Transaction/ConvertController.php @@ -82,7 +82,7 @@ class ConvertController extends Controller * * @return Factory|Redirector|RedirectResponse|View * - * @throws \Exception + * @throws Exception */ public function index(TransactionType $destinationType, TransactionGroup $group) { @@ -214,7 +214,7 @@ class ConvertController extends Controller } /** - * @throws \Exception + * @throws Exception */ private function getLiabilities(): array { @@ -238,7 +238,7 @@ class ConvertController extends Controller } /** - * @throws \Exception + * @throws Exception */ private function getAssetAccounts(): array { diff --git a/app/Http/Controllers/Transaction/MassController.php b/app/Http/Controllers/Transaction/MassController.php index aa44005821..bac580dc76 100644 --- a/app/Http/Controllers/Transaction/MassController.php +++ b/app/Http/Controllers/Transaction/MassController.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; +use InvalidArgumentException; use Carbon\Carbon; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\TransactionTypeEnum; @@ -231,7 +232,7 @@ class MassController extends Controller try { $carbon = Carbon::parse($value[$journalId]); - } catch (\InvalidArgumentException $e) { + } catch (InvalidArgumentException $e) { Log::warning(sprintf('Could not parse "%s" but dont mind', $value[$journalId])); Log::warning($e->getMessage()); diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index a4de77717e..7f11d50cba 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; +use Closure; use FireflyIII\Exceptions\FireflyException; use FireflyIII\User; use Illuminate\Auth\AuthenticationException; @@ -56,7 +57,7 @@ class Authenticate * @throws FireflyException * @throws AuthenticationException */ - public function handle($request, \Closure $next, ...$guards) + public function handle($request, Closure $next, ...$guards) { $this->authenticate($request, $guards); diff --git a/app/Http/Middleware/Binder.php b/app/Http/Middleware/Binder.php index 9f4413a06d..7b03830ba5 100644 --- a/app/Http/Middleware/Binder.php +++ b/app/Http/Middleware/Binder.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; +use Closure; use FireflyIII\Support\Domain; use Illuminate\Contracts\Auth\Factory as Auth; use Illuminate\Http\Request; @@ -63,7 +64,7 @@ class Binder * * @return mixed */ - public function handle($request, \Closure $next) + public function handle($request, Closure $next) { foreach ($request->route()->parameters() as $key => $value) { if (array_key_exists($key, $this->binders)) { diff --git a/app/Http/Middleware/InstallationId.php b/app/Http/Middleware/InstallationId.php index 79ac8daedc..6c8aff7dab 100644 --- a/app/Http/Middleware/InstallationId.php +++ b/app/Http/Middleware/InstallationId.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; +use Closure; use FireflyIII\Support\System\GeneratesInstallationId; use Illuminate\Http\Request; @@ -41,7 +42,7 @@ class InstallationId * * @return mixed */ - public function handle($request, \Closure $next) + public function handle($request, Closure $next) { $this->generateInstallationId(); diff --git a/app/Http/Middleware/Installer.php b/app/Http/Middleware/Installer.php index 1954f226bd..f7d38232ca 100644 --- a/app/Http/Middleware/Installer.php +++ b/app/Http/Middleware/Installer.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; +use Closure; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Support\System\OAuthKeys; use Illuminate\Database\QueryException; @@ -45,7 +46,7 @@ class Installer * * @throws FireflyException */ - public function handle($request, \Closure $next) + public function handle($request, Closure $next) { // Log::debug(sprintf('Installer middleware for URL %s', $request->url())); // ignore installer in test environment. diff --git a/app/Http/Middleware/InterestingMessage.php b/app/Http/Middleware/InterestingMessage.php index 49e013d5ed..30c9b65e68 100644 --- a/app/Http/Middleware/InterestingMessage.php +++ b/app/Http/Middleware/InterestingMessage.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; +use Closure; use FireflyIII\Models\Account; use FireflyIII\Models\Bill; use FireflyIII\Models\GroupMembership; @@ -45,7 +46,7 @@ class InterestingMessage * * @return mixed */ - public function handle(Request $request, \Closure $next) + public function handle(Request $request, Closure $next) { if ($this->testing()) { return $next($request); diff --git a/app/Http/Middleware/IsAdmin.php b/app/Http/Middleware/IsAdmin.php index c992713911..2412e607b7 100644 --- a/app/Http/Middleware/IsAdmin.php +++ b/app/Http/Middleware/IsAdmin.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; +use Closure; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Http\Request; @@ -40,7 +41,7 @@ class IsAdmin * * @return mixed */ - public function handle(Request $request, \Closure $next, $guard = null) + public function handle(Request $request, Closure $next, $guard = null) { if (Auth::guard($guard)->guest()) { if ($request->ajax()) { diff --git a/app/Http/Middleware/IsDemoUser.php b/app/Http/Middleware/IsDemoUser.php index c984e947a5..e792003b9a 100644 --- a/app/Http/Middleware/IsDemoUser.php +++ b/app/Http/Middleware/IsDemoUser.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; +use Closure; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Http\Request; @@ -37,7 +38,7 @@ class IsDemoUser * * @return mixed */ - public function handle(Request $request, \Closure $next) + public function handle(Request $request, Closure $next) { /** @var null|User $user */ $user = $request->user(); diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index 7db74aa139..28f261e807 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -23,6 +23,8 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; +use Closure; +use App; use Carbon\Carbon; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\Facades\Amount; @@ -42,7 +44,7 @@ class Range * * @return mixed */ - public function handle(Request $request, \Closure $next) + public function handle(Request $request, Closure $next) { if (null !== $request->user()) { // set start, end and finish: @@ -101,7 +103,7 @@ class Range // get locale preference: $language = app('steam')->getLanguage(); $locale = app('steam')->getLocale(); - \App::setLocale($language); + App::setLocale($language); Carbon::setLocale(substr((string) $locale, 0, 2)); $localeArray = app('steam')->getLocaleArray($locale); diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index 5bffbb7146..01cda1a816 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; +use Closure; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; @@ -39,7 +40,7 @@ class RedirectIfAuthenticated * * @return mixed */ - public function handle($request, \Closure $next, $guard = null) + public function handle($request, Closure $next, $guard = null) { if (Auth::guard($guard)->check()) { return response()->redirectTo(route('index')); diff --git a/app/Http/Middleware/SecureHeaders.php b/app/Http/Middleware/SecureHeaders.php index 4ae071b11f..5f8b104992 100644 --- a/app/Http/Middleware/SecureHeaders.php +++ b/app/Http/Middleware/SecureHeaders.php @@ -24,6 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; +use Closure; +use Exception; use Barryvdh\Debugbar\Facades\Debugbar; use Illuminate\Http\Request; use Illuminate\Support\Facades\Vite; @@ -38,9 +40,9 @@ class SecureHeaders * * @return mixed * - * @throws \Exception + * @throws Exception */ - public function handle(Request $request, \Closure $next) + public function handle(Request $request, Closure $next) { // generate and share nonce. $nonce = base64_encode(random_bytes(16)); diff --git a/app/Http/Middleware/StartFireflySession.php b/app/Http/Middleware/StartFireflySession.php index 03359f735a..922bc3ad8c 100644 --- a/app/Http/Middleware/StartFireflySession.php +++ b/app/Http/Middleware/StartFireflySession.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; +use Override; use Illuminate\Contracts\Session\Session; use Illuminate\Http\Request; use Illuminate\Session\Middleware\StartSession; @@ -37,7 +38,7 @@ class StartFireflySession extends StartSession * * @param Session $session */ - #[\Override] + #[Override] protected function storeCurrentUrl(Request $request, $session): void { $url = $request->fullUrl(); diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php index 9dcd6a249a..4446201045 100644 --- a/app/Http/Middleware/TrustHosts.php +++ b/app/Http/Middleware/TrustHosts.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; +use Override; use Illuminate\Http\Middleware\TrustHosts as Middleware; class TrustHosts extends Middleware @@ -33,7 +34,7 @@ class TrustHosts extends Middleware * * @return array */ - #[\Override] + #[Override] public function hosts(): array { return [ diff --git a/app/Http/Requests/ReportFormRequest.php b/app/Http/Requests/ReportFormRequest.php index bf7e4417bb..8c5de287d4 100644 --- a/app/Http/Requests/ReportFormRequest.php +++ b/app/Http/Requests/ReportFormRequest.php @@ -149,7 +149,7 @@ class ReportFormRequest extends FormRequest if (false !== $result && 0 !== $result) { try { $date = new Carbon($parts[1]); - } catch (\Exception $e) { // intentional generic exception + } catch (Exception $e) { // intentional generic exception $error = sprintf('"%s" is not a valid date range: %s', $range, $e->getMessage()); app('log')->error($error); app('log')->error($e->getTraceAsString()); @@ -187,7 +187,7 @@ class ReportFormRequest extends FormRequest if (false !== $result && 0 !== $result) { try { $date = new Carbon($parts[0]); - } catch (\Exception $e) { // intentional generic exception + } catch (Exception $e) { // intentional generic exception $error = sprintf('"%s" is not a valid date range: %s', $range, $e->getMessage()); app('log')->error($error); app('log')->error($e->getTraceAsString()); diff --git a/config/session.php b/config/session.php index 37a9a0b86e..84df47ec36 100644 --- a/config/session.php +++ b/config/session.php @@ -32,7 +32,7 @@ return [ 'table' => 'sessions', 'store' => null, 'lottery' => [2, 100], - 'cookie' => 'firefly_session', + 'cookie' => env('COOKIE_NAME','firefly_iii_session'), 'path' => env('COOKIE_PATH', '/'), 'domain' => env('COOKIE_DOMAIN', null), 'secure' => env('COOKIE_SECURE', null), From e333dedeecf8afb468127c0df4e25611fb39e15e Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 24 May 2025 17:07:12 +0200 Subject: [PATCH 06/14] Replace magic facades. --- .../TransactionCurrency/DestroyController.php | 2 +- .../TransactionLinkType/StoreController.php | 2 +- .../TransactionLinkType/UpdateController.php | 2 +- .../System/ConfigurationController.php | 2 +- app/Http/Controllers/Controller.php | 2 +- .../Controllers/Profile/MfaController.php | 4 +- app/Http/Controllers/ProfileController.php | 4 +- .../Controllers/System/InstallController.php | 4 +- app/Http/Middleware/Range.php | 2 +- app/Support/ExpandedForm.php | 4 +- .../Http/Controllers/RequestInformation.php | 2 +- app/Support/Twig/General.php | 2 +- config/app.php | 106 +----------------- 13 files changed, 19 insertions(+), 119 deletions(-) diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php index 263d6bc350..e22212bd46 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php @@ -24,7 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionCurrency; -use Validator; +use Illuminate\Support\Facades\Validator; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionCurrency; diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/StoreController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/StoreController.php index b779934ea6..e9aef4aa2a 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/StoreController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/StoreController.php @@ -24,7 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLinkType; -use Validator; +use Illuminate\Support\Facades\Validator; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\TransactionLinkType\StoreRequest; use FireflyIII\Exceptions\FireflyException; diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php index b1f06549ce..a530836684 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php @@ -23,8 +23,8 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLinkType; +use Illuminate\Support\Facades\Validator; -use Validator; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\TransactionLinkType\UpdateRequest; use FireflyIII\Exceptions\FireflyException; diff --git a/app/Api/V1/Controllers/System/ConfigurationController.php b/app/Api/V1/Controllers/System/ConfigurationController.php index 35e84f41b9..281c0712f8 100644 --- a/app/Api/V1/Controllers/System/ConfigurationController.php +++ b/app/Api/V1/Controllers/System/ConfigurationController.php @@ -24,7 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\System; -use Validator; +use Illuminate\Support\Facades\Validator; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\System\UpdateRequest; use FireflyIII\Exceptions\FireflyException; diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 50fc2118a4..7756ca861b 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -36,7 +36,7 @@ use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Routing\Controller as BaseController; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\View; -use Route; +use Illuminate\Support\Facades\Route; /** * Class Controller. diff --git a/app/Http/Controllers/Profile/MfaController.php b/app/Http/Controllers/Profile/MfaController.php index 5d70a3b3f4..333801c380 100644 --- a/app/Http/Controllers/Profile/MfaController.php +++ b/app/Http/Controllers/Profile/MfaController.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Profile; -use Cookie; -use Google2FA; +use Illuminate\Support\Facades\Cookie; +use PragmaRX\Google2FALaravel\Facade as Google2FA; use Carbon\Carbon; use FireflyIII\Events\Security\DisabledMFA; use FireflyIII\Events\Security\EnabledMFA; diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 1437138037..b8645a31ec 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -23,8 +23,8 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; -use Auth; -use Hash; +use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Hash; use Exception; use FireflyIII\Events\UserChangedEmail; use FireflyIII\Exceptions\FireflyException; diff --git a/app/Http/Controllers/System/InstallController.php b/app/Http/Controllers/System/InstallController.php index b20228becc..e2acfb680f 100644 --- a/app/Http/Controllers/System/InstallController.php +++ b/app/Http/Controllers/System/InstallController.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\System; -use Artisan; -use Cache; +use Illuminate\Support\Facades\Artisan; +use Illuminate\Support\Facades\Cache; use Exception; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index 28f261e807..4699a454c0 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -24,7 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; use Closure; -use App; +use Illuminate\Support\Facades\App; use Carbon\Carbon; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\Facades\Amount; diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php index f5cbb3b6e1..68e2c07064 100644 --- a/app/Support/ExpandedForm.php +++ b/app/Support/ExpandedForm.php @@ -23,7 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Support; -use Eloquent; +use Illuminate\Database\Eloquent\Model; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Support\Form\FormSupport; use Illuminate\Support\Collection; @@ -205,7 +205,7 @@ class ExpandedForm $selectList[0] = '(none)'; $fields = ['title', 'name', 'description']; - /** @var \Eloquent $entry */ + /** @var Model $entry */ foreach ($set as $entry) { // All Eloquent models have an ID $entryId = $entry->id; diff --git a/app/Support/Http/Controllers/RequestInformation.php b/app/Support/Http/Controllers/RequestInformation.php index 7f18f6fe3c..96e6edcfac 100644 --- a/app/Support/Http/Controllers/RequestInformation.php +++ b/app/Support/Http/Controllers/RequestInformation.php @@ -33,7 +33,7 @@ use FireflyIII\User; use Illuminate\Contracts\Validation\Validator as ValidatorContract; use Illuminate\Routing\Route; use Illuminate\Support\Facades\Validator; -use Route as RouteFacade; +use Illuminate\Support\Facades\Route as RouteFacade; /** * Trait RequestInformation diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index 96b7475dac..4ae8da0019 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -33,7 +33,7 @@ use FireflyIII\Support\Facades\Steam; use FireflyIII\Support\Search\OperatorQuerySearch; use Illuminate\Support\Facades\Log; use League\CommonMark\GithubFlavoredMarkdownConverter; -use Route; +use Illuminate\Support\Facades\Route; use Twig\Extension\AbstractExtension; use Twig\TwigFilter; use Twig\TwigFunction; diff --git a/config/app.php b/config/app.php index dd2a1b6458..27be7859cc 100644 --- a/config/app.php +++ b/config/app.php @@ -41,16 +41,6 @@ use FireflyIII\Providers\RuleServiceProvider; use FireflyIII\Providers\SearchServiceProvider; use FireflyIII\Providers\SessionServiceProvider; use FireflyIII\Providers\TagServiceProvider; -use FireflyIII\Support\Facades\AccountForm; -use FireflyIII\Support\Facades\Amount; -use FireflyIII\Support\Facades\CurrencyForm; -use FireflyIII\Support\Facades\ExpandedForm; -use FireflyIII\Support\Facades\FireflyConfig; -use FireflyIII\Support\Facades\Navigation; -use FireflyIII\Support\Facades\PiggyBankForm; -use FireflyIII\Support\Facades\Preferences; -use FireflyIII\Support\Facades\RuleForm; -use FireflyIII\Support\Facades\Steam; use Illuminate\Auth\AuthServiceProvider; use Illuminate\Auth\Passwords\PasswordResetServiceProvider; use Illuminate\Broadcasting\BroadcastServiceProvider; @@ -58,7 +48,6 @@ use Illuminate\Bus\BusServiceProvider; use Illuminate\Cache\CacheServiceProvider; use Illuminate\Cookie\CookieServiceProvider; use Illuminate\Database\DatabaseServiceProvider; -use Illuminate\Database\Eloquent\Model; use Illuminate\Encryption\EncryptionServiceProvider; use Illuminate\Filesystem\FilesystemServiceProvider; use Illuminate\Foundation\Providers\ConsoleSupportServiceProvider; @@ -70,47 +59,9 @@ use Illuminate\Pagination\PaginationServiceProvider; use Illuminate\Pipeline\PipelineServiceProvider; use Illuminate\Queue\QueueServiceProvider; use Illuminate\Redis\RedisServiceProvider; -use Illuminate\Support\Arr; -use Illuminate\Support\Facades\App; -use Illuminate\Support\Facades\Artisan; -use Illuminate\Support\Facades\Auth; -use Illuminate\Support\Facades\Blade; -use Illuminate\Support\Facades\Broadcast; -use Illuminate\Support\Facades\Bus; -use Illuminate\Support\Facades\Cache; -use Illuminate\Support\Facades\Config; -use Illuminate\Support\Facades\Cookie; -use Illuminate\Support\Facades\Crypt; -use Illuminate\Support\Facades\DB; -use Illuminate\Support\Facades\Event; -use Illuminate\Support\Facades\File; -use Illuminate\Support\Facades\Gate; -use Illuminate\Support\Facades\Hash; -use Illuminate\Support\Facades\Http; -use Illuminate\Support\Facades\Lang; -use Illuminate\Support\Facades\Log; -use Illuminate\Support\Facades\Mail; -use Illuminate\Support\Facades\Notification; -use Illuminate\Support\Facades\Password; -use Illuminate\Support\Facades\Queue; -use Illuminate\Support\Facades\Redirect; -use Illuminate\Support\Facades\Redis; -use Illuminate\Support\Facades\Request; -use Illuminate\Support\Facades\Response; -use Illuminate\Support\Facades\Route; -use Illuminate\Support\Facades\Schema; -use Illuminate\Support\Facades\Session; -use Illuminate\Support\Facades\Storage; -use Illuminate\Support\Facades\URL; -use Illuminate\Support\Facades\Validator; -use Illuminate\Support\Facades\View; -use Illuminate\Support\Str; use Illuminate\Translation\TranslationServiceProvider; use Illuminate\Validation\ValidationServiceProvider; use Illuminate\View\ViewServiceProvider; -use PragmaRX\Google2FALaravel\Facade; -use Spatie\Html\Facades\Html; -use TwigBridge\Facade\Twig; use TwigBridge\ServiceProvider; return [ @@ -178,60 +129,9 @@ return [ AdminServiceProvider::class, RecurringServiceProvider::class, ], - 'aliases' => [ - 'App' => App::class, - 'Artisan' => Artisan::class, - 'Auth' => Auth::class, - 'Blade' => Blade::class, - 'Broadcast' => Broadcast::class, - 'Bus' => Bus::class, - 'Cache' => Cache::class, - 'Config' => Config::class, - 'Cookie' => Cookie::class, - 'Crypt' => Crypt::class, - 'DB' => DB::class, - 'Eloquent' => Model::class, - 'Event' => Event::class, - 'File' => File::class, - 'Gate' => Gate::class, - 'Hash' => Hash::class, - 'Lang' => Lang::class, - 'Log' => Log::class, - 'Mail' => Mail::class, - 'Notification' => Notification::class, - 'Password' => Password::class, - 'Queue' => Queue::class, - 'Redirect' => Redirect::class, - 'Redis' => Redis::class, - 'Request' => Request::class, - 'Response' => Response::class, - 'Route' => Route::class, - 'Schema' => Schema::class, - 'Session' => Session::class, - 'Storage' => Storage::class, - 'URL' => URL::class, - 'Validator' => Validator::class, - 'View' => View::class, - 'Html' => Html::class, - 'Preferences' => Preferences::class, - 'FireflyConfig' => FireflyConfig::class, - 'Navigation' => Navigation::class, - 'Amount' => Amount::class, - 'Steam' => Steam::class, - 'ExpandedForm' => ExpandedForm::class, - 'CurrencyForm' => CurrencyForm::class, - 'AccountForm' => AccountForm::class, - 'PiggyBankForm' => PiggyBankForm::class, - 'RuleForm' => RuleForm::class, - 'Google2FA' => Facade::class, - 'Twig' => Twig::class, + 'aliases' => [], - 'Arr' => Arr::class, - 'Http' => Http::class, - 'Str' => Str::class, - ], - - 'asset_url' => env('ASSET_URL', null), + 'asset_url' => env('ASSET_URL', null), /* |-------------------------------------------------------------------------- @@ -244,5 +144,5 @@ return [ | */ - 'faker_locale' => 'en_US', + 'faker_locale' => 'en_US', ]; From b830bd2732010c73474c908435a41a1172be599c Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 24 May 2025 17:15:46 +0200 Subject: [PATCH 07/14] Replace magic facades --- app/Factory/TransactionFactory.php | 3 ++- app/Handlers/Events/UserEventHandler.php | 7 ++++--- app/Jobs/MailError.php | 3 ++- app/Providers/AppServiceProvider.php | 2 +- .../Internal/Support/AccountServiceTrait.php | 3 ++- app/Support/FireflyConfig.php | 15 ++++++++------- app/Support/System/OAuthKeys.php | 5 +++-- app/Support/Twig/General.php | 6 +++--- app/User.php | 3 ++- app/Validation/FireflyValidator.php | 5 +++-- routes/api-noauth.php | 2 ++ routes/api.php | 2 ++ routes/channels.php | 1 + routes/web.php | 4 +++- 14 files changed, 38 insertions(+), 23 deletions(-) diff --git a/app/Factory/TransactionFactory.php b/app/Factory/TransactionFactory.php index 83294e2045..1065b7bda3 100644 --- a/app/Factory/TransactionFactory.php +++ b/app/Factory/TransactionFactory.php @@ -32,6 +32,7 @@ use FireflyIII\Models\TransactionJournal; use FireflyIII\Rules\UniqueIban; use FireflyIII\Services\Internal\Update\AccountUpdateService; use Illuminate\Database\QueryException; +use Illuminate\Support\Facades\Validator; /** * Class TransactionFactory @@ -152,7 +153,7 @@ class TransactionFactory return; } // validate info: - $validator = \Validator::make(['iban' => $this->accountInformation['iban']], [ + $validator = Validator::make(['iban' => $this->accountInformation['iban']], [ 'iban' => ['required', new UniqueIban($this->account, $this->account->accountType->type)], ]); if ($validator->fails()) { diff --git a/app/Handlers/Events/UserEventHandler.php b/app/Handlers/Events/UserEventHandler.php index 62643d884e..261a4bda33 100644 --- a/app/Handlers/Events/UserEventHandler.php +++ b/app/Handlers/Events/UserEventHandler.php @@ -54,6 +54,7 @@ use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Auth\Events\Login; use Illuminate\Support\Facades\Log; +use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Notification; use Mail; @@ -266,7 +267,7 @@ class UserEventHandler $url = route('profile.confirm-email-change', [$token->data]); try { - \Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $url)); + Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $url)); } catch (\Exception $e) { app('log')->error($e->getMessage()); app('log')->error($e->getTraceAsString()); @@ -291,7 +292,7 @@ class UserEventHandler $url = route('profile.undo-email-change', [$token->data, $hashed]); try { - \Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $url)); + Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $url)); } catch (\Exception $e) { app('log')->error($e->getMessage()); app('log')->error($e->getTraceAsString()); @@ -355,7 +356,7 @@ class UserEventHandler $url = route('invite', [$event->invitee->invite_code]); try { - \Mail::to($invitee)->send(new InvitationMail($invitee, $admin, $url)); + Mail::to($invitee)->send(new InvitationMail($invitee, $admin, $url)); } catch (\Exception $e) { app('log')->error($e->getMessage()); app('log')->error($e->getTraceAsString()); diff --git a/app/Jobs/MailError.php b/app/Jobs/MailError.php index 7b906b93a6..229a55b28d 100644 --- a/app/Jobs/MailError.php +++ b/app/Jobs/MailError.php @@ -28,6 +28,7 @@ use Illuminate\Mail\Message; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Log; +use Illuminate\Support\Facades\Mail; use Symfony\Component\Mailer\Exception\TransportException; /** @@ -70,7 +71,7 @@ class MailError extends Job implements ShouldQueue if ($this->attempts() < 3 && '' !== $email) { try { - \Mail::send( + Mail::send( ['emails.error-html', 'emails.error-text'], $args, static function (Message $message) use ($email): void { diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ec474c598b..7de4243aaf 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -59,7 +59,7 @@ class AppServiceProvider extends ServiceProvider // blade extension Blade::directive('activeXRoutePartial', function (string $route) { - $name = \Route::getCurrentRoute()->getName() ?? ''; + $name = Route::getCurrentRoute()->getName() ?? ''; if (str_contains($name, $route)) { return 'menu-open'; } diff --git a/app/Services/Internal/Support/AccountServiceTrait.php b/app/Services/Internal/Support/AccountServiceTrait.php index 787a08c239..15fe51dfdd 100644 --- a/app/Services/Internal/Support/AccountServiceTrait.php +++ b/app/Services/Internal/Support/AccountServiceTrait.php @@ -39,6 +39,7 @@ use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Services\Internal\Destroy\TransactionGroupDestroyService; +use Illuminate\Support\Facades\Validator; /** * Trait AccountServiceTrait @@ -54,7 +55,7 @@ trait AccountServiceTrait } $data = ['iban' => $iban]; $rules = ['iban' => 'required|iban']; - $validator = \Validator::make($data, $rules); + $validator = Validator::make($data, $rules); if ($validator->fails()) { app('log')->info(sprintf('Detected invalid IBAN ("%s"). Return NULL instead.', $iban)); diff --git a/app/Support/FireflyConfig.php b/app/Support/FireflyConfig.php index a9e182b519..009fc71390 100644 --- a/app/Support/FireflyConfig.php +++ b/app/Support/FireflyConfig.php @@ -28,6 +28,7 @@ use FireflyIII\Models\Configuration; use Illuminate\Contracts\Encryption\DecryptException; use Illuminate\Contracts\Encryption\EncryptException; use Illuminate\Database\QueryException; +use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Log; /** @@ -38,8 +39,8 @@ class FireflyConfig public function delete(string $name): void { $fullName = 'ff-config-'.$name; - if (\Cache::has($fullName)) { - \Cache::forget($fullName); + if (Cache::has($fullName)) { + Cache::forget($fullName); } Configuration::where('name', $name)->forceDelete(); } @@ -80,8 +81,8 @@ class FireflyConfig public function get(string $name, mixed $default = null): ?Configuration { $fullName = 'ff-config-'.$name; - if (\Cache::has($fullName)) { - return \Cache::get($fullName); + if (Cache::has($fullName)) { + return Cache::get($fullName); } try { @@ -92,7 +93,7 @@ class FireflyConfig } if (null !== $config) { - \Cache::forever($fullName, $config); + Cache::forever($fullName, $config); return $config; } @@ -122,13 +123,13 @@ class FireflyConfig $item->name = $name; $item->data = $value; $item->save(); - \Cache::forget('ff-config-'.$name); + Cache::forget('ff3-config-'.$name); return $item; } $config->data = $value; $config->save(); - \Cache::forget('ff-config-'.$name); + Cache::forget('ff3-config-'.$name); return $config; } diff --git a/app/Support/System/OAuthKeys.php b/app/Support/System/OAuthKeys.php index e0c0fa0b7a..0ba89c644d 100644 --- a/app/Support/System/OAuthKeys.php +++ b/app/Support/System/OAuthKeys.php @@ -26,6 +26,7 @@ namespace FireflyIII\Support\System; use FireflyIII\Exceptions\FireflyException; use Illuminate\Contracts\Encryption\DecryptException; +use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Crypt; use Laravel\Passport\Console\KeysCommand; use Psr\Container\ContainerExceptionInterface; @@ -88,8 +89,8 @@ class OAuthKeys public static function generateKeys(): void { - \Artisan::registerCommand(new KeysCommand()); - \Artisan::call('firefly-iii:laravel-passport-keys'); + Artisan::registerCommand(new KeysCommand()); + Artisan::call('firefly-iii:laravel-passport-keys'); } public static function storeKeysInDB(): void diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index 4ae8da0019..6e369e4086 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -247,7 +247,7 @@ class General extends AbstractExtension static function (): string { $args = func_get_args(); $route = $args[0]; // name of the route. - $name = \Route::getCurrentRoute()->getName() ?? ''; + $name = Route::getCurrentRoute()->getName() ?? ''; if (str_contains($name, $route)) { return 'active'; } @@ -271,7 +271,7 @@ class General extends AbstractExtension if ($objectType === $activeObjectType && false !== stripos( - (string) \Route::getCurrentRoute()->getName(), + (string) Route::getCurrentRoute()->getName(), (string) $route )) { return 'active'; @@ -294,7 +294,7 @@ class General extends AbstractExtension static function (): string { $args = func_get_args(); $route = $args[0]; // name of the route. - $name = \Route::getCurrentRoute()->getName() ?? ''; + $name = Route::getCurrentRoute()->getName() ?? ''; if (str_contains($name, $route)) { return 'menu-open'; } diff --git a/app/User.php b/app/User.php index 51d27e3b6f..f6bc724e5f 100644 --- a/app/User.php +++ b/app/User.php @@ -61,6 +61,7 @@ use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notification; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Request; use Illuminate\Support\Str; use Laravel\Passport\HasApiTokens; use NotificationChannels\Pushover\PushoverReceiver; @@ -464,7 +465,7 @@ class User extends Authenticatable */ public function sendPasswordResetNotification($token): void { - $ipAddress = \Request::ip(); + $ipAddress = Request::ip(); event(new RequestedNewPassword($this, $token, $ipAddress)); } diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index 86409ed951..0ea1c687fd 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -44,6 +44,7 @@ use Illuminate\Validation\Validator; use PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException; use PragmaRX\Google2FA\Exceptions\InvalidCharactersException; use PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException; +use PragmaRX\Google2FALaravel\Facade; /** * Class FireflyValidator. @@ -79,7 +80,7 @@ class FireflyValidator extends Validator } $secret = (string) $secret; - return (bool) \Google2FA::verifyKey($secret, $value); + return (bool) Facade::verifyKey($secret, $value); } /** @@ -131,7 +132,7 @@ class FireflyValidator extends Validator } $secret = (string) $user->mfa_secret; - return (bool) \Google2FA::verifyKey($secret, $value); + return (bool) Facade::verifyKey($secret, $value); } /** diff --git a/routes/api-noauth.php b/routes/api-noauth.php index 7e4e1da126..743ec20051 100644 --- a/routes/api-noauth.php +++ b/routes/api-noauth.php @@ -22,6 +22,8 @@ declare(strict_types=1); +use Illuminate\Support\Facades\Route; + // Cron job API routes: use FireflyIII\Http\Middleware\AcceptHeaders; diff --git a/routes/api.php b/routes/api.php index 02bd5643ca..9be3f75bfa 100644 --- a/routes/api.php +++ b/routes/api.php @@ -22,6 +22,8 @@ declare(strict_types=1); +use Illuminate\Support\Facades\Route; + /* * * ____ ____ ___ .______ ______ __ __ .___________. _______ _______. diff --git a/routes/channels.php b/routes/channels.php index 702805feed..25c8051eec 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -22,6 +22,7 @@ declare(strict_types=1); +use Illuminate\Support\Facades\Broadcast; /* |-------------------------------------------------------------------------- | Broadcast Channels diff --git a/routes/web.php b/routes/web.php index ee6039a7ae..2fa1d255b6 100644 --- a/routes/web.php +++ b/routes/web.php @@ -19,9 +19,11 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ - declare(strict_types=1); +use Illuminate\Support\Facades\Route; + + if (!defined('DATEFORMAT')) { define('DATEFORMAT', '(19|20)[0-9]{2}-?[0-9]{2}-?[0-9]{2}'); } From f780de9e716b15be34aff16a6c7a3571d0d4a68d Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 24 May 2025 17:19:18 +0200 Subject: [PATCH 08/14] Replace magic facades --- app/Console/Commands/Correction/CorrectsDatabase.php | 3 ++- app/Console/Commands/Integrity/ReportsIntegrity.php | 3 ++- app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Console/Commands/Correction/CorrectsDatabase.php b/app/Console/Commands/Correction/CorrectsDatabase.php index 1d9ea62112..974d4a19c0 100644 --- a/app/Console/Commands/Correction/CorrectsDatabase.php +++ b/app/Console/Commands/Correction/CorrectsDatabase.php @@ -26,6 +26,7 @@ namespace FireflyIII\Console\Commands\Correction; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Schema; class CorrectsDatabase extends Command { @@ -40,7 +41,7 @@ class CorrectsDatabase extends Command public function handle(): int { // if table does not exist, return false - if (!\Schema::hasTable('users')) { + if (!Schema::hasTable('users')) { $this->friendlyError('No "users"-table, will not continue.'); return 1; diff --git a/app/Console/Commands/Integrity/ReportsIntegrity.php b/app/Console/Commands/Integrity/ReportsIntegrity.php index 2ac856b24b..46e5427ad6 100644 --- a/app/Console/Commands/Integrity/ReportsIntegrity.php +++ b/app/Console/Commands/Integrity/ReportsIntegrity.php @@ -26,6 +26,7 @@ namespace FireflyIII\Console\Commands\Integrity; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Schema; class ReportsIntegrity extends Command { @@ -41,7 +42,7 @@ class ReportsIntegrity extends Command public function handle(): int { // if table does not exist, return false - if (!\Schema::hasTable('users')) { + if (!Schema::hasTable('users')) { return 1; } $commands = [ diff --git a/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php b/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php index 281078dee2..aa2b108dea 100644 --- a/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php +++ b/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php @@ -31,6 +31,7 @@ use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalCLIRepositoryInterface; use Illuminate\Console\Command; use Illuminate\Database\QueryException; +use Illuminate\Support\Facades\Schema; class AddsTransactionIdentifiers extends Command { @@ -65,7 +66,7 @@ class AddsTransactionIdentifiers extends Command } // if table does not exist, return false - if (!\Schema::hasTable('transaction_journals')) { + if (!Schema::hasTable('transaction_journals')) { return 0; } From c9f07c093a70031617d74ae08373d63cc030b020 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 24 May 2025 17:30:08 +0200 Subject: [PATCH 09/14] Fix tests and migrations --- app/Handlers/Events/UserEventHandler.php | 1 - database/migrations/2016_06_16_000000_create_support_tables.php | 1 + database/migrations/2016_06_16_000001_create_users_table.php | 2 +- database/migrations/2016_06_16_000002_create_main_tables.php | 2 +- database/migrations/2016_08_25_091522_changes_for_3101.php | 2 +- database/migrations/2016_09_12_121359_fix_nullables.php | 2 +- .../migrations/2016_10_09_150037_expand_transactions_table.php | 2 +- database/migrations/2016_10_22_075804_changes_for_v410.php | 2 +- database/migrations/2016_11_24_210552_changes_for_v420.php | 2 +- database/migrations/2016_12_22_150431_changes_for_v430.php | 2 +- database/migrations/2016_12_28_203205_changes_for_v431.php | 2 +- database/migrations/2017_04_13_163623_changes_for_v440.php | 2 +- database/migrations/2017_06_02_105232_changes_for_v450.php | 2 +- database/migrations/2017_08_20_062014_changes_for_v470.php | 1 - database/migrations/2017_11_04_170844_changes_for_v470a.php | 1 - database/migrations/2018_03_19_141348_changes_for_v472.php | 2 +- database/migrations/2018_04_29_174524_changes_for_v474.php | 2 +- database/migrations/2018_06_08_200526_changes_for_v475.php | 2 +- database/migrations/2018_09_05_195147_changes_for_v477.php | 2 +- database/migrations/2018_11_06_172532_changes_for_v479.php | 2 +- database/migrations/2019_03_22_183214_changes_for_v480.php | 2 +- database/migrations/2020_03_13_201950_changes_for_v520.php | 2 +- database/migrations/2020_06_07_063612_changes_for_v530.php | 2 +- database/migrations/2024_11_05_062108_add_date_tz_columns.php | 2 +- 24 files changed, 21 insertions(+), 23 deletions(-) diff --git a/app/Handlers/Events/UserEventHandler.php b/app/Handlers/Events/UserEventHandler.php index 261a4bda33..70e2c8dab2 100644 --- a/app/Handlers/Events/UserEventHandler.php +++ b/app/Handlers/Events/UserEventHandler.php @@ -56,7 +56,6 @@ use Illuminate\Auth\Events\Login; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Notification; -use Mail; /** * Class UserEventHandler. diff --git a/database/migrations/2016_06_16_000000_create_support_tables.php b/database/migrations/2016_06_16_000000_create_support_tables.php index fd5c08dcd6..bd199cc3c7 100644 --- a/database/migrations/2016_06_16_000000_create_support_tables.php +++ b/database/migrations/2016_06_16_000000_create_support_tables.php @@ -24,6 +24,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; /** * Class CreateSupportTables. diff --git a/database/migrations/2016_06_16_000001_create_users_table.php b/database/migrations/2016_06_16_000001_create_users_table.php index 98df97b1a8..51e60085bf 100644 --- a/database/migrations/2016_06_16_000001_create_users_table.php +++ b/database/migrations/2016_06_16_000001_create_users_table.php @@ -24,7 +24,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class CreateUsersTable. * diff --git a/database/migrations/2016_06_16_000002_create_main_tables.php b/database/migrations/2016_06_16_000002_create_main_tables.php index f2d76e5c53..f9bf3e9a88 100644 --- a/database/migrations/2016_06_16_000002_create_main_tables.php +++ b/database/migrations/2016_06_16_000002_create_main_tables.php @@ -24,7 +24,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class CreateMainTables. * diff --git a/database/migrations/2016_08_25_091522_changes_for_3101.php b/database/migrations/2016_08_25_091522_changes_for_3101.php index ce78bf0dfe..d256767d45 100644 --- a/database/migrations/2016_08_25_091522_changes_for_3101.php +++ b/database/migrations/2016_08_25_091522_changes_for_3101.php @@ -22,7 +22,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; - +use Illuminate\Support\Facades\Schema; /** * Class ChangesFor3101. * diff --git a/database/migrations/2016_09_12_121359_fix_nullables.php b/database/migrations/2016_09_12_121359_fix_nullables.php index 8862bdd1cb..46a56188ad 100644 --- a/database/migrations/2016_09_12_121359_fix_nullables.php +++ b/database/migrations/2016_09_12_121359_fix_nullables.php @@ -24,7 +24,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class FixNullables. * diff --git a/database/migrations/2016_10_09_150037_expand_transactions_table.php b/database/migrations/2016_10_09_150037_expand_transactions_table.php index bd86fcb336..83fccf186a 100644 --- a/database/migrations/2016_10_09_150037_expand_transactions_table.php +++ b/database/migrations/2016_10_09_150037_expand_transactions_table.php @@ -24,7 +24,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class ExpandTransactionsTable. * diff --git a/database/migrations/2016_10_22_075804_changes_for_v410.php b/database/migrations/2016_10_22_075804_changes_for_v410.php index 42002388fe..80e228b53f 100644 --- a/database/migrations/2016_10_22_075804_changes_for_v410.php +++ b/database/migrations/2016_10_22_075804_changes_for_v410.php @@ -24,7 +24,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class ChangesForV410. * diff --git a/database/migrations/2016_11_24_210552_changes_for_v420.php b/database/migrations/2016_11_24_210552_changes_for_v420.php index 21d2d34410..5e924a06c0 100644 --- a/database/migrations/2016_11_24_210552_changes_for_v420.php +++ b/database/migrations/2016_11_24_210552_changes_for_v420.php @@ -24,7 +24,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class ChangesForV420. * diff --git a/database/migrations/2016_12_22_150431_changes_for_v430.php b/database/migrations/2016_12_22_150431_changes_for_v430.php index a4ee8dd1e6..be5ccbcdd7 100644 --- a/database/migrations/2016_12_22_150431_changes_for_v430.php +++ b/database/migrations/2016_12_22_150431_changes_for_v430.php @@ -24,7 +24,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class ChangesForV430. * diff --git a/database/migrations/2016_12_28_203205_changes_for_v431.php b/database/migrations/2016_12_28_203205_changes_for_v431.php index 1243266588..cc1b97ad22 100644 --- a/database/migrations/2016_12_28_203205_changes_for_v431.php +++ b/database/migrations/2016_12_28_203205_changes_for_v431.php @@ -24,7 +24,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class ChangesForV431. * diff --git a/database/migrations/2017_04_13_163623_changes_for_v440.php b/database/migrations/2017_04_13_163623_changes_for_v440.php index 0232cc68fe..e648d5556e 100644 --- a/database/migrations/2017_04_13_163623_changes_for_v440.php +++ b/database/migrations/2017_04_13_163623_changes_for_v440.php @@ -24,7 +24,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class ChangesForV440. * diff --git a/database/migrations/2017_06_02_105232_changes_for_v450.php b/database/migrations/2017_06_02_105232_changes_for_v450.php index 8151926cc0..6b6d442d69 100644 --- a/database/migrations/2017_06_02_105232_changes_for_v450.php +++ b/database/migrations/2017_06_02_105232_changes_for_v450.php @@ -24,7 +24,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class ChangesForV450. * diff --git a/database/migrations/2017_08_20_062014_changes_for_v470.php b/database/migrations/2017_08_20_062014_changes_for_v470.php index ded20b566b..75513768c7 100644 --- a/database/migrations/2017_08_20_062014_changes_for_v470.php +++ b/database/migrations/2017_08_20_062014_changes_for_v470.php @@ -25,7 +25,6 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; - /** * Class ChangesForV470. * diff --git a/database/migrations/2017_11_04_170844_changes_for_v470a.php b/database/migrations/2017_11_04_170844_changes_for_v470a.php index 40c2aa3df0..aabfc65ce0 100644 --- a/database/migrations/2017_11_04_170844_changes_for_v470a.php +++ b/database/migrations/2017_11_04_170844_changes_for_v470a.php @@ -25,7 +25,6 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; - /** * Class ChangesForV470a. * diff --git a/database/migrations/2018_03_19_141348_changes_for_v472.php b/database/migrations/2018_03_19_141348_changes_for_v472.php index e1548f08a7..195e1a3e13 100644 --- a/database/migrations/2018_03_19_141348_changes_for_v472.php +++ b/database/migrations/2018_03_19_141348_changes_for_v472.php @@ -25,7 +25,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class ChangesForV472. * diff --git a/database/migrations/2018_04_29_174524_changes_for_v474.php b/database/migrations/2018_04_29_174524_changes_for_v474.php index a3415a224d..3fa6d66de5 100644 --- a/database/migrations/2018_04_29_174524_changes_for_v474.php +++ b/database/migrations/2018_04_29_174524_changes_for_v474.php @@ -23,7 +23,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; - +use Illuminate\Support\Facades\Schema; /** * Class ChangesForV474. * diff --git a/database/migrations/2018_06_08_200526_changes_for_v475.php b/database/migrations/2018_06_08_200526_changes_for_v475.php index d0b33bd88b..15cfbb4814 100644 --- a/database/migrations/2018_06_08_200526_changes_for_v475.php +++ b/database/migrations/2018_06_08_200526_changes_for_v475.php @@ -25,7 +25,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class ChangesForV475. * diff --git a/database/migrations/2018_09_05_195147_changes_for_v477.php b/database/migrations/2018_09_05_195147_changes_for_v477.php index 4a5c82b061..f1000768d4 100644 --- a/database/migrations/2018_09_05_195147_changes_for_v477.php +++ b/database/migrations/2018_09_05_195147_changes_for_v477.php @@ -25,7 +25,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class ChangesForV477. * diff --git a/database/migrations/2018_11_06_172532_changes_for_v479.php b/database/migrations/2018_11_06_172532_changes_for_v479.php index 4c74ffcb7b..1044fbfc92 100644 --- a/database/migrations/2018_11_06_172532_changes_for_v479.php +++ b/database/migrations/2018_11_06_172532_changes_for_v479.php @@ -25,7 +25,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class ChangesForV479. * diff --git a/database/migrations/2019_03_22_183214_changes_for_v480.php b/database/migrations/2019_03_22_183214_changes_for_v480.php index ec5d0fa0e4..bc2b762cab 100644 --- a/database/migrations/2019_03_22_183214_changes_for_v480.php +++ b/database/migrations/2019_03_22_183214_changes_for_v480.php @@ -25,7 +25,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class ChangesForV480. * diff --git a/database/migrations/2020_03_13_201950_changes_for_v520.php b/database/migrations/2020_03_13_201950_changes_for_v520.php index 3787265066..c1c5a70928 100644 --- a/database/migrations/2020_03_13_201950_changes_for_v520.php +++ b/database/migrations/2020_03_13_201950_changes_for_v520.php @@ -25,7 +25,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class ChangesForV520. * diff --git a/database/migrations/2020_06_07_063612_changes_for_v530.php b/database/migrations/2020_06_07_063612_changes_for_v530.php index 5992d70862..eb86afcf2b 100644 --- a/database/migrations/2020_06_07_063612_changes_for_v530.php +++ b/database/migrations/2020_06_07_063612_changes_for_v530.php @@ -25,7 +25,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; /** * Class ChangesForV530 * diff --git a/database/migrations/2024_11_05_062108_add_date_tz_columns.php b/database/migrations/2024_11_05_062108_add_date_tz_columns.php index 29f83076b3..07720fd6b6 100644 --- a/database/migrations/2024_11_05_062108_add_date_tz_columns.php +++ b/database/migrations/2024_11_05_062108_add_date_tz_columns.php @@ -26,7 +26,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; - +use Illuminate\Support\Facades\Schema; return new class () extends Migration { private array $tables; From e9844dc2f5d0bf6a78858b6f757029c48ea01cfa Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 24 May 2025 19:48:09 +0200 Subject: [PATCH 10/14] Fix #10353 --- app/Http/Controllers/ProfileController.php | 3 ++- config/app.php | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index b8645a31ec..02730d4dda 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -157,7 +157,8 @@ class ProfileController extends Controller if (0 === $count) { /** @var ClientRepository $repository */ $repository = app(ClientRepository::class); - $repository->createPersonalAccessClient(null, config('app.name').' Personal Access Client', 'http://localhost'); + $name = sprintf('%s Personal Access Grant Client',config('app.name')); + $repository->createPersonalAccessGrantClient($name, config('app.name').' Personal Access Grant Client', 'http://localhost'); } $accessToken = app('preferences')->get('access_token'); diff --git a/config/app.php b/config/app.php index 27be7859cc..a47b4d6c69 100644 --- a/config/app.php +++ b/config/app.php @@ -129,7 +129,11 @@ return [ AdminServiceProvider::class, RecurringServiceProvider::class, ], - 'aliases' => [], + 'aliases' => [ + 'Auth' => Illuminate\Support\Facades\Auth::class, + 'Route' => Illuminate\Support\Facades\Route::class, + 'Config' => Illuminate\Support\Facades\Config::class, + ], 'asset_url' => env('ASSET_URL', null), From 19e5fd6277e83097f632e042e28be37c881d65ad Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 25 May 2025 06:24:01 +0200 Subject: [PATCH 11/14] Back to passport 12 for the time being. --- app/Http/Controllers/ProfileController.php | 2 +- app/Providers/AppServiceProvider.php | 2 +- composer.json | 2 +- composer.lock | 235 +++++---------------- 4 files changed, 57 insertions(+), 184 deletions(-) diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 02730d4dda..31a3e20e2d 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -158,7 +158,7 @@ class ProfileController extends Controller /** @var ClientRepository $repository */ $repository = app(ClientRepository::class); $name = sprintf('%s Personal Access Grant Client',config('app.name')); - $repository->createPersonalAccessGrantClient($name, config('app.name').' Personal Access Grant Client', 'http://localhost'); + $repository->createPersonalAccessClient(null, $name, 'http://localhost'); } $accessToken = app('preferences')->get('access_token'); diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 7de4243aaf..169258cb36 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -41,7 +41,7 @@ class AppServiceProvider extends ServiceProvider public function boot(): void { Schema::defaultStringLength(191); - Passport::$clientUuids = false; + // Passport::$clientUuids = false; Response::macro('api', function (array $value) { $headers = [ 'Cache-Control' => 'no-store', diff --git a/composer.json b/composer.json index 00bc69782e..87e1ec158b 100644 --- a/composer.json +++ b/composer.json @@ -89,7 +89,7 @@ "jc5/recovery": "^2", "laravel-notification-channels/pushover": "^4.0", "laravel/framework": "^12", - "laravel/passport": "^13.0", + "laravel/passport": "^12.0", "laravel/sanctum": "^4.1", "laravel/slack-notification-channel": "^3.3", "laravel/ui": "^4.2", diff --git a/composer.lock b/composer.lock index a8bea46c45..877f084225 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6f1ffe4fde89e06daca72732fa904917", + "content-hash": "b630645d62adf0b4c2a9a16ccfc7a3cc", "packages": [ { "name": "bacon/bacon-qr-code", @@ -2094,44 +2094,43 @@ }, { "name": "laravel/passport", - "version": "v13.0.1", + "version": "v12.4.2", "source": { "type": "git", "url": "https://github.com/laravel/passport.git", - "reference": "d96323a1c3699efe51ca477c3dd8fdd6500d7997" + "reference": "65a885607b62d361aedaeb10a946bc6b5a954262" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/passport/zipball/d96323a1c3699efe51ca477c3dd8fdd6500d7997", - "reference": "d96323a1c3699efe51ca477c3dd8fdd6500d7997", + "url": "https://api.github.com/repos/laravel/passport/zipball/65a885607b62d361aedaeb10a946bc6b5a954262", + "reference": "65a885607b62d361aedaeb10a946bc6b5a954262", "shasum": "" }, "require": { "ext-json": "*", - "ext-openssl": "*", "firebase/php-jwt": "^6.4", - "illuminate/auth": "^11.35|^12.0", - "illuminate/console": "^11.35|^12.0", - "illuminate/container": "^11.35|^12.0", - "illuminate/contracts": "^11.35|^12.0", - "illuminate/cookie": "^11.35|^12.0", - "illuminate/database": "^11.35|^12.0", - "illuminate/encryption": "^11.35|^12.0", - "illuminate/http": "^11.35|^12.0", - "illuminate/support": "^11.35|^12.0", - "league/oauth2-server": "^9.2", - "php": "^8.2", - "php-http/discovery": "^1.20", - "phpseclib/phpseclib": "^3.0", - "psr/http-factory-implementation": "*", - "symfony/console": "^7.1", - "symfony/psr-http-message-bridge": "^7.1" + "illuminate/auth": "^9.21|^10.0|^11.0|^12.0", + "illuminate/console": "^9.21|^10.0|^11.0|^12.0", + "illuminate/container": "^9.21|^10.0|^11.0|^12.0", + "illuminate/contracts": "^9.21|^10.0|^11.0|^12.0", + "illuminate/cookie": "^9.21|^10.0|^11.0|^12.0", + "illuminate/database": "^9.21|^10.0|^11.0|^12.0", + "illuminate/encryption": "^9.21|^10.0|^11.0|^12.0", + "illuminate/http": "^9.21|^10.0|^11.0|^12.0", + "illuminate/support": "^9.21|^10.0|^11.0|^12.0", + "lcobucci/jwt": "^4.3|^5.0", + "league/oauth2-server": "^8.5.3", + "nyholm/psr7": "^1.5", + "php": "^8.0", + "phpseclib/phpseclib": "^2.0|^3.0", + "symfony/console": "^6.0|^7.0", + "symfony/psr-http-message-bridge": "^2.1|^6.0|^7.0" }, "require-dev": { - "mockery/mockery": "^1.6", - "orchestra/testbench": "^9.9|^10.0", - "phpstan/phpstan": "^2.0", - "phpunit/phpunit": "^11.5|^12.0" + "mockery/mockery": "^1.0", + "orchestra/testbench": "^7.35|^8.14|^9.0|^10.0", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.3|^10.5|^11.5" }, "type": "library", "extra": { @@ -2167,7 +2166,7 @@ "issues": "https://github.com/laravel/passport/issues", "source": "https://github.com/laravel/passport" }, - "time": "2025-05-07T17:16:06+00:00" + "time": "2025-02-12T16:11:33+00:00" }, { "name": "laravel/prompts", @@ -2900,34 +2899,29 @@ }, { "name": "league/event", - "version": "3.0.3", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/thephpleague/event.git", - "reference": "ec38ff7ea10cad7d99a79ac937fbcffb9334c210" + "reference": "062ebb450efbe9a09bc2478e89b7c933875b0935" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/event/zipball/ec38ff7ea10cad7d99a79ac937fbcffb9334c210", - "reference": "ec38ff7ea10cad7d99a79ac937fbcffb9334c210", + "url": "https://api.github.com/repos/thephpleague/event/zipball/062ebb450efbe9a09bc2478e89b7c933875b0935", + "reference": "062ebb450efbe9a09bc2478e89b7c933875b0935", "shasum": "" }, "require": { - "php": ">=7.2.0", - "psr/event-dispatcher": "^1.0" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0" + "php": ">=7.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16", - "phpstan/phpstan": "^0.12.45", - "phpunit/phpunit": "^8.5" + "henrikbjorn/phpspec-code-coverage": "~1.0.1", + "phpspec/phpspec": "^2.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "2.2-dev" } }, "autoload": { @@ -2953,9 +2947,9 @@ ], "support": { "issues": "https://github.com/thephpleague/event/issues", - "source": "https://github.com/thephpleague/event/tree/3.0.3" + "source": "https://github.com/thephpleague/event/tree/2.3.0" }, - "time": "2024-09-04T16:06:53+00:00" + "time": "2025-03-14T19:51:10+00:00" }, { "name": "league/flysystem", @@ -3217,46 +3211,38 @@ }, { "name": "league/oauth2-server", - "version": "9.2.0", + "version": "8.5.5", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth2-server.git", - "reference": "00323013403e1a1e0f424affafca56c28b60c22c" + "reference": "cc8778350f905667e796b3c2364a9d3bd7a73518" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/00323013403e1a1e0f424affafca56c28b60c22c", - "reference": "00323013403e1a1e0f424affafca56c28b60c22c", + "url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/cc8778350f905667e796b3c2364a9d3bd7a73518", + "reference": "cc8778350f905667e796b3c2364a9d3bd7a73518", "shasum": "" }, "require": { - "defuse/php-encryption": "^2.4", - "ext-json": "*", + "defuse/php-encryption": "^2.3", "ext-openssl": "*", - "lcobucci/clock": "^2.3 || ^3.0", - "lcobucci/jwt": "^5.0", - "league/event": "^3.0", - "league/uri": "^7.0", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", - "psr/http-message": "^2.0", - "psr/http-server-middleware": "^1.0" + "lcobucci/clock": "^2.2 || ^3.0", + "lcobucci/jwt": "^4.3 || ^5.0", + "league/event": "^2.2", + "league/uri": "^6.7 || ^7.0", + "php": "^8.0", + "psr/http-message": "^1.0.1 || ^2.0" }, "replace": { "league/oauth2server": "*", "lncd/oauth2": "*" }, "require-dev": { - "laminas/laminas-diactoros": "^3.5", - "php-parallel-lint/php-parallel-lint": "^1.3.2", - "phpstan/extension-installer": "^1.3.1", - "phpstan/phpstan": "^1.12", - "phpstan/phpstan-deprecation-rules": "^1.1.4", - "phpstan/phpstan-phpunit": "^1.3.15", - "phpstan/phpstan-strict-rules": "^1.5.2", - "phpunit/phpunit": "^9.6.21", - "roave/security-advisories": "dev-master", - "slevomat/coding-standard": "^8.14.1", - "squizlabs/php_codesniffer": "^3.8" + "laminas/laminas-diactoros": "^3.0.0", + "phpstan/phpstan": "^0.12.57", + "phpstan/phpstan-phpunit": "^0.12.16", + "phpunit/phpunit": "^9.6.6", + "roave/security-advisories": "dev-master" }, "type": "library", "autoload": { @@ -3301,7 +3287,7 @@ ], "support": { "issues": "https://github.com/thephpleague/oauth2-server/issues", - "source": "https://github.com/thephpleague/oauth2-server/tree/9.2.0" + "source": "https://github.com/thephpleague/oauth2-server/tree/8.5.5" }, "funding": [ { @@ -3309,7 +3295,7 @@ "type": "github" } ], - "time": "2025-02-15T00:49:10+00:00" + "time": "2024-12-20T23:06:10+00:00" }, { "name": "league/uri", @@ -5538,119 +5524,6 @@ }, "time": "2023-04-04T09:54:51+00:00" }, - { - "name": "psr/http-server-handler", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-server-handler.git", - "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/84c4fb66179be4caaf8e97bd239203245302e7d4", - "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Server\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP server-side request handler", - "keywords": [ - "handler", - "http", - "http-interop", - "psr", - "psr-15", - "psr-7", - "request", - "response", - "server" - ], - "support": { - "source": "https://github.com/php-fig/http-server-handler/tree/1.0.2" - }, - "time": "2023-04-10T20:06:20+00:00" - }, - { - "name": "psr/http-server-middleware", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-server-middleware.git", - "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/c1481f747daaa6a0782775cd6a8c26a1bf4a3829", - "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "psr/http-message": "^1.0 || ^2.0", - "psr/http-server-handler": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Server\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP server-side middleware", - "keywords": [ - "http", - "http-interop", - "middleware", - "psr", - "psr-15", - "psr-7", - "request", - "response" - ], - "support": { - "issues": "https://github.com/php-fig/http-server-middleware/issues", - "source": "https://github.com/php-fig/http-server-middleware/tree/1.0.2" - }, - "time": "2023-04-11T06:14:47+00:00" - }, { "name": "psr/log", "version": "3.0.2", From 5a3240f69d6a55e2c8e66d1c145c5e87adcf9d13 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 25 May 2025 06:27:05 +0200 Subject: [PATCH 12/14] Update changelog. --- changelog.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/changelog.md b/changelog.md index d045b0d2cc..cc65c3c3be 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## 6.2.14 - 2025-05-26 + +### Fixed + +- #10356 +- #10357 + ## 6.2.13 - 2025-05-25 ### Fixed From 39914e238018f7f508bde4a82893b00b15ef8c89 Mon Sep 17 00:00:00 2001 From: JC5 Date: Sun, 25 May 2025 06:36:22 +0200 Subject: [PATCH 13/14] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-05-25?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Models/RuleGroup/TriggerController.php | 3 +- .../TransactionLinkType/UpdateController.php | 2 +- .../Controllers/Summary/BasicController.php | 5 +- app/Api/V1/Middleware/ApiDemoUser.php | 3 +- .../Requests/Data/Bulk/TransactionRequest.php | 3 +- .../V1/Requests/Models/Bill/StoreRequest.php | 6 +- .../Controllers/Summary/BasicController.php | 3 +- .../Model/Transaction/UpdateRequest.php | 7 +- app/Api/V2/Response/Sum/AutoSum.php | 3 +- app/Http/Controllers/DebugController.php | 6 +- app/Http/Controllers/HomeController.php | 3 +- .../Controllers/Json/FrontpageController.php | 3 +- .../Controllers/Json/ReconcileController.php | 5 +- app/Http/Controllers/Json/RuleController.php | 5 +- .../Controllers/PreferencesController.php | 3 +- app/Http/Controllers/ProfileController.php | 5 +- .../Controllers/Report/AccountController.php | 3 +- .../Controllers/Report/BalanceController.php | 3 +- .../Controllers/Report/BillController.php | 3 +- .../Controllers/Report/BudgetController.php | 7 +- .../Controllers/Report/CategoryController.php | 15 +- .../Controllers/Report/DoubleController.php | 9 +- .../Report/OperationsController.php | 7 +- app/Http/Controllers/Report/TagController.php | 9 +- app/Http/Controllers/Rule/EditController.php | 3 +- .../Controllers/Rule/SelectController.php | 5 +- .../RuleGroup/ExecutionController.php | 3 +- app/Http/Controllers/SearchController.php | 3 +- .../Controllers/System/InstallController.php | 2 +- .../Transaction/ConvertController.php | 6 +- .../Transaction/MassController.php | 3 +- app/Http/Middleware/Authenticate.php | 3 +- app/Http/Middleware/Binder.php | 3 +- app/Http/Middleware/InstallationId.php | 3 +- app/Http/Middleware/Installer.php | 3 +- app/Http/Middleware/InterestingMessage.php | 3 +- app/Http/Middleware/IsAdmin.php | 3 +- app/Http/Middleware/IsDemoUser.php | 3 +- app/Http/Middleware/Range.php | 3 +- .../Middleware/RedirectIfAuthenticated.php | 3 +- app/Http/Middleware/SecureHeaders.php | 6 +- app/Http/Middleware/StartFireflySession.php | 3 +- app/Http/Middleware/TrustHosts.php | 3 +- app/Http/Requests/ReportFormRequest.php | 4 +- changelog.md | 4 +- config/app.php | 13 +- config/firefly.php | 2 +- config/session.php | 2 +- .../2016_06_16_000001_create_users_table.php | 1 + .../2016_06_16_000002_create_main_tables.php | 1 + .../2016_08_25_091522_changes_for_3101.php | 2 +- .../2016_09_12_121359_fix_nullables.php | 1 + ...10_09_150037_expand_transactions_table.php | 1 + .../2016_10_22_075804_changes_for_v410.php | 1 + .../2016_11_24_210552_changes_for_v420.php | 1 + .../2016_12_22_150431_changes_for_v430.php | 1 + .../2016_12_28_203205_changes_for_v431.php | 1 + .../2017_04_13_163623_changes_for_v440.php | 1 + .../2017_06_02_105232_changes_for_v450.php | 1 + .../2017_08_20_062014_changes_for_v470.php | 1 + .../2017_11_04_170844_changes_for_v470a.php | 1 + .../2018_03_19_141348_changes_for_v472.php | 1 + .../2018_04_29_174524_changes_for_v474.php | 2 +- .../2018_06_08_200526_changes_for_v475.php | 1 + .../2018_09_05_195147_changes_for_v477.php | 1 + .../2018_11_06_172532_changes_for_v479.php | 1 + .../2019_03_22_183214_changes_for_v480.php | 1 + .../2020_03_13_201950_changes_for_v520.php | 1 + .../2020_06_07_063612_changes_for_v530.php | 1 + .../2024_11_05_062108_add_date_tz_columns.php | 1 + package-lock.json | 166 +++++++++--------- routes/api-noauth.php | 1 - routes/channels.php | 1 + routes/web.php | 1 - 74 files changed, 192 insertions(+), 211 deletions(-) diff --git a/app/Api/V1/Controllers/Models/RuleGroup/TriggerController.php b/app/Api/V1/Controllers/Models/RuleGroup/TriggerController.php index 4a4ef9eb69..14c480577a 100644 --- a/app/Api/V1/Controllers/Models/RuleGroup/TriggerController.php +++ b/app/Api/V1/Controllers/Models/RuleGroup/TriggerController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\RuleGroup; -use Exception; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\RuleGroup\TestRequest; use FireflyIII\Api\V1\Requests\Models\RuleGroup\TriggerRequest; @@ -129,7 +128,7 @@ class TriggerController extends Controller * * Execute the given rule group on a set of existing transactions. * - * @throws Exception + * @throws \Exception */ public function triggerGroup(TriggerRequest $request, RuleGroup $group): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php index a530836684..9d392ab805 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php @@ -23,8 +23,8 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLinkType; -use Illuminate\Support\Facades\Validator; +use Illuminate\Support\Facades\Validator; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\TransactionLinkType\UpdateRequest; use FireflyIII\Exceptions\FireflyException; diff --git a/app/Api/V1/Controllers/Summary/BasicController.php b/app/Api/V1/Controllers/Summary/BasicController.php index 1878812a27..2b36ee7775 100644 --- a/app/Api/V1/Controllers/Summary/BasicController.php +++ b/app/Api/V1/Controllers/Summary/BasicController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Summary; -use Exception; use Carbon\Carbon; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Data\DateRequest; @@ -92,7 +91,7 @@ class BasicController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/summary/getBasicSummary * - * @throws Exception + * @throws \Exception */ public function basic(DateRequest $request): JsonResponse { @@ -468,7 +467,7 @@ class BasicController extends Controller } /** - * @throws Exception + * @throws \Exception */ private function getLeftToSpendInfo(Carbon $start, Carbon $end): array { diff --git a/app/Api/V1/Middleware/ApiDemoUser.php b/app/Api/V1/Middleware/ApiDemoUser.php index cd85e94879..e031bfa039 100644 --- a/app/Api/V1/Middleware/ApiDemoUser.php +++ b/app/Api/V1/Middleware/ApiDemoUser.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Middleware; -use Closure; use FireflyIII\User; use Illuminate\Http\Request; @@ -37,7 +36,7 @@ class ApiDemoUser * * @return mixed */ - public function handle(Request $request, Closure $next) + public function handle(Request $request, \Closure $next) { /** @var null|User $user */ $user = $request->user(); diff --git a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php index da2bfb3d7c..b9319e0240 100644 --- a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php +++ b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Data\Bulk; -use JsonException; use FireflyIII\Enums\ClauseType; use FireflyIII\Rules\IsValidBulkClause; use FireflyIII\Support\Request\ChecksLogin; @@ -53,7 +52,7 @@ class TransactionRequest extends FormRequest $data = [ 'query' => json_decode($this->get('query'), true, 8, JSON_THROW_ON_ERROR), ]; - } catch (JsonException $e) { + } catch (\JsonException $e) { // dont really care. the validation should catch invalid json. app('log')->error($e->getMessage()); } diff --git a/app/Api/V1/Requests/Models/Bill/StoreRequest.php b/app/Api/V1/Requests/Models/Bill/StoreRequest.php index e773942ca3..40194a33f4 100644 --- a/app/Api/V1/Requests/Models/Bill/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Bill/StoreRequest.php @@ -24,8 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Bill; -use ValueError; -use TypeError; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; @@ -111,7 +109,7 @@ class StoreRequest extends FormRequest try { $result = bccomp($min, $max); - } catch (ValueError $e) { + } catch (\ValueError $e) { Log::error($e->getMessage()); $validator->errors()->add('amount_min', (string) trans('validation.generic_invalid')); $validator->errors()->add('amount_max', (string) trans('validation.generic_invalid')); @@ -126,7 +124,7 @@ class StoreRequest extends FormRequest try { $failed = $validator->fails(); - } catch (TypeError $e) { + } catch (\TypeError $e) { Log::error($e->getMessage()); $failed = false; } diff --git a/app/Api/V2/Controllers/Summary/BasicController.php b/app/Api/V2/Controllers/Summary/BasicController.php index feb3798cef..e9402880d2 100644 --- a/app/Api/V2/Controllers/Summary/BasicController.php +++ b/app/Api/V2/Controllers/Summary/BasicController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V2\Controllers\Summary; -use Exception; use Carbon\Carbon; use FireflyIII\Api\V2\Controllers\Controller; use FireflyIII\Api\V2\Request\Generic\DateRequest; @@ -93,7 +92,7 @@ class BasicController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/summary/getBasicSummary * - * @throws Exception + * @throws \Exception * * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ diff --git a/app/Api/V2/Request/Model/Transaction/UpdateRequest.php b/app/Api/V2/Request/Model/Transaction/UpdateRequest.php index 3aeda0e3c3..c4d8140c79 100644 --- a/app/Api/V2/Request/Model/Transaction/UpdateRequest.php +++ b/app/Api/V2/Request/Model/Transaction/UpdateRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V2\Request\Model\Transaction; -use Override; use FireflyIII\Api\V1\Requests\Models\AvailableBudget\Request; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionGroup; @@ -65,7 +64,7 @@ class UpdateRequest extends Request * * @throws FireflyException */ - #[Override] + #[\Override] public function getAll(): array { app('log')->debug(sprintf('Now in %s', __METHOD__)); @@ -249,7 +248,7 @@ class UpdateRequest extends Request /** * The rules that the incoming request must be matched against. */ - #[Override] + #[\Override] public function rules(): array { app('log')->debug(sprintf('Now in %s', __METHOD__)); @@ -333,7 +332,7 @@ class UpdateRequest extends Request /** * Configure the validator instance. */ - #[Override] + #[\Override] public function withValidator(Validator $validator): void { app('log')->debug('Now in withValidator'); diff --git a/app/Api/V2/Response/Sum/AutoSum.php b/app/Api/V2/Response/Sum/AutoSum.php index 0f1d601f7c..c4ca249fbb 100644 --- a/app/Api/V2/Response/Sum/AutoSum.php +++ b/app/Api/V2/Response/Sum/AutoSum.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V2\Response\Sum; -use Closure; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionCurrency; use Illuminate\Database\Eloquent\Model; @@ -40,7 +39,7 @@ class AutoSum /** * @throws FireflyException */ - public function autoSum(Collection $objects, Closure $getCurrency, Closure $getSum): array + public function autoSum(Collection $objects, \Closure $getCurrency, \Closure $getSum): array { $return = []; diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.php index dd570b63a9..761070bd46 100644 --- a/app/Http/Controllers/DebugController.php +++ b/app/Http/Controllers/DebugController.php @@ -111,7 +111,7 @@ class DebugController extends Controller try { Artisan::call('twig:clean'); - } catch (Exception $e) { // intentional generic exception + } catch (\Exception $e) { // intentional generic exception throw new FireflyException($e->getMessage(), 0, $e); } @@ -203,7 +203,7 @@ class DebugController extends Controller $return['build'] = trim((string) file_get_contents('/var/www/counter-main.txt')); app('log')->debug(sprintf('build is now "%s"', $return['build'])); } - } catch (Exception $e) { + } catch (\Exception $e) { app('log')->debug('Could not check build counter, but thats ok.'); app('log')->warning($e->getMessage()); } @@ -212,7 +212,7 @@ class DebugController extends Controller if (file_exists('/var/www/build-date-main.txt')) { $return['build_date'] = trim((string) file_get_contents('/var/www/build-date-main.txt')); } - } catch (Exception $e) { + } catch (\Exception $e) { app('log')->debug('Could not check build date, but thats ok.'); app('log')->warning($e->getMessage()); } diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index b829724308..4f300d8924 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; -use Exception; use Carbon\Carbon; use Carbon\Exceptions\InvalidFormatException; use FireflyIII\Enums\AccountTypeEnum; @@ -58,7 +57,7 @@ class HomeController extends Controller /** * Change index date range. * - * @throws Exception + * @throws \Exception */ public function dateRange(Request $request): JsonResponse { diff --git a/app/Http/Controllers/Json/FrontpageController.php b/app/Http/Controllers/Json/FrontpageController.php index f508c66763..08ed98cd53 100644 --- a/app/Http/Controllers/Json/FrontpageController.php +++ b/app/Http/Controllers/Json/FrontpageController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; -use Throwable; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\PiggyBank; @@ -90,7 +89,7 @@ class FrontpageController extends Controller if (0 !== count($info)) { try { $html = view('json.piggy-banks', compact('info', 'convertToNative', 'native'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Cannot render json.piggy-banks: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $html = 'Could not render view.'; diff --git a/app/Http/Controllers/Json/ReconcileController.php b/app/Http/Controllers/Json/ReconcileController.php index db7642cfe8..f2122dc310 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; @@ -131,7 +130,7 @@ class ReconcileController extends Controller try { $view = view('accounts.reconcile.overview', compact('account', 'start', 'diffCompare', 'difference', 'end', 'clearedAmount', 'startBalance', 'endBalance', 'amount', 'route', 'countCleared', 'reconSum', 'selectedIds'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->debug(sprintf('View error: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $view = sprintf('Could not render accounts.reconcile.overview: %s', $e->getMessage()); @@ -229,7 +228,7 @@ class ReconcileController extends Controller 'accounts.reconcile.transactions', compact('account', 'journals', 'currency', 'start', 'end', 'selectionStart', 'selectionEnd') )->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->debug(sprintf('Could not render: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $html = sprintf('Could not render accounts.reconcile.transactions: %s', $e->getMessage()); diff --git a/app/Http/Controllers/Json/RuleController.php b/app/Http/Controllers/Json/RuleController.php index a555015150..c91fb1c1e3 100644 --- a/app/Http/Controllers/Json/RuleController.php +++ b/app/Http/Controllers/Json/RuleController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; -use Throwable; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use Illuminate\Http\JsonResponse; @@ -51,7 +50,7 @@ class RuleController extends Controller try { $view = view('rules.partials.action', compact('actions', 'count'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Cannot render rules.partials.action: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $view = 'Could not render view.'; @@ -81,7 +80,7 @@ class RuleController extends Controller try { $view = view('rules.partials.trigger', compact('triggers', 'count'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Cannot render rules.partials.trigger: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $view = 'Could not render view.'; diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index 3031037624..4f2526083c 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; -use JsonException; use Carbon\Carbon; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Events\Preferences\UserGroupChangedDefaultCurrency; @@ -156,7 +155,7 @@ class PreferencesController extends Controller try { $locales = json_decode((string) file_get_contents(resource_path(sprintf('locales/%s/locales.json', $language))), true, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $e) { + } catch (\JsonException $e) { app('log')->error($e->getMessage()); $locales = []; } diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 31a3e20e2d..031b09a785 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -25,7 +25,6 @@ namespace FireflyIII\Http\Controllers; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; -use Exception; use FireflyIII\Events\UserChangedEmail; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\ValidationException; @@ -157,7 +156,7 @@ class ProfileController extends Controller if (0 === $count) { /** @var ClientRepository $repository */ $repository = app(ClientRepository::class); - $name = sprintf('%s Personal Access Grant Client',config('app.name')); + $name = sprintf('%s Personal Access Grant Client', config('app.name')); $repository->createPersonalAccessClient(null, $name, 'http://localhost'); } @@ -363,7 +362,7 @@ class ProfileController extends Controller * * @return Redirector|RedirectResponse * - * @throws Exception + * @throws \Exception */ public function regenerate(Request $request) { diff --git a/app/Http/Controllers/Report/AccountController.php b/app/Http/Controllers/Report/AccountController.php index dcd9464ce3..d99ec61237 100644 --- a/app/Http/Controllers/Report/AccountController.php +++ b/app/Http/Controllers/Report/AccountController.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; @@ -59,7 +58,7 @@ class AccountController extends Controller try { $result = view('reports.partials.accounts', compact('accountReport'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.accounts: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $result = 'Could not render view.'; diff --git a/app/Http/Controllers/Report/BalanceController.php b/app/Http/Controllers/Report/BalanceController.php index 41b3010a4a..914f12061c 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; @@ -141,7 +140,7 @@ class BalanceController extends Controller try { $result = view('reports.partials.balance', compact('report'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.balance: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $result = 'Could not render view.'; diff --git a/app/Http/Controllers/Report/BillController.php b/app/Http/Controllers/Report/BillController.php index 1fd70e3c48..afbb68362c 100644 --- a/app/Http/Controllers/Report/BillController.php +++ b/app/Http/Controllers/Report/BillController.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\Helpers\Report\ReportHelperInterface; @@ -59,7 +58,7 @@ class BillController extends Controller try { $result = view('reports.partials.bills', compact('report'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budgets: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $result = 'Could not render view.'; diff --git a/app/Http/Controllers/Report/BudgetController.php b/app/Http/Controllers/Report/BudgetController.php index f24dd2b551..67c316891d 100644 --- a/app/Http/Controllers/Report/BudgetController.php +++ b/app/Http/Controllers/Report/BudgetController.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; @@ -177,7 +176,7 @@ class BudgetController extends Controller try { $result = view('reports.budget.partials.avg-expenses', compact('result'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); app('log')->error($e->getTraceAsString()); @@ -327,7 +326,7 @@ class BudgetController extends Controller try { $result = view('reports.partials.budget-period', compact('report', 'periods'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $result = 'Could not render view.'; @@ -378,7 +377,7 @@ class BudgetController extends Controller try { $result = view('reports.budget.partials.top-expenses', compact('result'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); diff --git a/app/Http/Controllers/Report/CategoryController.php b/app/Http/Controllers/Report/CategoryController.php index fc8d17421a..0168fdd75e 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; @@ -296,7 +295,7 @@ class CategoryController extends Controller try { $result = view('reports.category.partials.avg-expenses', compact('result'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -346,7 +345,7 @@ class CategoryController extends Controller try { $result = view('reports.category.partials.avg-income', compact('result'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -528,7 +527,7 @@ class CategoryController extends Controller try { $result = view('reports.partials.category-period', compact('report', 'periods'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render category::expenses: %s', $e->getMessage())); $result = sprintf('An error prevented Firefly III from rendering: %s. Apologies.', $e->getMessage()); @@ -600,7 +599,7 @@ class CategoryController extends Controller try { $result = view('reports.partials.category-period', compact('report', 'periods'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render category::expenses: %s', $e->getMessage())); $result = sprintf('An error prevented Firefly III from rendering: %s. Apologies.', $e->getMessage()); @@ -640,7 +639,7 @@ class CategoryController extends Controller try { $result = view('reports.partials.categories', compact('report'))->render(); $cache->store($result); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render category::expenses: %s', $e->getMessage())); $result = sprintf('An error prevented Firefly III from rendering: %s. Apologies.', $e->getMessage()); @@ -688,7 +687,7 @@ class CategoryController extends Controller try { $result = view('reports.category.partials.top-expenses', compact('result'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->debug(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -736,7 +735,7 @@ class CategoryController extends Controller try { $result = view('reports.category.partials.top-income', compact('result'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->debug(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); diff --git a/app/Http/Controllers/Report/DoubleController.php b/app/Http/Controllers/Report/DoubleController.php index 32a1736844..79d9d5fc1e 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; @@ -103,7 +102,7 @@ class DoubleController extends Controller try { $result = view('reports.double.partials.avg-expenses', compact('result'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -153,7 +152,7 @@ class DoubleController extends Controller try { $result = view('reports.double.partials.avg-income', compact('result'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -430,7 +429,7 @@ class DoubleController extends Controller try { $result = view('reports.double.partials.top-expenses', compact('result'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -478,7 +477,7 @@ class DoubleController extends Controller try { $result = view('reports.double.partials.top-income', compact('result'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); diff --git a/app/Http/Controllers/Report/OperationsController.php b/app/Http/Controllers/Report/OperationsController.php index d2aaeaa3dd..de27b13d04 100644 --- a/app/Http/Controllers/Report/OperationsController.php +++ b/app/Http/Controllers/Report/OperationsController.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; @@ -79,7 +78,7 @@ class OperationsController extends Controller try { $result = view('reports.partials.income-expenses', compact('report', 'type'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.income-expense: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $result = 'Could not render view.'; @@ -113,7 +112,7 @@ class OperationsController extends Controller try { $result = view('reports.partials.income-expenses', compact('report', 'type'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.income-expenses: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $result = 'Could not render view.'; @@ -168,7 +167,7 @@ class OperationsController extends Controller try { $result = view('reports.partials.operations', compact('sums'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Could not render reports.partials.operations: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $result = 'Could not render view.'; diff --git a/app/Http/Controllers/Report/TagController.php b/app/Http/Controllers/Report/TagController.php index 22bca3fd99..0b8f8cde7b 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; @@ -293,7 +292,7 @@ class TagController extends Controller try { $result = view('reports.tag.partials.avg-expenses', compact('result'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->debug(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -343,7 +342,7 @@ class TagController extends Controller try { $result = view('reports.tag.partials.avg-income', compact('result'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->debug(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -491,7 +490,7 @@ class TagController extends Controller try { $result = view('reports.tag.partials.top-expenses', compact('result'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->debug(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); @@ -539,7 +538,7 @@ class TagController extends Controller try { $result = view('reports.tag.partials.top-income', compact('result'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->debug(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); diff --git a/app/Http/Controllers/Rule/EditController.php b/app/Http/Controllers/Rule/EditController.php index 848fa259a3..c6f50d48ec 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; @@ -178,7 +177,7 @@ class EditController extends Controller 'triggers' => $triggers, ] )->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { $message = sprintf('Throwable was thrown in getPreviousTriggers(): %s', $e->getMessage()); app('log')->debug($message); app('log')->error($e->getTraceAsString()); diff --git a/app/Http/Controllers/Rule/SelectController.php b/app/Http/Controllers/Rule/SelectController.php index 24c7dc0860..d6dae9d5fa 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 Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -175,7 +174,7 @@ class SelectController extends Controller try { $view = view('list.journals-array-tiny', ['groups' => $collection])->render(); - } catch (Throwable $exception) { + } catch (\Throwable $exception) { app('log')->error(sprintf('Could not render view in testTriggers(): %s', $exception->getMessage())); app('log')->error($exception->getTraceAsString()); $view = sprintf('Could not render list.journals-tiny: %s', $exception->getMessage()); @@ -217,7 +216,7 @@ class SelectController extends Controller try { $view = view('list.journals-array-tiny', ['groups' => $collection])->render(); - } catch (Throwable $exception) { + } catch (\Throwable $exception) { $message = sprintf('Could not render view in testTriggersByRule(): %s', $exception->getMessage()); app('log')->error($message); app('log')->error($exception->getTraceAsString()); diff --git a/app/Http/Controllers/RuleGroup/ExecutionController.php b/app/Http/Controllers/RuleGroup/ExecutionController.php index 40419e9656..542d38d0a7 100644 --- a/app/Http/Controllers/RuleGroup/ExecutionController.php +++ b/app/Http/Controllers/RuleGroup/ExecutionController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\RuleGroup; -use Exception; use Carbon\Carbon; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\SelectTransactionsRequest; @@ -65,7 +64,7 @@ class ExecutionController extends Controller /** * Execute the given rulegroup on a set of existing transactions. * - * @throws Exception + * @throws \Exception */ public function execute(SelectTransactionsRequest $request, RuleGroup $ruleGroup): RedirectResponse { diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index b30d1eefad..ceab9169c5 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; @@ -119,7 +118,7 @@ class SearchController extends Controller try { $html = view('search.search', compact('groups', 'hasPages', 'searchTime'))->render(); - } catch (Throwable $e) { + } catch (\Throwable $e) { app('log')->error(sprintf('Cannot render search.search: %s', $e->getMessage())); app('log')->error($e->getTraceAsString()); $html = 'Could not render view.'; diff --git a/app/Http/Controllers/System/InstallController.php b/app/Http/Controllers/System/InstallController.php index e2acfb680f..8f59b12f46 100644 --- a/app/Http/Controllers/System/InstallController.php +++ b/app/Http/Controllers/System/InstallController.php @@ -146,7 +146,7 @@ class InstallController extends Controller Artisan::call($command, $args); app('log')->debug(Artisan::output()); } - } catch (Exception $e) { // intentional generic exception + } catch (\Exception $e) { // intentional generic exception throw new FireflyException($e->getMessage(), 0, $e); } // clear cache as well. diff --git a/app/Http/Controllers/Transaction/ConvertController.php b/app/Http/Controllers/Transaction/ConvertController.php index d3b00a5738..929d46ede7 100644 --- a/app/Http/Controllers/Transaction/ConvertController.php +++ b/app/Http/Controllers/Transaction/ConvertController.php @@ -82,7 +82,7 @@ class ConvertController extends Controller * * @return Factory|Redirector|RedirectResponse|View * - * @throws Exception + * @throws \Exception */ public function index(TransactionType $destinationType, TransactionGroup $group) { @@ -214,7 +214,7 @@ class ConvertController extends Controller } /** - * @throws Exception + * @throws \Exception */ private function getLiabilities(): array { @@ -238,7 +238,7 @@ class ConvertController extends Controller } /** - * @throws Exception + * @throws \Exception */ private function getAssetAccounts(): array { diff --git a/app/Http/Controllers/Transaction/MassController.php b/app/Http/Controllers/Transaction/MassController.php index bac580dc76..aa44005821 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; @@ -232,7 +231,7 @@ class MassController extends Controller try { $carbon = Carbon::parse($value[$journalId]); - } catch (InvalidArgumentException $e) { + } catch (\InvalidArgumentException $e) { Log::warning(sprintf('Could not parse "%s" but dont mind', $value[$journalId])); Log::warning($e->getMessage()); diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 7f11d50cba..a4de77717e 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Closure; use FireflyIII\Exceptions\FireflyException; use FireflyIII\User; use Illuminate\Auth\AuthenticationException; @@ -57,7 +56,7 @@ class Authenticate * @throws FireflyException * @throws AuthenticationException */ - public function handle($request, Closure $next, ...$guards) + public function handle($request, \Closure $next, ...$guards) { $this->authenticate($request, $guards); diff --git a/app/Http/Middleware/Binder.php b/app/Http/Middleware/Binder.php index 7b03830ba5..9f4413a06d 100644 --- a/app/Http/Middleware/Binder.php +++ b/app/Http/Middleware/Binder.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Closure; use FireflyIII\Support\Domain; use Illuminate\Contracts\Auth\Factory as Auth; use Illuminate\Http\Request; @@ -64,7 +63,7 @@ class Binder * * @return mixed */ - public function handle($request, Closure $next) + public function handle($request, \Closure $next) { foreach ($request->route()->parameters() as $key => $value) { if (array_key_exists($key, $this->binders)) { diff --git a/app/Http/Middleware/InstallationId.php b/app/Http/Middleware/InstallationId.php index 6c8aff7dab..79ac8daedc 100644 --- a/app/Http/Middleware/InstallationId.php +++ b/app/Http/Middleware/InstallationId.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Closure; use FireflyIII\Support\System\GeneratesInstallationId; use Illuminate\Http\Request; @@ -42,7 +41,7 @@ class InstallationId * * @return mixed */ - public function handle($request, Closure $next) + public function handle($request, \Closure $next) { $this->generateInstallationId(); diff --git a/app/Http/Middleware/Installer.php b/app/Http/Middleware/Installer.php index f7d38232ca..1954f226bd 100644 --- a/app/Http/Middleware/Installer.php +++ b/app/Http/Middleware/Installer.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Closure; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Support\System\OAuthKeys; use Illuminate\Database\QueryException; @@ -46,7 +45,7 @@ class Installer * * @throws FireflyException */ - public function handle($request, Closure $next) + public function handle($request, \Closure $next) { // Log::debug(sprintf('Installer middleware for URL %s', $request->url())); // ignore installer in test environment. diff --git a/app/Http/Middleware/InterestingMessage.php b/app/Http/Middleware/InterestingMessage.php index 30c9b65e68..49e013d5ed 100644 --- a/app/Http/Middleware/InterestingMessage.php +++ b/app/Http/Middleware/InterestingMessage.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Closure; use FireflyIII\Models\Account; use FireflyIII\Models\Bill; use FireflyIII\Models\GroupMembership; @@ -46,7 +45,7 @@ class InterestingMessage * * @return mixed */ - public function handle(Request $request, Closure $next) + public function handle(Request $request, \Closure $next) { if ($this->testing()) { return $next($request); diff --git a/app/Http/Middleware/IsAdmin.php b/app/Http/Middleware/IsAdmin.php index 2412e607b7..c992713911 100644 --- a/app/Http/Middleware/IsAdmin.php +++ b/app/Http/Middleware/IsAdmin.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Closure; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Http\Request; @@ -41,7 +40,7 @@ class IsAdmin * * @return mixed */ - public function handle(Request $request, Closure $next, $guard = null) + public function handle(Request $request, \Closure $next, $guard = null) { if (Auth::guard($guard)->guest()) { if ($request->ajax()) { diff --git a/app/Http/Middleware/IsDemoUser.php b/app/Http/Middleware/IsDemoUser.php index e792003b9a..c984e947a5 100644 --- a/app/Http/Middleware/IsDemoUser.php +++ b/app/Http/Middleware/IsDemoUser.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Closure; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Http\Request; @@ -38,7 +37,7 @@ class IsDemoUser * * @return mixed */ - public function handle(Request $request, Closure $next) + public function handle(Request $request, \Closure $next) { /** @var null|User $user */ $user = $request->user(); diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index 4699a454c0..d0e151d331 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Closure; use Illuminate\Support\Facades\App; use Carbon\Carbon; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; @@ -44,7 +43,7 @@ class Range * * @return mixed */ - public function handle(Request $request, Closure $next) + public function handle(Request $request, \Closure $next) { if (null !== $request->user()) { // set start, end and finish: diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index 01cda1a816..5bffbb7146 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Closure; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; @@ -40,7 +39,7 @@ class RedirectIfAuthenticated * * @return mixed */ - public function handle($request, Closure $next, $guard = null) + public function handle($request, \Closure $next, $guard = null) { if (Auth::guard($guard)->check()) { return response()->redirectTo(route('index')); diff --git a/app/Http/Middleware/SecureHeaders.php b/app/Http/Middleware/SecureHeaders.php index 5f8b104992..4ae071b11f 100644 --- a/app/Http/Middleware/SecureHeaders.php +++ b/app/Http/Middleware/SecureHeaders.php @@ -24,8 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Closure; -use Exception; use Barryvdh\Debugbar\Facades\Debugbar; use Illuminate\Http\Request; use Illuminate\Support\Facades\Vite; @@ -40,9 +38,9 @@ class SecureHeaders * * @return mixed * - * @throws Exception + * @throws \Exception */ - public function handle(Request $request, Closure $next) + public function handle(Request $request, \Closure $next) { // generate and share nonce. $nonce = base64_encode(random_bytes(16)); diff --git a/app/Http/Middleware/StartFireflySession.php b/app/Http/Middleware/StartFireflySession.php index 922bc3ad8c..03359f735a 100644 --- a/app/Http/Middleware/StartFireflySession.php +++ b/app/Http/Middleware/StartFireflySession.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Override; use Illuminate\Contracts\Session\Session; use Illuminate\Http\Request; use Illuminate\Session\Middleware\StartSession; @@ -38,7 +37,7 @@ class StartFireflySession extends StartSession * * @param Session $session */ - #[Override] + #[\Override] protected function storeCurrentUrl(Request $request, $session): void { $url = $request->fullUrl(); diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php index 4446201045..9dcd6a249a 100644 --- a/app/Http/Middleware/TrustHosts.php +++ b/app/Http/Middleware/TrustHosts.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Override; use Illuminate\Http\Middleware\TrustHosts as Middleware; class TrustHosts extends Middleware @@ -34,7 +33,7 @@ class TrustHosts extends Middleware * * @return array */ - #[Override] + #[\Override] public function hosts(): array { return [ diff --git a/app/Http/Requests/ReportFormRequest.php b/app/Http/Requests/ReportFormRequest.php index 8c5de287d4..bf7e4417bb 100644 --- a/app/Http/Requests/ReportFormRequest.php +++ b/app/Http/Requests/ReportFormRequest.php @@ -149,7 +149,7 @@ class ReportFormRequest extends FormRequest if (false !== $result && 0 !== $result) { try { $date = new Carbon($parts[1]); - } catch (Exception $e) { // intentional generic exception + } catch (\Exception $e) { // intentional generic exception $error = sprintf('"%s" is not a valid date range: %s', $range, $e->getMessage()); app('log')->error($error); app('log')->error($e->getTraceAsString()); @@ -187,7 +187,7 @@ class ReportFormRequest extends FormRequest if (false !== $result && 0 !== $result) { try { $date = new Carbon($parts[0]); - } catch (Exception $e) { // intentional generic exception + } catch (\Exception $e) { // intentional generic exception $error = sprintf('"%s" is not a valid date range: %s', $range, $e->getMessage()); app('log')->error($error); app('log')->error($e->getTraceAsString()); diff --git a/changelog.md b/changelog.md index cc65c3c3be..51372ea900 100644 --- a/changelog.md +++ b/changelog.md @@ -7,8 +7,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed -- #10356 -- #10357 +- [Issue 10356](https://github.com/firefly-iii/firefly-iii/issues/10356) (Call to undefined method createPersonalAccessClient()) reported by @JC5 +- [Issue 10357](https://github.com/firefly-iii/firefly-iii/issues/10357) (Target AuthorizationViewResponse is not instantiable) reported by @JC5 ## 6.2.13 - 2025-05-25 diff --git a/config/app.php b/config/app.php index a47b4d6c69..19ee0f9721 100644 --- a/config/app.php +++ b/config/app.php @@ -63,6 +63,9 @@ use Illuminate\Translation\TranslationServiceProvider; use Illuminate\Validation\ValidationServiceProvider; use Illuminate\View\ViewServiceProvider; use TwigBridge\ServiceProvider; +use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Config; +use Illuminate\Support\Facades\Route; return [ 'name' => envNonEmpty('APP_NAME', 'Firefly III'), @@ -130,12 +133,12 @@ return [ RecurringServiceProvider::class, ], 'aliases' => [ - 'Auth' => Illuminate\Support\Facades\Auth::class, - 'Route' => Illuminate\Support\Facades\Route::class, - 'Config' => Illuminate\Support\Facades\Config::class, + 'Auth' => Auth::class, + 'Route' => Route::class, + 'Config' => Config::class, ], - 'asset_url' => env('ASSET_URL', null), + 'asset_url' => env('ASSET_URL', null), /* |-------------------------------------------------------------------------- @@ -148,5 +151,5 @@ return [ | */ - 'faker_locale' => 'en_US', + 'faker_locale' => 'en_US', ]; diff --git a/config/firefly.php b/config/firefly.php index d53cd6cfdb..ee307938b0 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -78,7 +78,7 @@ return [ 'running_balance_column' => env('USE_RUNNING_BALANCE', false), // see cer.php for exchange rates feature flag. ], - 'version' => '6.2.13', + 'version' => 'develop/2025-05-25', 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 25, diff --git a/config/session.php b/config/session.php index 84df47ec36..8881108f8b 100644 --- a/config/session.php +++ b/config/session.php @@ -32,7 +32,7 @@ return [ 'table' => 'sessions', 'store' => null, 'lottery' => [2, 100], - 'cookie' => env('COOKIE_NAME','firefly_iii_session'), + 'cookie' => env('COOKIE_NAME', 'firefly_iii_session'), 'path' => env('COOKIE_PATH', '/'), 'domain' => env('COOKIE_DOMAIN', null), 'secure' => env('COOKIE_SECURE', null), diff --git a/database/migrations/2016_06_16_000001_create_users_table.php b/database/migrations/2016_06_16_000001_create_users_table.php index 51e60085bf..91384acbe8 100644 --- a/database/migrations/2016_06_16_000001_create_users_table.php +++ b/database/migrations/2016_06_16_000001_create_users_table.php @@ -25,6 +25,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class CreateUsersTable. * diff --git a/database/migrations/2016_06_16_000002_create_main_tables.php b/database/migrations/2016_06_16_000002_create_main_tables.php index f9bf3e9a88..9cf5f644b2 100644 --- a/database/migrations/2016_06_16_000002_create_main_tables.php +++ b/database/migrations/2016_06_16_000002_create_main_tables.php @@ -25,6 +25,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class CreateMainTables. * diff --git a/database/migrations/2016_08_25_091522_changes_for_3101.php b/database/migrations/2016_08_25_091522_changes_for_3101.php index d256767d45..ce78bf0dfe 100644 --- a/database/migrations/2016_08_25_091522_changes_for_3101.php +++ b/database/migrations/2016_08_25_091522_changes_for_3101.php @@ -22,7 +22,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; -use Illuminate\Support\Facades\Schema; + /** * Class ChangesFor3101. * diff --git a/database/migrations/2016_09_12_121359_fix_nullables.php b/database/migrations/2016_09_12_121359_fix_nullables.php index 46a56188ad..3a0fcb80b1 100644 --- a/database/migrations/2016_09_12_121359_fix_nullables.php +++ b/database/migrations/2016_09_12_121359_fix_nullables.php @@ -25,6 +25,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class FixNullables. * diff --git a/database/migrations/2016_10_09_150037_expand_transactions_table.php b/database/migrations/2016_10_09_150037_expand_transactions_table.php index 83fccf186a..74a29bbce6 100644 --- a/database/migrations/2016_10_09_150037_expand_transactions_table.php +++ b/database/migrations/2016_10_09_150037_expand_transactions_table.php @@ -25,6 +25,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class ExpandTransactionsTable. * diff --git a/database/migrations/2016_10_22_075804_changes_for_v410.php b/database/migrations/2016_10_22_075804_changes_for_v410.php index 80e228b53f..ebbd798df2 100644 --- a/database/migrations/2016_10_22_075804_changes_for_v410.php +++ b/database/migrations/2016_10_22_075804_changes_for_v410.php @@ -25,6 +25,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class ChangesForV410. * diff --git a/database/migrations/2016_11_24_210552_changes_for_v420.php b/database/migrations/2016_11_24_210552_changes_for_v420.php index 5e924a06c0..6a8c04e25e 100644 --- a/database/migrations/2016_11_24_210552_changes_for_v420.php +++ b/database/migrations/2016_11_24_210552_changes_for_v420.php @@ -25,6 +25,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class ChangesForV420. * diff --git a/database/migrations/2016_12_22_150431_changes_for_v430.php b/database/migrations/2016_12_22_150431_changes_for_v430.php index be5ccbcdd7..69283e38aa 100644 --- a/database/migrations/2016_12_22_150431_changes_for_v430.php +++ b/database/migrations/2016_12_22_150431_changes_for_v430.php @@ -25,6 +25,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class ChangesForV430. * diff --git a/database/migrations/2016_12_28_203205_changes_for_v431.php b/database/migrations/2016_12_28_203205_changes_for_v431.php index cc1b97ad22..d88847c25a 100644 --- a/database/migrations/2016_12_28_203205_changes_for_v431.php +++ b/database/migrations/2016_12_28_203205_changes_for_v431.php @@ -25,6 +25,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class ChangesForV431. * diff --git a/database/migrations/2017_04_13_163623_changes_for_v440.php b/database/migrations/2017_04_13_163623_changes_for_v440.php index e648d5556e..4ae7ceee15 100644 --- a/database/migrations/2017_04_13_163623_changes_for_v440.php +++ b/database/migrations/2017_04_13_163623_changes_for_v440.php @@ -25,6 +25,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class ChangesForV440. * diff --git a/database/migrations/2017_06_02_105232_changes_for_v450.php b/database/migrations/2017_06_02_105232_changes_for_v450.php index 6b6d442d69..efd01f0f1c 100644 --- a/database/migrations/2017_06_02_105232_changes_for_v450.php +++ b/database/migrations/2017_06_02_105232_changes_for_v450.php @@ -25,6 +25,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class ChangesForV450. * diff --git a/database/migrations/2017_08_20_062014_changes_for_v470.php b/database/migrations/2017_08_20_062014_changes_for_v470.php index 75513768c7..ded20b566b 100644 --- a/database/migrations/2017_08_20_062014_changes_for_v470.php +++ b/database/migrations/2017_08_20_062014_changes_for_v470.php @@ -25,6 +25,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class ChangesForV470. * diff --git a/database/migrations/2017_11_04_170844_changes_for_v470a.php b/database/migrations/2017_11_04_170844_changes_for_v470a.php index aabfc65ce0..40c2aa3df0 100644 --- a/database/migrations/2017_11_04_170844_changes_for_v470a.php +++ b/database/migrations/2017_11_04_170844_changes_for_v470a.php @@ -25,6 +25,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class ChangesForV470a. * diff --git a/database/migrations/2018_03_19_141348_changes_for_v472.php b/database/migrations/2018_03_19_141348_changes_for_v472.php index 195e1a3e13..1ec9d06ad1 100644 --- a/database/migrations/2018_03_19_141348_changes_for_v472.php +++ b/database/migrations/2018_03_19_141348_changes_for_v472.php @@ -26,6 +26,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class ChangesForV472. * diff --git a/database/migrations/2018_04_29_174524_changes_for_v474.php b/database/migrations/2018_04_29_174524_changes_for_v474.php index 3fa6d66de5..a3415a224d 100644 --- a/database/migrations/2018_04_29_174524_changes_for_v474.php +++ b/database/migrations/2018_04_29_174524_changes_for_v474.php @@ -23,7 +23,7 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; -use Illuminate\Support\Facades\Schema; + /** * Class ChangesForV474. * diff --git a/database/migrations/2018_06_08_200526_changes_for_v475.php b/database/migrations/2018_06_08_200526_changes_for_v475.php index 15cfbb4814..01bbf63fcf 100644 --- a/database/migrations/2018_06_08_200526_changes_for_v475.php +++ b/database/migrations/2018_06_08_200526_changes_for_v475.php @@ -26,6 +26,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class ChangesForV475. * diff --git a/database/migrations/2018_09_05_195147_changes_for_v477.php b/database/migrations/2018_09_05_195147_changes_for_v477.php index f1000768d4..6936d1e1e1 100644 --- a/database/migrations/2018_09_05_195147_changes_for_v477.php +++ b/database/migrations/2018_09_05_195147_changes_for_v477.php @@ -26,6 +26,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class ChangesForV477. * diff --git a/database/migrations/2018_11_06_172532_changes_for_v479.php b/database/migrations/2018_11_06_172532_changes_for_v479.php index 1044fbfc92..80562d03a0 100644 --- a/database/migrations/2018_11_06_172532_changes_for_v479.php +++ b/database/migrations/2018_11_06_172532_changes_for_v479.php @@ -26,6 +26,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class ChangesForV479. * diff --git a/database/migrations/2019_03_22_183214_changes_for_v480.php b/database/migrations/2019_03_22_183214_changes_for_v480.php index bc2b762cab..d8574ab640 100644 --- a/database/migrations/2019_03_22_183214_changes_for_v480.php +++ b/database/migrations/2019_03_22_183214_changes_for_v480.php @@ -26,6 +26,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class ChangesForV480. * diff --git a/database/migrations/2020_03_13_201950_changes_for_v520.php b/database/migrations/2020_03_13_201950_changes_for_v520.php index c1c5a70928..2587157c65 100644 --- a/database/migrations/2020_03_13_201950_changes_for_v520.php +++ b/database/migrations/2020_03_13_201950_changes_for_v520.php @@ -26,6 +26,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class ChangesForV520. * diff --git a/database/migrations/2020_06_07_063612_changes_for_v530.php b/database/migrations/2020_06_07_063612_changes_for_v530.php index eb86afcf2b..01fc783f8c 100644 --- a/database/migrations/2020_06_07_063612_changes_for_v530.php +++ b/database/migrations/2020_06_07_063612_changes_for_v530.php @@ -26,6 +26,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + /** * Class ChangesForV530 * diff --git a/database/migrations/2024_11_05_062108_add_date_tz_columns.php b/database/migrations/2024_11_05_062108_add_date_tz_columns.php index 07720fd6b6..fcbb2cb75b 100644 --- a/database/migrations/2024_11_05_062108_add_date_tz_columns.php +++ b/database/migrations/2024_11_05_062108_add_date_tz_columns.php @@ -27,6 +27,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\QueryException; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + return new class () extends Migration { private array $tables; diff --git a/package-lock.json b/package-lock.json index 977088f92a..da33c5ce5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2552,9 +2552,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.41.0.tgz", - "integrity": "sha512-KxN+zCjOYHGwCl4UCtSfZ6jrq/qi88JDUtiEFk8LELEHq2Egfc/FgW+jItZiOLRuQfb/3xJSgFuNPC9jzggX+A==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.41.1.tgz", + "integrity": "sha512-NELNvyEWZ6R9QMkiytB4/L4zSEaBC03KIXEghptLGLZWJ6VPrL63ooZQCOnlx36aQPGhzuOMwDerC1Eb2VmrLw==", "cpu": [ "arm" ], @@ -2566,9 +2566,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.41.0.tgz", - "integrity": "sha512-yDvqx3lWlcugozax3DItKJI5j05B0d4Kvnjx+5mwiUpWramVvmAByYigMplaoAQ3pvdprGCTCE03eduqE/8mPQ==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.41.1.tgz", + "integrity": "sha512-DXdQe1BJ6TK47ukAoZLehRHhfKnKg9BjnQYUu9gzhI8Mwa1d2fzxA1aw2JixHVl403bwp1+/o/NhhHtxWJBgEA==", "cpu": [ "arm64" ], @@ -2580,9 +2580,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.41.0.tgz", - "integrity": "sha512-2KOU574vD3gzcPSjxO0eyR5iWlnxxtmW1F5CkNOHmMlueKNCQkxR6+ekgWyVnz6zaZihpUNkGxjsYrkTJKhkaw==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.41.1.tgz", + "integrity": "sha512-5afxvwszzdulsU2w8JKWwY8/sJOLPzf0e1bFuvcW5h9zsEg+RQAojdW0ux2zyYAz7R8HvvzKCjLNJhVq965U7w==", "cpu": [ "arm64" ], @@ -2594,9 +2594,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.41.0.tgz", - "integrity": "sha512-gE5ACNSxHcEZyP2BA9TuTakfZvULEW4YAOtxl/A/YDbIir/wPKukde0BNPlnBiP88ecaN4BJI2TtAd+HKuZPQQ==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.41.1.tgz", + "integrity": "sha512-egpJACny8QOdHNNMZKf8xY0Is6gIMz+tuqXlusxquWu3F833DcMwmGM7WlvCO9sB3OsPjdC4U0wHw5FabzCGZg==", "cpu": [ "x64" ], @@ -2608,9 +2608,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.41.0.tgz", - "integrity": "sha512-GSxU6r5HnWij7FoSo7cZg3l5GPg4HFLkzsFFh0N/b16q5buW1NAWuCJ+HMtIdUEi6XF0qH+hN0TEd78laRp7Dg==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.41.1.tgz", + "integrity": "sha512-DBVMZH5vbjgRk3r0OzgjS38z+atlupJ7xfKIDJdZZL6sM6wjfDNo64aowcLPKIx7LMQi8vybB56uh1Ftck/Atg==", "cpu": [ "arm64" ], @@ -2622,9 +2622,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.41.0.tgz", - "integrity": "sha512-KGiGKGDg8qLRyOWmk6IeiHJzsN/OYxO6nSbT0Vj4MwjS2XQy/5emsmtoqLAabqrohbgLWJ5GV3s/ljdrIr8Qjg==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.41.1.tgz", + "integrity": "sha512-3FkydeohozEskBxNWEIbPfOE0aqQgB6ttTkJ159uWOFn42VLyfAiyD9UK5mhu+ItWzft60DycIN1Xdgiy8o/SA==", "cpu": [ "x64" ], @@ -2636,9 +2636,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.41.0.tgz", - "integrity": "sha512-46OzWeqEVQyX3N2/QdiU/CMXYDH/lSHpgfBkuhl3igpZiaB3ZIfSjKuOnybFVBQzjsLwkus2mjaESy8H41SzvA==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.41.1.tgz", + "integrity": "sha512-wC53ZNDgt0pqx5xCAgNunkTzFE8GTgdZ9EwYGVcg+jEjJdZGtq9xPjDnFgfFozQI/Xm1mh+D9YlYtl+ueswNEg==", "cpu": [ "arm" ], @@ -2650,9 +2650,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.41.0.tgz", - "integrity": "sha512-lfgW3KtQP4YauqdPpcUZHPcqQXmTmH4nYU0cplNeW583CMkAGjtImw4PKli09NFi2iQgChk4e9erkwlfYem6Lg==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.41.1.tgz", + "integrity": "sha512-jwKCca1gbZkZLhLRtsrka5N8sFAaxrGz/7wRJ8Wwvq3jug7toO21vWlViihG85ei7uJTpzbXZRcORotE+xyrLA==", "cpu": [ "arm" ], @@ -2664,9 +2664,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.41.0.tgz", - "integrity": "sha512-nn8mEyzMbdEJzT7cwxgObuwviMx6kPRxzYiOl6o/o+ChQq23gfdlZcUNnt89lPhhz3BYsZ72rp0rxNqBSfqlqw==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.41.1.tgz", + "integrity": "sha512-g0UBcNknsmmNQ8V2d/zD2P7WWfJKU0F1nu0k5pW4rvdb+BIqMm8ToluW/eeRmxCared5dD76lS04uL4UaNgpNA==", "cpu": [ "arm64" ], @@ -2678,9 +2678,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.41.0.tgz", - "integrity": "sha512-l+QK99je2zUKGd31Gh+45c4pGDAqZSuWQiuRFCdHYC2CSiO47qUWsCcenrI6p22hvHZrDje9QjwSMAFL3iwXwQ==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.41.1.tgz", + "integrity": "sha512-XZpeGB5TKEZWzIrj7sXr+BEaSgo/ma/kCgrZgL0oo5qdB1JlTzIYQKel/RmhT6vMAvOdM2teYlAaOGJpJ9lahg==", "cpu": [ "arm64" ], @@ -2692,9 +2692,9 @@ ] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.41.0.tgz", - "integrity": "sha512-WbnJaxPv1gPIm6S8O/Wg+wfE/OzGSXlBMbOe4ie+zMyykMOeqmgD1BhPxZQuDqwUN+0T/xOFtL2RUWBspnZj3w==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.41.1.tgz", + "integrity": "sha512-bkCfDJ4qzWfFRCNt5RVV4DOw6KEgFTUZi2r2RuYhGWC8WhCA8lCAJhDeAmrM/fdiAH54m0mA0Vk2FGRPyzI+tw==", "cpu": [ "loong64" ], @@ -2706,9 +2706,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.41.0.tgz", - "integrity": "sha512-eRDWR5t67/b2g8Q/S8XPi0YdbKcCs4WQ8vklNnUYLaSWF+Cbv2axZsp4jni6/j7eKvMLYCYdcsv8dcU+a6QNFg==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.41.1.tgz", + "integrity": "sha512-3mr3Xm+gvMX+/8EKogIZSIEF0WUu0HL9di+YWlJpO8CQBnoLAEL/roTCxuLncEdgcfJcvA4UMOf+2dnjl4Ut1A==", "cpu": [ "ppc64" ], @@ -2720,9 +2720,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.41.0.tgz", - "integrity": "sha512-TWrZb6GF5jsEKG7T1IHwlLMDRy2f3DPqYldmIhnA2DVqvvhY2Ai184vZGgahRrg8k9UBWoSlHv+suRfTN7Ua4A==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.41.1.tgz", + "integrity": "sha512-3rwCIh6MQ1LGrvKJitQjZFuQnT2wxfU+ivhNBzmxXTXPllewOF7JR1s2vMX/tWtUYFgphygxjqMl76q4aMotGw==", "cpu": [ "riscv64" ], @@ -2734,9 +2734,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.41.0.tgz", - "integrity": "sha512-ieQljaZKuJpmWvd8gW87ZmSFwid6AxMDk5bhONJ57U8zT77zpZ/TPKkU9HpnnFrM4zsgr4kiGuzbIbZTGi7u9A==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.41.1.tgz", + "integrity": "sha512-LdIUOb3gvfmpkgFZuccNa2uYiqtgZAz3PTzjuM5bH3nvuy9ty6RGc/Q0+HDFrHrizJGVpjnTZ1yS5TNNjFlklw==", "cpu": [ "riscv64" ], @@ -2748,9 +2748,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.41.0.tgz", - "integrity": "sha512-/L3pW48SxrWAlVsKCN0dGLB2bi8Nv8pr5S5ocSM+S0XCn5RCVCXqi8GVtHFsOBBCSeR+u9brV2zno5+mg3S4Aw==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.41.1.tgz", + "integrity": "sha512-oIE6M8WC9ma6xYqjvPhzZYk6NbobIURvP/lEbh7FWplcMO6gn7MM2yHKA1eC/GvYwzNKK/1LYgqzdkZ8YFxR8g==", "cpu": [ "s390x" ], @@ -2762,9 +2762,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.41.0.tgz", - "integrity": "sha512-XMLeKjyH8NsEDCRptf6LO8lJk23o9wvB+dJwcXMaH6ZQbbkHu2dbGIUindbMtRN6ux1xKi16iXWu6q9mu7gDhQ==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.41.1.tgz", + "integrity": "sha512-cWBOvayNvA+SyeQMp79BHPK8ws6sHSsYnK5zDcsC3Hsxr1dgTABKjMnMslPq1DvZIp6uO7kIWhiGwaTdR4Og9A==", "cpu": [ "x64" ], @@ -2776,9 +2776,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.41.0.tgz", - "integrity": "sha512-m/P7LycHZTvSQeXhFmgmdqEiTqSV80zn6xHaQ1JSqwCtD1YGtwEK515Qmy9DcB2HK4dOUVypQxvhVSy06cJPEg==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.41.1.tgz", + "integrity": "sha512-y5CbN44M+pUCdGDlZFzGGBSKCA4A/J2ZH4edTYSSxFg7ce1Xt3GtydbVKWLlzL+INfFIZAEg1ZV6hh9+QQf9YQ==", "cpu": [ "x64" ], @@ -2790,9 +2790,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.41.0.tgz", - "integrity": "sha512-4yodtcOrFHpbomJGVEqZ8fzD4kfBeCbpsUy5Pqk4RluXOdsWdjLnjhiKy2w3qzcASWd04fp52Xz7JKarVJ5BTg==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.41.1.tgz", + "integrity": "sha512-lZkCxIrjlJlMt1dLO/FbpZbzt6J/A8p4DnqzSa4PWqPEUUUnzXLeki/iyPLfV0BmHItlYgHUqJe+3KiyydmiNQ==", "cpu": [ "arm64" ], @@ -2804,9 +2804,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.41.0.tgz", - "integrity": "sha512-tmazCrAsKzdkXssEc65zIE1oC6xPHwfy9d5Ta25SRCDOZS+I6RypVVShWALNuU9bxIfGA0aqrmzlzoM5wO5SPQ==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.41.1.tgz", + "integrity": "sha512-+psFT9+pIh2iuGsxFYYa/LhS5MFKmuivRsx9iPJWNSGbh2XVEjk90fmpUEjCnILPEPJnikAU6SFDiEUyOv90Pg==", "cpu": [ "ia32" ], @@ -2818,9 +2818,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.41.0.tgz", - "integrity": "sha512-h1J+Yzjo/X+0EAvR2kIXJDuTuyT7drc+t2ALY0nIcGPbTatNOf0VWdhEA2Z4AAjv6X1NJV7SYo5oCTYRJhSlVA==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.41.1.tgz", + "integrity": "sha512-Wq2zpapRYLfi4aKxf2Xff0tN+7slj2d4R87WEzqw7ZLsVvO5zwYCIuEGSZYiK41+GlwUo1HiR+GdkLEJnCKTCw==", "cpu": [ "x64" ], @@ -9973,9 +9973,9 @@ } }, "node_modules/rollup": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.41.0.tgz", - "integrity": "sha512-HqMFpUbWlf/tvcxBFNKnJyzc7Lk+XO3FGc3pbNBLqEbOz0gPLRgcrlS3UF4MfUrVlstOaP/q0kM6GVvi+LrLRg==", + "version": "4.41.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.41.1.tgz", + "integrity": "sha512-cPmwD3FnFv8rKMBc1MxWCwVQFxwf1JEmSX3iQXrRVVG15zerAIXRjMFVWnd5Q5QvgKF7Aj+5ykXFhUl+QGnyOw==", "dev": true, "license": "MIT", "dependencies": { @@ -9989,26 +9989,26 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.41.0", - "@rollup/rollup-android-arm64": "4.41.0", - "@rollup/rollup-darwin-arm64": "4.41.0", - "@rollup/rollup-darwin-x64": "4.41.0", - "@rollup/rollup-freebsd-arm64": "4.41.0", - "@rollup/rollup-freebsd-x64": "4.41.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.41.0", - "@rollup/rollup-linux-arm-musleabihf": "4.41.0", - "@rollup/rollup-linux-arm64-gnu": "4.41.0", - "@rollup/rollup-linux-arm64-musl": "4.41.0", - "@rollup/rollup-linux-loongarch64-gnu": "4.41.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.41.0", - "@rollup/rollup-linux-riscv64-gnu": "4.41.0", - "@rollup/rollup-linux-riscv64-musl": "4.41.0", - "@rollup/rollup-linux-s390x-gnu": "4.41.0", - "@rollup/rollup-linux-x64-gnu": "4.41.0", - "@rollup/rollup-linux-x64-musl": "4.41.0", - "@rollup/rollup-win32-arm64-msvc": "4.41.0", - "@rollup/rollup-win32-ia32-msvc": "4.41.0", - "@rollup/rollup-win32-x64-msvc": "4.41.0", + "@rollup/rollup-android-arm-eabi": "4.41.1", + "@rollup/rollup-android-arm64": "4.41.1", + "@rollup/rollup-darwin-arm64": "4.41.1", + "@rollup/rollup-darwin-x64": "4.41.1", + "@rollup/rollup-freebsd-arm64": "4.41.1", + "@rollup/rollup-freebsd-x64": "4.41.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.41.1", + "@rollup/rollup-linux-arm-musleabihf": "4.41.1", + "@rollup/rollup-linux-arm64-gnu": "4.41.1", + "@rollup/rollup-linux-arm64-musl": "4.41.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.41.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.41.1", + "@rollup/rollup-linux-riscv64-gnu": "4.41.1", + "@rollup/rollup-linux-riscv64-musl": "4.41.1", + "@rollup/rollup-linux-s390x-gnu": "4.41.1", + "@rollup/rollup-linux-x64-gnu": "4.41.1", + "@rollup/rollup-linux-x64-musl": "4.41.1", + "@rollup/rollup-win32-arm64-msvc": "4.41.1", + "@rollup/rollup-win32-ia32-msvc": "4.41.1", + "@rollup/rollup-win32-x64-msvc": "4.41.1", "fsevents": "~2.3.2" } }, diff --git a/routes/api-noauth.php b/routes/api-noauth.php index 743ec20051..7c960e9033 100644 --- a/routes/api-noauth.php +++ b/routes/api-noauth.php @@ -23,7 +23,6 @@ declare(strict_types=1); use Illuminate\Support\Facades\Route; - // Cron job API routes: use FireflyIII\Http\Middleware\AcceptHeaders; diff --git a/routes/channels.php b/routes/channels.php index 25c8051eec..92bf6b22ef 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -23,6 +23,7 @@ declare(strict_types=1); use Illuminate\Support\Facades\Broadcast; + /* |-------------------------------------------------------------------------- | Broadcast Channels diff --git a/routes/web.php b/routes/web.php index 2fa1d255b6..b6b7ddcc40 100644 --- a/routes/web.php +++ b/routes/web.php @@ -23,7 +23,6 @@ declare(strict_types=1); use Illuminate\Support\Facades\Route; - if (!defined('DATEFORMAT')) { define('DATEFORMAT', '(19|20)[0-9]{2}-?[0-9]{2}-?[0-9]{2}'); } From 5f73e3765706ee7706fbd950ed58b7893e015675 Mon Sep 17 00:00:00 2001 From: JC5 Date: Sun, 25 May 2025 06:49:44 +0200 Subject: [PATCH 14/14] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'v6.2.14'=20on=202025-05-25?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/firefly.php b/config/firefly.php index ee307938b0..5eea30585f 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -78,7 +78,7 @@ return [ 'running_balance_column' => env('USE_RUNNING_BALANCE', false), // see cer.php for exchange rates feature flag. ], - 'version' => 'develop/2025-05-25', + 'version' => '6.2.14', 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 25,