From 189a323f3cefd5c727c0d84190fe9b07650b7251 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 29 May 2025 13:38:40 +0200 Subject: [PATCH 01/44] Catch a nullpointer. --- app/Console/Commands/Upgrade/RepairsPostgresSequences.php | 2 +- resources/views/list/groups.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/Upgrade/RepairsPostgresSequences.php b/app/Console/Commands/Upgrade/RepairsPostgresSequences.php index db3f2cfb84..b37f33afe8 100644 --- a/app/Console/Commands/Upgrade/RepairsPostgresSequences.php +++ b/app/Console/Commands/Upgrade/RepairsPostgresSequences.php @@ -1,7 +1,7 @@ Date: Thu, 29 May 2025 15:01:06 +0200 Subject: [PATCH 02/44] Update files using Rector. --- .ci/rector.php | 24 +++++-- .ci/rector.sh | 8 +++ app/Api/V1/Controllers/Controller.php | 21 +++--- app/Api/V1/Requests/Chart/ChartRequest.php | 2 +- .../Data/Bulk/MoveTransactionsRequest.php | 2 +- .../Requests/Data/Bulk/TransactionRequest.php | 2 +- .../Requests/Models/Account/UpdateRequest.php | 2 +- .../Models/AvailableBudget/Request.php | 2 +- .../V1/Requests/Models/Bill/StoreRequest.php | 2 +- .../V1/Requests/Models/Bill/UpdateRequest.php | 2 +- .../Requests/Models/Budget/StoreRequest.php | 2 +- .../Requests/Models/Budget/UpdateRequest.php | 2 +- .../Models/BudgetLimit/UpdateRequest.php | 2 +- .../Models/PiggyBank/StoreRequest.php | 2 +- .../Models/Recurrence/StoreRequest.php | 2 +- .../Models/Recurrence/UpdateRequest.php | 2 +- .../V1/Requests/Models/Rule/StoreRequest.php | 2 +- .../V1/Requests/Models/Rule/UpdateRequest.php | 2 +- .../Models/Transaction/StoreRequest.php | 2 +- .../Models/Transaction/UpdateRequest.php | 2 +- .../Models/TransactionLink/StoreRequest.php | 2 +- .../Models/TransactionLink/UpdateRequest.php | 2 +- .../V1/Requests/System/UserUpdateRequest.php | 2 +- .../V2/Request/Chart/BalanceChartRequest.php | 2 +- app/Api/V2/Request/Chart/ChartRequest.php | 2 +- .../Request/Chart/DashboardChartRequest.php | 2 +- .../Model/Transaction/StoreRequest.php | 2 +- .../Model/Transaction/UpdateRequest.php | 2 +- app/Http/Requests/AccountFormRequest.php | 2 +- app/Http/Requests/AttachmentFormRequest.php | 2 +- app/Http/Requests/BillStoreRequest.php | 2 +- app/Http/Requests/BillUpdateRequest.php | 2 +- app/Http/Requests/BudgetFormStoreRequest.php | 2 +- app/Http/Requests/BudgetFormUpdateRequest.php | 2 +- app/Http/Requests/BudgetIncomeRequest.php | 2 +- app/Http/Requests/BulkEditJournalRequest.php | 2 +- app/Http/Requests/CategoryFormRequest.php | 2 +- app/Http/Requests/ConfigurationRequest.php | 2 +- app/Http/Requests/CurrencyFormRequest.php | 2 +- .../Requests/DeleteAccountFormRequest.php | 2 +- app/Http/Requests/EmailFormRequest.php | 2 +- .../Requests/ExistingTokenFormRequest.php | 2 +- app/Http/Requests/InviteUserFormRequest.php | 2 +- app/Http/Requests/JournalLinkRequest.php | 2 +- app/Http/Requests/LinkTypeFormRequest.php | 2 +- .../Requests/MassDeleteJournalRequest.php | 2 +- app/Http/Requests/MassEditJournalRequest.php | 2 +- app/Http/Requests/NewUserFormRequest.php | 2 +- app/Http/Requests/ObjectGroupFormRequest.php | 2 +- app/Http/Requests/PiggyBankStoreRequest.php | 2 +- app/Http/Requests/PiggyBankUpdateRequest.php | 2 +- app/Http/Requests/ProfileFormRequest.php | 2 +- .../Requests/ReconciliationStoreRequest.php | 2 +- app/Http/Requests/RecurrenceFormRequest.php | 2 +- app/Http/Requests/ReportFormRequest.php | 2 +- app/Http/Requests/RuleFormRequest.php | 2 +- app/Http/Requests/RuleGroupFormRequest.php | 2 +- .../Requests/SelectTransactionsRequest.php | 2 +- app/Http/Requests/TagFormRequest.php | 2 +- app/Http/Requests/TestRuleFormRequest.php | 2 +- app/Http/Requests/TokenFormRequest.php | 2 +- .../Requests/TriggerRecurrenceRequest.php | 2 +- app/Http/Requests/UserFormRequest.php | 2 +- app/Http/Requests/UserRegistrationRequest.php | 2 +- app/Models/Account.php | 64 ++++++++++--------- app/Models/AccountMeta.php | 18 +++--- app/Models/Attachment.php | 21 +++--- app/Models/AuditLogEntry.php | 19 +++--- app/Models/AvailableBudget.php | 29 +++++---- app/Models/Bill.php | 39 +++++------ app/Models/Budget.php | 23 +++---- app/Models/BudgetLimit.php | 23 +++---- app/Models/Category.php | 21 +++--- app/Models/Configuration.php | 23 +++---- app/Models/CurrencyExchangeRate.php | 27 ++++---- app/Models/GroupMembership.php | 17 ++--- app/Models/InvitedUser.php | 17 ++--- app/Models/LinkType.php | 17 ++--- app/Models/Location.php | 21 +++--- app/Models/Note.php | 15 +++-- app/Models/ObjectGroup.php | 19 +++--- app/Models/PiggyBank.php | 29 +++++---- app/Models/PiggyBankEvent.php | 19 +++--- app/Models/PiggyBankRepetition.php | 26 ++++---- app/Models/Preference.php | 19 +++--- app/Models/Recurrence.php | 37 +++++------ app/Models/RecurrenceMeta.php | 19 +++--- app/Models/RecurrenceTransaction.php | 21 +++--- app/Models/RecurrenceTransactionMeta.php | 19 +++--- app/Models/Role.php | 13 ++-- app/Models/Rule.php | 33 +++++----- app/Models/RuleAction.php | 19 +++--- app/Models/RuleGroup.php | 25 ++++---- app/Models/RuleTrigger.php | 19 +++--- app/Models/Tag.php | 27 ++++---- app/Models/Transaction.php | 49 +++++++------- app/Models/TransactionCurrency.php | 18 +++--- app/Models/TransactionGroup.php | 25 ++++---- app/Models/TransactionJournal.php | 39 +++++------ app/Models/TransactionJournalLink.php | 13 ++-- app/Models/TransactionJournalMeta.php | 33 ++++------ app/Models/WebhookMessage.php | 19 +++--- app/Providers/AccountServiceProvider.php | 9 +-- app/Providers/AdminServiceProvider.php | 3 +- app/Providers/AttachmentServiceProvider.php | 3 +- app/Providers/BillServiceProvider.php | 3 +- app/Providers/BudgetServiceProvider.php | 15 ++--- app/Providers/CategoryServiceProvider.php | 9 +-- app/Providers/CurrencyServiceProvider.php | 10 +-- app/Providers/FireflyServiceProvider.php | 15 ++--- app/Providers/JournalServiceProvider.php | 15 ++--- app/Providers/PiggyBankServiceProvider.php | 3 +- app/Providers/RecurringServiceProvider.php | 3 +- app/Providers/RuleGroupServiceProvider.php | 3 +- app/Providers/RuleServiceProvider.php | 3 +- app/Providers/SearchServiceProvider.php | 6 +- app/Providers/TagServiceProvider.php | 6 +- app/User.php | 15 +++-- .../Bulk/ValidatesBulkTransactionQuery.php | 2 +- .../AutoBudget/ValidatesAutoBudgetRequest.php | 2 +- app/Validation/CurrencyValidation.php | 2 +- app/Validation/GroupValidation.php | 2 +- app/Validation/RecurrenceValidation.php | 2 +- app/Validation/TransactionValidation.php | 2 +- composer.json | 1 + composer.lock | 37 ++++++++++- 126 files changed, 668 insertions(+), 612 deletions(-) diff --git a/.ci/rector.php b/.ci/rector.php index 6e98485438..7c9ac6c6df 100644 --- a/.ci/rector.php +++ b/.ci/rector.php @@ -25,20 +25,32 @@ declare(strict_types=1); use Rector\Config\RectorConfig; use Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector; +use Rector\Transform\Rector\String_\StringToClassConstantRector; +use RectorLaravel\Set\LaravelLevelSetList; + return RectorConfig::configure() ->withSkip([ ChangeOrIfContinueToMultiContinueRector::class, + StringToClassConstantRector::class => [ + __DIR__ . '/../app/Http/Controllers/Auth/LoginController.php', + ] ]) ->withPaths([ __DIR__ . '/../app', - __DIR__ . '/../bootstrap', - __DIR__ . '/../config', - __DIR__ . '/../public', - __DIR__ . '/../resources/lang/en_US', - __DIR__ . '/../routes', - __DIR__ . '/../tests', +// __DIR__ . '/../bootstrap', +// __DIR__ . '/../config', +// __DIR__ . '/../public', +// __DIR__ . '/../resources/lang/en_US', +// __DIR__ . '/../routes', +// __DIR__ . '/../tests', ]) + ->withSets([ + LaravelLevelSetList::UP_TO_LARAVEL_120, + ]) +// ->withConfiguredRule(ReplaceServiceContainerCallArgRector::class, [ +// new ReplaceServiceContainerCallArg('log', new ClassConstFetch(new Name('Illuminate\Support\Facades\Log'), 'class')), +// ]) // uncomment to reach your current PHP version ->withPhpSets() ->withPreparedSets( diff --git a/.ci/rector.sh b/.ci/rector.sh index 3bd4f802b9..6b2d4b0e13 100755 --- a/.ci/rector.sh +++ b/.ci/rector.sh @@ -25,4 +25,12 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +echo $1 + +if [ "$1" == "--dry-run" ]; then + echo "Running rector in dry run." + $SCRIPT_DIR/../vendor/bin/rector --config $SCRIPT_DIR/rector.php --dry-run + exit $? +fi + $SCRIPT_DIR/../vendor/bin/rector --config $SCRIPT_DIR/rector.php diff --git a/app/Api/V1/Controllers/Controller.php b/app/Api/V1/Controllers/Controller.php index 2566ddbe58..dc5063afc4 100644 --- a/app/Api/V1/Controllers/Controller.php +++ b/app/Api/V1/Controllers/Controller.php @@ -40,6 +40,7 @@ use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Routing\Controller as BaseController; +use Illuminate\Support\Facades\Log; use League\Fractal\Manager; use League\Fractal\Pagination\IlluminatePaginatorAdapter; use League\Fractal\Resource\Collection as FractalCollection; @@ -123,9 +124,9 @@ abstract class Controller extends BaseController try { $date = request()->query->get($field); } catch (BadRequestException $e) { - app('log')->error(sprintf('Request field "%s" contains a non-scalar value. Value set to NULL.', $field)); - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error(sprintf('Request field "%s" contains a non-scalar value. Value set to NULL.', $field)); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); $value = null; } $obj = null; @@ -134,7 +135,7 @@ abstract class Controller extends BaseController $obj = Carbon::parse((string) $date); } catch (InvalidFormatException $e) { // don't care - app('log')->warning( + Log::warning( sprintf( 'Ignored invalid date "%s" in API controller parameter check: %s', substr((string) $date, 0, 20), @@ -152,9 +153,9 @@ abstract class Controller extends BaseController try { $value = request()->query->get($integer); } catch (BadRequestException $e) { - app('log')->error(sprintf('Request field "%s" contains a non-scalar value. Value set to NULL.', $integer)); - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error(sprintf('Request field "%s" contains a non-scalar value. Value set to NULL.', $integer)); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); $value = null; } if (null !== $value) { @@ -192,9 +193,9 @@ abstract class Controller extends BaseController try { $param = (string) request()->query->get('sort'); } catch (BadRequestException $e) { - app('log')->error('Request field "sort" contains a non-scalar value. Value set to NULL.'); - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error('Request field "sort" contains a non-scalar value. Value set to NULL.'); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); $param = ''; } if ('' === $param) { diff --git a/app/Api/V1/Requests/Chart/ChartRequest.php b/app/Api/V1/Requests/Chart/ChartRequest.php index 7d3f0e4a94..58ade4f0c3 100644 --- a/app/Api/V1/Requests/Chart/ChartRequest.php +++ b/app/Api/V1/Requests/Chart/ChartRequest.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Chart; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class ChartRequest diff --git a/app/Api/V1/Requests/Data/Bulk/MoveTransactionsRequest.php b/app/Api/V1/Requests/Data/Bulk/MoveTransactionsRequest.php index 3ada80f591..8731e354aa 100644 --- a/app/Api/V1/Requests/Data/Bulk/MoveTransactionsRequest.php +++ b/app/Api/V1/Requests/Data/Bulk/MoveTransactionsRequest.php @@ -24,12 +24,12 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Data\Bulk; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class MoveTransactionsRequest diff --git a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php index da2bfb3d7c..ca3c43ca0d 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 Illuminate\Contracts\Validation\Validator; use JsonException; use FireflyIII\Enums\ClauseType; use FireflyIII\Rules\IsValidBulkClause; @@ -32,7 +33,6 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\Api\Data\Bulk\ValidatesBulkTransactionQuery; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; use function Safe\json_decode; diff --git a/app/Api/V1/Requests/Models/Account/UpdateRequest.php b/app/Api/V1/Requests/Models/Account/UpdateRequest.php index dbe30eab1b..5fb31b6fc8 100644 --- a/app/Api/V1/Requests/Models/Account/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Account/UpdateRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Account; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\Account; use FireflyIII\Models\Location; use FireflyIII\Repositories\Account\AccountRepositoryInterface; @@ -35,7 +36,6 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/AvailableBudget/Request.php b/app/Api/V1/Requests/Models/AvailableBudget/Request.php index ccf7e4d030..ad36cdb728 100644 --- a/app/Api/V1/Requests/Models/AvailableBudget/Request.php +++ b/app/Api/V1/Requests/Models/AvailableBudget/Request.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\AvailableBudget; +use Illuminate\Contracts\Validation\Validator; use Carbon\Carbon; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class Request diff --git a/app/Api/V1/Requests/Models/Bill/StoreRequest.php b/app/Api/V1/Requests/Models/Bill/StoreRequest.php index e773942ca3..9c4cffd668 100644 --- a/app/Api/V1/Requests/Models/Bill/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Bill/StoreRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Bill; +use Illuminate\Contracts\Validation\Validator; use ValueError; use TypeError; use FireflyIII\Rules\IsBoolean; @@ -32,7 +33,6 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Bill/UpdateRequest.php b/app/Api/V1/Requests/Models/Bill/UpdateRequest.php index 5931fc7bd2..4b69d4d6ee 100644 --- a/app/Api/V1/Requests/Models/Bill/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Bill/UpdateRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Bill; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\Bill; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; @@ -31,7 +32,6 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/Budget/StoreRequest.php b/app/Api/V1/Requests/Models/Budget/StoreRequest.php index f6a96a6941..43f44c7720 100644 --- a/app/Api/V1/Requests/Models/Budget/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Budget/StoreRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Budget; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; @@ -31,7 +32,6 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\AutoBudget\ValidatesAutoBudgetRequest; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Budget/UpdateRequest.php b/app/Api/V1/Requests/Models/Budget/UpdateRequest.php index 1319df36e6..ed1d119e93 100644 --- a/app/Api/V1/Requests/Models/Budget/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Budget/UpdateRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Budget; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\Budget; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; @@ -32,7 +33,6 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\AutoBudget\ValidatesAutoBudgetRequest; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php b/app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php index 1fb3d53ca9..c1ed04a9a4 100644 --- a/app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\BudgetLimit; +use Illuminate\Contracts\Validation\Validator; use Carbon\Carbon; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php b/app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php index e7ae890499..f99939be28 100644 --- a/app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php +++ b/app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\PiggyBank; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Account\AccountRepositoryInterface; @@ -32,7 +33,6 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php b/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php index f8f5091ed0..7afa2243fa 100644 --- a/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Recurrence; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Rules\BelongsUser; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; @@ -35,7 +36,6 @@ use FireflyIII\Validation\RecurrenceValidation; use FireflyIII\Validation\TransactionValidation; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php b/app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php index 5449a5edda..e387e0b4cc 100644 --- a/app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Recurrence; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\Recurrence; use FireflyIII\Rules\BelongsUser; use FireflyIII\Rules\IsBoolean; @@ -36,7 +37,6 @@ use FireflyIII\Validation\RecurrenceValidation; use FireflyIII\Validation\TransactionValidation; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/Rule/StoreRequest.php b/app/Api/V1/Requests/Models/Rule/StoreRequest.php index dd65d648a0..496dbc550a 100644 --- a/app/Api/V1/Requests/Models/Rule/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Rule/StoreRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Rule; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidActionExpression; use FireflyIII\Support\Request\ChecksLogin; @@ -31,7 +32,6 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Support\Request\GetRuleConfiguration; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Rule/UpdateRequest.php b/app/Api/V1/Requests/Models/Rule/UpdateRequest.php index 13a8a97676..8b58fbd3d8 100644 --- a/app/Api/V1/Requests/Models/Rule/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Rule/UpdateRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Rule; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\Rule; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidActionExpression; @@ -32,7 +33,6 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Support\Request\GetRuleConfiguration; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/Transaction/StoreRequest.php b/app/Api/V1/Requests/Models/Transaction/StoreRequest.php index c9a99f88eb..73dcb768aa 100644 --- a/app/Api/V1/Requests/Models/Transaction/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Transaction/StoreRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Transaction; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\Location; use FireflyIII\Rules\BelongsUser; use FireflyIII\Rules\IsBoolean; @@ -39,7 +40,6 @@ use FireflyIII\Validation\GroupValidation; use FireflyIII\Validation\TransactionValidation; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php b/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php index f53b5ba6df..1e1ba30fca 100644 --- a/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Transaction; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionGroup; use FireflyIII\Rules\BelongsUser; @@ -37,7 +38,6 @@ use FireflyIII\Validation\GroupValidation; use FireflyIII\Validation\TransactionValidation; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/TransactionLink/StoreRequest.php b/app/Api/V1/Requests/Models/TransactionLink/StoreRequest.php index 638bda8306..b93334289d 100644 --- a/app/Api/V1/Requests/Models/TransactionLink/StoreRequest.php +++ b/app/Api/V1/Requests/Models/TransactionLink/StoreRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\TransactionLink; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; use FireflyIII\Support\Request\ChecksLogin; @@ -31,7 +32,6 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\User; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/TransactionLink/UpdateRequest.php b/app/Api/V1/Requests/Models/TransactionLink/UpdateRequest.php index 0ab51bccd0..ce62f5a87c 100644 --- a/app/Api/V1/Requests/Models/TransactionLink/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/TransactionLink/UpdateRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\TransactionLink; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\TransactionJournalLink; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; @@ -31,7 +32,6 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/System/UserUpdateRequest.php b/app/Api/V1/Requests/System/UserUpdateRequest.php index 553f8e54e4..d22090ba0b 100644 --- a/app/Api/V1/Requests/System/UserUpdateRequest.php +++ b/app/Api/V1/Requests/System/UserUpdateRequest.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\System; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Rules\IsBoolean; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\User; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class UserUpdateRequest diff --git a/app/Api/V2/Request/Chart/BalanceChartRequest.php b/app/Api/V2/Request/Chart/BalanceChartRequest.php index bdbb141b65..3220714cdb 100644 --- a/app/Api/V2/Request/Chart/BalanceChartRequest.php +++ b/app/Api/V2/Request/Chart/BalanceChartRequest.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Api\V2\Request\Chart; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class BalanceChartRequest diff --git a/app/Api/V2/Request/Chart/ChartRequest.php b/app/Api/V2/Request/Chart/ChartRequest.php index 6ca32ea6e8..cecb7edc40 100644 --- a/app/Api/V2/Request/Chart/ChartRequest.php +++ b/app/Api/V2/Request/Chart/ChartRequest.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Api\V2\Request\Chart; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class ChartRequest diff --git a/app/Api/V2/Request/Chart/DashboardChartRequest.php b/app/Api/V2/Request/Chart/DashboardChartRequest.php index 96f66e1095..6c4a3cdfa6 100644 --- a/app/Api/V2/Request/Chart/DashboardChartRequest.php +++ b/app/Api/V2/Request/Chart/DashboardChartRequest.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Api\V2\Request\Chart; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class DashboardChartRequest diff --git a/app/Api/V2/Request/Model/Transaction/StoreRequest.php b/app/Api/V2/Request/Model/Transaction/StoreRequest.php index 4e95b69e9f..18cc85d5a2 100644 --- a/app/Api/V2/Request/Model/Transaction/StoreRequest.php +++ b/app/Api/V2/Request/Model/Transaction/StoreRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Api\V2\Request\Model\Transaction; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Models\UserGroup; use FireflyIII\Rules\BelongsUserGroup; @@ -40,7 +41,6 @@ use FireflyIII\Validation\GroupValidation; use FireflyIII\Validation\TransactionValidation; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V2/Request/Model/Transaction/UpdateRequest.php b/app/Api/V2/Request/Model/Transaction/UpdateRequest.php index 3aeda0e3c3..2511d52e26 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 Illuminate\Contracts\Validation\Validator; use Override; use FireflyIII\Api\V1\Requests\Models\AvailableBudget\Request; use FireflyIII\Exceptions\FireflyException; @@ -38,7 +39,6 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\GroupValidation; use FireflyIII\Validation\TransactionValidation; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Http/Requests/AccountFormRequest.php b/app/Http/Requests/AccountFormRequest.php index 9cd8d51163..8d99bc4765 100644 --- a/app/Http/Requests/AccountFormRequest.php +++ b/app/Http/Requests/AccountFormRequest.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Models\Account; use FireflyIII\Models\Location; @@ -33,7 +34,6 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class AccountFormRequest. diff --git a/app/Http/Requests/AttachmentFormRequest.php b/app/Http/Requests/AttachmentFormRequest.php index f481510ee6..2da2240168 100644 --- a/app/Http/Requests/AttachmentFormRequest.php +++ b/app/Http/Requests/AttachmentFormRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class AttachmentFormRequest. diff --git a/app/Http/Requests/BillStoreRequest.php b/app/Http/Requests/BillStoreRequest.php index 37e9f7ef02..0f530a2191 100644 --- a/app/Http/Requests/BillStoreRequest.php +++ b/app/Http/Requests/BillStoreRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class BillStoreRequest. diff --git a/app/Http/Requests/BillUpdateRequest.php b/app/Http/Requests/BillUpdateRequest.php index cde6978364..f4376c00b4 100644 --- a/app/Http/Requests/BillUpdateRequest.php +++ b/app/Http/Requests/BillUpdateRequest.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\Bill; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class BillUpdateRequest. diff --git a/app/Http/Requests/BudgetFormStoreRequest.php b/app/Http/Requests/BudgetFormStoreRequest.php index 86779d3794..cb6c99f037 100644 --- a/app/Http/Requests/BudgetFormStoreRequest.php +++ b/app/Http/Requests/BudgetFormStoreRequest.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\AutoBudget\ValidatesAutoBudgetRequest; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class BudgetFormStoreRequest diff --git a/app/Http/Requests/BudgetFormUpdateRequest.php b/app/Http/Requests/BudgetFormUpdateRequest.php index 5dbecfd4c8..4fc1ec8f47 100644 --- a/app/Http/Requests/BudgetFormUpdateRequest.php +++ b/app/Http/Requests/BudgetFormUpdateRequest.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\Budget; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; @@ -30,7 +31,6 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\AutoBudget\ValidatesAutoBudgetRequest; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class BudgetFormUpdateRequest diff --git a/app/Http/Requests/BudgetIncomeRequest.php b/app/Http/Requests/BudgetIncomeRequest.php index d75f81faa9..d0a2b96b17 100644 --- a/app/Http/Requests/BudgetIncomeRequest.php +++ b/app/Http/Requests/BudgetIncomeRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class BudgetIncomeRequest. diff --git a/app/Http/Requests/BulkEditJournalRequest.php b/app/Http/Requests/BulkEditJournalRequest.php index 4bbaafa77b..bcbbf533ca 100644 --- a/app/Http/Requests/BulkEditJournalRequest.php +++ b/app/Http/Requests/BulkEditJournalRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class MassEditBulkJournalRequest. diff --git a/app/Http/Requests/CategoryFormRequest.php b/app/Http/Requests/CategoryFormRequest.php index 8ca3455168..53e25c7be3 100644 --- a/app/Http/Requests/CategoryFormRequest.php +++ b/app/Http/Requests/CategoryFormRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\Category; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class CategoryFormRequest. diff --git a/app/Http/Requests/ConfigurationRequest.php b/app/Http/Requests/ConfigurationRequest.php index 57f8a969b4..212b706b5f 100644 --- a/app/Http/Requests/ConfigurationRequest.php +++ b/app/Http/Requests/ConfigurationRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class ConfigurationRequest. diff --git a/app/Http/Requests/CurrencyFormRequest.php b/app/Http/Requests/CurrencyFormRequest.php index 959678e64c..9a4f49672c 100644 --- a/app/Http/Requests/CurrencyFormRequest.php +++ b/app/Http/Requests/CurrencyFormRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class CurrencyFormRequest. diff --git a/app/Http/Requests/DeleteAccountFormRequest.php b/app/Http/Requests/DeleteAccountFormRequest.php index 31222e084a..c06cba8b51 100644 --- a/app/Http/Requests/DeleteAccountFormRequest.php +++ b/app/Http/Requests/DeleteAccountFormRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class DeleteAccountFormRequest. diff --git a/app/Http/Requests/EmailFormRequest.php b/app/Http/Requests/EmailFormRequest.php index cd4369f3ec..26f2c66750 100644 --- a/app/Http/Requests/EmailFormRequest.php +++ b/app/Http/Requests/EmailFormRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class EmailFormRequest. diff --git a/app/Http/Requests/ExistingTokenFormRequest.php b/app/Http/Requests/ExistingTokenFormRequest.php index b843012fba..37f7eb7867 100644 --- a/app/Http/Requests/ExistingTokenFormRequest.php +++ b/app/Http/Requests/ExistingTokenFormRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class ExistingTokenFormRequest. diff --git a/app/Http/Requests/InviteUserFormRequest.php b/app/Http/Requests/InviteUserFormRequest.php index 2c31d965ce..5c71175d81 100644 --- a/app/Http/Requests/InviteUserFormRequest.php +++ b/app/Http/Requests/InviteUserFormRequest.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class InviteUserFormRequest diff --git a/app/Http/Requests/JournalLinkRequest.php b/app/Http/Requests/JournalLinkRequest.php index 185aaea191..f924a24ee6 100644 --- a/app/Http/Requests/JournalLinkRequest.php +++ b/app/Http/Requests/JournalLinkRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\LinkType; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class JournalLink. diff --git a/app/Http/Requests/LinkTypeFormRequest.php b/app/Http/Requests/LinkTypeFormRequest.php index 3fb7511c6a..202b3fe3b8 100644 --- a/app/Http/Requests/LinkTypeFormRequest.php +++ b/app/Http/Requests/LinkTypeFormRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class LinkTypeFormRequest. diff --git a/app/Http/Requests/MassDeleteJournalRequest.php b/app/Http/Requests/MassDeleteJournalRequest.php index 603e8a7d51..5700ac4224 100644 --- a/app/Http/Requests/MassDeleteJournalRequest.php +++ b/app/Http/Requests/MassDeleteJournalRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class MassDeleteJournalRequest. diff --git a/app/Http/Requests/MassEditJournalRequest.php b/app/Http/Requests/MassEditJournalRequest.php index 7f217aaf67..d236c3abc0 100644 --- a/app/Http/Requests/MassEditJournalRequest.php +++ b/app/Http/Requests/MassEditJournalRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class MassEditJournalRequest. diff --git a/app/Http/Requests/NewUserFormRequest.php b/app/Http/Requests/NewUserFormRequest.php index bed1e3def7..1d0da88187 100644 --- a/app/Http/Requests/NewUserFormRequest.php +++ b/app/Http/Requests/NewUserFormRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Rules\IsValidAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class NewUserFormRequest. diff --git a/app/Http/Requests/ObjectGroupFormRequest.php b/app/Http/Requests/ObjectGroupFormRequest.php index 8d8dcb1b8a..5febc46231 100644 --- a/app/Http/Requests/ObjectGroupFormRequest.php +++ b/app/Http/Requests/ObjectGroupFormRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\ObjectGroup; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class ObjectGroupFormRequest. diff --git a/app/Http/Requests/PiggyBankStoreRequest.php b/app/Http/Requests/PiggyBankStoreRequest.php index d3ce9e2507..61ba326821 100644 --- a/app/Http/Requests/PiggyBankStoreRequest.php +++ b/app/Http/Requests/PiggyBankStoreRequest.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Rules\IsValidPositiveAmount; @@ -31,7 +32,6 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class PiggyBankStoreRequest. diff --git a/app/Http/Requests/PiggyBankUpdateRequest.php b/app/Http/Requests/PiggyBankUpdateRequest.php index 56f023768c..d6facfb7de 100644 --- a/app/Http/Requests/PiggyBankUpdateRequest.php +++ b/app/Http/Requests/PiggyBankUpdateRequest.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Account\AccountRepositoryInterface; @@ -32,7 +33,6 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class PiggyBankFormRequest. diff --git a/app/Http/Requests/ProfileFormRequest.php b/app/Http/Requests/ProfileFormRequest.php index bf741778e6..65034257b9 100644 --- a/app/Http/Requests/ProfileFormRequest.php +++ b/app/Http/Requests/ProfileFormRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class ProfileFormRequest. diff --git a/app/Http/Requests/ReconciliationStoreRequest.php b/app/Http/Requests/ReconciliationStoreRequest.php index 75a1a6d8e3..d9827230ed 100644 --- a/app/Http/Requests/ReconciliationStoreRequest.php +++ b/app/Http/Requests/ReconciliationStoreRequest.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Rules\IsValidAmount; use FireflyIII\Rules\ValidJournals; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class ReconciliationStoreRequest diff --git a/app/Http/Requests/RecurrenceFormRequest.php b/app/Http/Requests/RecurrenceFormRequest.php index 9613291d3f..8536cdf206 100644 --- a/app/Http/Requests/RecurrenceFormRequest.php +++ b/app/Http/Requests/RecurrenceFormRequest.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Factory\CategoryFactory; @@ -36,7 +37,6 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\AccountValidator; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class RecurrenceFormRequest diff --git a/app/Http/Requests/ReportFormRequest.php b/app/Http/Requests/ReportFormRequest.php index 8c5de287d4..f3b96f4a3e 100644 --- a/app/Http/Requests/ReportFormRequest.php +++ b/app/Http/Requests/ReportFormRequest.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use Carbon\Carbon; use Exception; use FireflyIII\Exceptions\FireflyException; @@ -34,7 +35,6 @@ use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; use function Safe\preg_match; diff --git a/app/Http/Requests/RuleFormRequest.php b/app/Http/Requests/RuleFormRequest.php index 8b7d9ca061..03b1beb270 100644 --- a/app/Http/Requests/RuleFormRequest.php +++ b/app/Http/Requests/RuleFormRequest.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\Rule; use FireflyIII\Rules\IsValidActionExpression; use FireflyIII\Support\Request\ChecksLogin; @@ -30,7 +31,6 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Support\Request\GetRuleConfiguration; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class RuleFormRequest. diff --git a/app/Http/Requests/RuleGroupFormRequest.php b/app/Http/Requests/RuleGroupFormRequest.php index 8f5c4af01b..f73cff0b74 100644 --- a/app/Http/Requests/RuleGroupFormRequest.php +++ b/app/Http/Requests/RuleGroupFormRequest.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\RuleGroup; use FireflyIII\Rules\IsBoolean; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class RuleGroupFormRequest. diff --git a/app/Http/Requests/SelectTransactionsRequest.php b/app/Http/Requests/SelectTransactionsRequest.php index e87b4af6b1..4ad02aefd5 100644 --- a/app/Http/Requests/SelectTransactionsRequest.php +++ b/app/Http/Requests/SelectTransactionsRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use Carbon\Carbon; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class SelectTransactionsRequest. diff --git a/app/Http/Requests/TagFormRequest.php b/app/Http/Requests/TagFormRequest.php index 2529907f0f..8686b2bd5d 100644 --- a/app/Http/Requests/TagFormRequest.php +++ b/app/Http/Requests/TagFormRequest.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Models\Location; use FireflyIII\Models\Tag; use FireflyIII\Support\Request\AppendsLocationData; @@ -30,7 +31,6 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class TagFormRequest. diff --git a/app/Http/Requests/TestRuleFormRequest.php b/app/Http/Requests/TestRuleFormRequest.php index 0cf0524667..fa4e289e4e 100644 --- a/app/Http/Requests/TestRuleFormRequest.php +++ b/app/Http/Requests/TestRuleFormRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\GetRuleConfiguration; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class TestRuleFormRequest. diff --git a/app/Http/Requests/TokenFormRequest.php b/app/Http/Requests/TokenFormRequest.php index 3a53cbe7ab..19c0f3bc06 100644 --- a/app/Http/Requests/TokenFormRequest.php +++ b/app/Http/Requests/TokenFormRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class TokenFormRequest. diff --git a/app/Http/Requests/TriggerRecurrenceRequest.php b/app/Http/Requests/TriggerRecurrenceRequest.php index c03e531a00..36d16331d6 100644 --- a/app/Http/Requests/TriggerRecurrenceRequest.php +++ b/app/Http/Requests/TriggerRecurrenceRequest.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class TriggerRecurrenceRequest diff --git a/app/Http/Requests/UserFormRequest.php b/app/Http/Requests/UserFormRequest.php index 409cfba453..cc89dff35b 100644 --- a/app/Http/Requests/UserFormRequest.php +++ b/app/Http/Requests/UserFormRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class UserFormRequest. diff --git a/app/Http/Requests/UserRegistrationRequest.php b/app/Http/Requests/UserRegistrationRequest.php index 6e26763831..8bd3504ea3 100644 --- a/app/Http/Requests/UserRegistrationRequest.php +++ b/app/Http/Requests/UserRegistrationRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Class UserRegistrationRequest. diff --git a/app/Models/Account.php b/app/Models/Account.php index f7110c38b7..5465c1e107 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Models; +use Illuminate\Database\Eloquent\Attributes\Scope; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Support\Models\ReturnsIntegerIdTrait; use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait; @@ -46,19 +47,6 @@ class Account extends Model use ReturnsIntegerUserIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - 'deleted_at' => 'datetime', - 'active' => 'boolean', - 'encrypted' => 'boolean', - 'virtual_balance' => 'string', - 'native_virtual_balance' => 'string', - ]; - protected $fillable = ['user_id', 'user_group_id', 'account_type_id', 'name', 'active', 'virtual_balance', 'iban', 'native_virtual_balance']; protected $hidden = ['encrypted']; @@ -110,15 +98,16 @@ class Account extends Model /** * Get the account number. */ - public function getAccountNumberAttribute(): string + protected function accountNumber(): Attribute { - /** @var null|AccountMeta $metaValue */ - $metaValue = $this->accountMeta() - ->where('name', 'account_number') - ->first() - ; - - return null !== $metaValue ? $metaValue->data : ''; + return Attribute::make(get: function () { + /** @var null|AccountMeta $metaValue */ + $metaValue = $this->accountMeta() + ->where('name', 'account_number') + ->first() + ; + return null !== $metaValue ? $metaValue->data : ''; + }); } public function accountMeta(): HasMany @@ -126,15 +115,15 @@ class Account extends Model return $this->hasMany(AccountMeta::class); } - public function getEditNameAttribute(): string + protected function editName(): Attribute { - $name = $this->name; - - if (AccountTypeEnum::CASH->value === $this->accountType->type) { - return ''; - } - - return $name; + return Attribute::make(get: function () { + $name = $this->name; + if (AccountTypeEnum::CASH->value === $this->accountType->type) { + return ''; + } + return $name; + }); } public function locations(): MorphMany @@ -163,7 +152,8 @@ class Account extends Model return $this->belongsToMany(PiggyBank::class); } - public function scopeAccountTypeIn(EloquentBuilder $query, array $types): void + #[Scope] + protected function accountTypeIn(EloquentBuilder $query, array $types): void { if (false === $this->joinedAccountTypes) { $query->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id'); @@ -231,4 +221,18 @@ class Account extends Model get: static fn ($value) => (string) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + 'deleted_at' => 'datetime', + 'active' => 'boolean', + 'encrypted' => 'boolean', + 'virtual_balance' => 'string', + 'native_virtual_balance' => 'string', + ]; + } } diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php index c053cdafb4..5e3cca85e2 100644 --- a/app/Models/AccountMeta.php +++ b/app/Models/AccountMeta.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Models; +use Illuminate\Database\Eloquent\Casts\Attribute; use FireflyIII\Support\Models\ReturnsIntegerIdTrait; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -34,12 +35,6 @@ class AccountMeta extends Model { use ReturnsIntegerIdTrait; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - ]; - protected $fillable = ['account_id', 'name', 'data']; protected $table = 'account_meta'; @@ -48,13 +43,16 @@ class AccountMeta extends Model return $this->belongsTo(Account::class); } - public function getDataAttribute(mixed $value): string + protected function data(): Attribute { - return (string) json_decode((string) $value, true); + return Attribute::make(get: fn(mixed $value) => (string) json_decode((string) $value, true), set: fn(mixed $value) => ['data' => json_encode($value)]); } - public function setDataAttribute(mixed $value): void + protected function casts(): array { - $this->attributes['data'] = json_encode($value); + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + ]; } } diff --git a/app/Models/Attachment.php b/app/Models/Attachment.php index c46326e7fe..b8ba65a49b 100644 --- a/app/Models/Attachment.php +++ b/app/Models/Attachment.php @@ -40,16 +40,6 @@ class Attachment extends Model use ReturnsIntegerUserIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'uploaded' => 'boolean', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - ]; - protected $fillable = ['attachable_id', 'attachable_type', 'user_id', 'user_group_id', 'md5', 'filename', 'mime', 'title', 'description', 'size', 'uploaded']; /** @@ -110,4 +100,15 @@ class Attachment extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'uploaded' => 'boolean', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + ]; + } } diff --git a/app/Models/AuditLogEntry.php b/app/Models/AuditLogEntry.php index 436436340e..b5b27108af 100644 --- a/app/Models/AuditLogEntry.php +++ b/app/Models/AuditLogEntry.php @@ -35,15 +35,6 @@ class AuditLogEntry extends Model use ReturnsIntegerIdTrait; use SoftDeletes; - protected $casts - = [ - 'before' => 'array', - 'after' => 'array', - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - ]; - public function auditable(): MorphTo { return $this->morphTo(); @@ -67,4 +58,14 @@ class AuditLogEntry extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'before' => 'array', + 'after' => 'array', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + ]; + } } diff --git a/app/Models/AvailableBudget.php b/app/Models/AvailableBudget.php index 043ee93cf5..774900c289 100644 --- a/app/Models/AvailableBudget.php +++ b/app/Models/AvailableBudget.php @@ -39,20 +39,6 @@ class AvailableBudget extends Model use ReturnsIntegerUserIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'start_date' => 'date', - 'end_date' => 'date', - 'transaction_currency_id' => 'int', - 'amount' => 'string', - 'native_amount' => 'string', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - ]; - protected $fillable = ['user_id', 'user_group_id', 'transaction_currency_id', 'amount', 'start_date', 'end_date', 'start_date_tz', 'end_date_tz', 'native_amount']; /** @@ -117,4 +103,19 @@ class AvailableBudget extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'start_date' => 'date', + 'end_date' => 'date', + 'transaction_currency_id' => 'int', + 'amount' => 'string', + 'native_amount' => 'string', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + ]; + } } diff --git a/app/Models/Bill.php b/app/Models/Bill.php index 2e3ef309ea..9dd230feb3 100644 --- a/app/Models/Bill.php +++ b/app/Models/Bill.php @@ -42,25 +42,6 @@ class Bill extends Model use ReturnsIntegerUserIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'date' => SeparateTimezoneCaster::class, - 'end_date' => SeparateTimezoneCaster::class, - 'extension_date' => SeparateTimezoneCaster::class, - 'skip' => 'int', - 'automatch' => 'boolean', - 'active' => 'boolean', - 'name_encrypted' => 'boolean', - 'match_encrypted' => 'boolean', - 'amount_min' => 'string', - 'amount_max' => 'string', - 'native_amount_min' => 'string', - 'native_amount_max' => 'string', - ]; - protected $fillable = [ 'name', @@ -204,4 +185,24 @@ class Bill extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'date' => SeparateTimezoneCaster::class, + 'end_date' => SeparateTimezoneCaster::class, + 'extension_date' => SeparateTimezoneCaster::class, + 'skip' => 'int', + 'automatch' => 'boolean', + 'active' => 'boolean', + 'name_encrypted' => 'boolean', + 'match_encrypted' => 'boolean', + 'amount_min' => 'string', + 'amount_max' => 'string', + 'native_amount_min' => 'string', + 'native_amount_max' => 'string', + ]; + } } diff --git a/app/Models/Budget.php b/app/Models/Budget.php index ca1f083071..e670c69f31 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -41,17 +41,6 @@ class Budget extends Model use ReturnsIntegerUserIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'active' => 'boolean', - 'encrypted' => 'boolean', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - ]; - protected $fillable = ['user_id', 'user_group_id', 'name', 'active', 'order', 'user_group_id']; protected $hidden = ['encrypted']; @@ -123,4 +112,16 @@ class Budget extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'active' => 'boolean', + 'encrypted' => 'boolean', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + ]; + } } diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.php index 6f1c891182..571d750977 100644 --- a/app/Models/BudgetLimit.php +++ b/app/Models/BudgetLimit.php @@ -37,17 +37,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; class BudgetLimit extends Model { use ReturnsIntegerIdTrait; - - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'start_date' => SeparateTimezoneCaster::class, - 'end_date' => SeparateTimezoneCaster::class, - 'auto_budget' => 'boolean', - 'amount' => 'string', - 'native_amount' => 'string', - ]; protected $dispatchesEvents = [ 'created' => Created::class, @@ -120,4 +109,16 @@ class BudgetLimit extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'start_date' => SeparateTimezoneCaster::class, + 'end_date' => SeparateTimezoneCaster::class, + 'auto_budget' => 'boolean', + 'amount' => 'string', + 'native_amount' => 'string', + ]; + } } diff --git a/app/Models/Category.php b/app/Models/Category.php index a426ffa0a1..c8a47b6611 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -40,16 +40,6 @@ class Category extends Model use ReturnsIntegerUserIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'encrypted' => 'boolean', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - ]; - protected $fillable = ['user_id', 'user_group_id', 'name']; protected $hidden = ['encrypted']; @@ -104,4 +94,15 @@ class Category extends Model { return $this->belongsToMany(Transaction::class, 'category_transaction', 'category_id'); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'encrypted' => 'boolean', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + ]; + } } diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 78c9e8f44e..6cec2053c9 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Models; +use Illuminate\Database\Eloquent\Casts\Attribute; use FireflyIII\Support\Models\ReturnsIntegerIdTrait; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; @@ -35,13 +36,6 @@ class Configuration extends Model use ReturnsIntegerIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - ]; - protected $table = 'configuration'; /** @@ -51,16 +45,17 @@ class Configuration extends Model * * @return mixed */ - public function getDataAttribute($value) + protected function data(): Attribute { - return json_decode((string) $value); + return Attribute::make(get: fn($value) => json_decode((string) $value), set: fn($value) => ['data' => json_encode($value)]); } - /** - * @param mixed $value - */ - public function setDataAttribute($value): void + protected function casts(): array { - $this->attributes['data'] = json_encode($value); + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + ]; } } diff --git a/app/Models/CurrencyExchangeRate.php b/app/Models/CurrencyExchangeRate.php index 430a8c2464..3c8d13ceac 100644 --- a/app/Models/CurrencyExchangeRate.php +++ b/app/Models/CurrencyExchangeRate.php @@ -37,19 +37,6 @@ class CurrencyExchangeRate extends Model use ReturnsIntegerIdTrait; use ReturnsIntegerUserIdTrait; use SoftDeletes; - - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - 'from_currency_id' => 'integer', - 'to_currency_id' => 'integer', - 'date' => SeparateTimezoneCaster::class, - 'rate' => 'string', - 'user_rate' => 'string', - ]; protected $fillable = ['user_id', 'from_currency_id', 'to_currency_id', 'date', 'date_tz', 'rate']; public function fromCurrency(): BelongsTo @@ -94,4 +81,18 @@ class CurrencyExchangeRate extends Model get: static fn ($value) => (string) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + 'from_currency_id' => 'integer', + 'to_currency_id' => 'integer', + 'date' => SeparateTimezoneCaster::class, + 'rate' => 'string', + 'user_rate' => 'string', + ]; + } } diff --git a/app/Models/GroupMembership.php b/app/Models/GroupMembership.php index 1be2ef9b1d..59cc884d69 100644 --- a/app/Models/GroupMembership.php +++ b/app/Models/GroupMembership.php @@ -36,14 +36,6 @@ class GroupMembership extends Model use ReturnsIntegerIdTrait; use ReturnsIntegerUserIdTrait; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - ]; - protected $fillable = ['user_id', 'user_group_id', 'user_role_id']; public function user(): BelongsTo @@ -67,4 +59,13 @@ class GroupMembership extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + ]; + } } diff --git a/app/Models/InvitedUser.php b/app/Models/InvitedUser.php index da0d77e670..82596f72ec 100644 --- a/app/Models/InvitedUser.php +++ b/app/Models/InvitedUser.php @@ -36,14 +36,6 @@ class InvitedUser extends Model { use ReturnsIntegerIdTrait; use ReturnsIntegerUserIdTrait; - - protected $casts - = [ - 'expires' => SeparateTimezoneCaster::class, - 'redeemed' => 'boolean', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - ]; protected $fillable = ['user_group_id', 'user_id', 'email', 'invite_code', 'expires', 'expires_tz', 'redeemed']; /** @@ -68,4 +60,13 @@ class InvitedUser extends Model { return $this->belongsTo(User::class); } + protected function casts(): array + { + return [ + 'expires' => SeparateTimezoneCaster::class, + 'redeemed' => 'boolean', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + ]; + } } diff --git a/app/Models/LinkType.php b/app/Models/LinkType.php index a865277cd9..9a0579dd32 100644 --- a/app/Models/LinkType.php +++ b/app/Models/LinkType.php @@ -34,14 +34,6 @@ class LinkType extends Model use ReturnsIntegerIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'editable' => 'boolean', - ]; - protected $fillable = ['name', 'inward', 'outward', 'editable']; /** @@ -66,4 +58,13 @@ class LinkType extends Model { return $this->hasMany(TransactionJournalLink::class); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'editable' => 'boolean', + ]; + } } diff --git a/app/Models/Location.php b/app/Models/Location.php index 50d051d532..7762c20e80 100644 --- a/app/Models/Location.php +++ b/app/Models/Location.php @@ -34,16 +34,6 @@ class Location extends Model { use ReturnsIntegerIdTrait; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'zoomLevel' => 'int', - 'latitude' => 'float', - 'longitude' => 'float', - ]; - protected $fillable = ['locatable_id', 'locatable_type', 'latitude', 'longitude', 'zoom_level']; /** @@ -82,4 +72,15 @@ class Location extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'zoomLevel' => 'int', + 'latitude' => 'float', + 'longitude' => 'float', + ]; + } } diff --git a/app/Models/Note.php b/app/Models/Note.php index 29762af139..c5dcf0f54e 100644 --- a/app/Models/Note.php +++ b/app/Models/Note.php @@ -34,13 +34,6 @@ class Note extends Model use ReturnsIntegerIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - ]; - protected $fillable = ['title', 'text', 'noteable_id', 'noteable_type']; /** @@ -57,4 +50,12 @@ class Note extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + ]; + } } diff --git a/app/Models/ObjectGroup.php b/app/Models/ObjectGroup.php index a13614d01c..ec468a545d 100644 --- a/app/Models/ObjectGroup.php +++ b/app/Models/ObjectGroup.php @@ -37,15 +37,6 @@ class ObjectGroup extends Model { use ReturnsIntegerIdTrait; use ReturnsIntegerUserIdTrait; - - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - 'deleted_at' => 'datetime', - ]; protected $fillable = ['title', 'order', 'user_id', 'user_group_id']; /** @@ -105,4 +96,14 @@ class ObjectGroup extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + 'deleted_at' => 'datetime', + ]; + } } diff --git a/app/Models/PiggyBank.php b/app/Models/PiggyBank.php index 8d0a680941..2f16545ea3 100644 --- a/app/Models/PiggyBank.php +++ b/app/Models/PiggyBank.php @@ -39,20 +39,6 @@ class PiggyBank extends Model use ReturnsIntegerIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'start_date' => 'date', - 'target_date' => 'date', - 'order' => 'int', - 'active' => 'boolean', - 'encrypted' => 'boolean', - 'target_amount' => 'string', - 'native_target_amount' => 'string', - ]; - protected $fillable = ['name', 'order', 'target_amount', 'start_date', 'start_date_tz', 'target_date', 'target_date_tz', 'active', 'transaction_currency_id', 'native_target_amount']; /** @@ -154,4 +140,19 @@ class PiggyBank extends Model get: static fn ($value) => (string) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'start_date' => 'date', + 'target_date' => 'date', + 'order' => 'int', + 'active' => 'boolean', + 'encrypted' => 'boolean', + 'target_amount' => 'string', + 'native_target_amount' => 'string', + ]; + } } diff --git a/app/Models/PiggyBankEvent.php b/app/Models/PiggyBankEvent.php index 9ab7ab7c18..77afbf79ab 100644 --- a/app/Models/PiggyBankEvent.php +++ b/app/Models/PiggyBankEvent.php @@ -33,15 +33,6 @@ class PiggyBankEvent extends Model { use ReturnsIntegerIdTrait; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'date' => SeparateTimezoneCaster::class, - 'amount' => 'string', - 'native_amount' => 'string', - ]; - protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'date_tz', 'amount', 'native_amount']; protected $hidden = ['amount_encrypted']; @@ -80,4 +71,14 @@ class PiggyBankEvent extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'date' => SeparateTimezoneCaster::class, + 'amount' => 'string', + 'native_amount' => 'string', + ]; + } } diff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.php index 715d5b276c..a1dcd4dbe8 100644 --- a/app/Models/PiggyBankRepetition.php +++ b/app/Models/PiggyBankRepetition.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Models; +use Illuminate\Database\Eloquent\Attributes\Scope; use Carbon\Carbon; use FireflyIII\Casts\SeparateTimezoneCaster; use FireflyIII\Support\Models\ReturnsIntegerIdTrait; @@ -35,15 +36,6 @@ class PiggyBankRepetition extends Model { use ReturnsIntegerIdTrait; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'start_date' => SeparateTimezoneCaster::class, - 'target_date' => SeparateTimezoneCaster::class, - 'virtual_balance' => 'string', - ]; - protected $fillable = ['piggy_bank_id', 'start_date', 'start_date_tz', 'target_date', 'target_date_tz', 'current_amount']; public function piggyBank(): BelongsTo @@ -51,7 +43,8 @@ class PiggyBankRepetition extends Model return $this->belongsTo(PiggyBank::class); } - public function scopeOnDates(EloquentBuilder $query, Carbon $start, Carbon $target): EloquentBuilder + #[Scope] + protected function onDates(EloquentBuilder $query, Carbon $start, Carbon $target): EloquentBuilder { return $query->where('start_date', $start->format('Y-m-d'))->where('target_date', $target->format('Y-m-d')); } @@ -59,7 +52,8 @@ class PiggyBankRepetition extends Model /** * @return EloquentBuilder */ - public function scopeRelevantOnDate(EloquentBuilder $query, Carbon $date) + #[Scope] + protected function relevantOnDate(EloquentBuilder $query, Carbon $date) { return $query->where( static function (EloquentBuilder $q) use ($date): void { @@ -100,4 +94,14 @@ class PiggyBankRepetition extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'start_date' => SeparateTimezoneCaster::class, + 'target_date' => SeparateTimezoneCaster::class, + 'virtual_balance' => 'string', + ]; + } } diff --git a/app/Models/Preference.php b/app/Models/Preference.php index dbf2ef212f..60fa6fe682 100644 --- a/app/Models/Preference.php +++ b/app/Models/Preference.php @@ -35,15 +35,6 @@ class Preference extends Model use ReturnsIntegerIdTrait; use ReturnsIntegerUserIdTrait; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'data' => 'array', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - ]; - protected $fillable = ['user_id', 'data', 'name', 'user_group_id']; /** @@ -102,4 +93,14 @@ class Preference extends Model { return $this->belongsTo(User::class); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'data' => 'array', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + ]; + } } diff --git a/app/Models/Recurrence.php b/app/Models/Recurrence.php index 5d4ad39ccd..7c4ec43141 100644 --- a/app/Models/Recurrence.php +++ b/app/Models/Recurrence.php @@ -42,24 +42,6 @@ class Recurrence extends Model use ReturnsIntegerUserIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'title' => 'string', - 'id' => 'int', - 'description' => 'string', - 'first_date' => SeparateTimezoneCaster::class, - 'repeat_until' => SeparateTimezoneCaster::class, - 'latest_date' => SeparateTimezoneCaster::class, - 'repetitions' => 'int', - 'active' => 'bool', - 'apply_rules' => 'bool', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - ]; - protected $fillable = ['user_id', 'user_group_id', 'transaction_type_id', 'title', 'description', 'first_date', 'first_date_tz', 'repeat_until', 'repeat_until_tz', 'latest_date', 'latest_date_tz', 'repetitions', 'apply_rules', 'active']; @@ -137,4 +119,23 @@ class Recurrence extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'title' => 'string', + 'id' => 'int', + 'description' => 'string', + 'first_date' => SeparateTimezoneCaster::class, + 'repeat_until' => SeparateTimezoneCaster::class, + 'latest_date' => SeparateTimezoneCaster::class, + 'repetitions' => 'int', + 'active' => 'bool', + 'apply_rules' => 'bool', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + ]; + } } diff --git a/app/Models/RecurrenceMeta.php b/app/Models/RecurrenceMeta.php index c977252354..1e1642c68f 100644 --- a/app/Models/RecurrenceMeta.php +++ b/app/Models/RecurrenceMeta.php @@ -35,15 +35,6 @@ class RecurrenceMeta extends Model use ReturnsIntegerIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'name' => 'string', - 'value' => 'string', - ]; - protected $fillable = ['recurrence_id', 'name', 'value']; protected $table = 'recurrences_meta'; @@ -59,4 +50,14 @@ class RecurrenceMeta extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'name' => 'string', + 'value' => 'string', + ]; + } } diff --git a/app/Models/RecurrenceTransaction.php b/app/Models/RecurrenceTransaction.php index b648cf4cd2..544dd9823a 100644 --- a/app/Models/RecurrenceTransaction.php +++ b/app/Models/RecurrenceTransaction.php @@ -36,16 +36,6 @@ class RecurrenceTransaction extends Model use ReturnsIntegerIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'amount' => 'string', - 'foreign_amount' => 'string', - 'description' => 'string', - ]; - protected $fillable = [ 'recurrence_id', @@ -143,4 +133,15 @@ class RecurrenceTransaction extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'amount' => 'string', + 'foreign_amount' => 'string', + 'description' => 'string', + ]; + } } diff --git a/app/Models/RecurrenceTransactionMeta.php b/app/Models/RecurrenceTransactionMeta.php index c4e5758df4..bb644aa8db 100644 --- a/app/Models/RecurrenceTransactionMeta.php +++ b/app/Models/RecurrenceTransactionMeta.php @@ -35,15 +35,6 @@ class RecurrenceTransactionMeta extends Model use ReturnsIntegerIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'name' => 'string', - 'value' => 'string', - ]; - protected $fillable = ['rt_id', 'name', 'value']; protected $table = 'rt_meta'; @@ -59,4 +50,14 @@ class RecurrenceTransactionMeta extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'name' => 'string', + 'value' => 'string', + ]; + } } diff --git a/app/Models/Role.php b/app/Models/Role.php index 421e896d24..2b4b8761e9 100644 --- a/app/Models/Role.php +++ b/app/Models/Role.php @@ -32,16 +32,17 @@ class Role extends Model { use ReturnsIntegerIdTrait; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - ]; - protected $fillable = ['name', 'display_name', 'description']; public function users(): BelongsToMany { return $this->belongsToMany(User::class); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + ]; + } } diff --git a/app/Models/Rule.php b/app/Models/Rule.php index 86d8c36f20..7609316a4e 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -39,20 +39,6 @@ class Rule extends Model use ReturnsIntegerUserIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'active' => 'boolean', - 'order' => 'int', - 'stop_processing' => 'boolean', - 'id' => 'int', - 'strict' => 'boolean', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - ]; - protected $fillable = ['rule_group_id', 'order', 'active', 'title', 'description', 'user_id', 'user_group_id', 'strict']; /** @@ -101,9 +87,9 @@ class Rule extends Model /** * @param mixed $value */ - public function setDescriptionAttribute($value): void + protected function description(): Attribute { - $this->attributes['description'] = e($value); + return Attribute::make(set: fn($value) => ['description' => e($value)]); } public function userGroup(): BelongsTo @@ -124,4 +110,19 @@ class Rule extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'active' => 'boolean', + 'order' => 'int', + 'stop_processing' => 'boolean', + 'id' => 'int', + 'strict' => 'boolean', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + ]; + } } diff --git a/app/Models/RuleAction.php b/app/Models/RuleAction.php index f7fbd2e6eb..2725653f18 100644 --- a/app/Models/RuleAction.php +++ b/app/Models/RuleAction.php @@ -35,15 +35,6 @@ class RuleAction extends Model { use ReturnsIntegerIdTrait; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'active' => 'boolean', - 'order' => 'int', - 'stop_processing' => 'boolean', - ]; - protected $fillable = ['rule_id', 'action_type', 'action_value', 'order', 'active', 'stop_processing']; public function getValue(array $journal): string @@ -88,4 +79,14 @@ class RuleAction extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'active' => 'boolean', + 'order' => 'int', + 'stop_processing' => 'boolean', + ]; + } } diff --git a/app/Models/RuleGroup.php b/app/Models/RuleGroup.php index 02b6494bda..6a56c78e9b 100644 --- a/app/Models/RuleGroup.php +++ b/app/Models/RuleGroup.php @@ -39,18 +39,6 @@ class RuleGroup extends Model use ReturnsIntegerUserIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'active' => 'boolean', - 'stop_processing' => 'boolean', - 'order' => 'int', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - ]; - protected $fillable = ['user_id', 'user_group_id', 'stop_processing', 'order', 'title', 'description', 'active']; /** @@ -92,4 +80,17 @@ class RuleGroup extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'active' => 'boolean', + 'stop_processing' => 'boolean', + 'order' => 'int', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + ]; + } } diff --git a/app/Models/RuleTrigger.php b/app/Models/RuleTrigger.php index ac400525d9..71f16e75c1 100644 --- a/app/Models/RuleTrigger.php +++ b/app/Models/RuleTrigger.php @@ -32,15 +32,6 @@ class RuleTrigger extends Model { use ReturnsIntegerIdTrait; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'active' => 'boolean', - 'order' => 'int', - 'stop_processing' => 'boolean', - ]; - protected $fillable = ['rule_id', 'trigger_type', 'trigger_value', 'order', 'active', 'stop_processing']; public function rule(): BelongsTo @@ -61,4 +52,14 @@ class RuleTrigger extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'active' => 'boolean', + 'order' => 'int', + 'stop_processing' => 'boolean', + ]; + } } diff --git a/app/Models/Tag.php b/app/Models/Tag.php index fed190c86a..ce55c8cec7 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -40,19 +40,6 @@ class Tag extends Model use ReturnsIntegerUserIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'date' => SeparateTimezoneCaster::class, - 'zoomLevel' => 'int', - 'latitude' => 'float', - 'longitude' => 'float', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - ]; - protected $fillable = ['user_id', 'user_group_id', 'tag', 'date', 'date_tz', 'description', 'tagMode']; protected $hidden = ['zoomLevel', 'latitude', 'longitude']; @@ -99,4 +86,18 @@ class Tag extends Model { return $this->belongsToMany(TransactionJournal::class); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'date' => SeparateTimezoneCaster::class, + 'zoomLevel' => 'int', + 'latitude' => 'float', + 'longitude' => 'float', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + ]; + } } diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index cad47192fa..a68bf51480 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Models; +use Illuminate\Database\Eloquent\Attributes\Scope; use Carbon\Carbon; use FireflyIII\Support\Models\ReturnsIntegerIdTrait; use Illuminate\Database\Eloquent\Builder; @@ -39,25 +40,6 @@ class Transaction extends Model use ReturnsIntegerIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'identifier' => 'int', - 'encrypted' => 'boolean', // model does not have these fields though - 'bill_name_encrypted' => 'boolean', - 'reconciled' => 'boolean', - 'balance_dirty' => 'boolean', - 'balance_before' => 'string', - 'balance_after' => 'string', - 'date' => 'datetime', - 'amount' => 'string', - 'foreign_amount' => 'string', - 'native_amount' => 'string', - 'native_foreign_amount' => 'string', - ]; - protected $fillable = [ 'account_id', @@ -110,7 +92,8 @@ class Transaction extends Model /** * Check for transactions AFTER a specified date. */ - public function scopeAfter(Builder $query, Carbon $date): void + #[Scope] + protected function after(Builder $query, Carbon $date): void { if (!self::isJoined($query, 'transaction_journals')) { $query->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id'); @@ -137,7 +120,8 @@ class Transaction extends Model /** * Check for transactions BEFORE the specified date. */ - public function scopeBefore(Builder $query, Carbon $date): void + #[Scope] + protected function before(Builder $query, Carbon $date): void { if (!self::isJoined($query, 'transaction_journals')) { $query->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id'); @@ -145,7 +129,8 @@ class Transaction extends Model $query->where('transaction_journals.date', '<=', $date->format('Y-m-d 23:59:59')); } - public function scopeTransactionTypes(Builder $query, array $types): void + #[Scope] + protected function transactionTypes(Builder $query, array $types): void { if (!self::isJoined($query, 'transaction_journals')) { $query->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id'); @@ -215,4 +200,24 @@ class Transaction extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'identifier' => 'int', + 'encrypted' => 'boolean', // model does not have these fields though + 'bill_name_encrypted' => 'boolean', + 'reconciled' => 'boolean', + 'balance_dirty' => 'boolean', + 'balance_before' => 'string', + 'balance_after' => 'string', + 'date' => 'datetime', + 'amount' => 'string', + 'foreign_amount' => 'string', + 'native_amount' => 'string', + 'native_foreign_amount' => 'string', + ]; + } } diff --git a/app/Models/TransactionCurrency.php b/app/Models/TransactionCurrency.php index 33f08ee01b..99342bc5df 100644 --- a/app/Models/TransactionCurrency.php +++ b/app/Models/TransactionCurrency.php @@ -39,14 +39,6 @@ class TransactionCurrency extends Model public ?bool $userGroupEnabled = null; public ?bool $userGroupNative = null; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'decimal_places' => 'int', - 'enabled' => 'bool', - ]; protected $fillable = ['name', 'code', 'symbol', 'decimal_places', 'enabled']; @@ -115,4 +107,14 @@ class TransactionCurrency extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'decimal_places' => 'int', + 'enabled' => 'bool', + ]; + } } diff --git a/app/Models/TransactionGroup.php b/app/Models/TransactionGroup.php index 9128667f97..5d9870ee72 100644 --- a/app/Models/TransactionGroup.php +++ b/app/Models/TransactionGroup.php @@ -38,18 +38,6 @@ class TransactionGroup extends Model use ReturnsIntegerUserIdTrait; use SoftDeletes; - protected $casts - = [ - 'id' => 'integer', - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'title' => 'string', - 'date' => 'datetime', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - ]; - protected $fillable = ['user_id', 'user_group_id', 'title']; /** @@ -97,4 +85,17 @@ class TransactionGroup extends Model { return $this->belongsTo(UserGroup::class); } + protected function casts(): array + { + return [ + 'id' => 'integer', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'title' => 'string', + 'date' => 'datetime', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + ]; + } } diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index 6c39101e1a..64621f0c52 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Models; +use Illuminate\Database\Eloquent\Attributes\Scope; use Carbon\Carbon; use FireflyIII\Casts\SeparateTimezoneCaster; use FireflyIII\Enums\TransactionTypeEnum; @@ -52,23 +53,6 @@ class TransactionJournal extends Model use ReturnsIntegerUserIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - 'date' => SeparateTimezoneCaster::class, - 'interest_date' => 'date', - 'book_date' => 'date', - 'process_date' => 'date', - 'order' => 'int', - 'tag_count' => 'int', - 'encrypted' => 'boolean', - 'completed' => 'boolean', - 'user_id' => 'integer', - 'user_group_id' => 'integer', - ]; - protected $fillable = [ 'user_id', @@ -181,7 +165,8 @@ class TransactionJournal extends Model return $query->where('transaction_journals.date', '<=', $date->format('Y-m-d H:i:s')); } - public function scopeTransactionTypes(EloquentBuilder $query, array $types): void + #[Scope] + protected function transactionTypes(EloquentBuilder $query, array $types): void { if (!self::isJoined($query, 'transaction_types')) { $query->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id'); @@ -259,4 +244,22 @@ class TransactionJournal extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + 'date' => SeparateTimezoneCaster::class, + 'interest_date' => 'date', + 'book_date' => 'date', + 'process_date' => 'date', + 'order' => 'int', + 'tag_count' => 'int', + 'encrypted' => 'boolean', + 'completed' => 'boolean', + 'user_id' => 'integer', + 'user_group_id' => 'integer', + ]; + } } diff --git a/app/Models/TransactionJournalLink.php b/app/Models/TransactionJournalLink.php index 4d7d8a632f..4263db2d8e 100644 --- a/app/Models/TransactionJournalLink.php +++ b/app/Models/TransactionJournalLink.php @@ -34,12 +34,6 @@ class TransactionJournalLink extends Model { use ReturnsIntegerIdTrait; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - ]; - protected $table = 'journal_links'; /** @@ -109,4 +103,11 @@ class TransactionJournalLink extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + ]; + } } diff --git a/app/Models/TransactionJournalMeta.php b/app/Models/TransactionJournalMeta.php index 51bfd13e34..e82a372c1f 100644 --- a/app/Models/TransactionJournalMeta.php +++ b/app/Models/TransactionJournalMeta.php @@ -37,35 +37,20 @@ class TransactionJournalMeta extends Model use ReturnsIntegerIdTrait; use SoftDeletes; - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'deleted_at' => 'datetime', - ]; - protected $fillable = ['transaction_journal_id', 'name', 'data', 'hash']; protected $table = 'journal_meta'; - /** * @param mixed $value * * @return mixed */ - public function getDataAttribute($value) + protected function data(): Attribute { - return json_decode((string) $value, false); - } - - /** - * @param mixed $value - */ - public function setDataAttribute($value): void - { - $data = json_encode($value); - $this->attributes['data'] = $data; - $this->attributes['hash'] = hash('sha256', (string) $data); + return Attribute::make(get: fn($value) => json_decode((string) $value, false), set: function ($value) { + $data = json_encode($value); + return ['data' => $data, 'hash' => hash('sha256', (string) $data)]; + }); } public function transactionJournal(): BelongsTo @@ -79,4 +64,12 @@ class TransactionJournalMeta extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', + ]; + } } diff --git a/app/Models/WebhookMessage.php b/app/Models/WebhookMessage.php index f18347330c..2a4bc459d1 100644 --- a/app/Models/WebhookMessage.php +++ b/app/Models/WebhookMessage.php @@ -36,15 +36,6 @@ class WebhookMessage extends Model { use ReturnsIntegerIdTrait; - protected $casts - = [ - 'sent' => 'boolean', - 'errored' => 'boolean', - 'uuid' => 'string', - 'message' => 'json', - 'logs' => 'json', - ]; - /** * Route binder. Converts the key in the URL to the specified object (or throw 404). * @@ -94,4 +85,14 @@ class WebhookMessage extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array + { + return [ + 'sent' => 'boolean', + 'errored' => 'boolean', + 'uuid' => 'string', + 'message' => 'json', + 'logs' => 'json', + ]; + } } diff --git a/app/Providers/AccountServiceProvider.php b/app/Providers/AccountServiceProvider.php index 311aae4bba..caa4ffe49f 100644 --- a/app/Providers/AccountServiceProvider.php +++ b/app/Providers/AccountServiceProvider.php @@ -59,8 +59,7 @@ class AccountServiceProvider extends ServiceProvider private function registerRepository(): void { $this->app->bind( - AccountRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): AccountRepositoryInterface { /** @var AccountRepositoryInterface $repository */ $repository = app(AccountRepository::class); @@ -74,8 +73,7 @@ class AccountServiceProvider extends ServiceProvider ); $this->app->bind( - OperationsRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): OperationsRepositoryInterface { /** @var OperationsRepository $repository */ $repository = app(OperationsRepository::class); @@ -95,8 +93,7 @@ class AccountServiceProvider extends ServiceProvider private function registerTasker(): void { $this->app->bind( - AccountTaskerInterface::class, - static function (Application $app) { + static function (Application $app): AccountTaskerInterface { /** @var AccountTaskerInterface $tasker */ $tasker = app(AccountTasker::class); diff --git a/app/Providers/AdminServiceProvider.php b/app/Providers/AdminServiceProvider.php index ac768ddb9d..a775515130 100644 --- a/app/Providers/AdminServiceProvider.php +++ b/app/Providers/AdminServiceProvider.php @@ -54,8 +54,7 @@ class AdminServiceProvider extends ServiceProvider private function linkType(): void { $this->app->bind( - LinkTypeRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): LinkTypeRepositoryInterface { /** @var LinkTypeRepository $repository */ $repository = app(LinkTypeRepository::class); // reference to auth is not understood by phpstan. diff --git a/app/Providers/AttachmentServiceProvider.php b/app/Providers/AttachmentServiceProvider.php index 50a00766fe..4b653f5b69 100644 --- a/app/Providers/AttachmentServiceProvider.php +++ b/app/Providers/AttachmentServiceProvider.php @@ -46,8 +46,7 @@ class AttachmentServiceProvider extends ServiceProvider public function register(): void { $this->app->bind( - AttachmentRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): AttachmentRepositoryInterface { /** @var AttachmentRepositoryInterface $repository */ $repository = app(AttachmentRepository::class); // reference to auth is not understood by phpstan. diff --git a/app/Providers/BillServiceProvider.php b/app/Providers/BillServiceProvider.php index 2035762a51..0a5472304d 100644 --- a/app/Providers/BillServiceProvider.php +++ b/app/Providers/BillServiceProvider.php @@ -46,8 +46,7 @@ class BillServiceProvider extends ServiceProvider public function register(): void { $this->app->bind( - BillRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): BillRepositoryInterface { /** @var BillRepositoryInterface $repository */ $repository = app(BillRepository::class); diff --git a/app/Providers/BudgetServiceProvider.php b/app/Providers/BudgetServiceProvider.php index 25184a1aac..a6bc575d31 100644 --- a/app/Providers/BudgetServiceProvider.php +++ b/app/Providers/BudgetServiceProvider.php @@ -57,8 +57,7 @@ class BudgetServiceProvider extends ServiceProvider { // reference to auth is not understood by phpstan. $this->app->bind( - BudgetRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): BudgetRepositoryInterface { /** @var BudgetRepositoryInterface $repository */ $repository = app(BudgetRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line @@ -71,8 +70,7 @@ class BudgetServiceProvider extends ServiceProvider // available budget repos $this->app->bind( - AvailableBudgetRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): AvailableBudgetRepositoryInterface { /** @var AvailableBudgetRepositoryInterface $repository */ $repository = app(AvailableBudgetRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line @@ -85,8 +83,7 @@ class BudgetServiceProvider extends ServiceProvider // budget limit repository. $this->app->bind( - BudgetLimitRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): BudgetLimitRepositoryInterface { /** @var BudgetLimitRepositoryInterface $repository */ $repository = app(BudgetLimitRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line @@ -99,8 +96,7 @@ class BudgetServiceProvider extends ServiceProvider // no budget repos $this->app->bind( - NoBudgetRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): NoBudgetRepositoryInterface { /** @var NoBudgetRepositoryInterface $repository */ $repository = app(NoBudgetRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line @@ -113,8 +109,7 @@ class BudgetServiceProvider extends ServiceProvider // operations repos $this->app->bind( - OperationsRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): OperationsRepositoryInterface { /** @var OperationsRepositoryInterface $repository */ $repository = app(OperationsRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line diff --git a/app/Providers/CategoryServiceProvider.php b/app/Providers/CategoryServiceProvider.php index 2ab8db6ff5..6346fea046 100644 --- a/app/Providers/CategoryServiceProvider.php +++ b/app/Providers/CategoryServiceProvider.php @@ -51,8 +51,7 @@ class CategoryServiceProvider extends ServiceProvider { // phpstan does not understand reference to 'auth'. $this->app->bind( - CategoryRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): CategoryRepositoryInterface { /** @var CategoryRepository $repository */ $repository = app(CategoryRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line @@ -64,8 +63,7 @@ class CategoryServiceProvider extends ServiceProvider ); $this->app->bind( - OperationsRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): OperationsRepositoryInterface { /** @var OperationsRepository $repository */ $repository = app(OperationsRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line @@ -77,8 +75,7 @@ class CategoryServiceProvider extends ServiceProvider ); $this->app->bind( - NoCategoryRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): NoCategoryRepositoryInterface { /** @var NoCategoryRepository $repository */ $repository = app(NoCategoryRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line diff --git a/app/Providers/CurrencyServiceProvider.php b/app/Providers/CurrencyServiceProvider.php index 6ffb3688f7..3b6a751b64 100644 --- a/app/Providers/CurrencyServiceProvider.php +++ b/app/Providers/CurrencyServiceProvider.php @@ -25,7 +25,6 @@ namespace FireflyIII\Providers; use FireflyIII\Repositories\Currency\CurrencyRepository; use FireflyIII\Repositories\Currency\CurrencyRepository as GroupCurrencyRepository; -use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface as GroupCurrencyRepositoryInterface; use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepository; use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepositoryInterface; @@ -50,8 +49,7 @@ class CurrencyServiceProvider extends ServiceProvider public function register(): void { $this->app->bind( - CurrencyRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): GroupCurrencyRepositoryInterface { /** @var CurrencyRepository $repository */ $repository = app(CurrencyRepository::class); // phpstan does not get the reference to auth @@ -63,8 +61,7 @@ class CurrencyServiceProvider extends ServiceProvider } ); $this->app->bind( - GroupCurrencyRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): GroupCurrencyRepositoryInterface { /** @var GroupCurrencyRepository $repository */ $repository = app(GroupCurrencyRepository::class); // phpstan does not get the reference to auth @@ -77,8 +74,7 @@ class CurrencyServiceProvider extends ServiceProvider ); $this->app->bind( - ExchangeRateRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): ExchangeRateRepositoryInterface { /** @var ExchangeRateRepository $repository */ $repository = app(ExchangeRateRepository::class); // phpstan does not get the reference to auth diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php index 83b4c1e585..02ff3d729b 100644 --- a/app/Providers/FireflyServiceProvider.php +++ b/app/Providers/FireflyServiceProvider.php @@ -163,8 +163,7 @@ class FireflyServiceProvider extends ServiceProvider $this->app->bind(ALERepositoryInterface::class, ALERepository::class); $this->app->bind( - ObjectGroupRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): ObjectGroupRepositoryInterface { /** @var ObjectGroupRepository $repository */ $repository = app(ObjectGroupRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) @@ -176,8 +175,7 @@ class FireflyServiceProvider extends ServiceProvider ); $this->app->bind( - WebhookRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): WebhookRepositoryInterface { /** @var WebhookRepository $repository */ $repository = app(WebhookRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) @@ -190,8 +188,7 @@ class FireflyServiceProvider extends ServiceProvider // rule expression language $this->app->singleton( - ExpressionLanguage::class, - static function () { + static function (): ExpressionLanguage { $expressionLanguage = new ExpressionLanguage(); $expressionLanguage->registerProvider(new ActionExpressionLanguageProvider()); @@ -200,8 +197,7 @@ class FireflyServiceProvider extends ServiceProvider ); $this->app->bind( - RuleEngineInterface::class, - static function (Application $app) { + static function (Application $app): RuleEngineInterface { /** @var SearchRuleEngine $engine */ $engine = app(SearchRuleEngine::class); if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) @@ -213,8 +209,7 @@ class FireflyServiceProvider extends ServiceProvider ); $this->app->bind( - UserGroupRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): UserGroupRepositoryInterface { /** @var UserGroupRepository $repository */ $repository = app(UserGroupRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) diff --git a/app/Providers/JournalServiceProvider.php b/app/Providers/JournalServiceProvider.php index 3c02bbaed4..ac27b169ba 100644 --- a/app/Providers/JournalServiceProvider.php +++ b/app/Providers/JournalServiceProvider.php @@ -64,8 +64,7 @@ class JournalServiceProvider extends ServiceProvider private function registerRepository(): void { $this->app->bind( - JournalRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): JournalRepositoryInterface { /** @var JournalRepositoryInterface $repository */ $repository = app(JournalRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) @@ -78,8 +77,7 @@ class JournalServiceProvider extends ServiceProvider // also bind new API repository $this->app->bind( - JournalAPIRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): JournalAPIRepositoryInterface { /** @var JournalAPIRepositoryInterface $repository */ $repository = app(JournalAPIRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) @@ -92,8 +90,7 @@ class JournalServiceProvider extends ServiceProvider // also bind new CLI repository $this->app->bind( - JournalCLIRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): JournalCLIRepositoryInterface { /** @var JournalCLIRepositoryInterface $repository */ $repository = app(JournalCLIRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) @@ -111,8 +108,7 @@ class JournalServiceProvider extends ServiceProvider private function registerGroupRepository(): void { $this->app->bind( - TransactionGroupRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): TransactionGroupRepositoryInterface { /** @var TransactionGroupRepositoryInterface $repository */ $repository = app(TransactionGroupRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) @@ -127,8 +123,7 @@ class JournalServiceProvider extends ServiceProvider private function registerGroupCollector(): void { $this->app->bind( - GroupCollectorInterface::class, - static function (Application $app) { + static function (Application $app): GroupCollectorInterface { /** @var GroupCollectorInterface $collector */ $collector = app(GroupCollector::class); if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) diff --git a/app/Providers/PiggyBankServiceProvider.php b/app/Providers/PiggyBankServiceProvider.php index c89fe9c6d0..99020bc2e3 100644 --- a/app/Providers/PiggyBankServiceProvider.php +++ b/app/Providers/PiggyBankServiceProvider.php @@ -46,8 +46,7 @@ class PiggyBankServiceProvider extends ServiceProvider public function register(): void { $this->app->bind( - PiggyBankRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): PiggyBankRepositoryInterface { /** @var PiggyBankRepository $repository */ $repository = app(PiggyBankRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) diff --git a/app/Providers/RecurringServiceProvider.php b/app/Providers/RecurringServiceProvider.php index b9aeed4c4f..a8184d735f 100644 --- a/app/Providers/RecurringServiceProvider.php +++ b/app/Providers/RecurringServiceProvider.php @@ -46,8 +46,7 @@ class RecurringServiceProvider extends ServiceProvider public function register(): void { $this->app->bind( - RecurringRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): RecurringRepositoryInterface { /** @var RecurringRepositoryInterface $repository */ $repository = app(RecurringRepository::class); diff --git a/app/Providers/RuleGroupServiceProvider.php b/app/Providers/RuleGroupServiceProvider.php index df76177faf..32fa85b17e 100644 --- a/app/Providers/RuleGroupServiceProvider.php +++ b/app/Providers/RuleGroupServiceProvider.php @@ -46,8 +46,7 @@ class RuleGroupServiceProvider extends ServiceProvider public function register(): void { $this->app->bind( - RuleGroupRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): RuleGroupRepositoryInterface { /** @var RuleGroupRepository $repository */ $repository = app(RuleGroupRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) diff --git a/app/Providers/RuleServiceProvider.php b/app/Providers/RuleServiceProvider.php index 6c3df05f49..e7b235588f 100644 --- a/app/Providers/RuleServiceProvider.php +++ b/app/Providers/RuleServiceProvider.php @@ -46,8 +46,7 @@ class RuleServiceProvider extends ServiceProvider public function register(): void { $this->app->bind( - RuleRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): RuleRepositoryInterface { /** @var RuleRepository $repository */ $repository = app(RuleRepository::class); if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) diff --git a/app/Providers/SearchServiceProvider.php b/app/Providers/SearchServiceProvider.php index 93b96a4b97..baf32f811b 100644 --- a/app/Providers/SearchServiceProvider.php +++ b/app/Providers/SearchServiceProvider.php @@ -49,8 +49,7 @@ class SearchServiceProvider extends ServiceProvider public function register(): void { $this->app->bind( - QueryParserInterface::class, - static function (): GdbotsQueryParser|QueryParser { + static function (): QueryParserInterface { $implementation = config('search.query_parser'); return match ($implementation) { @@ -61,8 +60,7 @@ class SearchServiceProvider extends ServiceProvider ); $this->app->bind( - SearchInterface::class, - static function (Application $app) { + static function (Application $app): SearchInterface { /** @var OperatorQuerySearch $search */ $search = app(OperatorQuerySearch::class); if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) diff --git a/app/Providers/TagServiceProvider.php b/app/Providers/TagServiceProvider.php index 0b11619c22..85b9b85cfe 100644 --- a/app/Providers/TagServiceProvider.php +++ b/app/Providers/TagServiceProvider.php @@ -48,8 +48,7 @@ class TagServiceProvider extends ServiceProvider public function register(): void { $this->app->bind( - TagRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): TagRepositoryInterface { /** @var TagRepository $repository */ $repository = app(TagRepository::class); @@ -62,8 +61,7 @@ class TagServiceProvider extends ServiceProvider ); $this->app->bind( - OperationsRepositoryInterface::class, - static function (Application $app) { + static function (Application $app): OperationsRepositoryInterface { /** @var OperationsRepository $repository */ $repository = app(OperationsRepository::class); diff --git a/app/User.php b/app/User.php index 46a0041ec3..a14e3d310c 100644 --- a/app/User.php +++ b/app/User.php @@ -73,13 +73,6 @@ class User extends Authenticatable use HasApiTokens; use Notifiable; use ReturnsIntegerIdTrait; - - protected $casts - = [ - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - 'blocked' => 'boolean', - ]; protected $fillable = ['email', 'password', 'blocked', 'blocked_code']; protected $hidden = ['password', 'remember_token']; protected $table = 'users'; @@ -539,4 +532,12 @@ class User extends Authenticatable { return $this->hasMany(Webhook::class); } + protected function casts(): array + { + return [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'blocked' => 'boolean', + ]; + } } diff --git a/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php b/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php index 8f8cffba91..89ea275b39 100644 --- a/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php +++ b/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Validation\Api\Data\Bulk; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Repositories\Account\AccountRepositoryInterface; -use Illuminate\Validation\Validator; use function Safe\json_decode; diff --git a/app/Validation/AutoBudget/ValidatesAutoBudgetRequest.php b/app/Validation/AutoBudget/ValidatesAutoBudgetRequest.php index 581e0da61c..1967857616 100644 --- a/app/Validation/AutoBudget/ValidatesAutoBudgetRequest.php +++ b/app/Validation/AutoBudget/ValidatesAutoBudgetRequest.php @@ -24,7 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Validation\AutoBudget; -use Illuminate\Validation\Validator; +use Illuminate\Contracts\Validation\Validator; /** * Trait ValidatesAutoBudgetRequest diff --git a/app/Validation/CurrencyValidation.php b/app/Validation/CurrencyValidation.php index 52bad8ff61..bc4711ba9e 100644 --- a/app/Validation/CurrencyValidation.php +++ b/app/Validation/CurrencyValidation.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Validation; +use Illuminate\Contracts\Validation\Validator; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Trait CurrencyValidation diff --git a/app/Validation/GroupValidation.php b/app/Validation/GroupValidation.php index 84c32cfc90..7a8176f7ec 100644 --- a/app/Validation/GroupValidation.php +++ b/app/Validation/GroupValidation.php @@ -24,10 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Validation; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionGroup; -use Illuminate\Validation\Validator; /** * Trait GroupValidation. diff --git a/app/Validation/RecurrenceValidation.php b/app/Validation/RecurrenceValidation.php index 52b829203e..9ec2ccd3ab 100644 --- a/app/Validation/RecurrenceValidation.php +++ b/app/Validation/RecurrenceValidation.php @@ -24,10 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Validation; +use Illuminate\Contracts\Validation\Validator; use Carbon\Carbon; use FireflyIII\Models\Recurrence; use FireflyIII\Models\RecurrenceTransaction; -use Illuminate\Validation\Validator; use InvalidArgumentException; /** diff --git a/app/Validation/TransactionValidation.php b/app/Validation/TransactionValidation.php index b03511f193..c56c976c16 100644 --- a/app/Validation/TransactionValidation.php +++ b/app/Validation/TransactionValidation.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Validation; +use Illuminate\Contracts\Validation\Validator; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; @@ -36,7 +37,6 @@ use FireflyIII\Repositories\Account\AccountRepository; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\User; use Illuminate\Support\Facades\Log; -use Illuminate\Validation\Validator; /** * Trait TransactionValidation diff --git a/composer.json b/composer.json index 87e1ec158b..037c109753 100644 --- a/composer.json +++ b/composer.json @@ -114,6 +114,7 @@ "require-dev": { "barryvdh/laravel-debugbar": "^3.9", "barryvdh/laravel-ide-helper": "^3", + "driftingly/rector-laravel": "^2.0", "fakerphp/faker": "1.*", "filp/whoops": "2.*", "larastan/larastan": "^3", diff --git a/composer.lock b/composer.lock index 630b710370..9089bdf6ed 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": "b630645d62adf0b4c2a9a16ccfc7a3cc", + "content-hash": "5c65637d2a997c3503e4922eb7647e2a", "packages": [ { "name": "bacon/bacon-qr-code", @@ -10288,6 +10288,41 @@ ], "time": "2024-11-12T16:29:46+00:00" }, + { + "name": "driftingly/rector-laravel", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/driftingly/rector-laravel.git", + "reference": "ac61de4f267c23249d175d7fc9149fd01528567d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/driftingly/rector-laravel/zipball/ac61de4f267c23249d175d7fc9149fd01528567d", + "reference": "ac61de4f267c23249d175d7fc9149fd01528567d", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "rector/rector": "^2.0" + }, + "type": "rector-extension", + "autoload": { + "psr-4": { + "RectorLaravel\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Rector upgrades rules for Laravel Framework", + "support": { + "issues": "https://github.com/driftingly/rector-laravel/issues", + "source": "https://github.com/driftingly/rector-laravel/tree/2.0.5" + }, + "time": "2025-05-14T17:30:41+00:00" + }, { "name": "fakerphp/faker", "version": "v1.24.1", From adba36046620bf9dcf8e09125893bceb32d5da5f Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 29 May 2025 15:22:55 +0200 Subject: [PATCH 03/44] Update some code with rector. --- .ci/rector.php | 15 ++++++++------- .../Support/Models/BillDateCalculatorTest.php | 2 +- .../Support/NavigationCustomEndOfPeriodTest.php | 2 +- tests/unit/Support/Calendar/CalculatorTest.php | 4 ++-- .../Calendar/Periodicity/IntervalTestCase.php | 2 +- tests/unit/Support/NavigationAddPeriodTest.php | 8 ++++---- tests/unit/Support/NavigationEndOfPeriodTest.php | 4 ++-- ...avigationPreferredCarbonFormatByPeriodTest.php | 2 +- .../NavigationPreferredCarbonFormatTest.php | 2 +- .../NavigationPreferredEndOfPeriodTest.php | 2 +- .../NavigationPreferredRangeFormatTest.php | 2 +- .../Support/NavigationPreferredSqlFormatTest.php | 2 +- .../unit/Support/NavigationStartOfPeriodTest.php | 4 ++-- ...stractQueryParserInterfaceParseQueryTester.php | 2 +- 14 files changed, 27 insertions(+), 26 deletions(-) diff --git a/.ci/rector.php b/.ci/rector.php index 7c9ac6c6df..1a6971352b 100644 --- a/.ci/rector.php +++ b/.ci/rector.php @@ -34,16 +34,17 @@ return RectorConfig::configure() ChangeOrIfContinueToMultiContinueRector::class, StringToClassConstantRector::class => [ __DIR__ . '/../app/Http/Controllers/Auth/LoginController.php', - ] + ], + __DIR__.'/../bootstrap/cache/*' ]) ->withPaths([ __DIR__ . '/../app', -// __DIR__ . '/../bootstrap', -// __DIR__ . '/../config', -// __DIR__ . '/../public', -// __DIR__ . '/../resources/lang/en_US', -// __DIR__ . '/../routes', -// __DIR__ . '/../tests', + __DIR__ . '/../bootstrap', + __DIR__ . '/../config', + __DIR__ . '/../public', + __DIR__ . '/../resources/lang/en_US', + __DIR__ . '/../routes', + __DIR__ . '/../tests', ]) ->withSets([ LaravelLevelSetList::UP_TO_LARAVEL_120, diff --git a/tests/integration/Support/Models/BillDateCalculatorTest.php b/tests/integration/Support/Models/BillDateCalculatorTest.php index 1164fce606..d8206c714a 100644 --- a/tests/integration/Support/Models/BillDateCalculatorTest.php +++ b/tests/integration/Support/Models/BillDateCalculatorTest.php @@ -56,7 +56,7 @@ final class BillDateCalculatorTest extends TestCase public function testGivenSomeDataItWorks(Carbon $earliest, Carbon $latest, Carbon $billStart, string $period, int $skip, ?Carbon $lastPaid, array $expected): void { $result = $this->calculator->getPayDates($earliest, $latest, $billStart, $period, $skip, $lastPaid); - self::assertSame($expected, $result); + $this->assertSame($expected, $result); } public static function provideDates(): Iterator diff --git a/tests/integration/Support/NavigationCustomEndOfPeriodTest.php b/tests/integration/Support/NavigationCustomEndOfPeriodTest.php index 18a4166646..16102bc7fc 100644 --- a/tests/integration/Support/NavigationCustomEndOfPeriodTest.php +++ b/tests/integration/Support/NavigationCustomEndOfPeriodTest.php @@ -45,6 +45,6 @@ final class NavigationCustomEndOfPeriodTest extends TestCase $navigation = new Navigation(); $period = $navigation->endOfPeriod($from, 'custom'); - self::assertSame($expected->toDateString(), $period->toDateString()); + $this->assertSame($expected->toDateString(), $period->toDateString()); } } diff --git a/tests/unit/Support/Calendar/CalculatorTest.php b/tests/unit/Support/Calendar/CalculatorTest.php index ec2be998c9..d6d9677361 100644 --- a/tests/unit/Support/Calendar/CalculatorTest.php +++ b/tests/unit/Support/Calendar/CalculatorTest.php @@ -73,7 +73,7 @@ final class CalculatorTest extends TestCase { $calculator = new Calculator(); $period = $calculator->nextDateByInterval($provider->epoch(), $provider->periodicity); - self::assertSame($provider->expected()->toDateString(), $period->toDateString()); + $this->assertSame($provider->expected()->toDateString(), $period->toDateString()); } public static function provideAllPeriodicity(): iterable @@ -102,7 +102,7 @@ final class CalculatorTest extends TestCase { $calculator = new Calculator(); $period = $calculator->nextDateByInterval($provider->epoch(), $provider->periodicity, $provider->skip); - self::assertSame($provider->expected()->toDateString(), $period->toDateString()); + $this->assertSame($provider->expected()->toDateString(), $period->toDateString()); } public static function provideSkippedIntervals(): iterable diff --git a/tests/unit/Support/Calendar/Periodicity/IntervalTestCase.php b/tests/unit/Support/Calendar/Periodicity/IntervalTestCase.php index 7a67095366..0654ab3247 100644 --- a/tests/unit/Support/Calendar/Periodicity/IntervalTestCase.php +++ b/tests/unit/Support/Calendar/Periodicity/IntervalTestCase.php @@ -36,7 +36,7 @@ abstract class IntervalTestCase extends TestCase public function testGivenAnEpochWhenCallTheNextDateThenReturnsTheExpectedDateSuccessful(IntervalProvider $provider): void { $period = static::factory()->nextDate($provider->epoch); - self::assertSame($provider->expected->toDateString(), $period->toDateString()); + $this->assertSame($provider->expected->toDateString(), $period->toDateString()); } public static function provider(): iterable diff --git a/tests/unit/Support/NavigationAddPeriodTest.php b/tests/unit/Support/NavigationAddPeriodTest.php index e492584c50..1c13a557b4 100644 --- a/tests/unit/Support/NavigationAddPeriodTest.php +++ b/tests/unit/Support/NavigationAddPeriodTest.php @@ -56,7 +56,7 @@ final class NavigationAddPeriodTest extends TestCase public function testGivenAFrequencyAndSkipIntervalWhenCalculateTheDateThenReturnsTheSkippedDateSuccessful(int $skip, string $frequency, Carbon $from, Carbon $expected): void { $period = $this->navigation->addPeriod($from, $frequency, $skip); - self::assertSame($expected->toDateString(), $period->toDateString()); + $this->assertSame($expected->toDateString(), $period->toDateString()); } public static function providePeriodsWithSkippingParam(): iterable @@ -108,7 +108,7 @@ final class NavigationAddPeriodTest extends TestCase public function testGivenAFrequencyWhenCalculateTheDateThenReturnsTheExpectedDateSuccessful(string $frequency, Carbon $from, Carbon $expected): void { $period = $this->navigation->addPeriod($from, $frequency, 0); - self::assertSame($expected->toDateString(), $period->toDateString()); + $this->assertSame($expected->toDateString(), $period->toDateString()); } public static function providePeriods(): Iterator @@ -158,7 +158,7 @@ final class NavigationAddPeriodTest extends TestCase public function testGivenAIntervalWhenCallTheNextDateByIntervalMethodThenReturnsTheExpectedDateSuccessful(Periodicity $periodicity, Carbon $from, Carbon $expected): void { $period = $this->navigation->nextDateByInterval($from, $periodicity); - self::assertSame($expected->toDateString(), $period->toDateString()); + $this->assertSame($expected->toDateString(), $period->toDateString()); } public static function provideFrequencies(): Iterator @@ -212,7 +212,7 @@ final class NavigationAddPeriodTest extends TestCase public function testGivenAMonthFrequencyWhenCalculateTheDateThenReturnsTheLastDayOfMonthSuccessful(string $frequency, Carbon $from, Carbon $expected): void { $period = $this->navigation->addPeriod($from, $frequency, 0); - self::assertSame($expected->toDateString(), $period->toDateString()); + $this->assertSame($expected->toDateString(), $period->toDateString()); } public static function provideMonthPeriods(): Iterator diff --git a/tests/unit/Support/NavigationEndOfPeriodTest.php b/tests/unit/Support/NavigationEndOfPeriodTest.php index f76bb84be9..4e8ccea578 100644 --- a/tests/unit/Support/NavigationEndOfPeriodTest.php +++ b/tests/unit/Support/NavigationEndOfPeriodTest.php @@ -55,7 +55,7 @@ final class NavigationEndOfPeriodTest extends TestCase public function testGivenADateAndFrequencyWhenCalculateTheDateThenReturnsTheExpectedDateSuccessful(string $frequency, Carbon $from, Carbon $expected): void { $period = clone $this->navigation->endOfPeriod($from, $frequency); - self::assertSame($expected->toDateString(), $period->toDateString()); + $this->assertSame($expected->toDateString(), $period->toDateString()); } public static function provideDates(): Iterator @@ -116,7 +116,7 @@ final class NavigationEndOfPeriodTest extends TestCase Log::spy(); $period = $this->navigation->endOfPeriod($from, $frequency); - self::assertSame($expected->toDateString(), $period->toDateString()); + $this->assertSame($expected->toDateString(), $period->toDateString()); $expectedMessage = sprintf('Cannot do endOfPeriod for $repeat_freq "%s"', $frequency); Log::shouldHaveReceived('error', [$expectedMessage]); diff --git a/tests/unit/Support/NavigationPreferredCarbonFormatByPeriodTest.php b/tests/unit/Support/NavigationPreferredCarbonFormatByPeriodTest.php index 6f25d44beb..76a8dc54ba 100644 --- a/tests/unit/Support/NavigationPreferredCarbonFormatByPeriodTest.php +++ b/tests/unit/Support/NavigationPreferredCarbonFormatByPeriodTest.php @@ -54,7 +54,7 @@ final class NavigationPreferredCarbonFormatByPeriodTest extends TestCase public function testGivenAPeriodWhenCallPreferredCarbonFormatByPeriodThenReturnsExpectedFormat(string $period, string $expected): void { $formatPeriod = $this->navigation->preferredCarbonFormatByPeriod($period); - self::assertSame($expected, $formatPeriod); + $this->assertSame($expected, $formatPeriod); } public static function providePeriods(): Iterator diff --git a/tests/unit/Support/NavigationPreferredCarbonFormatTest.php b/tests/unit/Support/NavigationPreferredCarbonFormatTest.php index 01f06aad2b..3584a98c2a 100644 --- a/tests/unit/Support/NavigationPreferredCarbonFormatTest.php +++ b/tests/unit/Support/NavigationPreferredCarbonFormatTest.php @@ -55,7 +55,7 @@ final class NavigationPreferredCarbonFormatTest extends TestCase public function testGivenStartAndEndDatesWhenCallPreferredCarbonFormatThenReturnsTheExpectedFormatSuccessful(Carbon $start, Carbon $end, string $expected): void { $carbonFormat = $this->navigation->preferredCarbonFormat($start, $end); - self::assertSame($expected, $carbonFormat); + $this->assertSame($expected, $carbonFormat); } public static function providePeriods(): Iterator diff --git a/tests/unit/Support/NavigationPreferredEndOfPeriodTest.php b/tests/unit/Support/NavigationPreferredEndOfPeriodTest.php index 95bf81b575..4d0f22e3e7 100644 --- a/tests/unit/Support/NavigationPreferredEndOfPeriodTest.php +++ b/tests/unit/Support/NavigationPreferredEndOfPeriodTest.php @@ -55,7 +55,7 @@ final class NavigationPreferredEndOfPeriodTest extends TestCase public function testGivenStartAndEndDatesWhenCallPreferredEndOfPeriodThenReturnsTheExpectedFormatSuccessful(Carbon $start, Carbon $end, string $expected): void { $formatPeriod = $this->navigation->preferredEndOfPeriod($start, $end); - self::assertSame($expected, $formatPeriod); + $this->assertSame($expected, $formatPeriod); } public static function providePeriods(): Iterator diff --git a/tests/unit/Support/NavigationPreferredRangeFormatTest.php b/tests/unit/Support/NavigationPreferredRangeFormatTest.php index 6c0eff7d07..7218e59db2 100644 --- a/tests/unit/Support/NavigationPreferredRangeFormatTest.php +++ b/tests/unit/Support/NavigationPreferredRangeFormatTest.php @@ -55,7 +55,7 @@ final class NavigationPreferredRangeFormatTest extends TestCase public function testGivenStartAndEndDatesWhenCallPreferredRangeFormatThenReturnsTheExpectedFormatSuccessful(Carbon $start, Carbon $end, string $expected): void { $formatPeriod = $this->navigation->preferredRangeFormat($start, $end); - self::assertSame($expected, $formatPeriod); + $this->assertSame($expected, $formatPeriod); } public static function providePeriods(): Iterator diff --git a/tests/unit/Support/NavigationPreferredSqlFormatTest.php b/tests/unit/Support/NavigationPreferredSqlFormatTest.php index fa44b76178..4a8fa37420 100644 --- a/tests/unit/Support/NavigationPreferredSqlFormatTest.php +++ b/tests/unit/Support/NavigationPreferredSqlFormatTest.php @@ -55,7 +55,7 @@ final class NavigationPreferredSqlFormatTest extends TestCase public function testGivenStartAndEndDatesWhenCallPreferredSqlFormatThenReturnsTheExpectedFormatSuccessful(Carbon $start, Carbon $end, string $expected): void { $formatPeriod = $this->navigation->preferredSqlFormat($start, $end); - self::assertSame($expected, $formatPeriod); + $this->assertSame($expected, $formatPeriod); } public static function provideDates(): Iterator diff --git a/tests/unit/Support/NavigationStartOfPeriodTest.php b/tests/unit/Support/NavigationStartOfPeriodTest.php index ffe2514683..288aa7ecc4 100644 --- a/tests/unit/Support/NavigationStartOfPeriodTest.php +++ b/tests/unit/Support/NavigationStartOfPeriodTest.php @@ -56,7 +56,7 @@ final class NavigationStartOfPeriodTest extends TestCase public function testGivenADateAndFrequencyWhenCalculateTheDateThenReturnsTheExpectedDateSuccessful(string $frequency, Carbon $from, Carbon $expected): void { $period = $this->navigation->startOfPeriod($from, $frequency); - self::assertSame($expected->toDateString(), $period->toDateString()); + $this->assertSame($expected->toDateString(), $period->toDateString()); } public static function provideDates(): Iterator @@ -121,7 +121,7 @@ final class NavigationStartOfPeriodTest extends TestCase ; $period = $this->navigation->startOfPeriod($from, $frequency); - self::assertSame($expected->toDateString(), $period->toDateString()); + $this->assertSame($expected->toDateString(), $period->toDateString()); } public static function provideUnknownFrequencies(): Iterator diff --git a/tests/unit/Support/Search/QueryParser/AbstractQueryParserInterfaceParseQueryTester.php b/tests/unit/Support/Search/QueryParser/AbstractQueryParserInterfaceParseQueryTester.php index 311e745586..33946565c4 100644 --- a/tests/unit/Support/Search/QueryParser/AbstractQueryParserInterfaceParseQueryTester.php +++ b/tests/unit/Support/Search/QueryParser/AbstractQueryParserInterfaceParseQueryTester.php @@ -26,7 +26,7 @@ abstract class AbstractQueryParserInterfaceParseQueryTester extends TestCase { $actual = $this->createParser()->parse($query); - self::assertObjectEquals($expected, $actual); + $this->assertObjectEquals($expected, $actual); } From 2e69e098085462b6f24764ff1e6c068b879a261a Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 29 May 2025 19:55:13 +0200 Subject: [PATCH 04/44] Catch error --- package-lock.json | 96 +++++++++---------- ...eta2.patch => admin-lte+4.0.0-beta3.patch} | 0 resources/views/list/groups.twig | 2 +- 3 files changed, 49 insertions(+), 49 deletions(-) rename patches/{admin-lte+4.0.0-beta2.patch => admin-lte+4.0.0-beta3.patch} (100%) diff --git a/package-lock.json b/package-lock.json index 0f0688b22b..c11befa3cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3108,9 +3108,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.15.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.21.tgz", - "integrity": "sha512-EV/37Td6c+MgKAbkcLG6vqZ2zEYHD7bvSrzqqs2RIhbA6w3x+Dqz8MZM3sP6kGTeLrdoOgKZe+Xja7tUB2DNkQ==", + "version": "22.15.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.24.tgz", + "integrity": "sha512-w9CZGm9RDjzTh/D+hFwlBJ3ziUaVw7oufKA3vOFSOZlzmW9AkZnfjPb+DLnrV6qtgL/LNmP0/2zBNCFHL3F0ng==", "dev": true, "license": "MIT", "dependencies": { @@ -3216,42 +3216,42 @@ } }, "node_modules/@vue/compiler-core": { - "version": "3.5.15", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.15.tgz", - "integrity": "sha512-nGRc6YJg/kxNqbv/7Tg4juirPnjHvuVdhcmDvQWVZXlLHjouq7VsKmV1hIxM/8yKM0VUfwT/Uzc0lO510ltZqw==", + "version": "3.5.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.16.tgz", + "integrity": "sha512-AOQS2eaQOaaZQoL1u+2rCJIKDruNXVBZSiUD3chnUrsoX5ZTQMaCvXlWNIfxBJuU15r1o7+mpo5223KVtIhAgQ==", "dev": true, "license": "MIT", "dependencies": { "@babel/parser": "^7.27.2", - "@vue/shared": "3.5.15", + "@vue/shared": "3.5.16", "entities": "^4.5.0", "estree-walker": "^2.0.2", "source-map-js": "^1.2.1" } }, "node_modules/@vue/compiler-dom": { - "version": "3.5.15", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.15.tgz", - "integrity": "sha512-ZelQd9n+O/UCBdL00rlwCrsArSak+YLZpBVuNDio1hN3+wrCshYZEDUO3khSLAzPbF1oQS2duEoMDUHScUlYjA==", + "version": "3.5.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.16.tgz", + "integrity": "sha512-SSJIhBr/teipXiXjmWOVWLnxjNGo65Oj/8wTEQz0nqwQeP75jWZ0n4sF24Zxoht1cuJoWopwj0J0exYwCJ0dCQ==", "dev": true, "license": "MIT", "dependencies": { - "@vue/compiler-core": "3.5.15", - "@vue/shared": "3.5.15" + "@vue/compiler-core": "3.5.16", + "@vue/shared": "3.5.16" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.5.15", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.15.tgz", - "integrity": "sha512-3zndKbxMsOU6afQWer75Zot/aydjtxNj0T2KLg033rAFaQUn2PGuE32ZRe4iMhflbTcAxL0yEYsRWFxtPro8RQ==", + "version": "3.5.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.16.tgz", + "integrity": "sha512-rQR6VSFNpiinDy/DVUE0vHoIDUF++6p910cgcZoaAUm3POxgNOOdS/xgoll3rNdKYTYPnnbARDCZOyZ+QSe6Pw==", "dev": true, "license": "MIT", "dependencies": { "@babel/parser": "^7.27.2", - "@vue/compiler-core": "3.5.15", - "@vue/compiler-dom": "3.5.15", - "@vue/compiler-ssr": "3.5.15", - "@vue/shared": "3.5.15", + "@vue/compiler-core": "3.5.16", + "@vue/compiler-dom": "3.5.16", + "@vue/compiler-ssr": "3.5.16", + "@vue/shared": "3.5.16", "estree-walker": "^2.0.2", "magic-string": "^0.30.17", "postcss": "^8.5.3", @@ -3259,14 +3259,14 @@ } }, "node_modules/@vue/compiler-ssr": { - "version": "3.5.15", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.15.tgz", - "integrity": "sha512-gShn8zRREZbrXqTtmLSCffgZXDWv8nHc/GhsW+mbwBfNZL5pI96e7IWcIq8XGQe1TLtVbu7EV9gFIVSmfyarPg==", + "version": "3.5.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.16.tgz", + "integrity": "sha512-d2V7kfxbdsjrDSGlJE7my1ZzCXViEcqN6w14DOsDrUCHEA6vbnVCpRFfrc4ryCP/lCKzX2eS1YtnLE/BuC9f/A==", "dev": true, "license": "MIT", "dependencies": { - "@vue/compiler-dom": "3.5.15", - "@vue/shared": "3.5.15" + "@vue/compiler-dom": "3.5.16", + "@vue/shared": "3.5.16" } }, "node_modules/@vue/component-compiler-utils": { @@ -3348,9 +3348,9 @@ "license": "MIT" }, "node_modules/@vue/shared": { - "version": "3.5.15", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.15.tgz", - "integrity": "sha512-bKvgFJJL1ZX9KxMCTQY6xD9Dhe3nusd1OhyOb1cJYGqvAr0Vg8FIjHPMOEVbJ9GDT9HG+Bjdn4oS8ohKP8EvoA==", + "version": "3.5.16", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.16.tgz", + "integrity": "sha512-c/0fWy3Jw6Z8L9FmTyYfkpM5zklnqqa9+a6dz3DvONRKW2NEbh46BP0FHuLFSWi2TnQEtp91Z6zOWNrU6QiyPg==", "dev": true, "license": "MIT" }, @@ -4257,9 +4257,9 @@ } }, "node_modules/browserslist": { - "version": "4.24.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.5.tgz", - "integrity": "sha512-FDToo4Wo82hIdgc1CQ+NQD0hEhmpPjrZ3hiUgwgOG6IuTdlpr8jdjyG24P6cNP1yJpTLzS5OcGgSw0xmDU1/Tw==", + "version": "4.25.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.0.tgz", + "integrity": "sha512-PJ8gYKeS5e/whHBh8xrwYK+dAvEj7JXtz6uTucnMRB8OiGTsKccFekoRrjajPBHV8oOY+2tI4uxeceSimKwMFA==", "dev": true, "funding": [ { @@ -4277,8 +4277,8 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001716", - "electron-to-chromium": "^1.5.149", + "caniuse-lite": "^1.0.30001718", + "electron-to-chromium": "^1.5.160", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.3" }, @@ -4417,9 +4417,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001718", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001718.tgz", - "integrity": "sha512-AflseV1ahcSunK53NfEs9gFWgOEmzr0f+kaMFA4xiLZlr9Hzt7HxcSpIFcnNCUkz6R6dWKa54rUz3HUmI3nVcw==", + "version": "1.0.30001720", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001720.tgz", + "integrity": "sha512-Ec/2yV2nNPwb4DnTANEV99ZWwm3ZWfdlfkQbWSDDt+PsXEVYwlhPH8tdMaPunYTKKmz7AnHi2oNEi1GcmKCD8g==", "dev": true, "funding": [ { @@ -5632,9 +5632,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.158", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.158.tgz", - "integrity": "sha512-9vcp2xHhkvraY6AHw2WMi+GDSLPX42qe2xjYaVoZqFRJiOcilVQFq9mZmpuHEQpzlgGDelKlV7ZiGcmMsc8WxQ==", + "version": "1.5.161", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.161.tgz", + "integrity": "sha512-hwtetwfKNZo/UlwHIVBlKZVdy7o8bIZxxKs0Mv/ROPiQQQmDgdm5a+KvKtBsxM8ZjFzTaCeLoodZ8jiBE3o9rA==", "dev": true, "license": "ISC" }, @@ -8856,9 +8856,9 @@ } }, "node_modules/postcss": { - "version": "8.5.3", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz", - "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.4.tgz", + "integrity": "sha512-QSa9EBe+uwlGTFmHsPKokv3B/oEMQZxfqW0QqNCyhpa6mB1afzulwn8hihglqAb2pOw+BJgNlmXQ8la2VeHB7w==", "dev": true, "funding": [ { @@ -8876,7 +8876,7 @@ ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.8", + "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, @@ -11013,9 +11013,9 @@ } }, "node_modules/tinyglobby/node_modules/fdir": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", - "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", + "version": "6.4.5", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.5.tgz", + "integrity": "sha512-4BG7puHpVsIYxZUbiUE3RqGloLaSSwzYie5jvasC4LWuBWzZawynvYouhjbQKw2JuIGYdm0DzIxl8iVidKlUEw==", "dev": true, "license": "MIT", "peerDependencies": { @@ -11423,9 +11423,9 @@ "license": "MIT" }, "node_modules/vite/node_modules/fdir": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", - "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", + "version": "6.4.5", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.5.tgz", + "integrity": "sha512-4BG7puHpVsIYxZUbiUE3RqGloLaSSwzYie5jvasC4LWuBWzZawynvYouhjbQKw2JuIGYdm0DzIxl8iVidKlUEw==", "dev": true, "license": "MIT", "peerDependencies": { diff --git a/patches/admin-lte+4.0.0-beta2.patch b/patches/admin-lte+4.0.0-beta3.patch similarity index 100% rename from patches/admin-lte+4.0.0-beta2.patch rename to patches/admin-lte+4.0.0-beta3.patch diff --git a/resources/views/list/groups.twig b/resources/views/list/groups.twig index 89129cfdfc..ec963eff29 100644 --- a/resources/views/list/groups.twig +++ b/resources/views/list/groups.twig @@ -264,7 +264,7 @@ {{ formatAmountBySymbol(transaction.destination_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }} {% endif %} {% if currency.id == transaction.foreign_currency_id and null != transaction.destination_balance_after and null != transaction.destination_balance_after %} - {{ formatAmountBySymbol(transaction.destination_balance_after, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }} + {{ formatAmountBySymbol(transaction.destination_balance_after, transaction.foreign_currency_symbol ?? transaction.currency_symbol, transaction.foreign_currency_decimal_places ?? transaction.currency_decimal_places) }} {% endif %} {% else %} From 36ab188ad1d65c52ce2aff1e4801a056e62aba27 Mon Sep 17 00:00:00 2001 From: JC5 Date: Thu, 29 May 2025 19:58:55 +0200 Subject: [PATCH 05/44] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-05-29?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .ci/php-cs-fixer/composer.lock | 83 +++--- app/Models/Account.php | 3 + app/Models/AccountMeta.php | 2 +- app/Models/Attachment.php | 1 + app/Models/AuditLogEntry.php | 1 + app/Models/AvailableBudget.php | 1 + app/Models/Bill.php | 1 + app/Models/Budget.php | 1 + app/Models/BudgetLimit.php | 1 + app/Models/Category.php | 1 + app/Models/Configuration.php | 4 +- app/Models/CurrencyExchangeRate.php | 1 + app/Models/GroupMembership.php | 1 + app/Models/InvitedUser.php | 1 + app/Models/LinkType.php | 1 + app/Models/Location.php | 1 + app/Models/Note.php | 1 + app/Models/ObjectGroup.php | 1 + app/Models/PiggyBank.php | 1 + app/Models/PiggyBankEvent.php | 1 + app/Models/PiggyBankRepetition.php | 1 + app/Models/Preference.php | 1 + app/Models/Recurrence.php | 1 + app/Models/RecurrenceMeta.php | 1 + app/Models/RecurrenceTransaction.php | 1 + app/Models/RecurrenceTransactionMeta.php | 1 + app/Models/Role.php | 1 + app/Models/Rule.php | 6 +- app/Models/RuleAction.php | 1 + app/Models/RuleGroup.php | 1 + app/Models/RuleTrigger.php | 1 + app/Models/Tag.php | 1 + app/Models/Transaction.php | 1 + app/Models/TransactionCurrency.php | 1 + app/Models/TransactionGroup.php | 1 + app/Models/TransactionJournal.php | 1 + app/Models/TransactionJournalLink.php | 1 + app/Models/TransactionJournalMeta.php | 9 +- app/Models/WebhookMessage.php | 1 + app/User.php | 1 + composer.lock | 257 +++++++++--------- config/firefly.php | 2 +- .../Support/Models/BillDateCalculatorTest.php | 2 +- .../NavigationCustomEndOfPeriodTest.php | 2 +- .../unit/Support/Calendar/CalculatorTest.php | 4 +- .../Calendar/Periodicity/IntervalTestCase.php | 2 +- .../unit/Support/NavigationAddPeriodTest.php | 8 +- .../Support/NavigationEndOfPeriodTest.php | 4 +- ...ationPreferredCarbonFormatByPeriodTest.php | 2 +- .../NavigationPreferredCarbonFormatTest.php | 2 +- .../NavigationPreferredEndOfPeriodTest.php | 2 +- .../NavigationPreferredRangeFormatTest.php | 2 +- .../NavigationPreferredSqlFormatTest.php | 2 +- .../Support/NavigationStartOfPeriodTest.php | 4 +- ...ctQueryParserInterfaceParseQueryTester.php | 2 +- 55 files changed, 240 insertions(+), 198 deletions(-) diff --git a/.ci/php-cs-fixer/composer.lock b/.ci/php-cs-fixer/composer.lock index e8d67ba02f..4967d366a8 100644 --- a/.ci/php-cs-fixer/composer.lock +++ b/.ci/php-cs-fixer/composer.lock @@ -1256,23 +1256,24 @@ }, { "name": "symfony/console", - "version": "v7.2.6", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218" + "reference": "66c1440edf6f339fd82ed6c7caa76cb006211b44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0e2e3f38c192e93e622e41ec37f4ca70cfedf218", - "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218", + "url": "https://api.github.com/repos/symfony/console/zipball/66c1440edf6f339fd82ed6c7caa76cb006211b44", + "reference": "66c1440edf6f339fd82ed6c7caa76cb006211b44", "shasum": "" }, "require": { "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^6.4|^7.0" + "symfony/string": "^7.2" }, "conflict": { "symfony/dependency-injection": "<6.4", @@ -1329,7 +1330,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.2.6" + "source": "https://github.com/symfony/console/tree/v7.3.0" }, "funding": [ { @@ -1345,7 +1346,7 @@ "type": "tidelift" } ], - "time": "2025-04-07T19:09:28+00:00" + "time": "2025-05-24T10:34:04+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1416,16 +1417,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v7.2.0", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1" + "reference": "497f73ac996a598c92409b44ac43b6690c4f666d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/910c5db85a5356d0fea57680defec4e99eb9c8c1", - "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/497f73ac996a598c92409b44ac43b6690c4f666d", + "reference": "497f73ac996a598c92409b44ac43b6690c4f666d", "shasum": "" }, "require": { @@ -1476,7 +1477,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v7.2.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.3.0" }, "funding": [ { @@ -1492,7 +1493,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:21:43+00:00" + "time": "2025-04-22T09:11:45+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -1572,7 +1573,7 @@ }, { "name": "symfony/filesystem", - "version": "v7.2.0", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -1618,7 +1619,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.2.0" + "source": "https://github.com/symfony/filesystem/tree/v7.3.0" }, "funding": [ { @@ -1638,16 +1639,16 @@ }, { "name": "symfony/finder", - "version": "v7.2.2", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "87a71856f2f56e4100373e92529eed3171695cfb" + "reference": "ec2344cf77a48253bbca6939aa3d2477773ea63d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", - "reference": "87a71856f2f56e4100373e92529eed3171695cfb", + "url": "https://api.github.com/repos/symfony/finder/zipball/ec2344cf77a48253bbca6939aa3d2477773ea63d", + "reference": "ec2344cf77a48253bbca6939aa3d2477773ea63d", "shasum": "" }, "require": { @@ -1682,7 +1683,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.2.2" + "source": "https://github.com/symfony/finder/tree/v7.3.0" }, "funding": [ { @@ -1698,20 +1699,20 @@ "type": "tidelift" } ], - "time": "2024-12-30T19:00:17+00:00" + "time": "2024-12-30T19:00:26+00:00" }, { "name": "symfony/options-resolver", - "version": "v7.2.0", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" + "reference": "afb9a8038025e5dbc657378bfab9198d75f10fca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", - "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/afb9a8038025e5dbc657378bfab9198d75f10fca", + "reference": "afb9a8038025e5dbc657378bfab9198d75f10fca", "shasum": "" }, "require": { @@ -1749,7 +1750,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" + "source": "https://github.com/symfony/options-resolver/tree/v7.3.0" }, "funding": [ { @@ -1765,7 +1766,7 @@ "type": "tidelift" } ], - "time": "2024-11-20T11:17:29+00:00" + "time": "2025-04-04T13:12:05+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2244,16 +2245,16 @@ }, { "name": "symfony/process", - "version": "v7.2.5", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "87b7c93e57df9d8e39a093d32587702380ff045d" + "reference": "40c295f2deb408d5e9d2d32b8ba1dd61e36f05af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/87b7c93e57df9d8e39a093d32587702380ff045d", - "reference": "87b7c93e57df9d8e39a093d32587702380ff045d", + "url": "https://api.github.com/repos/symfony/process/zipball/40c295f2deb408d5e9d2d32b8ba1dd61e36f05af", + "reference": "40c295f2deb408d5e9d2d32b8ba1dd61e36f05af", "shasum": "" }, "require": { @@ -2285,7 +2286,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.2.5" + "source": "https://github.com/symfony/process/tree/v7.3.0" }, "funding": [ { @@ -2301,7 +2302,7 @@ "type": "tidelift" } ], - "time": "2025-03-13T12:21:46+00:00" + "time": "2025-04-17T09:11:12+00:00" }, { "name": "symfony/service-contracts", @@ -2388,7 +2389,7 @@ }, { "name": "symfony/stopwatch", - "version": "v7.2.4", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -2430,7 +2431,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v7.2.4" + "source": "https://github.com/symfony/stopwatch/tree/v7.3.0" }, "funding": [ { @@ -2450,16 +2451,16 @@ }, { "name": "symfony/string", - "version": "v7.2.6", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931" + "reference": "f3570b8c61ca887a9e2938e85cb6458515d2b125" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/a214fe7d62bd4df2a76447c67c6b26e1d5e74931", - "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931", + "url": "https://api.github.com/repos/symfony/string/zipball/f3570b8c61ca887a9e2938e85cb6458515d2b125", + "reference": "f3570b8c61ca887a9e2938e85cb6458515d2b125", "shasum": "" }, "require": { @@ -2517,7 +2518,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.2.6" + "source": "https://github.com/symfony/string/tree/v7.3.0" }, "funding": [ { @@ -2533,7 +2534,7 @@ "type": "tidelift" } ], - "time": "2025-04-20T20:18:16+00:00" + "time": "2025-04-20T20:19:01+00:00" } ], "packages-dev": [], diff --git a/app/Models/Account.php b/app/Models/Account.php index 5465c1e107..683b4a2973 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -106,6 +106,7 @@ class Account extends Model ->where('name', 'account_number') ->first() ; + return null !== $metaValue ? $metaValue->data : ''; }); } @@ -122,6 +123,7 @@ class Account extends Model if (AccountTypeEnum::CASH->value === $this->accountType->type) { return ''; } + return $name; }); } @@ -221,6 +223,7 @@ class Account extends Model get: static fn ($value) => (string) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php index 5e3cca85e2..61d8644ff3 100644 --- a/app/Models/AccountMeta.php +++ b/app/Models/AccountMeta.php @@ -45,7 +45,7 @@ class AccountMeta extends Model protected function data(): Attribute { - return Attribute::make(get: fn(mixed $value) => (string) json_decode((string) $value, true), set: fn(mixed $value) => ['data' => json_encode($value)]); + return Attribute::make(get: fn (mixed $value) => (string) json_decode((string) $value, true), set: fn (mixed $value) => ['data' => json_encode($value)]); } protected function casts(): array diff --git a/app/Models/Attachment.php b/app/Models/Attachment.php index b8ba65a49b..2287666db1 100644 --- a/app/Models/Attachment.php +++ b/app/Models/Attachment.php @@ -100,6 +100,7 @@ class Attachment extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/AuditLogEntry.php b/app/Models/AuditLogEntry.php index b5b27108af..53773692a1 100644 --- a/app/Models/AuditLogEntry.php +++ b/app/Models/AuditLogEntry.php @@ -58,6 +58,7 @@ class AuditLogEntry extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/AvailableBudget.php b/app/Models/AvailableBudget.php index 774900c289..576864a2ea 100644 --- a/app/Models/AvailableBudget.php +++ b/app/Models/AvailableBudget.php @@ -103,6 +103,7 @@ class AvailableBudget extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/Bill.php b/app/Models/Bill.php index 9dd230feb3..a0f59bc9d4 100644 --- a/app/Models/Bill.php +++ b/app/Models/Bill.php @@ -185,6 +185,7 @@ class Bill extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/Budget.php b/app/Models/Budget.php index e670c69f31..c5c1c29d46 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -112,6 +112,7 @@ class Budget extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.php index 571d750977..3fc20b25af 100644 --- a/app/Models/BudgetLimit.php +++ b/app/Models/BudgetLimit.php @@ -109,6 +109,7 @@ class BudgetLimit extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/Category.php b/app/Models/Category.php index c8a47b6611..3e50f448c6 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -94,6 +94,7 @@ class Category extends Model { return $this->belongsToMany(Transaction::class, 'category_transaction', 'category_id'); } + protected function casts(): array { return [ diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 6cec2053c9..1eeb2007dc 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -41,13 +41,11 @@ class Configuration extends Model /** * TODO can be replaced with native laravel code. * - * @param mixed $value - * * @return mixed */ protected function data(): Attribute { - return Attribute::make(get: fn($value) => json_decode((string) $value), set: fn($value) => ['data' => json_encode($value)]); + return Attribute::make(get: fn ($value) => json_decode((string) $value), set: fn ($value) => ['data' => json_encode($value)]); } protected function casts(): array diff --git a/app/Models/CurrencyExchangeRate.php b/app/Models/CurrencyExchangeRate.php index 3c8d13ceac..f5117715fe 100644 --- a/app/Models/CurrencyExchangeRate.php +++ b/app/Models/CurrencyExchangeRate.php @@ -81,6 +81,7 @@ class CurrencyExchangeRate extends Model get: static fn ($value) => (string) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/GroupMembership.php b/app/Models/GroupMembership.php index 59cc884d69..830826967e 100644 --- a/app/Models/GroupMembership.php +++ b/app/Models/GroupMembership.php @@ -59,6 +59,7 @@ class GroupMembership extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/InvitedUser.php b/app/Models/InvitedUser.php index 82596f72ec..d543d82c47 100644 --- a/app/Models/InvitedUser.php +++ b/app/Models/InvitedUser.php @@ -60,6 +60,7 @@ class InvitedUser extends Model { return $this->belongsTo(User::class); } + protected function casts(): array { return [ diff --git a/app/Models/LinkType.php b/app/Models/LinkType.php index 9a0579dd32..f7b662961c 100644 --- a/app/Models/LinkType.php +++ b/app/Models/LinkType.php @@ -58,6 +58,7 @@ class LinkType extends Model { return $this->hasMany(TransactionJournalLink::class); } + protected function casts(): array { return [ diff --git a/app/Models/Location.php b/app/Models/Location.php index 7762c20e80..ce5744dba9 100644 --- a/app/Models/Location.php +++ b/app/Models/Location.php @@ -72,6 +72,7 @@ class Location extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/Note.php b/app/Models/Note.php index c5dcf0f54e..6c8c56653e 100644 --- a/app/Models/Note.php +++ b/app/Models/Note.php @@ -50,6 +50,7 @@ class Note extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/ObjectGroup.php b/app/Models/ObjectGroup.php index ec468a545d..d7833412fb 100644 --- a/app/Models/ObjectGroup.php +++ b/app/Models/ObjectGroup.php @@ -96,6 +96,7 @@ class ObjectGroup extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/PiggyBank.php b/app/Models/PiggyBank.php index 2f16545ea3..08d5a2563d 100644 --- a/app/Models/PiggyBank.php +++ b/app/Models/PiggyBank.php @@ -140,6 +140,7 @@ class PiggyBank extends Model get: static fn ($value) => (string) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/PiggyBankEvent.php b/app/Models/PiggyBankEvent.php index 77afbf79ab..733792ffeb 100644 --- a/app/Models/PiggyBankEvent.php +++ b/app/Models/PiggyBankEvent.php @@ -71,6 +71,7 @@ class PiggyBankEvent extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.php index a1dcd4dbe8..f0f6125b53 100644 --- a/app/Models/PiggyBankRepetition.php +++ b/app/Models/PiggyBankRepetition.php @@ -94,6 +94,7 @@ class PiggyBankRepetition extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/Preference.php b/app/Models/Preference.php index 60fa6fe682..0e282cf1a5 100644 --- a/app/Models/Preference.php +++ b/app/Models/Preference.php @@ -93,6 +93,7 @@ class Preference extends Model { return $this->belongsTo(User::class); } + protected function casts(): array { return [ diff --git a/app/Models/Recurrence.php b/app/Models/Recurrence.php index 7c4ec43141..4e369fca27 100644 --- a/app/Models/Recurrence.php +++ b/app/Models/Recurrence.php @@ -119,6 +119,7 @@ class Recurrence extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/RecurrenceMeta.php b/app/Models/RecurrenceMeta.php index 1e1642c68f..7430c942f6 100644 --- a/app/Models/RecurrenceMeta.php +++ b/app/Models/RecurrenceMeta.php @@ -50,6 +50,7 @@ class RecurrenceMeta extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/RecurrenceTransaction.php b/app/Models/RecurrenceTransaction.php index 544dd9823a..2c17d52ebb 100644 --- a/app/Models/RecurrenceTransaction.php +++ b/app/Models/RecurrenceTransaction.php @@ -133,6 +133,7 @@ class RecurrenceTransaction extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/RecurrenceTransactionMeta.php b/app/Models/RecurrenceTransactionMeta.php index bb644aa8db..a334b9c433 100644 --- a/app/Models/RecurrenceTransactionMeta.php +++ b/app/Models/RecurrenceTransactionMeta.php @@ -50,6 +50,7 @@ class RecurrenceTransactionMeta extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/Role.php b/app/Models/Role.php index 2b4b8761e9..b1b3476ca4 100644 --- a/app/Models/Role.php +++ b/app/Models/Role.php @@ -38,6 +38,7 @@ class Role extends Model { return $this->belongsToMany(User::class); } + protected function casts(): array { return [ diff --git a/app/Models/Rule.php b/app/Models/Rule.php index 7609316a4e..5308eae4d5 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -84,12 +84,9 @@ class Rule extends Model return $this->hasMany(RuleTrigger::class); } - /** - * @param mixed $value - */ protected function description(): Attribute { - return Attribute::make(set: fn($value) => ['description' => e($value)]); + return Attribute::make(set: fn ($value) => ['description' => e($value)]); } public function userGroup(): BelongsTo @@ -110,6 +107,7 @@ class Rule extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/RuleAction.php b/app/Models/RuleAction.php index 2725653f18..60ebc7254f 100644 --- a/app/Models/RuleAction.php +++ b/app/Models/RuleAction.php @@ -79,6 +79,7 @@ class RuleAction extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/RuleGroup.php b/app/Models/RuleGroup.php index 6a56c78e9b..1a25031a7e 100644 --- a/app/Models/RuleGroup.php +++ b/app/Models/RuleGroup.php @@ -80,6 +80,7 @@ class RuleGroup extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/RuleTrigger.php b/app/Models/RuleTrigger.php index 71f16e75c1..5c9f4fca2e 100644 --- a/app/Models/RuleTrigger.php +++ b/app/Models/RuleTrigger.php @@ -52,6 +52,7 @@ class RuleTrigger extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/Tag.php b/app/Models/Tag.php index ce55c8cec7..6a740a3730 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -86,6 +86,7 @@ class Tag extends Model { return $this->belongsToMany(TransactionJournal::class); } + protected function casts(): array { return [ diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index a68bf51480..a563e3656f 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -200,6 +200,7 @@ class Transaction extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/TransactionCurrency.php b/app/Models/TransactionCurrency.php index 99342bc5df..4f93717955 100644 --- a/app/Models/TransactionCurrency.php +++ b/app/Models/TransactionCurrency.php @@ -107,6 +107,7 @@ class TransactionCurrency extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/TransactionGroup.php b/app/Models/TransactionGroup.php index 5d9870ee72..a09af2b231 100644 --- a/app/Models/TransactionGroup.php +++ b/app/Models/TransactionGroup.php @@ -85,6 +85,7 @@ class TransactionGroup extends Model { return $this->belongsTo(UserGroup::class); } + protected function casts(): array { return [ diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index 64621f0c52..609d7dc353 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -244,6 +244,7 @@ class TransactionJournal extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/TransactionJournalLink.php b/app/Models/TransactionJournalLink.php index 4263db2d8e..92adb6a7e2 100644 --- a/app/Models/TransactionJournalLink.php +++ b/app/Models/TransactionJournalLink.php @@ -103,6 +103,7 @@ class TransactionJournalLink extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/TransactionJournalMeta.php b/app/Models/TransactionJournalMeta.php index e82a372c1f..144bc79e82 100644 --- a/app/Models/TransactionJournalMeta.php +++ b/app/Models/TransactionJournalMeta.php @@ -40,15 +40,15 @@ class TransactionJournalMeta extends Model protected $fillable = ['transaction_journal_id', 'name', 'data', 'hash']; protected $table = 'journal_meta'; + /** - * @param mixed $value - * * @return mixed */ protected function data(): Attribute { - return Attribute::make(get: fn($value) => json_decode((string) $value, false), set: function ($value) { - $data = json_encode($value); + return Attribute::make(get: fn ($value) => json_decode((string) $value, false), set: function ($value) { + $data = json_encode($value); + return ['data' => $data, 'hash' => hash('sha256', (string) $data)]; }); } @@ -64,6 +64,7 @@ class TransactionJournalMeta extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/Models/WebhookMessage.php b/app/Models/WebhookMessage.php index 2a4bc459d1..77d6a0642c 100644 --- a/app/Models/WebhookMessage.php +++ b/app/Models/WebhookMessage.php @@ -85,6 +85,7 @@ class WebhookMessage extends Model get: static fn ($value) => (int) $value, ); } + protected function casts(): array { return [ diff --git a/app/User.php b/app/User.php index a14e3d310c..fd7221c9ef 100644 --- a/app/User.php +++ b/app/User.php @@ -532,6 +532,7 @@ class User extends Authenticatable { return $this->hasMany(Webhook::class); } + protected function casts(): array { return [ diff --git a/composer.lock b/composer.lock index 9089bdf6ed..4f70022618 100644 --- a/composer.lock +++ b/composer.lock @@ -6423,23 +6423,23 @@ }, { "name": "symfony/cache", - "version": "v7.2.6", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "8b49dde3f5a5e9867595a3a269977f78418d75ee" + "reference": "c4b217b578c11ec764867aa0c73e602c602965de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/8b49dde3f5a5e9867595a3a269977f78418d75ee", - "reference": "8b49dde3f5a5e9867595a3a269977f78418d75ee", + "url": "https://api.github.com/repos/symfony/cache/zipball/c4b217b578c11ec764867aa0c73e602c602965de", + "reference": "c4b217b578c11ec764867aa0c73e602c602965de", "shasum": "" }, "require": { "php": ">=8.2", "psr/cache": "^2.0|^3.0", "psr/log": "^1.1|^2|^3", - "symfony/cache-contracts": "^2.5|^3", + "symfony/cache-contracts": "^3.6", "symfony/deprecation-contracts": "^2.5|^3.0", "symfony/service-contracts": "^2.5|^3", "symfony/var-exporter": "^6.4|^7.0" @@ -6501,7 +6501,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v7.2.6" + "source": "https://github.com/symfony/cache/tree/v7.3.0" }, "funding": [ { @@ -6517,7 +6517,7 @@ "type": "tidelift" } ], - "time": "2025-04-08T09:06:23+00:00" + "time": "2025-05-06T19:00:13+00:00" }, { "name": "symfony/cache-contracts", @@ -6597,7 +6597,7 @@ }, { "name": "symfony/clock", - "version": "v7.2.0", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/clock.git", @@ -6651,7 +6651,7 @@ "time" ], "support": { - "source": "https://github.com/symfony/clock/tree/v7.2.0" + "source": "https://github.com/symfony/clock/tree/v7.3.0" }, "funding": [ { @@ -6671,23 +6671,24 @@ }, { "name": "symfony/console", - "version": "v7.2.6", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218" + "reference": "66c1440edf6f339fd82ed6c7caa76cb006211b44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0e2e3f38c192e93e622e41ec37f4ca70cfedf218", - "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218", + "url": "https://api.github.com/repos/symfony/console/zipball/66c1440edf6f339fd82ed6c7caa76cb006211b44", + "reference": "66c1440edf6f339fd82ed6c7caa76cb006211b44", "shasum": "" }, "require": { "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^6.4|^7.0" + "symfony/string": "^7.2" }, "conflict": { "symfony/dependency-injection": "<6.4", @@ -6744,7 +6745,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.2.6" + "source": "https://github.com/symfony/console/tree/v7.3.0" }, "funding": [ { @@ -6760,11 +6761,11 @@ "type": "tidelift" } ], - "time": "2025-04-07T19:09:28+00:00" + "time": "2025-05-24T10:34:04+00:00" }, { "name": "symfony/css-selector", - "version": "v7.2.0", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -6809,7 +6810,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v7.2.0" + "source": "https://github.com/symfony/css-selector/tree/v7.3.0" }, "funding": [ { @@ -6896,16 +6897,16 @@ }, { "name": "symfony/error-handler", - "version": "v7.2.5", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "102be5e6a8e4f4f3eb3149bcbfa33a80d1ee374b" + "reference": "cf68d225bc43629de4ff54778029aee6dc191b83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/102be5e6a8e4f4f3eb3149bcbfa33a80d1ee374b", - "reference": "102be5e6a8e4f4f3eb3149bcbfa33a80d1ee374b", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/cf68d225bc43629de4ff54778029aee6dc191b83", + "reference": "cf68d225bc43629de4ff54778029aee6dc191b83", "shasum": "" }, "require": { @@ -6918,9 +6919,11 @@ "symfony/http-kernel": "<6.4" }, "require-dev": { + "symfony/console": "^6.4|^7.0", "symfony/deprecation-contracts": "^2.5|^3", "symfony/http-kernel": "^6.4|^7.0", - "symfony/serializer": "^6.4|^7.0" + "symfony/serializer": "^6.4|^7.0", + "symfony/webpack-encore-bundle": "^1.0|^2.0" }, "bin": [ "Resources/bin/patch-type-declarations" @@ -6951,7 +6954,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v7.2.5" + "source": "https://github.com/symfony/error-handler/tree/v7.3.0" }, "funding": [ { @@ -6967,20 +6970,20 @@ "type": "tidelift" } ], - "time": "2025-03-03T07:12:39+00:00" + "time": "2025-05-29T07:19:49+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v7.2.0", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1" + "reference": "497f73ac996a598c92409b44ac43b6690c4f666d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/910c5db85a5356d0fea57680defec4e99eb9c8c1", - "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/497f73ac996a598c92409b44ac43b6690c4f666d", + "reference": "497f73ac996a598c92409b44ac43b6690c4f666d", "shasum": "" }, "require": { @@ -7031,7 +7034,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v7.2.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.3.0" }, "funding": [ { @@ -7047,7 +7050,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:21:43+00:00" + "time": "2025-04-22T09:11:45+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -7127,7 +7130,7 @@ }, { "name": "symfony/expression-language", - "version": "v7.2.0", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", @@ -7171,7 +7174,7 @@ "description": "Provides an engine that can compile and evaluate expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/expression-language/tree/v7.2.0" + "source": "https://github.com/symfony/expression-language/tree/v7.3.0" }, "funding": [ { @@ -7191,16 +7194,16 @@ }, { "name": "symfony/finder", - "version": "v7.2.2", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "87a71856f2f56e4100373e92529eed3171695cfb" + "reference": "ec2344cf77a48253bbca6939aa3d2477773ea63d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", - "reference": "87a71856f2f56e4100373e92529eed3171695cfb", + "url": "https://api.github.com/repos/symfony/finder/zipball/ec2344cf77a48253bbca6939aa3d2477773ea63d", + "reference": "ec2344cf77a48253bbca6939aa3d2477773ea63d", "shasum": "" }, "require": { @@ -7235,7 +7238,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.2.2" + "source": "https://github.com/symfony/finder/tree/v7.3.0" }, "funding": [ { @@ -7251,20 +7254,20 @@ "type": "tidelift" } ], - "time": "2024-12-30T19:00:17+00:00" + "time": "2024-12-30T19:00:26+00:00" }, { "name": "symfony/http-client", - "version": "v7.2.4", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "78981a2ffef6437ed92d4d7e2a86a82f256c6dc6" + "reference": "57e4fb86314015a695a750ace358d07a7e37b8a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/78981a2ffef6437ed92d4d7e2a86a82f256c6dc6", - "reference": "78981a2ffef6437ed92d4d7e2a86a82f256c6dc6", + "url": "https://api.github.com/repos/symfony/http-client/zipball/57e4fb86314015a695a750ace358d07a7e37b8a9", + "reference": "57e4fb86314015a695a750ace358d07a7e37b8a9", "shasum": "" }, "require": { @@ -7330,7 +7333,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.2.4" + "source": "https://github.com/symfony/http-client/tree/v7.3.0" }, "funding": [ { @@ -7346,7 +7349,7 @@ "type": "tidelift" } ], - "time": "2025-02-13T10:27:23+00:00" + "time": "2025-05-02T08:23:16+00:00" }, { "name": "symfony/http-client-contracts", @@ -7428,16 +7431,16 @@ }, { "name": "symfony/http-foundation", - "version": "v7.2.6", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "6023ec7607254c87c5e69fb3558255aca440d72b" + "reference": "4236baf01609667d53b20371486228231eb135fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/6023ec7607254c87c5e69fb3558255aca440d72b", - "reference": "6023ec7607254c87c5e69fb3558255aca440d72b", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/4236baf01609667d53b20371486228231eb135fd", + "reference": "4236baf01609667d53b20371486228231eb135fd", "shasum": "" }, "require": { @@ -7454,6 +7457,7 @@ "doctrine/dbal": "^3.6|^4", "predis/predis": "^1.1|^2.0", "symfony/cache": "^6.4.12|^7.1.5", + "symfony/clock": "^6.4|^7.0", "symfony/dependency-injection": "^6.4|^7.0", "symfony/expression-language": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", @@ -7486,7 +7490,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v7.2.6" + "source": "https://github.com/symfony/http-foundation/tree/v7.3.0" }, "funding": [ { @@ -7502,20 +7506,20 @@ "type": "tidelift" } ], - "time": "2025-04-09T08:14:01+00:00" + "time": "2025-05-12T14:48:23+00:00" }, { "name": "symfony/http-kernel", - "version": "v7.2.6", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "f9dec01e6094a063e738f8945ef69c0cfcf792ec" + "reference": "ac7b8e163e8c83dce3abcc055a502d4486051a9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f9dec01e6094a063e738f8945ef69c0cfcf792ec", - "reference": "f9dec01e6094a063e738f8945ef69c0cfcf792ec", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/ac7b8e163e8c83dce3abcc055a502d4486051a9f", + "reference": "ac7b8e163e8c83dce3abcc055a502d4486051a9f", "shasum": "" }, "require": { @@ -7523,8 +7527,8 @@ "psr/log": "^1|^2|^3", "symfony/deprecation-contracts": "^2.5|^3", "symfony/error-handler": "^6.4|^7.0", - "symfony/event-dispatcher": "^6.4|^7.0", - "symfony/http-foundation": "^6.4|^7.0", + "symfony/event-dispatcher": "^7.3", + "symfony/http-foundation": "^7.3", "symfony/polyfill-ctype": "^1.8" }, "conflict": { @@ -7600,7 +7604,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v7.2.6" + "source": "https://github.com/symfony/http-kernel/tree/v7.3.0" }, "funding": [ { @@ -7616,20 +7620,20 @@ "type": "tidelift" } ], - "time": "2025-05-02T09:04:03+00:00" + "time": "2025-05-29T07:47:32+00:00" }, { "name": "symfony/mailer", - "version": "v7.2.6", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/mailer.git", - "reference": "998692469d6e698c6eadc7ef37a6530a9eabb356" + "reference": "0f375bbbde96ae8c78e4aa3e63aabd486e33364c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/998692469d6e698c6eadc7ef37a6530a9eabb356", - "reference": "998692469d6e698c6eadc7ef37a6530a9eabb356", + "url": "https://api.github.com/repos/symfony/mailer/zipball/0f375bbbde96ae8c78e4aa3e63aabd486e33364c", + "reference": "0f375bbbde96ae8c78e4aa3e63aabd486e33364c", "shasum": "" }, "require": { @@ -7680,7 +7684,7 @@ "description": "Helps sending emails", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailer/tree/v7.2.6" + "source": "https://github.com/symfony/mailer/tree/v7.3.0" }, "funding": [ { @@ -7696,11 +7700,11 @@ "type": "tidelift" } ], - "time": "2025-04-04T09:50:51+00:00" + "time": "2025-04-04T09:51:09+00:00" }, { "name": "symfony/mailgun-mailer", - "version": "v7.2.0", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/mailgun-mailer.git", @@ -7749,7 +7753,7 @@ "description": "Symfony Mailgun Mailer Bridge", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailgun-mailer/tree/v7.2.0" + "source": "https://github.com/symfony/mailgun-mailer/tree/v7.3.0" }, "funding": [ { @@ -7769,16 +7773,16 @@ }, { "name": "symfony/mime", - "version": "v7.2.6", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "706e65c72d402539a072d0d6ad105fff6c161ef1" + "reference": "0e7b19b2f399c31df0cdbe5d8cbf53f02f6cfcd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/706e65c72d402539a072d0d6ad105fff6c161ef1", - "reference": "706e65c72d402539a072d0d6ad105fff6c161ef1", + "url": "https://api.github.com/repos/symfony/mime/zipball/0e7b19b2f399c31df0cdbe5d8cbf53f02f6cfcd9", + "reference": "0e7b19b2f399c31df0cdbe5d8cbf53f02f6cfcd9", "shasum": "" }, "require": { @@ -7833,7 +7837,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v7.2.6" + "source": "https://github.com/symfony/mime/tree/v7.3.0" }, "funding": [ { @@ -7849,20 +7853,20 @@ "type": "tidelift" } ], - "time": "2025-04-27T13:34:41+00:00" + "time": "2025-02-19T08:51:26+00:00" }, { "name": "symfony/options-resolver", - "version": "v7.2.0", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" + "reference": "afb9a8038025e5dbc657378bfab9198d75f10fca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", - "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/afb9a8038025e5dbc657378bfab9198d75f10fca", + "reference": "afb9a8038025e5dbc657378bfab9198d75f10fca", "shasum": "" }, "require": { @@ -7900,7 +7904,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" + "source": "https://github.com/symfony/options-resolver/tree/v7.3.0" }, "funding": [ { @@ -7916,7 +7920,7 @@ "type": "tidelift" } ], - "time": "2024-11-20T11:17:29+00:00" + "time": "2025-04-04T13:12:05+00:00" }, { "name": "symfony/polyfill-ctype", @@ -8557,16 +8561,16 @@ }, { "name": "symfony/process", - "version": "v7.2.5", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "87b7c93e57df9d8e39a093d32587702380ff045d" + "reference": "40c295f2deb408d5e9d2d32b8ba1dd61e36f05af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/87b7c93e57df9d8e39a093d32587702380ff045d", - "reference": "87b7c93e57df9d8e39a093d32587702380ff045d", + "url": "https://api.github.com/repos/symfony/process/zipball/40c295f2deb408d5e9d2d32b8ba1dd61e36f05af", + "reference": "40c295f2deb408d5e9d2d32b8ba1dd61e36f05af", "shasum": "" }, "require": { @@ -8598,7 +8602,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.2.5" + "source": "https://github.com/symfony/process/tree/v7.3.0" }, "funding": [ { @@ -8614,11 +8618,11 @@ "type": "tidelift" } ], - "time": "2025-03-13T12:21:46+00:00" + "time": "2025-04-17T09:11:12+00:00" }, { "name": "symfony/psr-http-message-bridge", - "version": "v7.2.0", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/psr-http-message-bridge.git", @@ -8681,7 +8685,7 @@ "psr-7" ], "support": { - "source": "https://github.com/symfony/psr-http-message-bridge/tree/v7.2.0" + "source": "https://github.com/symfony/psr-http-message-bridge/tree/v7.3.0" }, "funding": [ { @@ -8701,16 +8705,16 @@ }, { "name": "symfony/routing", - "version": "v7.2.3", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "ee9a67edc6baa33e5fae662f94f91fd262930996" + "reference": "8e213820c5fea844ecea29203d2a308019007c15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/ee9a67edc6baa33e5fae662f94f91fd262930996", - "reference": "ee9a67edc6baa33e5fae662f94f91fd262930996", + "url": "https://api.github.com/repos/symfony/routing/zipball/8e213820c5fea844ecea29203d2a308019007c15", + "reference": "8e213820c5fea844ecea29203d2a308019007c15", "shasum": "" }, "require": { @@ -8762,7 +8766,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v7.2.3" + "source": "https://github.com/symfony/routing/tree/v7.3.0" }, "funding": [ { @@ -8778,7 +8782,7 @@ "type": "tidelift" } ], - "time": "2025-01-17T10:56:55+00:00" + "time": "2025-05-24T20:43:28+00:00" }, { "name": "symfony/service-contracts", @@ -8865,16 +8869,16 @@ }, { "name": "symfony/string", - "version": "v7.2.6", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931" + "reference": "f3570b8c61ca887a9e2938e85cb6458515d2b125" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/a214fe7d62bd4df2a76447c67c6b26e1d5e74931", - "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931", + "url": "https://api.github.com/repos/symfony/string/zipball/f3570b8c61ca887a9e2938e85cb6458515d2b125", + "reference": "f3570b8c61ca887a9e2938e85cb6458515d2b125", "shasum": "" }, "require": { @@ -8932,7 +8936,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.2.6" + "source": "https://github.com/symfony/string/tree/v7.3.0" }, "funding": [ { @@ -8948,20 +8952,20 @@ "type": "tidelift" } ], - "time": "2025-04-20T20:18:16+00:00" + "time": "2025-04-20T20:19:01+00:00" }, { "name": "symfony/translation", - "version": "v7.2.6", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "e7fd8e2a4239b79a0fd9fb1fef3e0e7f969c6dc6" + "reference": "4aba29076a29a3aa667e09b791e5f868973a8667" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/e7fd8e2a4239b79a0fd9fb1fef3e0e7f969c6dc6", - "reference": "e7fd8e2a4239b79a0fd9fb1fef3e0e7f969c6dc6", + "url": "https://api.github.com/repos/symfony/translation/zipball/4aba29076a29a3aa667e09b791e5f868973a8667", + "reference": "4aba29076a29a3aa667e09b791e5f868973a8667", "shasum": "" }, "require": { @@ -8971,6 +8975,7 @@ "symfony/translation-contracts": "^2.5|^3.0" }, "conflict": { + "nikic/php-parser": "<5.0", "symfony/config": "<6.4", "symfony/console": "<6.4", "symfony/dependency-injection": "<6.4", @@ -8984,7 +8989,7 @@ "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { - "nikic/php-parser": "^4.18|^5.0", + "nikic/php-parser": "^5.0", "psr/log": "^1|^2|^3", "symfony/config": "^6.4|^7.0", "symfony/console": "^6.4|^7.0", @@ -9027,7 +9032,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v7.2.6" + "source": "https://github.com/symfony/translation/tree/v7.3.0" }, "funding": [ { @@ -9043,7 +9048,7 @@ "type": "tidelift" } ], - "time": "2025-04-07T19:09:28+00:00" + "time": "2025-05-29T07:19:49+00:00" }, { "name": "symfony/translation-contracts", @@ -9125,16 +9130,16 @@ }, { "name": "symfony/uid", - "version": "v7.2.0", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/uid.git", - "reference": "2d294d0c48df244c71c105a169d0190bfb080426" + "reference": "7beeb2b885cd584cd01e126c5777206ae4c3c6a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/uid/zipball/2d294d0c48df244c71c105a169d0190bfb080426", - "reference": "2d294d0c48df244c71c105a169d0190bfb080426", + "url": "https://api.github.com/repos/symfony/uid/zipball/7beeb2b885cd584cd01e126c5777206ae4c3c6a3", + "reference": "7beeb2b885cd584cd01e126c5777206ae4c3c6a3", "shasum": "" }, "require": { @@ -9179,7 +9184,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/uid/tree/v7.2.0" + "source": "https://github.com/symfony/uid/tree/v7.3.0" }, "funding": [ { @@ -9195,24 +9200,25 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:21:43+00:00" + "time": "2025-05-24T14:28:13+00:00" }, { "name": "symfony/var-dumper", - "version": "v7.2.6", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "9c46038cd4ed68952166cf7001b54eb539184ccb" + "reference": "548f6760c54197b1084e1e5c71f6d9d523f2f78e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/9c46038cd4ed68952166cf7001b54eb539184ccb", - "reference": "9c46038cd4ed68952166cf7001b54eb539184ccb", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/548f6760c54197b1084e1e5c71f6d9d523f2f78e", + "reference": "548f6760c54197b1084e1e5c71f6d9d523f2f78e", "shasum": "" }, "require": { "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -9262,7 +9268,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v7.2.6" + "source": "https://github.com/symfony/var-dumper/tree/v7.3.0" }, "funding": [ { @@ -9278,24 +9284,25 @@ "type": "tidelift" } ], - "time": "2025-04-09T08:14:01+00:00" + "time": "2025-04-27T18:39:23+00:00" }, { "name": "symfony/var-exporter", - "version": "v7.2.6", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "422b8de94c738830a1e071f59ad14d67417d7007" + "reference": "c9a1168891b5aaadfd6332ef44393330b3498c4c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/422b8de94c738830a1e071f59ad14d67417d7007", - "reference": "422b8de94c738830a1e071f59ad14d67417d7007", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/c9a1168891b5aaadfd6332ef44393330b3498c4c", + "reference": "c9a1168891b5aaadfd6332ef44393330b3498c4c", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" }, "require-dev": { "symfony/property-access": "^6.4|^7.0", @@ -9338,7 +9345,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v7.2.6" + "source": "https://github.com/symfony/var-exporter/tree/v7.3.0" }, "funding": [ { @@ -9354,7 +9361,7 @@ "type": "tidelift" } ], - "time": "2025-05-02T08:36:00+00:00" + "time": "2025-05-15T09:04:05+00:00" }, { "name": "thecodingmachine/safe", diff --git a/config/firefly.php b/config/firefly.php index 94fa435673..73b18409bf 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.16', + 'version' => 'develop/2025-05-29', 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 25, diff --git a/tests/integration/Support/Models/BillDateCalculatorTest.php b/tests/integration/Support/Models/BillDateCalculatorTest.php index d8206c714a..1164fce606 100644 --- a/tests/integration/Support/Models/BillDateCalculatorTest.php +++ b/tests/integration/Support/Models/BillDateCalculatorTest.php @@ -56,7 +56,7 @@ final class BillDateCalculatorTest extends TestCase public function testGivenSomeDataItWorks(Carbon $earliest, Carbon $latest, Carbon $billStart, string $period, int $skip, ?Carbon $lastPaid, array $expected): void { $result = $this->calculator->getPayDates($earliest, $latest, $billStart, $period, $skip, $lastPaid); - $this->assertSame($expected, $result); + self::assertSame($expected, $result); } public static function provideDates(): Iterator diff --git a/tests/integration/Support/NavigationCustomEndOfPeriodTest.php b/tests/integration/Support/NavigationCustomEndOfPeriodTest.php index 16102bc7fc..18a4166646 100644 --- a/tests/integration/Support/NavigationCustomEndOfPeriodTest.php +++ b/tests/integration/Support/NavigationCustomEndOfPeriodTest.php @@ -45,6 +45,6 @@ final class NavigationCustomEndOfPeriodTest extends TestCase $navigation = new Navigation(); $period = $navigation->endOfPeriod($from, 'custom'); - $this->assertSame($expected->toDateString(), $period->toDateString()); + self::assertSame($expected->toDateString(), $period->toDateString()); } } diff --git a/tests/unit/Support/Calendar/CalculatorTest.php b/tests/unit/Support/Calendar/CalculatorTest.php index d6d9677361..ec2be998c9 100644 --- a/tests/unit/Support/Calendar/CalculatorTest.php +++ b/tests/unit/Support/Calendar/CalculatorTest.php @@ -73,7 +73,7 @@ final class CalculatorTest extends TestCase { $calculator = new Calculator(); $period = $calculator->nextDateByInterval($provider->epoch(), $provider->periodicity); - $this->assertSame($provider->expected()->toDateString(), $period->toDateString()); + self::assertSame($provider->expected()->toDateString(), $period->toDateString()); } public static function provideAllPeriodicity(): iterable @@ -102,7 +102,7 @@ final class CalculatorTest extends TestCase { $calculator = new Calculator(); $period = $calculator->nextDateByInterval($provider->epoch(), $provider->periodicity, $provider->skip); - $this->assertSame($provider->expected()->toDateString(), $period->toDateString()); + self::assertSame($provider->expected()->toDateString(), $period->toDateString()); } public static function provideSkippedIntervals(): iterable diff --git a/tests/unit/Support/Calendar/Periodicity/IntervalTestCase.php b/tests/unit/Support/Calendar/Periodicity/IntervalTestCase.php index 0654ab3247..7a67095366 100644 --- a/tests/unit/Support/Calendar/Periodicity/IntervalTestCase.php +++ b/tests/unit/Support/Calendar/Periodicity/IntervalTestCase.php @@ -36,7 +36,7 @@ abstract class IntervalTestCase extends TestCase public function testGivenAnEpochWhenCallTheNextDateThenReturnsTheExpectedDateSuccessful(IntervalProvider $provider): void { $period = static::factory()->nextDate($provider->epoch); - $this->assertSame($provider->expected->toDateString(), $period->toDateString()); + self::assertSame($provider->expected->toDateString(), $period->toDateString()); } public static function provider(): iterable diff --git a/tests/unit/Support/NavigationAddPeriodTest.php b/tests/unit/Support/NavigationAddPeriodTest.php index 1c13a557b4..e492584c50 100644 --- a/tests/unit/Support/NavigationAddPeriodTest.php +++ b/tests/unit/Support/NavigationAddPeriodTest.php @@ -56,7 +56,7 @@ final class NavigationAddPeriodTest extends TestCase public function testGivenAFrequencyAndSkipIntervalWhenCalculateTheDateThenReturnsTheSkippedDateSuccessful(int $skip, string $frequency, Carbon $from, Carbon $expected): void { $period = $this->navigation->addPeriod($from, $frequency, $skip); - $this->assertSame($expected->toDateString(), $period->toDateString()); + self::assertSame($expected->toDateString(), $period->toDateString()); } public static function providePeriodsWithSkippingParam(): iterable @@ -108,7 +108,7 @@ final class NavigationAddPeriodTest extends TestCase public function testGivenAFrequencyWhenCalculateTheDateThenReturnsTheExpectedDateSuccessful(string $frequency, Carbon $from, Carbon $expected): void { $period = $this->navigation->addPeriod($from, $frequency, 0); - $this->assertSame($expected->toDateString(), $period->toDateString()); + self::assertSame($expected->toDateString(), $period->toDateString()); } public static function providePeriods(): Iterator @@ -158,7 +158,7 @@ final class NavigationAddPeriodTest extends TestCase public function testGivenAIntervalWhenCallTheNextDateByIntervalMethodThenReturnsTheExpectedDateSuccessful(Periodicity $periodicity, Carbon $from, Carbon $expected): void { $period = $this->navigation->nextDateByInterval($from, $periodicity); - $this->assertSame($expected->toDateString(), $period->toDateString()); + self::assertSame($expected->toDateString(), $period->toDateString()); } public static function provideFrequencies(): Iterator @@ -212,7 +212,7 @@ final class NavigationAddPeriodTest extends TestCase public function testGivenAMonthFrequencyWhenCalculateTheDateThenReturnsTheLastDayOfMonthSuccessful(string $frequency, Carbon $from, Carbon $expected): void { $period = $this->navigation->addPeriod($from, $frequency, 0); - $this->assertSame($expected->toDateString(), $period->toDateString()); + self::assertSame($expected->toDateString(), $period->toDateString()); } public static function provideMonthPeriods(): Iterator diff --git a/tests/unit/Support/NavigationEndOfPeriodTest.php b/tests/unit/Support/NavigationEndOfPeriodTest.php index 4e8ccea578..f76bb84be9 100644 --- a/tests/unit/Support/NavigationEndOfPeriodTest.php +++ b/tests/unit/Support/NavigationEndOfPeriodTest.php @@ -55,7 +55,7 @@ final class NavigationEndOfPeriodTest extends TestCase public function testGivenADateAndFrequencyWhenCalculateTheDateThenReturnsTheExpectedDateSuccessful(string $frequency, Carbon $from, Carbon $expected): void { $period = clone $this->navigation->endOfPeriod($from, $frequency); - $this->assertSame($expected->toDateString(), $period->toDateString()); + self::assertSame($expected->toDateString(), $period->toDateString()); } public static function provideDates(): Iterator @@ -116,7 +116,7 @@ final class NavigationEndOfPeriodTest extends TestCase Log::spy(); $period = $this->navigation->endOfPeriod($from, $frequency); - $this->assertSame($expected->toDateString(), $period->toDateString()); + self::assertSame($expected->toDateString(), $period->toDateString()); $expectedMessage = sprintf('Cannot do endOfPeriod for $repeat_freq "%s"', $frequency); Log::shouldHaveReceived('error', [$expectedMessage]); diff --git a/tests/unit/Support/NavigationPreferredCarbonFormatByPeriodTest.php b/tests/unit/Support/NavigationPreferredCarbonFormatByPeriodTest.php index 76a8dc54ba..6f25d44beb 100644 --- a/tests/unit/Support/NavigationPreferredCarbonFormatByPeriodTest.php +++ b/tests/unit/Support/NavigationPreferredCarbonFormatByPeriodTest.php @@ -54,7 +54,7 @@ final class NavigationPreferredCarbonFormatByPeriodTest extends TestCase public function testGivenAPeriodWhenCallPreferredCarbonFormatByPeriodThenReturnsExpectedFormat(string $period, string $expected): void { $formatPeriod = $this->navigation->preferredCarbonFormatByPeriod($period); - $this->assertSame($expected, $formatPeriod); + self::assertSame($expected, $formatPeriod); } public static function providePeriods(): Iterator diff --git a/tests/unit/Support/NavigationPreferredCarbonFormatTest.php b/tests/unit/Support/NavigationPreferredCarbonFormatTest.php index 3584a98c2a..01f06aad2b 100644 --- a/tests/unit/Support/NavigationPreferredCarbonFormatTest.php +++ b/tests/unit/Support/NavigationPreferredCarbonFormatTest.php @@ -55,7 +55,7 @@ final class NavigationPreferredCarbonFormatTest extends TestCase public function testGivenStartAndEndDatesWhenCallPreferredCarbonFormatThenReturnsTheExpectedFormatSuccessful(Carbon $start, Carbon $end, string $expected): void { $carbonFormat = $this->navigation->preferredCarbonFormat($start, $end); - $this->assertSame($expected, $carbonFormat); + self::assertSame($expected, $carbonFormat); } public static function providePeriods(): Iterator diff --git a/tests/unit/Support/NavigationPreferredEndOfPeriodTest.php b/tests/unit/Support/NavigationPreferredEndOfPeriodTest.php index 4d0f22e3e7..95bf81b575 100644 --- a/tests/unit/Support/NavigationPreferredEndOfPeriodTest.php +++ b/tests/unit/Support/NavigationPreferredEndOfPeriodTest.php @@ -55,7 +55,7 @@ final class NavigationPreferredEndOfPeriodTest extends TestCase public function testGivenStartAndEndDatesWhenCallPreferredEndOfPeriodThenReturnsTheExpectedFormatSuccessful(Carbon $start, Carbon $end, string $expected): void { $formatPeriod = $this->navigation->preferredEndOfPeriod($start, $end); - $this->assertSame($expected, $formatPeriod); + self::assertSame($expected, $formatPeriod); } public static function providePeriods(): Iterator diff --git a/tests/unit/Support/NavigationPreferredRangeFormatTest.php b/tests/unit/Support/NavigationPreferredRangeFormatTest.php index 7218e59db2..6c0eff7d07 100644 --- a/tests/unit/Support/NavigationPreferredRangeFormatTest.php +++ b/tests/unit/Support/NavigationPreferredRangeFormatTest.php @@ -55,7 +55,7 @@ final class NavigationPreferredRangeFormatTest extends TestCase public function testGivenStartAndEndDatesWhenCallPreferredRangeFormatThenReturnsTheExpectedFormatSuccessful(Carbon $start, Carbon $end, string $expected): void { $formatPeriod = $this->navigation->preferredRangeFormat($start, $end); - $this->assertSame($expected, $formatPeriod); + self::assertSame($expected, $formatPeriod); } public static function providePeriods(): Iterator diff --git a/tests/unit/Support/NavigationPreferredSqlFormatTest.php b/tests/unit/Support/NavigationPreferredSqlFormatTest.php index 4a8fa37420..fa44b76178 100644 --- a/tests/unit/Support/NavigationPreferredSqlFormatTest.php +++ b/tests/unit/Support/NavigationPreferredSqlFormatTest.php @@ -55,7 +55,7 @@ final class NavigationPreferredSqlFormatTest extends TestCase public function testGivenStartAndEndDatesWhenCallPreferredSqlFormatThenReturnsTheExpectedFormatSuccessful(Carbon $start, Carbon $end, string $expected): void { $formatPeriod = $this->navigation->preferredSqlFormat($start, $end); - $this->assertSame($expected, $formatPeriod); + self::assertSame($expected, $formatPeriod); } public static function provideDates(): Iterator diff --git a/tests/unit/Support/NavigationStartOfPeriodTest.php b/tests/unit/Support/NavigationStartOfPeriodTest.php index 288aa7ecc4..ffe2514683 100644 --- a/tests/unit/Support/NavigationStartOfPeriodTest.php +++ b/tests/unit/Support/NavigationStartOfPeriodTest.php @@ -56,7 +56,7 @@ final class NavigationStartOfPeriodTest extends TestCase public function testGivenADateAndFrequencyWhenCalculateTheDateThenReturnsTheExpectedDateSuccessful(string $frequency, Carbon $from, Carbon $expected): void { $period = $this->navigation->startOfPeriod($from, $frequency); - $this->assertSame($expected->toDateString(), $period->toDateString()); + self::assertSame($expected->toDateString(), $period->toDateString()); } public static function provideDates(): Iterator @@ -121,7 +121,7 @@ final class NavigationStartOfPeriodTest extends TestCase ; $period = $this->navigation->startOfPeriod($from, $frequency); - $this->assertSame($expected->toDateString(), $period->toDateString()); + self::assertSame($expected->toDateString(), $period->toDateString()); } public static function provideUnknownFrequencies(): Iterator diff --git a/tests/unit/Support/Search/QueryParser/AbstractQueryParserInterfaceParseQueryTester.php b/tests/unit/Support/Search/QueryParser/AbstractQueryParserInterfaceParseQueryTester.php index 33946565c4..311e745586 100644 --- a/tests/unit/Support/Search/QueryParser/AbstractQueryParserInterfaceParseQueryTester.php +++ b/tests/unit/Support/Search/QueryParser/AbstractQueryParserInterfaceParseQueryTester.php @@ -26,7 +26,7 @@ abstract class AbstractQueryParserInterfaceParseQueryTester extends TestCase { $actual = $this->createParser()->parse($query); - $this->assertObjectEquals($expected, $actual); + self::assertObjectEquals($expected, $actual); } From 7e9c5a668fe50b2cee6b05714ef43c0999a66b78 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 29 May 2025 22:04:42 +0200 Subject: [PATCH 06/44] Remove spaces from account numbers. --- app/Console/Commands/Correction/CorrectsIbans.php | 14 +++++++++++++- app/Factory/AccountMetaFactory.php | 6 ++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/Correction/CorrectsIbans.php b/app/Console/Commands/Correction/CorrectsIbans.php index d3f1705612..8502350322 100644 --- a/app/Console/Commands/Correction/CorrectsIbans.php +++ b/app/Console/Commands/Correction/CorrectsIbans.php @@ -43,7 +43,7 @@ class CorrectsIbans extends Command */ public function handle(): int { - $accounts = Account::whereNotNull('iban')->get(); + $accounts = Account::with('accountMeta')->get(); $this->filterIbans($accounts); $this->countAndCorrectIbans($accounts); @@ -62,6 +62,18 @@ class CorrectsIbans extends Command $this->friendlyInfo(sprintf('Removed spaces from IBAN of account #%d', $account->id)); ++$this->count; } + // same for account number: + $accountNumber = $account->accountMeta->where('name', 'account_number')->first(); + if(null !== $accountNumber) { + $number = (string) $accountNumber->value; + $newNumber = app('steam')->filterSpaces($number); + if ('' !== $number && $number !== $newNumber) { + $accountNumber->value = $newNumber; + $accountNumber->save(); + $this->friendlyInfo(sprintf('Removed spaces from account number of account #%d', $account->id)); + ++$this->count; + } + } } } diff --git a/app/Factory/AccountMetaFactory.php b/app/Factory/AccountMetaFactory.php index cad3bdddb6..6193dc4147 100644 --- a/app/Factory/AccountMetaFactory.php +++ b/app/Factory/AccountMetaFactory.php @@ -26,6 +26,7 @@ namespace FireflyIII\Factory; use FireflyIII\Models\Account; use FireflyIII\Models\AccountMeta; +use FireflyIII\Support\Facades\Steam; /** * Class AccountMetaFactory @@ -41,11 +42,16 @@ class AccountMetaFactory $entry = $account->accountMeta()->where('name', $field)->first(); // must not be an empty string: if ('' !== $value) { + if('account_number' === $field) { + $value = Steam::filterSpaces($value); + $value = trim(str_replace([' ',"\t", "\n", "\r"], '', $value)); + } // if $data has field and $entry is null, create new one: if (null === $entry) { return $this->create(['account_id' => $account->id, 'name' => $field, 'data' => $value]); } + // if $data has field and $entry is not null, update $entry: $entry->data = $value; $entry->save(); From 0521da124e7bb9a45043d537ed76e7c030aaf42d Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 30 May 2025 08:10:51 +0200 Subject: [PATCH 07/44] Add new fields to API. --- app/Helpers/Collector/GroupCollector.php | 5 ++-- .../TransactionGroupEnrichment.php | 16 +++++++++++- .../TransactionGroupTransformer.php | 26 +++++++++++++++++++ 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index 5daa03922e..3bbb4e3c7c 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -86,7 +86,7 @@ class GroupCollector implements GroupCollectorInterface $this->hasJoinedAttTables = false; $this->expandGroupSearch = false; $this->hasJoinedMetaTables = false; - $this->booleanFields = ['balance_dirty']; + $this->booleanFields = ['source_balance_dirty','destination_balance_dirty']; $this->integerFields = [ 'transaction_group_id', 'user_id', @@ -137,7 +137,7 @@ class GroupCollector implements GroupCollectorInterface // currency info: 'source.amount as amount', 'source.balance_after as source_balance_after', - 'source.balance_dirty as balance_dirty', + 'source.balance_dirty as source_balance_dirty', 'source.native_amount as native_amount', 'source.transaction_currency_id as currency_id', 'currency.code as currency_code', @@ -157,6 +157,7 @@ class GroupCollector implements GroupCollectorInterface // destination account info (always present) 'destination.account_id as destination_account_id', 'destination.balance_after as destination_balance_after', + 'destination.balance_dirty as destination_balance_dirty', ]; } diff --git a/app/Support/JsonApi/Enrichments/TransactionGroupEnrichment.php b/app/Support/JsonApi/Enrichments/TransactionGroupEnrichment.php index 9bac754a7c..c3a28f1144 100644 --- a/app/Support/JsonApi/Enrichments/TransactionGroupEnrichment.php +++ b/app/Support/JsonApi/Enrichments/TransactionGroupEnrichment.php @@ -30,10 +30,12 @@ use FireflyIII\Models\Attachment; use FireflyIII\Models\Location; use FireflyIII\Models\Note; use FireflyIII\Models\Tag; +use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournalMeta; use FireflyIII\Models\UserGroup; +use FireflyIII\Support\Facades\Amount; use FireflyIII\User; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Collection; @@ -52,6 +54,7 @@ class TransactionGroupEnrichment implements EnrichmentInterface private array $notes; // @phpstan-ignore-line private array $tags; private User $user; + private TransactionCurrency $nativeCurrency; private UserGroup $userGroup; public function __construct() @@ -63,6 +66,7 @@ class TransactionGroupEnrichment implements EnrichmentInterface $this->locations = []; $this->attachmentCount = []; $this->dateFields = ['interest_date', 'book_date', 'process_date', 'due_date', 'payment_date', 'invoice_date']; + $this->nativeCurrency = Amount::getNativeCurrency(); } #[Override] @@ -192,8 +196,9 @@ class TransactionGroupEnrichment implements EnrichmentInterface $metaData = $this->metaData; $locations = $this->locations; $attachmentCount = $this->attachmentCount; + $nativeCurrency = $this->nativeCurrency; - $this->collection = $this->collection->map(function (array $item) use ($notes, $tags, $metaData, $locations, $attachmentCount) { + $this->collection = $this->collection->map(function (array $item) use ($nativeCurrency, $notes, $tags, $metaData, $locations, $attachmentCount) { foreach ($item['transactions'] as $index => $transaction) { $journalId = (int) $transaction['transaction_journal_id']; @@ -213,6 +218,15 @@ class TransactionGroupEnrichment implements EnrichmentInterface 'zoom_level' => null, ]; + // native currency + $item['transactions'][$index]['native_currency'] = [ + 'id' => (string) $nativeCurrency->id, + 'code' => $nativeCurrency->code, + 'name' => $nativeCurrency->name, + 'symbol' => $nativeCurrency->symbol, + 'decimal_places' => $nativeCurrency->decimal_places, + ]; + // append meta data $item['transactions'][$index]['meta'] = []; $item['transactions'][$index]['meta_date'] = []; diff --git a/app/Transformers/TransactionGroupTransformer.php b/app/Transformers/TransactionGroupTransformer.php index ef5f8213c8..c9868bba83 100644 --- a/app/Transformers/TransactionGroupTransformer.php +++ b/app/Transformers/TransactionGroupTransformer.php @@ -144,12 +144,38 @@ class TransactionGroupTransformer extends AbstractTransformer 'foreign_currency_id' => $this->stringFromArray($transaction, 'foreign_currency_id', null), 'foreign_currency_code' => $transaction['foreign_currency_code'], + 'foreign_currency_name' => $transaction['foreign_currency_name'], 'foreign_currency_symbol' => $transaction['foreign_currency_symbol'], 'foreign_currency_decimal_places' => $transaction['foreign_currency_decimal_places'], 'amount' => $amount, 'foreign_amount' => $foreignAmount, + // native amount, defaults to NULL when convertToNative is false. + 'native_amount' => $transaction['native_amount'] ?? null, + + // native currency, always present. + 'native_currency_id' => $transaction['native_currency']['id'] ?? null, + 'native_currency_code' => $transaction['native_currency']['code'] ?? null, + 'native_currency_name' => $transaction['native_currency']['name'] ?? null, + 'native_currency_symbol' => $transaction['native_currency']['symbol'] ?? null, + 'native_currency_decimal_places' => $transaction['native_currency']['decimal_places'] ?? null, + + // source balance after + 'source_balance_after' => $transaction['source_balance_after'] ?? null, + 'source_balance_dirty' => $transaction['source_balance_dirty'], + + // destination balance after + 'destination_balance_after' => $transaction['destination_balance_after'] ?? null, + 'destination_balance_dirty' => $transaction['destination_balance_dirty'], + + // balance before and after, if not dirty. + //'running_balance_dirty' => $transaction['balance_dirty'] ?? false, + //'running_balance_before' => $transaction['balance_before'] ?? null, + //'running_balance_after' => $transaction['balance_after'] ?? null, + + + 'description' => $transaction['description'], 'source_id' => (string) $transaction['source_account_id'], From 3344d2e5f3573458f6aab5b8474e0bffc9f29890 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 30 May 2025 08:11:12 +0200 Subject: [PATCH 08/44] Expand and pick up layout. --- resources/assets/v2/vite.config.js | 6 +++--- resources/views/list/groups.twig | 14 +++++++++++++- .../v2/partials/dashboard/account-list.blade.php | 8 ++++---- .../v2/partials/dashboard/subscriptions.blade.php | 2 +- routes/web.php | 6 +++--- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/resources/assets/v2/vite.config.js b/resources/assets/v2/vite.config.js index f3f18671bb..fad196ce34 100644 --- a/resources/assets/v2/vite.config.js +++ b/resources/assets/v2/vite.config.js @@ -36,8 +36,8 @@ export default defineConfig(({command, mode, isSsrBuild, isPreview}) => { let https = null; if (command === 'serve') { https = { - key: fs.readFileSync(`/vagrant/tls-certificates/wildcard.sd.internal.key`), - cert: fs.readFileSync(`/vagrant/tls-certificates/wildcard.sd.internal.crt`), + key: fs.readFileSync(`/Users/sander/Sites/vm/tls-certificates/wildcard.sd.internal.key`), + cert: fs.readFileSync(`/Users/sander/Sites/vm/tls-certificates/wildcard.sd.internal.crt`), }; } @@ -83,7 +83,7 @@ export default defineConfig(({command, mode, isSsrBuild, isPreview}) => { server: { cors: true, - origin: 'https://firefly.sd.internal:5173', + origin: 'https://localhost:5173', watch: { usePolling: true, }, diff --git a/resources/views/list/groups.twig b/resources/views/list/groups.twig index ec963eff29..5c1354023f 100644 --- a/resources/views/list/groups.twig +++ b/resources/views/list/groups.twig @@ -165,20 +165,28 @@ {# deposit #} {% if transaction.transaction_type_type == 'Deposit' %} + {# amount of deposit #} {{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places) }} + {# foreign amount of deposit #} {% if null != transaction.foreign_amount %} ({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }}) {% endif %} + {# native amount of deposit #} {% if convertToNative and 0 != transaction.native_amount %} ({{ formatAmountBySymbol(transaction.native_amount*-1, defaultCurrency.symbol, defaultCurrency.decimal_places) }}) {% endif %} {# transfer #} {% elseif transaction.transaction_type_type == 'Transfer' %} - {{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places, false) }} + {# amount of transfer #} + {{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places, false) }} + + {# foreign amount of transfer #} {% if null != transaction.foreign_amount %} ({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places, false) }}) {% endif %} + + {# native amount of transfer #} {% if convertToNative and 0 != transaction.native_amount %} ({{ formatAmountBySymbol(transaction.native_amount*-1, defaultCurrency.symbol, defaultCurrency.decimal_places) }}) {% endif %} @@ -244,10 +252,14 @@ {# THE REST #} {% else %} + {# amount of withdrawal #} {{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_decimal_places) }} + + {# foreign amount of withdrawal #} {% if null != transaction.foreign_amount %} ({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }}) {% endif %} + {# native amount of withdrawal #} {% if convertToNative and 0 != transaction.native_amount %} ({{ formatAmountBySymbol(transaction.native_amount, defaultCurrency.symbol, defaultCurrency.decimal_places) }}) {% endif %} diff --git a/resources/views/v2/partials/dashboard/account-list.blade.php b/resources/views/v2/partials/dashboard/account-list.blade.php index a7b2f5078d..19c999d5ec 100644 --- a/resources/views/v2/partials/dashboard/account-list.blade.php +++ b/resources/views/v2/partials/dashboard/account-list.blade.php @@ -9,7 +9,7 @@

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