From 8e393066b8100d3c9f2d2e9eb3eccbddecd5b33b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 04:00:19 +0000 Subject: [PATCH 1/2] Bump i18next from 25.10.10 to 26.0.1 Bumps [i18next](https://github.com/i18next/i18next) from 25.10.10 to 26.0.1. - [Release notes](https://github.com/i18next/i18next/releases) - [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/i18next/compare/v25.10.10...v26.0.1) --- updated-dependencies: - dependency-name: i18next dependency-version: 26.0.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- resources/assets/v2/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6290ea732b..067ee2a209 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6647,9 +6647,9 @@ } }, "node_modules/i18next": { - "version": "25.10.10", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.10.10.tgz", - "integrity": "sha512-cqUW2Z3EkRx7NqSyywjkgCLK7KLCL6IFVFcONG7nVYIJ3ekZ1/N5jUsihHV6Bq37NfhgtczxJcxduELtjTwkuQ==", + "version": "26.0.3", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-26.0.3.tgz", + "integrity": "sha512-1571kXINxHKY7LksWp8wP+zP0YqHSSpl/OW0Y0owFEf2H3s8gCAffWaZivcz14rMkOvn3R/psiQxVsR9t2Nafg==", "funding": [ { "type": "individual", @@ -12244,7 +12244,7 @@ "chartjs-adapter-date-fns": "^3.0.0", "chartjs-chart-sankey": "^0.14.0", "date-fns": "^4.0.0", - "i18next": "^25.0.1", + "i18next": "^26.0.3", "i18next-chained-backend": "^5.0.0", "i18next-http-backend": "^3.0.1", "i18next-localstorage-backend": "^4.2.0", diff --git a/resources/assets/v2/package.json b/resources/assets/v2/package.json index dbeade0d63..814739358e 100644 --- a/resources/assets/v2/package.json +++ b/resources/assets/v2/package.json @@ -27,7 +27,7 @@ "chartjs-adapter-date-fns": "^3.0.0", "chartjs-chart-sankey": "^0.14.0", "date-fns": "^4.0.0", - "i18next": "^25.0.1", + "i18next": "^26.0.3", "i18next-chained-backend": "^5.0.0", "i18next-http-backend": "^3.0.1", "i18next-localstorage-backend": "^4.2.0", From ecab686ac91e37d86335236144988752f469db44 Mon Sep 17 00:00:00 2001 From: JC5 Date: Fri, 3 Apr 2026 07:31:27 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20releas?= =?UTF-8?q?e=20'develop'=20on=202026-04-03?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .ci/php-cs-fixer/composer.lock | 12 +- .../Correction/CreatesGroupMemberships.php | 6 +- .../RemovesLinksToDeletedObjects.php | 28 +--- .../Commands/Correction/RemovesZeroAmount.php | 6 +- .../Upgrade/UpgradesJournalMetaData.php | 24 +--- .../Commands/Upgrade/UpgradesWebhooks.php | 6 +- app/Factory/AccountFactory.php | 14 +- app/Factory/BillFactory.php | 6 +- app/Factory/BudgetFactory.php | 6 +- app/Factory/CategoryFactory.php | 6 +- app/Factory/TagFactory.php | 6 +- .../Observer/DeletedAccountObserver.php | 6 +- app/Helpers/Collector/GroupCollector.php | 9 +- app/Http/Controllers/NewUserController.php | 6 +- app/Http/Controllers/ProfileController.php | 6 +- .../TransactionCurrency/EditController.php | 6 +- .../Account/AccountRepository.php | 33 +---- app/Repositories/Bill/BillRepository.php | 38 +---- .../Budget/AvailableBudgetRepository.php | 26 +--- app/Repositories/Budget/BudgetRepository.php | 32 +---- .../Category/CategoryRepository.php | 19 +-- .../Currency/CurrencyRepository.php | 21 +-- .../ExchangeRate/ExchangeRateRepository.php | 19 +-- .../Journal/JournalRepository.php | 24 +--- .../LinkType/LinkTypeRepository.php | 6 +- .../ObjectGroup/CreatesObjectGroups.php | 18 +-- .../ObjectGroup/ObjectGroupRepository.php | 6 +- app/Repositories/Rule/RuleRepository.php | 12 +- .../RuleGroup/RuleGroupRepository.php | 18 +-- app/Repositories/Tag/TagRepository.php | 50 ++----- app/Repositories/User/UserRepository.php | 6 +- .../UserGroup/UserGroupRepository.php | 6 +- .../Destroy/CategoryDestroyService.php | 6 +- .../Internal/Support/BillServiceTrait.php | 6 +- .../Internal/Update/JournalUpdateService.php | 25 +--- .../Http/Api/CollectsAccountsFromFilter.php | 6 +- .../Enrichments/BudgetLimitEnrichment.php | 6 +- .../Enrichments/PiggyBankEnrichment.php | 132 +++++++++--------- app/Support/Search/OperatorQuerySearch.php | 6 +- app/Support/Twig/TransactionGroupTwig.php | 21 +-- app/TransactionRules/Actions/AddTag.php | 6 +- .../Actions/AppendDescription.php | 6 +- app/TransactionRules/Actions/ClearNotes.php | 6 +- .../Actions/ConvertToDeposit.php | 18 +-- .../Actions/ConvertToTransfer.php | 6 +- .../Actions/ConvertToWithdrawal.php | 18 +-- app/TransactionRules/Actions/LinkToBill.php | 6 +- .../Actions/PrependDescription.php | 6 +- app/TransactionRules/Actions/RemoveTag.php | 12 +- .../Actions/SetDestinationAccount.php | 6 +- .../Actions/SetDestinationToCashAccount.php | 6 +- .../Actions/SetSourceAccount.php | 6 +- .../Actions/SetSourceToCashAccount.php | 6 +- app/User.php | 7 +- app/Validation/FireflyValidator.php | 12 +- app/Validation/TransactionValidation.php | 12 +- composer.lock | 70 +++++----- config/firefly.php | 4 +- package-lock.json | 56 ++++---- .../Api/Models/Account/ListControllerTest.php | 6 +- .../Api/Models/Account/ShowControllerTest.php | 29 +--- .../Support/NavigationEndOfPeriodTest.php | 60 ++------ 62 files changed, 268 insertions(+), 791 deletions(-) diff --git a/.ci/php-cs-fixer/composer.lock b/.ci/php-cs-fixer/composer.lock index 50f32775bd..fbd221c1a9 100644 --- a/.ci/php-cs-fixer/composer.lock +++ b/.ci/php-cs-fixer/composer.lock @@ -1582,16 +1582,16 @@ }, { "name": "symfony/filesystem", - "version": "v8.0.6", + "version": "v8.0.8", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "7bf9162d7a0dff98d079b72948508fa48018a770" + "reference": "66b769ae743ce2d13e435528fbef4af03d623e5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/7bf9162d7a0dff98d079b72948508fa48018a770", - "reference": "7bf9162d7a0dff98d079b72948508fa48018a770", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/66b769ae743ce2d13e435528fbef4af03d623e5a", + "reference": "66b769ae743ce2d13e435528fbef4af03d623e5a", "shasum": "" }, "require": { @@ -1628,7 +1628,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v8.0.6" + "source": "https://github.com/symfony/filesystem/tree/v8.0.8" }, "funding": [ { @@ -1648,7 +1648,7 @@ "type": "tidelift" } ], - "time": "2026-02-25T16:59:43+00:00" + "time": "2026-03-30T15:14:47+00:00" }, { "name": "symfony/finder", diff --git a/app/Console/Commands/Correction/CreatesGroupMemberships.php b/app/Console/Commands/Correction/CreatesGroupMemberships.php index ad332c0cdb..20968c04b9 100644 --- a/app/Console/Commands/Correction/CreatesGroupMemberships.php +++ b/app/Console/Commands/Correction/CreatesGroupMemberships.php @@ -60,11 +60,7 @@ class CreatesGroupMemberships extends Command if (null === $userRole) { throw new FireflyException('Firefly III could not find a user role. Please make sure all migrations have run.'); } - $membership = GroupMembership::where('user_id', $user->id) - ->where('user_group_id', $userGroup->id) - ->where('user_role_id', $userRole->id) - ->first() - ; + $membership = GroupMembership::where('user_id', $user->id)->where('user_group_id', $userGroup->id)->where('user_role_id', $userRole->id)->first(); if (null === $membership) { GroupMembership::create(['user_id' => $user->id, 'user_role_id' => $userRole->id, 'user_group_id' => $userGroup->id]); } diff --git a/app/Console/Commands/Correction/RemovesLinksToDeletedObjects.php b/app/Console/Commands/Correction/RemovesLinksToDeletedObjects.php index cd6e3ac749..232e8b91c8 100644 --- a/app/Console/Commands/Correction/RemovesLinksToDeletedObjects.php +++ b/app/Console/Commands/Correction/RemovesLinksToDeletedObjects.php @@ -57,30 +57,10 @@ class RemovesLinksToDeletedObjects extends Command */ public function handle(): void { - $deletedTags = Tag::withTrashed() - ->whereNotNull('deleted_at') - ->get('tags.id') - ->pluck('id') - ->toArray() - ; - $deletedJournals = TransactionJournal::withTrashed() - ->whereNotNull('deleted_at') - ->get('transaction_journals.id') - ->pluck('id') - ->toArray() - ; - $deletedBudgets = Budget::withTrashed() - ->whereNotNull('deleted_at') - ->get('budgets.id') - ->pluck('id') - ->toArray() - ; - $deletedCategories = Category::withTrashed() - ->whereNotNull('deleted_at') - ->get('categories.id') - ->pluck('id') - ->toArray() - ; + $deletedTags = Tag::withTrashed()->whereNotNull('deleted_at')->get('tags.id')->pluck('id')->toArray(); + $deletedJournals = TransactionJournal::withTrashed()->whereNotNull('deleted_at')->get('transaction_journals.id')->pluck('id')->toArray(); + $deletedBudgets = Budget::withTrashed()->whereNotNull('deleted_at')->get('budgets.id')->pluck('id')->toArray(); + $deletedCategories = Category::withTrashed()->whereNotNull('deleted_at')->get('categories.id')->pluck('id')->toArray(); if (count($deletedTags) > 0) { $this->cleanupTags($deletedTags); diff --git a/app/Console/Commands/Correction/RemovesZeroAmount.php b/app/Console/Commands/Correction/RemovesZeroAmount.php index 1dd02c5775..fd9d1c344e 100644 --- a/app/Console/Commands/Correction/RemovesZeroAmount.php +++ b/app/Console/Commands/Correction/RemovesZeroAmount.php @@ -42,11 +42,7 @@ class RemovesZeroAmount extends Command */ public function handle(): int { - $set = Transaction::where('amount', 0) - ->get(['transaction_journal_id']) - ->pluck('transaction_journal_id') - ->toArray() - ; + $set = Transaction::where('amount', 0)->get(['transaction_journal_id'])->pluck('transaction_journal_id')->toArray(); $set = array_unique($set); $journals = TransactionJournal::whereIn('id', $set)->get(); diff --git a/app/Console/Commands/Upgrade/UpgradesJournalMetaData.php b/app/Console/Commands/Upgrade/UpgradesJournalMetaData.php index 4fe68a395c..ff6c433256 100644 --- a/app/Console/Commands/Upgrade/UpgradesJournalMetaData.php +++ b/app/Console/Commands/Upgrade/UpgradesJournalMetaData.php @@ -70,20 +70,12 @@ class UpgradesJournalMetaData extends Command private function getIdsForBudgets(): array { - $transactions = DB::table('budget_transaction') - ->distinct() - ->pluck('transaction_id') - ->toArray() - ; + $transactions = DB::table('budget_transaction')->distinct()->pluck('transaction_id')->toArray(); $array = []; $chunks = array_chunk($transactions, 500); foreach ($chunks as $chunk) { - $set = DB::table('transactions') - ->whereIn('transactions.id', $chunk) - ->pluck('transaction_journal_id') - ->toArray() - ; + $set = DB::table('transactions')->whereIn('transactions.id', $chunk)->pluck('transaction_journal_id')->toArray(); $array = array_merge($array, $set); } @@ -92,20 +84,12 @@ class UpgradesJournalMetaData extends Command private function getIdsForCategories(): array { - $transactions = DB::table('category_transaction') - ->distinct() - ->pluck('transaction_id') - ->toArray() - ; + $transactions = DB::table('category_transaction')->distinct()->pluck('transaction_id')->toArray(); $array = []; $chunks = array_chunk($transactions, 500); foreach ($chunks as $chunk) { - $set = DB::table('transactions') - ->whereIn('transactions.id', $chunk) - ->pluck('transaction_journal_id') - ->toArray() - ; + $set = DB::table('transactions')->whereIn('transactions.id', $chunk)->pluck('transaction_journal_id')->toArray(); $array = array_merge($array, $set); } diff --git a/app/Console/Commands/Upgrade/UpgradesWebhooks.php b/app/Console/Commands/Upgrade/UpgradesWebhooks.php index 93c19d25ee..d75f6071d6 100644 --- a/app/Console/Commands/Upgrade/UpgradesWebhooks.php +++ b/app/Console/Commands/Upgrade/UpgradesWebhooks.php @@ -104,11 +104,7 @@ class UpgradesWebhooks extends Command private function upgradeWebhooks(): void { - $set = Webhook::where('delivery', '>', 1) - ->orWhere('trigger', '>', 1) - ->orWhere('response', '>', 1) - ->get() - ; + $set = Webhook::where('delivery', '>', 1)->orWhere('trigger', '>', 1)->orWhere('response', '>', 1)->get(); /** @var Webhook $webhook */ foreach ($set as $webhook) { diff --git a/app/Factory/AccountFactory.php b/app/Factory/AccountFactory.php index 3b32423a24..f665de20ba 100644 --- a/app/Factory/AccountFactory.php +++ b/app/Factory/AccountFactory.php @@ -96,12 +96,7 @@ class AccountFactory $type = AccountType::whereType($accountType)->first(); /** @var null|Account */ - return $this->user - ->accounts() - ->where('account_type_id', $type->id) - ->where('name', $accountName) - ->first() - ; + return $this->user->accounts()->where('account_type_id', $type->id)->where('name', $accountName)->first(); } /** @@ -117,12 +112,7 @@ class AccountFactory } /** @var null|Account $return */ - $return = $this->user - ->accounts - ->where('account_type_id', $type->id) - ->where('name', $accountName) - ->first() - ; + $return = $this->user->accounts->where('account_type_id', $type->id)->where('name', $accountName)->first(); if (null === $return) { Log::debug('Found nothing. Will create a new one.'); diff --git a/app/Factory/BillFactory.php b/app/Factory/BillFactory.php index 83fccbe71c..c606d12592 100644 --- a/app/Factory/BillFactory.php +++ b/app/Factory/BillFactory.php @@ -136,11 +136,7 @@ class BillFactory public function findByName(string $name): ?Bill { /** @var null|Bill */ - return $this->user - ->bills() - ->whereLike('name', sprintf('%%%s%%', $name)) - ->first() - ; + return $this->user->bills()->whereLike('name', sprintf('%%%s%%', $name))->first(); } public function setUser(User $user): void diff --git a/app/Factory/BudgetFactory.php b/app/Factory/BudgetFactory.php index fa4ceab6d8..bbb274fa5d 100644 --- a/app/Factory/BudgetFactory.php +++ b/app/Factory/BudgetFactory.php @@ -64,11 +64,7 @@ class BudgetFactory public function findByName(string $name): ?Budget { /** @var null|Budget */ - return $this->user - ->budgets() - ->where('name', $name) - ->first() - ; + return $this->user->budgets()->where('name', $name)->first(); } public function setUser(User $user): void diff --git a/app/Factory/CategoryFactory.php b/app/Factory/CategoryFactory.php index ba27c486e9..8ea94a3915 100644 --- a/app/Factory/CategoryFactory.php +++ b/app/Factory/CategoryFactory.php @@ -39,11 +39,7 @@ class CategoryFactory public function findByName(string $name): ?Category { /** @var null|Category */ - return $this->user - ->categories() - ->where('name', $name) - ->first() - ; + return $this->user->categories()->where('name', $name)->first(); } /** diff --git a/app/Factory/TagFactory.php b/app/Factory/TagFactory.php index c4988089eb..9880a703a1 100644 --- a/app/Factory/TagFactory.php +++ b/app/Factory/TagFactory.php @@ -76,11 +76,7 @@ class TagFactory Log::debug(sprintf('Now in TagFactory::findOrCreate("%s")', $tag)); /** @var null|Tag $dbTag */ - $dbTag = $this->user - ->tags() - ->where('tag', $tag) - ->first() - ; + $dbTag = $this->user->tags()->where('tag', $tag)->first(); if (null !== $dbTag) { Log::debug(sprintf('Tag exists (#%d), return it.', $dbTag->id)); diff --git a/app/Handlers/Observer/DeletedAccountObserver.php b/app/Handlers/Observer/DeletedAccountObserver.php index 9ab1eff8fa..fc434afd50 100644 --- a/app/Handlers/Observer/DeletedAccountObserver.php +++ b/app/Handlers/Observer/DeletedAccountObserver.php @@ -49,11 +49,7 @@ class DeletedAccountObserver $repository->destroy($attachment); } - $journalIds = Transaction::where('account_id', $account->id) - ->get(['transactions.transaction_journal_id']) - ->pluck('transaction_journal_id') - ->toArray() - ; + $journalIds = Transaction::where('account_id', $account->id)->get(['transactions.transaction_journal_id'])->pluck('transaction_journal_id')->toArray(); $groupIds = array_map(function (array $item) { return $item['transaction_group_id']; diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index 22e10bc187..0bb66b0aad 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -750,11 +750,7 @@ class GroupCollector implements GroupCollectorInterface private function getCollectedGroupIds(): array { - return $this->query - ->get(['transaction_journals.transaction_group_id']) - ->pluck('transaction_group_id') - ->toArray() - ; + return $this->query->get(['transaction_journals.transaction_group_id'])->pluck('transaction_group_id')->toArray(); } private function mergeAttachments(array $existingJournal, TransactionJournal $newJournal): array @@ -1126,6 +1122,7 @@ class GroupCollector implements GroupCollectorInterface ->orderBy('transaction_journals.order', 'ASC') ->orderBy('transaction_journals.id', 'DESC') ->orderBy('transaction_journals.description', 'DESC') - ->orderBy('source.amount', 'DESC'); + ->orderBy('source.amount', 'DESC') + ; } } diff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.php index 652a3a4b25..331b5ff0de 100644 --- a/app/Http/Controllers/NewUserController.php +++ b/app/Http/Controllers/NewUserController.php @@ -109,11 +109,7 @@ final class NewUserController extends Controller $currencyRepository->makePrimary($currency); // store frontpage preferences: - $accounts = $this->repository - ->getAccountsByType([AccountTypeEnum::ASSET->value]) - ->pluck('id') - ->toArray() - ; + $accounts = $this->repository->getAccountsByType([AccountTypeEnum::ASSET->value])->pluck('id')->toArray(); Preferences::set('frontpageAccounts', $accounts); // mark. diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index c70797ec74..30366a21b0 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -187,11 +187,7 @@ final class ProfileController extends Controller /** @var User $user */ $user = auth()->user(); $isInternalAuth = $this->internalAuth; - $count = DB::table('oauth_clients') - ->where('personal_access_client', true) - ->whereNull('user_id') - ->count() - ; + $count = DB::table('oauth_clients')->where('personal_access_client', true)->whereNull('user_id')->count(); $subTitle = $user->email; $userId = $user->id; $enabled2FA = null !== $user->mfa_secret; diff --git a/app/Http/Controllers/TransactionCurrency/EditController.php b/app/Http/Controllers/TransactionCurrency/EditController.php index f3b6fadc27..94db8c4b2c 100644 --- a/app/Http/Controllers/TransactionCurrency/EditController.php +++ b/app/Http/Controllers/TransactionCurrency/EditController.php @@ -82,11 +82,7 @@ final class EditController extends Controller $currency->symbol = htmlentities($currency->symbol); // is currently enabled (for this user?) - $userCurrencies = $this->repository - ->get() - ->pluck('id') - ->toArray() - ; + $userCurrencies = $this->repository->get()->pluck('id')->toArray(); $enabled = in_array($currency->id, $userCurrencies, true); // code to handle active-checkboxes diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index 20a2081f41..6ad694e81c 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -60,11 +60,7 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac public function count(array $types): int { - return $this->user - ->accounts() - ->accountTypeIn($types) - ->count() - ; + return $this->user->accounts()->accountTypeIn($types)->count(); } /** @@ -88,12 +84,7 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac /** @var Account $account */ foreach ($accounts as $account) { - $byName = $this->user - ->accounts() - ->where('name', $account->name) - ->where('id', '!=', $account->id) - ->first() - ; + $byName = $this->user->accounts()->where('name', $account->name)->where('id', '!=', $account->id)->first(); if (null !== $byName) { $result->push($account); $result->push($byName); @@ -101,12 +92,7 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac continue; } if (null !== $account->iban) { - $byIban = $this->user - ->accounts() - ->where('iban', $account->iban) - ->where('id', '!=', $account->id) - ->first() - ; + $byIban = $this->user->accounts()->where('iban', $account->iban)->where('id', '!=', $account->id)->first(); if (null !== $byIban) { $result->push($account); $result->push($byIban); @@ -151,11 +137,7 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac public function findByIbanNull(string $iban, array $types): ?Account { $iban = Steam::filterSpaces($iban); - $query = $this->user - ->accounts() - ->where('iban', '!=', '') - ->whereNotNull('iban') - ; + $query = $this->user->accounts()->where('iban', '!=', '')->whereNotNull('iban'); if (0 !== count($types)) { $query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id'); @@ -453,12 +435,7 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac $type = AccountType::where('type', AccountTypeEnum::RECONCILIATION->value)->first(); /** @var null|Account $current */ - $current = $this->user - ->accounts() - ->where('account_type_id', $type->id) - ->where('name', $name) - ->first() - ; + $current = $this->user->accounts()->where('account_type_id', $type->id)->where('name', $name)->first(); if (null !== $current) { return $current; diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index 3db5576b2e..030fa48c3c 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -87,11 +87,7 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface */ public function correctOrder(): void { - $set = $this->user - ->bills() - ->orderBy('order', 'ASC') - ->get() - ; + $set = $this->user->bills()->orderBy('order', 'ASC')->get(); $current = 1; foreach ($set as $bill) { if ($bill->order !== $current) { @@ -110,12 +106,7 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface if (null === $withdrawal) { return; } - $this->user - ->transactionJournals() - ->whereNotNull('bill_id') - ->where('transaction_type_id', '!=', $withdrawal->id) - ->update(['bill_id' => null]) - ; + $this->user->transactionJournals()->whereNotNull('bill_id')->where('transaction_type_id', '!=', $withdrawal->id)->update(['bill_id' => null]); } public function destroy(Bill $bill): bool @@ -174,11 +165,7 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface public function findByName(string $name): ?Bill { /** @var null|Bill */ - return $this->user - ->bills() - ->where('name', $name) - ->first(['bills.*']) - ; + return $this->user->bills()->where('name', $name)->first(['bills.*']); } public function getActiveBills(): Collection @@ -261,11 +248,7 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface */ public function getByIds(array $billIds): Collection { - return $this->user - ->bills() - ->whereIn('id', $billIds) - ->get() - ; + return $this->user->bills()->whereIn('id', $billIds)->get(); } /** @@ -329,12 +312,7 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface public function getPaginator(int $size): LengthAwarePaginator { - return $this->user - ->bills() - ->orderBy('active', 'DESC') - ->orderBy('name', 'ASC') - ->paginate($size) - ; + return $this->user->bills()->orderBy('active', 'DESC')->orderBy('name', 'ASC')->paginate($size); } /** @@ -726,11 +704,7 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface public function unlinkAll(Bill $bill): void { - $this->user - ->transactionJournals() - ->where('bill_id', $bill->id) - ->update(['bill_id' => null]) - ; + $this->user->transactionJournals()->where('bill_id', $bill->id)->update(['bill_id' => null]); } /** diff --git a/app/Repositories/Budget/AvailableBudgetRepository.php b/app/Repositories/Budget/AvailableBudgetRepository.php index d62f75e5f4..c61b187470 100644 --- a/app/Repositories/Budget/AvailableBudgetRepository.php +++ b/app/Repositories/Budget/AvailableBudgetRepository.php @@ -79,11 +79,7 @@ class AvailableBudgetRepository implements AvailableBudgetRepositoryInterface, U ->toArray() ; // delete available budgets without these currencies. - $this->user - ->availableBudgets() - ->whereNotIn('transaction_currency_id', $currencies) - ->delete() - ; + $this->user->availableBudgets()->whereNotIn('transaction_currency_id', $currencies)->delete(); } /** @@ -180,11 +176,7 @@ class AvailableBudgetRepository implements AvailableBudgetRepositoryInterface, U */ public function getAvailableBudgetsByCurrency(TransactionCurrency $currency): Collection { - return $this->user - ->availableBudgets() - ->where('transaction_currency_id', $currency->id) - ->get() - ; + return $this->user->availableBudgets()->where('transaction_currency_id', $currency->id)->get(); } /** @@ -209,24 +201,14 @@ class AvailableBudgetRepository implements AvailableBudgetRepositoryInterface, U */ public function getAvailableBudgetsByExactDate(Carbon $start, Carbon $end): Collection { - return $this->user - ->availableBudgets() - ->where('start_date', '=', $start->format('Y-m-d')) - ->where('end_date', '=', $end->format('Y-m-d')) - ->get() - ; + return $this->user->availableBudgets()->where('start_date', '=', $start->format('Y-m-d'))->where('end_date', '=', $end->format('Y-m-d'))->get(); } public function getAvailableBudgetWithCurrency(Carbon $start, Carbon $end): array { Log::debug(sprintf('Now in %s(%s, %s)', __METHOD__, $start->format('Y-m-d H:i:s'), $end->format('Y-m-d H:i:s'))); $return = []; - $availableBudgets = $this->user - ->availableBudgets() - ->where('start_date', $start->format('Y-m-d')) - ->where('end_date', $end->format('Y-m-d')) - ->get() - ; + $availableBudgets = $this->user->availableBudgets()->where('start_date', $start->format('Y-m-d'))->where('end_date', $end->format('Y-m-d'))->get(); Log::debug(sprintf('Found %d available budgets (already converted)', $availableBudgets->count())); diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index a7dd131635..091d752d5f 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -227,11 +227,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface $budget->saveQuietly(); } // other budgets, set to 0. - $this->user - ->budgets() - ->where('active', 0) - ->update(['order' => 0]) - ; + $this->user->budgets()->where('active', 0)->update(['order' => 0]); return true; } @@ -316,11 +312,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface $query = sprintf('%%%s%%', $name); /** @var null|Budget */ - return $this->user - ->budgets() - ->whereLike('name', $query) - ->first() - ; + return $this->user->budgets()->whereLike('name', $query)->first(); } /** @@ -369,20 +361,10 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface public function getBudgets(): Collection { if (null === $this->user) { - return $this->userGroup - ->budgets() - ->orderBy('order', 'ASC') - ->orderBy('name', 'ASC') - ->get() - ; + return $this->userGroup->budgets()->orderBy('order', 'ASC')->orderBy('name', 'ASC')->get(); } - return $this->user - ->budgets() - ->orderBy('order', 'ASC') - ->orderBy('name', 'ASC') - ->get() - ; + return $this->user->budgets()->orderBy('order', 'ASC')->orderBy('name', 'ASC')->get(); } /** @@ -390,11 +372,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface */ public function getByIds(array $budgetIds): Collection { - return $this->user - ->budgets() - ->whereIn('id', $budgetIds) - ->get() - ; + return $this->user->budgets()->whereIn('id', $budgetIds)->get(); } public function getInactiveBudgets(): Collection diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index e0ff091c38..6e6443fd14 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -111,11 +111,7 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf public function findByName(string $name): ?Category { /** @var null|Category */ - return $this->user - ->categories() - ->where('name', $name) - ->first(['categories.*']) - ; + return $this->user->categories()->where('name', $name)->first(['categories.*']); } /** @@ -184,11 +180,7 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf */ public function getByIds(array $categoryIds): Collection { - return $this->user - ->categories() - ->whereIn('id', $categoryIds) - ->get() - ; + return $this->user->categories()->whereIn('id', $categoryIds)->get(); } /** @@ -196,12 +188,7 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf */ public function getCategories(): Collection { - return $this->user - ->categories() - ->with(['attachments']) - ->orderBy('name', 'ASC') - ->get() - ; + return $this->user->categories()->with(['attachments'])->orderBy('name', 'ASC')->get(); } public function getNoteText(Category $category): ?string diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index 4712d5f253..fc7857a22b 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -155,12 +155,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf } // is the default currency for the user or the system - $count = $this->userGroup - ->currencies() - ->where('transaction_currencies.id', $currency->id) - ->wherePivot('group_default', 1) - ->count() - ; + $count = $this->userGroup->currencies()->where('transaction_currencies.id', $currency->id)->wherePivot('group_default', 1)->count(); if ($count > 0) { Log::info('Is the default currency of the user, return true.'); @@ -168,12 +163,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf } // is the default currency for the user or the system - $count = $this->userGroup - ->currencies() - ->where('transaction_currencies.id', $currency->id) - ->wherePivot('group_default', 1) - ->count() - ; + $count = $this->userGroup->currencies()->where('transaction_currencies.id', $currency->id)->wherePivot('group_default', 1)->count(); if ($count > 0) { Log::info('Is the default currency of the user group, return true.'); @@ -298,12 +288,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf public function get(): Collection { - $all = $this->userGroup - ->currencies() - ->orderBy('code', 'ASC') - ->withPivot(['group_default']) - ->get() - ; + $all = $this->userGroup->currencies()->orderBy('code', 'ASC')->withPivot(['group_default'])->get(); $all->map(static function (TransactionCurrency $current): TransactionCurrency { $current->userGroupEnabled = true; $current->userGroupNative = 1 === (int) $current->pivot->group_default; diff --git a/app/Repositories/ExchangeRate/ExchangeRateRepository.php b/app/Repositories/ExchangeRate/ExchangeRateRepository.php index e158960721..9460538b9b 100644 --- a/app/Repositories/ExchangeRate/ExchangeRateRepository.php +++ b/app/Repositories/ExchangeRate/ExchangeRateRepository.php @@ -40,31 +40,18 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface, UserGro #[Override] public function deleteRate(CurrencyExchangeRate $rate): void { - $this->userGroup - ->currencyExchangeRates() - ->where('id', $rate->id) - ->delete() - ; + $this->userGroup->currencyExchangeRates()->where('id', $rate->id)->delete(); } public function deleteRates(TransactionCurrency $from, TransactionCurrency $to): void { - $this->userGroup - ->currencyExchangeRates() - ->where('from_currency_id', $from->id) - ->where('to_currency_id', $to->id) - ->delete() - ; + $this->userGroup->currencyExchangeRates()->where('from_currency_id', $from->id)->where('to_currency_id', $to->id)->delete(); } #[Override] public function getAll(): Collection { - return $this->userGroup - ->currencyExchangeRates() - ->orderBy('date', 'ASC') - ->get() - ; + return $this->userGroup->currencyExchangeRates()->orderBy('date', 'ASC')->get(); } #[Override] diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php index 96c2cddfe6..2f68552902 100644 --- a/app/Repositories/Journal/JournalRepository.php +++ b/app/Repositories/Journal/JournalRepository.php @@ -130,11 +130,7 @@ class JournalRepository implements JournalRepositoryInterface, UserGroupInterfac public function firstNull(): ?TransactionJournal { /** @var null|TransactionJournal */ - return $this->user - ->transactionJournals() - ->orderBy('date', 'ASC') - ->first(['transaction_journals.*']) - ; + return $this->user->transactionJournals()->orderBy('date', 'ASC')->first(['transaction_journals.*']); } #[Override] @@ -183,11 +179,7 @@ class JournalRepository implements JournalRepositoryInterface, UserGroupInterfac public function getLast(): ?TransactionJournal { /** @var null|TransactionJournal */ - return $this->user - ->transactionJournals() - ->orderBy('date', 'DESC') - ->first(['transaction_journals.*']) - ; + return $this->user->transactionJournals()->orderBy('date', 'DESC')->first(['transaction_journals.*']); } public function getLinkNoteText(TransactionJournalLink $link): string @@ -241,11 +233,7 @@ class JournalRepository implements JournalRepositoryInterface, UserGroupInterfac #[Override] public function getUncompletedJournals(): Collection { - return $this->userGroup - ->transactionJournals() - ->where('completed', false) - ->get(['transaction_journals.*']) - ; + return $this->userGroup->transactionJournals()->where('completed', false)->get(['transaction_journals.*']); } #[Override] @@ -266,11 +254,7 @@ class JournalRepository implements JournalRepositoryInterface, UserGroupInterfac */ public function searchJournalDescriptions(string $search, int $limit): Collection { - $query = $this->user - ->transactionJournals() - ->orderBy('date', 'DESC') - ->orderBy('description', 'ASC') - ; + $query = $this->user->transactionJournals()->orderBy('date', 'DESC')->orderBy('description', 'ASC'); if ('' !== $search) { $query->whereLike('description', sprintf('%%%s%%', $search)); } diff --git a/app/Repositories/LinkType/LinkTypeRepository.php b/app/Repositories/LinkType/LinkTypeRepository.php index 43876c93ca..4ec09ae643 100644 --- a/app/Repositories/LinkType/LinkTypeRepository.php +++ b/app/Repositories/LinkType/LinkTypeRepository.php @@ -96,11 +96,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface, UserGroupInterf */ public function findSpecificLink(LinkType $linkType, TransactionJournal $inward, TransactionJournal $outward): ?TransactionJournalLink { - return TransactionJournalLink::where('link_type_id', $linkType->id) - ->where('source_id', $inward->id) - ->where('destination_id', $outward->id) - ->first() - ; + return TransactionJournalLink::where('link_type_id', $linkType->id)->where('source_id', $inward->id)->where('destination_id', $outward->id)->first(); } public function get(): Collection diff --git a/app/Repositories/ObjectGroup/CreatesObjectGroups.php b/app/Repositories/ObjectGroup/CreatesObjectGroups.php index bd68339e45..dd8505deb4 100644 --- a/app/Repositories/ObjectGroup/CreatesObjectGroups.php +++ b/app/Repositories/ObjectGroup/CreatesObjectGroups.php @@ -34,21 +34,13 @@ trait CreatesObjectGroups protected function findObjectGroup(string $title): ?ObjectGroup { /** @var null|ObjectGroup */ - return $this->user - ->objectGroups() - ->where('title', $title) - ->first() - ; + return $this->user->objectGroups()->where('title', $title)->first(); } protected function findObjectGroupById(int $groupId): ?ObjectGroup { /** @var null|ObjectGroup */ - return $this->user - ->objectGroups() - ->where('id', $groupId) - ->first() - ; + return $this->user->objectGroups()->where('id', $groupId)->first(); } protected function findOrCreateObjectGroup(string $title): ?ObjectGroup @@ -74,10 +66,6 @@ trait CreatesObjectGroups protected function hasObjectGroup(string $title): bool { - return 1 === $this->user - ->objectGroups() - ->where('title', $title) - ->count() - ; + return 1 === $this->user->objectGroups()->where('title', $title)->count(); } } diff --git a/app/Repositories/ObjectGroup/ObjectGroupRepository.php b/app/Repositories/ObjectGroup/ObjectGroupRepository.php index e5b258a3f6..294358ca9c 100644 --- a/app/Repositories/ObjectGroup/ObjectGroupRepository.php +++ b/app/Repositories/ObjectGroup/ObjectGroupRepository.php @@ -122,11 +122,7 @@ class ObjectGroupRepository implements ObjectGroupRepositoryInterface, UserGroup public function search(string $query, int $limit): Collection { - $dbQuery = $this->user - ->objectGroups() - ->orderBy('order', 'ASC') - ->orderBy('title', 'ASC') - ; + $dbQuery = $this->user->objectGroups()->orderBy('order', 'ASC')->orderBy('title', 'ASC'); if ('' !== $query) { // split query on spaces just in case: $parts = explode(' ', $query); diff --git a/app/Repositories/Rule/RuleRepository.php b/app/Repositories/Rule/RuleRepository.php index 2a6ccbedf6..65114dcf95 100644 --- a/app/Repositories/Rule/RuleRepository.php +++ b/app/Repositories/Rule/RuleRepository.php @@ -100,11 +100,7 @@ class RuleRepository implements RuleRepositoryInterface, UserGroupInterface */ public function getAll(): Collection { - return $this->user - ->rules() - ->with(['ruleGroup', 'ruleTriggers', 'ruleActions']) - ->get() - ; + return $this->user->rules()->with(['ruleGroup', 'ruleTriggers', 'ruleActions'])->get(); } /** @@ -309,11 +305,7 @@ class RuleRepository implements RuleRepositoryInterface, UserGroupInterface $ruleGroup = $this->user->ruleGroups()->find($data['rule_group_id']); } if (array_key_exists('rule_group_title', $data)) { - $ruleGroup = $this->user - ->ruleGroups() - ->where('title', $data['rule_group_title']) - ->first() - ; + $ruleGroup = $this->user->ruleGroups()->where('title', $data['rule_group_title'])->first(); } if (null === $ruleGroup) { throw new FireflyException('No such rule group.'); diff --git a/app/Repositories/RuleGroup/RuleGroupRepository.php b/app/Repositories/RuleGroup/RuleGroupRepository.php index 044e04153d..ea0e78a44d 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepository.php +++ b/app/Repositories/RuleGroup/RuleGroupRepository.php @@ -115,20 +115,12 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface, UserGroupInte public function findByTitle(string $title): ?RuleGroup { /** @var null|RuleGroup */ - return $this->user - ->ruleGroups() - ->where('title', $title) - ->first() - ; + return $this->user->ruleGroups()->where('title', $title)->first(); } public function get(): Collection { - return $this->user - ->ruleGroups() - ->orderBy('order', 'ASC') - ->get() - ; + return $this->user->ruleGroups()->orderBy('order', 'ASC')->get(); } public function getActiveGroups(): Collection @@ -278,11 +270,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface, UserGroupInte public function maxOrder(): int { - return (int) $this->user - ->ruleGroups() - ->where('active', true) - ->max('order') - ; + return (int) $this->user->ruleGroups()->where('active', true)->max('order'); } public function resetOrder(): bool diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index d3db6c9039..ad6d4b976c 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -100,11 +100,7 @@ class TagRepository implements TagRepositoryInterface, UserGroupInterface public function findByTag(string $tag): ?Tag { /** @var null|Tag */ - return $this->user - ->tags() - ->where('tag', $tag) - ->first() - ; + return $this->user->tags()->where('tag', $tag)->first(); } public function firstUseDate(Tag $tag): ?Carbon @@ -114,11 +110,7 @@ class TagRepository implements TagRepositoryInterface, UserGroupInterface public function get(): Collection { - return $this->user - ->tags() - ->orderBy('tag', 'ASC') - ->get(['tags.*']) - ; + return $this->user->tags()->orderBy('tag', 'ASC')->get(['tags.*']); } public function getAttachments(Tag $tag): Collection @@ -150,11 +142,7 @@ class TagRepository implements TagRepositoryInterface, UserGroupInterface public function getTagsInYear(?int $year): array { // get all tags in the year (if present): - $tagQuery = $this->user - ->tags() - ->with(['locations', 'attachments']) - ->orderBy('tags.tag') - ; + $tagQuery = $this->user->tags()->with(['locations', 'attachments'])->orderBy('tags.tag'); // add date range (or not): if (null === $year) { @@ -207,23 +195,13 @@ class TagRepository implements TagRepositoryInterface, UserGroupInterface public function newestTag(): ?Tag { /** @var null|Tag */ - return $this->user - ->tags() - ->whereNotNull('date') - ->orderBy('date', 'DESC') - ->first() - ; + return $this->user->tags()->whereNotNull('date')->orderBy('date', 'DESC')->first(); } public function oldestTag(): ?Tag { /** @var null|Tag */ - return $this->user - ->tags() - ->whereNotNull('date') - ->orderBy('date', 'ASC') - ->first() - ; + return $this->user->tags()->whereNotNull('date')->orderBy('date', 'ASC')->first(); } #[Override] @@ -274,11 +252,7 @@ class TagRepository implements TagRepositoryInterface, UserGroupInterface { $search = sprintf('%%%s%%', $query); - return $this->user - ->tags() - ->whereLike('tag', $search) - ->get(['tags.*']) - ; + return $this->user->tags()->whereLike('tag', $search)->get(['tags.*']); } /** @@ -381,22 +355,14 @@ class TagRepository implements TagRepositoryInterface, UserGroupInterface { $search = sprintf('%%%s', $query); - return $this->user - ->tags() - ->whereLike('tag', $search) - ->get(['tags.*']) - ; + return $this->user->tags()->whereLike('tag', $search)->get(['tags.*']); } public function tagStartsWith(string $query): Collection { $search = sprintf('%s%%', $query); - return $this->user - ->tags() - ->whereLike('tag', $search) - ->get(['tags.*']) - ; + return $this->user->tags()->whereLike('tag', $search)->get(['tags.*']); } public function transferredInPeriod(Tag $tag, Carbon $start, Carbon $end): array diff --git a/app/Repositories/User/UserRepository.php b/app/Repositories/User/UserRepository.php index c7bfd60099..8f37a55528 100644 --- a/app/Repositories/User/UserRepository.php +++ b/app/Repositories/User/UserRepository.php @@ -412,11 +412,7 @@ class UserRepository implements UserRepositoryInterface public function validateInviteCode(string $code): bool { $now = today(config('app.timezone')); - $invitee = InvitedUser::where('invite_code', $code) - ->where('expires', '>', $now->format('Y-m-d H:i:s')) - ->where('redeemed', 0) - ->first() - ; + $invitee = InvitedUser::where('invite_code', $code)->where('expires', '>', $now->format('Y-m-d H:i:s'))->where('redeemed', 0)->first(); return null !== $invitee; } diff --git a/app/Repositories/UserGroup/UserGroupRepository.php b/app/Repositories/UserGroup/UserGroupRepository.php index c47fb08d75..df228ebf06 100644 --- a/app/Repositories/UserGroup/UserGroupRepository.php +++ b/app/Repositories/UserGroup/UserGroupRepository.php @@ -157,11 +157,7 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte #[Override] public function getMembershipsFromGroupId(int $groupId): Collection { - return $this->user - ->groupMemberships() - ->where('user_group_id', $groupId) - ->get() - ; + return $this->user->groupMemberships()->where('user_group_id', $groupId)->get(); } /** diff --git a/app/Services/Internal/Destroy/CategoryDestroyService.php b/app/Services/Internal/Destroy/CategoryDestroyService.php index 8c9680c04d..04b6fb3873 100644 --- a/app/Services/Internal/Destroy/CategoryDestroyService.php +++ b/app/Services/Internal/Destroy/CategoryDestroyService.php @@ -43,10 +43,6 @@ class CategoryDestroyService DB::table('category_transaction')->where('category_id', $category->id)->delete(); // delete references to category from recurring transactions. - DB::table('rt_meta') - ->where('name', 'category_id') - ->where('value', $category->id) - ->delete() - ; + DB::table('rt_meta')->where('name', 'category_id')->where('value', $category->id)->delete(); } } diff --git a/app/Services/Internal/Support/BillServiceTrait.php b/app/Services/Internal/Support/BillServiceTrait.php index 58907377f9..c2c2506b44 100644 --- a/app/Services/Internal/Support/BillServiceTrait.php +++ b/app/Services/Internal/Support/BillServiceTrait.php @@ -40,11 +40,7 @@ trait BillServiceTrait return; } $ruleIds = $bill->user->rules()->get(['id'])->pluck('id')->toArray(); - $set = RuleAction::whereIn('rule_id', $ruleIds) - ->where('action_type', 'link_to_bill') - ->where('action_value', $oldName) - ->get() - ; + $set = RuleAction::whereIn('rule_id', $ruleIds)->where('action_type', 'link_to_bill')->where('action_value', $oldName)->get(); /** @var RuleAction $ruleAction */ foreach ($set as $ruleAction) { diff --git a/app/Services/Internal/Update/JournalUpdateService.php b/app/Services/Internal/Update/JournalUpdateService.php index 439a31995d..26945e7844 100644 --- a/app/Services/Internal/Update/JournalUpdateService.php +++ b/app/Services/Internal/Update/JournalUpdateService.php @@ -208,11 +208,7 @@ class JournalUpdateService { if (!$this->destinationTransaction instanceof Transaction) { /** @var null|Transaction $result */ - $result = $this->transactionJournal - ->transactions() - ->where('amount', '>', 0) - ->first() - ; + $result = $this->transactionJournal->transactions()->where('amount', '>', 0)->first(); $this->destinationTransaction = $result; } @@ -260,12 +256,7 @@ class JournalUpdateService { if (!$this->sourceTransaction instanceof Transaction) { /** @var null|Transaction $result */ - $result = $this->transactionJournal - ->transactions() - ->with(['account']) - ->where('amount', '<', 0) - ->first() - ; + $result = $this->transactionJournal->transactions()->with(['account'])->where('amount', '<', 0)->first(); $this->sourceTransaction = $result; } Log::debug(sprintf('getSourceTransaction: %s', $this->sourceTransaction->amount)); @@ -418,18 +409,10 @@ class JournalUpdateService private function isBetweenAssetAndLiability(): bool { /** @var null|Transaction $sourceTransaction */ - $sourceTransaction = $this->transactionJournal - ->transactions() - ->where('amount', '<', 0) - ->first() - ; + $sourceTransaction = $this->transactionJournal->transactions()->where('amount', '<', 0)->first(); /** @var null|Transaction $destinationTransaction */ - $destinationTransaction = $this->transactionJournal - ->transactions() - ->where('amount', '>', 0) - ->first() - ; + $destinationTransaction = $this->transactionJournal->transactions()->where('amount', '>', 0)->first(); if (null === $sourceTransaction || null === $destinationTransaction) { Log::warning('Either transaction is false, stop.'); diff --git a/app/Support/Http/Api/CollectsAccountsFromFilter.php b/app/Support/Http/Api/CollectsAccountsFromFilter.php index 0baeaa9098..cd063afdb2 100644 --- a/app/Support/Http/Api/CollectsAccountsFromFilter.php +++ b/app/Support/Http/Api/CollectsAccountsFromFilter.php @@ -53,11 +53,7 @@ trait CollectsAccountsFromFilter } // if no preselected, but no accounts: if ('empty' === $queryParameters['preselected'] && 0 === $collection->count()) { - $defaultSet = $this->repository - ->getAccountsByType([AccountTypeEnum::ASSET->value, AccountTypeEnum::DEFAULT->value]) - ->pluck('id') - ->toArray() - ; + $defaultSet = $this->repository->getAccountsByType([AccountTypeEnum::ASSET->value, AccountTypeEnum::DEFAULT->value])->pluck('id')->toArray(); $frontpage = Preferences::get('frontpageAccounts', $defaultSet); if (!(is_array($frontpage->data) && count($frontpage->data) > 0)) { diff --git a/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php b/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php index c236c7d85f..644063ff8a 100644 --- a/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php +++ b/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php @@ -109,11 +109,7 @@ class BudgetLimitEnrichment implements EnrichmentInterface private function collectBudgets(): void { - $budgetIds = $this->collection - ->pluck('budget_id') - ->unique() - ->toArray() - ; + $budgetIds = $this->collection->pluck('budget_id')->unique()->toArray(); $budgets = Budget::whereIn('id', $budgetIds)->get(); $repository = app(OperationsRepository::class); diff --git a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php index 9eb950307f..48b51a33ef 100644 --- a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php +++ b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php @@ -42,19 +42,19 @@ use Illuminate\Support\Facades\Log; class PiggyBankEnrichment implements EnrichmentInterface { - private array $accountIds = []; - private array $accounts = []; - private array $amounts = []; + private array $accountIds = []; + private array $accounts = []; + private array $amounts = []; private Collection $collection; - private array $currencies = []; - private array $currencyIds = []; - private array $ids = []; + private array $currencies = []; + private array $currencyIds = []; + private array $ids = []; // private array $accountCurrencies = []; - private array $mappedObjects = []; - private array $notes = []; - private array $objectGroups = []; + private array $mappedObjects = []; + private array $notes = []; + private array $objectGroups = []; private readonly TransactionCurrency $primaryCurrency; - private ?Carbon $date; + private ?Carbon $date; public function __construct() { @@ -74,7 +74,7 @@ class PiggyBankEnrichment implements EnrichmentInterface return $this->collection; } - public function enrichSingle(array | Model $model): array | Model + public function enrichSingle(array|Model $model): array|Model { Log::debug(__METHOD__); $collection = new Collection()->push($model); @@ -98,14 +98,14 @@ class PiggyBankEnrichment implements EnrichmentInterface private function appendCollectedData(): void { $this->collection = $this->collection->map(function (PiggyBank $item): PiggyBank { - $id = (int)$item->id; - $currencyId = (int)$item->transaction_currency_id; - $currency = $this->currencies[$currencyId] ?? $this->primaryCurrency; - $targetAmount = null; + $id = (int) $item->id; + $currencyId = (int) $item->transaction_currency_id; + $currency = $this->currencies[$currencyId] ?? $this->primaryCurrency; + $targetAmount = null; if (0 !== bccomp($item->target_amount, '0')) { $targetAmount = $item->target_amount; } - $meta = [ + $meta = [ 'notes' => $this->notes[$id] ?? null, 'currency' => $this->currencies[$currencyId] ?? null, // 'auto_budget' => $this->autoBudgets[$id] ?? null, @@ -130,25 +130,25 @@ class PiggyBankEnrichment implements EnrichmentInterface // add object group if available if (array_key_exists($id, $this->mappedObjects)) { $key = $this->mappedObjects[$id]; - $meta['object_group_id'] = (string)$this->objectGroups[$key]['id']; + $meta['object_group_id'] = (string) $this->objectGroups[$key]['id']; $meta['object_group_title'] = $this->objectGroups[$key]['title']; $meta['object_group_order'] = $this->objectGroups[$key]['order']; } // add current amount(s). foreach ($this->amounts[$id] as $accountId => $row) { - $meta['accounts'][] = [ - 'account_id' => (string)$accountId, + $meta['accounts'][] = [ + 'account_id' => (string) $accountId, 'name' => $this->accounts[$accountId]['name'] ?? '', 'current_amount' => Steam::bcround($row['current_amount'], $currency->decimal_places), 'pc_current_amount' => Steam::bcround($row['pc_current_amount'], $this->primaryCurrency->decimal_places), ]; - $meta['current_amount'] = bcadd($meta['current_amount'], (string)$row['current_amount']); + $meta['current_amount'] = bcadd($meta['current_amount'], (string) $row['current_amount']); // only add pc_current_amount when the pc_current_amount is set $meta['pc_current_amount'] = null === $row['pc_current_amount'] ? null - : bcadd((string)$meta['pc_current_amount'], (string)$row['pc_current_amount']); + : bcadd((string) $meta['pc_current_amount'], (string) $row['pc_current_amount']); } - $meta['current_amount'] = Steam::bcround($meta['current_amount'], $currency->decimal_places); + $meta['current_amount'] = Steam::bcround($meta['current_amount'], $currency->decimal_places); // only round this number when pc_current_amount is set. $meta['pc_current_amount'] = null === $meta['pc_current_amount'] ? null @@ -156,14 +156,14 @@ class PiggyBankEnrichment implements EnrichmentInterface // calculate left to save, only when there is a target amount. if (null !== $targetAmount) { - $meta['left_to_save'] = bcsub((string)$meta['target_amount'], (string)$meta['current_amount']); + $meta['left_to_save'] = bcsub((string) $meta['target_amount'], (string) $meta['current_amount']); $meta['pc_left_to_save'] = null === $meta['pc_target_amount'] ? null - : bcsub((string)$meta['pc_target_amount'], (string)$meta['pc_current_amount']); + : bcsub((string) $meta['pc_target_amount'], (string) $meta['pc_current_amount']); } // get suggested per month. - $meta['save_per_month'] = Steam::bcround( + $meta['save_per_month'] = Steam::bcround( $this->getSuggestedMonthlyAmount($this->date, $item->target_date, $meta['target_amount'], $meta['current_amount']), $currency->decimal_places ); @@ -174,7 +174,7 @@ class PiggyBankEnrichment implements EnrichmentInterface ); } - $item->meta = $meta; + $item->meta = $meta; return $item; }); @@ -184,44 +184,44 @@ class PiggyBankEnrichment implements EnrichmentInterface { /** @var PiggyBank $piggy */ foreach ($this->collection as $piggy) { - $id = (int)$piggy->id; + $id = (int) $piggy->id; $this->ids[] = $id; - $this->currencyIds[$id] = (int)$piggy->transaction_currency_id; + $this->currencyIds[$id] = (int) $piggy->transaction_currency_id; } - $this->ids = array_unique($this->ids); + $this->ids = array_unique($this->ids); // collect currencies. - $currencies = TransactionCurrency::whereIn('id', $this->currencyIds)->get(); + $currencies = TransactionCurrency::whereIn('id', $this->currencyIds)->get(); foreach ($currencies as $currency) { - $this->currencies[(int)$currency->id] = $currency; + $this->currencies[(int) $currency->id] = $currency; } // collect accounts - $set = DB::table('account_piggy_bank')->whereIn('piggy_bank_id', $this->ids)->get([ - 'piggy_bank_id', - 'account_id', - 'current_amount', - 'native_current_amount', - ]); + $set = DB::table('account_piggy_bank')->whereIn('piggy_bank_id', $this->ids)->get([ + 'piggy_bank_id', + 'account_id', + 'current_amount', + 'native_current_amount', + ]); foreach ($set as $item) { - $id = (int)$item->piggy_bank_id; - $accountId = (int)$item->account_id; + $id = (int) $item->piggy_bank_id; + $accountId = (int) $item->account_id; $this->amounts[$id] ??= []; if (!array_key_exists($id, $this->accountIds)) { $this->accountIds[$id] = []; } - $this->accountIds[$id][] = (int)$item->account_id; + $this->accountIds[$id][] = (int) $item->account_id; if (!array_key_exists($accountId, $this->amounts[$id])) { $this->amounts[$id][$accountId] = ['current_amount' => '0', 'pc_current_amount' => '0']; } $this->amounts[$id][$accountId]['current_amount'] = bcadd( - (string)$this->amounts[$id][$accountId]['current_amount'], - (string)$item->current_amount + (string) $this->amounts[$id][$accountId]['current_amount'], + (string) $item->current_amount ); if (null !== $this->amounts[$id][$accountId]['pc_current_amount'] && null !== $item->native_current_amount) { $this->amounts[$id][$accountId]['pc_current_amount'] = bcadd( $this->amounts[$id][$accountId]['pc_current_amount'], - (string)$item->native_current_amount + (string) $item->native_current_amount ); } } @@ -232,12 +232,12 @@ class PiggyBankEnrichment implements EnrichmentInterface } // get account currency preference for ALL. - $set = AccountMeta::whereIn('account_id', $allAccountIds)->where('name', 'currency_id')->get(); + $set = AccountMeta::whereIn('account_id', $allAccountIds)->where('name', 'currency_id')->get(); /** @var AccountMeta $item */ foreach ($set as $item) { // $accountId = (int) $item->account_id; - $currencyId = (int)$item->data; + $currencyId = (int) $item->data; if (!array_key_exists($currencyId, $this->currencies)) { $this->currencies[$currencyId] = Amount::getTransactionCurrencyById($currencyId); } @@ -245,11 +245,11 @@ class PiggyBankEnrichment implements EnrichmentInterface // $this->accountCurrencies[$accountId] = $this->currencies[$currencyId]; } - $set = Account::whereIn('id', $allAccountIds)->get(); + $set = Account::whereIn('id', $allAccountIds)->get(); /** @var Account $item */ foreach ($set as $item) { - $id = (int)$item->id; + $id = (int) $item->id; $this->accounts[$id] = ['id' => $id, 'name' => $item->name]; } } @@ -257,14 +257,15 @@ class PiggyBankEnrichment implements EnrichmentInterface private function collectNotes(): void { $notes = Note::query() - ->whereIn('noteable_id', $this->ids) - ->whereNotNull('notes.text') - ->where('notes.text', '!=', '') - ->where('noteable_type', PiggyBank::class) - ->get(['notes.noteable_id', 'notes.text']) - ->toArray(); + ->whereIn('noteable_id', $this->ids) + ->whereNotNull('notes.text') + ->where('notes.text', '!=', '') + ->where('noteable_type', PiggyBank::class) + ->get(['notes.noteable_id', 'notes.text']) + ->toArray() + ; foreach ($notes as $note) { - $this->notes[(int)$note['noteable_id']] = (string)$note['text']; + $this->notes[(int) $note['noteable_id']] = (string) $note['text']; } // Log::debug(sprintf('Enrich with %d note(s)', count($this->notes))); @@ -272,22 +273,23 @@ class PiggyBankEnrichment implements EnrichmentInterface private function collectObjectGroups(): void { - $set = DB::table('object_groupables') - ->whereIn('object_groupable_id', $this->ids) - ->where('object_groupable_type', PiggyBank::class) - ->get(['object_groupable_id', 'object_group_id']); + $set = DB::table('object_groupables') + ->whereIn('object_groupable_id', $this->ids) + ->where('object_groupable_type', PiggyBank::class) + ->get(['object_groupable_id', 'object_group_id']) + ; - $ids = array_unique($set->pluck('object_group_id')->toArray()); + $ids = array_unique($set->pluck('object_group_id')->toArray()); foreach ($set as $entry) { - $this->mappedObjects[(int)$entry->object_groupable_id] = (int)$entry->object_group_id; + $this->mappedObjects[(int) $entry->object_groupable_id] = (int) $entry->object_group_id; } $groups = ObjectGroup::whereIn('id', $ids)->get(['id', 'title', 'order'])->toArray(); foreach ($groups as $group) { - $group['id'] = (int)$group['id']; - $group['order'] = (int)$group['order']; - $this->objectGroups[(int)$group['id']] = $group; + $group['id'] = (int) $group['id']; + $group['order'] = (int) $group['order']; + $this->objectGroups[(int) $group['id']] = $group; } } @@ -302,12 +304,12 @@ class PiggyBankEnrichment implements EnrichmentInterface $savePerMonth = '0'; if (1 === bccomp($targetAmount, $currentAmount)) { $now = today(config('app.timezone')); - $diffInMonths = (int)$startDate->diffInMonths($targetDate); + $diffInMonths = (int) $startDate->diffInMonths($targetDate); $remainingAmount = bcsub($targetAmount, $currentAmount); // more than 1 month to go and still need money to save: if ($diffInMonths > 0 && 1 === bccomp($remainingAmount, '0')) { - $savePerMonth = bcdiv($remainingAmount, (string)$diffInMonths); + $savePerMonth = bcdiv($remainingAmount, (string) $diffInMonths); } // less than 1 month to go but still need money to save: diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php index 8de9e78429..063880496b 100644 --- a/app/Support/Search/OperatorQuerySearch.php +++ b/app/Support/Search/OperatorQuerySearch.php @@ -250,11 +250,7 @@ class OperatorQuerySearch implements SearchInterface $this->tagRepository->setUser($user); $this->collector = app(GroupCollectorInterface::class); $this->collector->setUser($user); - $this->collector - ->withAccountInformation() - ->withCategoryInformation() - ->withBudgetInformation() - ; + $this->collector->withAccountInformation()->withCategoryInformation()->withBudgetInformation(); $this->setLimit((int) Preferences::getForUser($user, 'listPageSize', 50)->data); } diff --git a/app/Support/Twig/TransactionGroupTwig.php b/app/Support/Twig/TransactionGroupTwig.php index c9da254942..5082d3d4e3 100644 --- a/app/Support/Twig/TransactionGroupTwig.php +++ b/app/Support/Twig/TransactionGroupTwig.php @@ -76,12 +76,7 @@ class TransactionGroupTwig extends AbstractExtension { return new TwigFunction('journalGetMetaDate', static function (int $journalId, string $metaField): Carbon|CarbonInterface { /** @var null|TransactionJournalMeta $entry */ - $entry = DB::table('journal_meta') - ->where('name', $metaField) - ->where('transaction_journal_id', $journalId) - ->whereNull('deleted_at') - ->first() - ; + $entry = DB::table('journal_meta')->where('name', $metaField)->where('transaction_journal_id', $journalId)->whereNull('deleted_at')->first(); if (null === $entry) { return today(config('app.timezone')); } @@ -94,12 +89,7 @@ class TransactionGroupTwig extends AbstractExtension { return new TwigFunction('journalGetMetaField', static function (int $journalId, string $metaField) { /** @var null|TransactionJournalMeta $entry */ - $entry = DB::table('journal_meta') - ->where('name', $metaField) - ->where('transaction_journal_id', $journalId) - ->whereNull('deleted_at') - ->first() - ; + $entry = DB::table('journal_meta')->where('name', $metaField)->where('transaction_journal_id', $journalId)->whereNull('deleted_at')->first(); if (null === $entry) { return ''; } @@ -111,12 +101,7 @@ class TransactionGroupTwig extends AbstractExtension public function journalHasMeta(): TwigFunction { return new TwigFunction('journalHasMeta', static function (int $journalId, string $metaField): bool { - $count = DB::table('journal_meta') - ->where('name', $metaField) - ->where('transaction_journal_id', $journalId) - ->whereNull('deleted_at') - ->count() - ; + $count = DB::table('journal_meta')->where('name', $metaField)->where('transaction_journal_id', $journalId)->whereNull('deleted_at')->count(); return 1 === $count; }); diff --git a/app/TransactionRules/Actions/AddTag.php b/app/TransactionRules/Actions/AddTag.php index b0323ff852..70e9ef82bd 100644 --- a/app/TransactionRules/Actions/AddTag.php +++ b/app/TransactionRules/Actions/AddTag.php @@ -75,11 +75,7 @@ class AddTag implements ActionInterface return false; } - $count = DB::table('tag_transaction_journal') - ->where('tag_id', $tag->id) - ->where('transaction_journal_id', $journal['transaction_journal_id']) - ->count() - ; + $count = DB::table('tag_transaction_journal')->where('tag_id', $tag->id)->where('transaction_journal_id', $journal['transaction_journal_id'])->count(); if (0 === $count) { // add to journal: DB::table('tag_transaction_journal')->insert([ diff --git a/app/TransactionRules/Actions/AppendDescription.php b/app/TransactionRules/Actions/AppendDescription.php index e15a8fc2e6..8b4ebfbf9b 100644 --- a/app/TransactionRules/Actions/AppendDescription.php +++ b/app/TransactionRules/Actions/AppendDescription.php @@ -49,11 +49,7 @@ class AppendDescription implements ActionInterface $this->refreshNotes($journal); $append = $this->action->getValue($journal); $description = sprintf('%s %s', $journal['description'], $append); - DB::table('transaction_journals') - ->where('id', $journal['transaction_journal_id']) - ->limit(1) - ->update(['description' => $description]) - ; + DB::table('transaction_journals')->where('id', $journal['transaction_journal_id'])->limit(1)->update(['description' => $description]); // event for audit log entry /** @var TransactionJournal $object */ diff --git a/app/TransactionRules/Actions/ClearNotes.php b/app/TransactionRules/Actions/ClearNotes.php index 252d820171..22e1d34117 100644 --- a/app/TransactionRules/Actions/ClearNotes.php +++ b/app/TransactionRules/Actions/ClearNotes.php @@ -58,11 +58,7 @@ class ClearNotes implements ActionInterface } $before = $notes->text; - DB::table('notes') - ->where('noteable_id', $journal['transaction_journal_id']) - ->where('noteable_type', TransactionJournal::class) - ->delete() - ; + DB::table('notes')->where('noteable_id', $journal['transaction_journal_id'])->where('noteable_type', TransactionJournal::class)->delete(); Log::debug(sprintf('RuleAction ClearNotes removed all notes from journal #%d.', $journal['transaction_journal_id'])); event(new TransactionGroupRequestsAuditLogEntry($this->action->rule, $object, 'clear_notes', $before, null)); diff --git a/app/TransactionRules/Actions/ConvertToDeposit.php b/app/TransactionRules/Actions/ConvertToDeposit.php index 903e12b577..41378da788 100644 --- a/app/TransactionRules/Actions/ConvertToDeposit.php +++ b/app/TransactionRules/Actions/ConvertToDeposit.php @@ -169,11 +169,7 @@ class ConvertToDeposit implements ActionInterface Log::debug(sprintf('ConvertToDeposit. Action value is "%s", revenue name is "%s"', $actionValue, $opposingAccount->name)); // update source transaction(s) to be revenue account - DB::table('transactions') - ->where('transaction_journal_id', '=', $journal->id) - ->where('amount', '<', 0) - ->update(['account_id' => $opposingAccount->id]) - ; + DB::table('transactions')->where('transaction_journal_id', '=', $journal->id)->where('amount', '<', 0)->update(['account_id' => $opposingAccount->id]); // change transaction type of journal: $newType = TransactionType::whereType(TransactionTypeEnum::DEPOSIT->value)->first(); @@ -219,18 +215,10 @@ class ConvertToDeposit implements ActionInterface Log::debug(sprintf('ConvertToDeposit. Action value is "%s", new opposing name is "%s"', $actionValue, $opposingAccount->name)); // update the source transaction and put in the new revenue ID. - DB::table('transactions') - ->where('transaction_journal_id', '=', $journal->id) - ->where('amount', '<', 0) - ->update(['account_id' => $opposingAccount->id]) - ; + DB::table('transactions')->where('transaction_journal_id', '=', $journal->id)->where('amount', '<', 0)->update(['account_id' => $opposingAccount->id]); // update the destination transaction and put in the original source account ID. - DB::table('transactions') - ->where('transaction_journal_id', '=', $journal->id) - ->where('amount', '>', 0) - ->update(['account_id' => $sourceAccount->id]) - ; + DB::table('transactions')->where('transaction_journal_id', '=', $journal->id)->where('amount', '>', 0)->update(['account_id' => $sourceAccount->id]); // change transaction type of journal: $newType = TransactionType::whereType(TransactionTypeEnum::DEPOSIT->value)->first(); diff --git a/app/TransactionRules/Actions/ConvertToTransfer.php b/app/TransactionRules/Actions/ConvertToTransfer.php index 1719205c59..43fb44794a 100644 --- a/app/TransactionRules/Actions/ConvertToTransfer.php +++ b/app/TransactionRules/Actions/ConvertToTransfer.php @@ -196,11 +196,7 @@ class ConvertToTransfer implements ActionInterface } // update source transaction: - DB::table('transactions') - ->where('transaction_journal_id', '=', $journal->id) - ->where('amount', '<', 0) - ->update(['account_id' => $opposing->id]) - ; + DB::table('transactions')->where('transaction_journal_id', '=', $journal->id)->where('amount', '<', 0)->update(['account_id' => $opposing->id]); // change transaction type of journal: $newType = TransactionType::whereType(TransactionTypeEnum::TRANSFER->value)->first(); diff --git a/app/TransactionRules/Actions/ConvertToWithdrawal.php b/app/TransactionRules/Actions/ConvertToWithdrawal.php index 039562a28b..7cce44767d 100644 --- a/app/TransactionRules/Actions/ConvertToWithdrawal.php +++ b/app/TransactionRules/Actions/ConvertToWithdrawal.php @@ -163,18 +163,10 @@ class ConvertToWithdrawal implements ActionInterface Log::debug(sprintf('ConvertToWithdrawal. Action value is "%s", expense name is "%s"', $actionValue, $opposingName)); // update source transaction(s) to be the original destination account - DB::table('transactions') - ->where('transaction_journal_id', '=', $journal->id) - ->where('amount', '<', 0) - ->update(['account_id' => $destAccount->id]) - ; + DB::table('transactions')->where('transaction_journal_id', '=', $journal->id)->where('amount', '<', 0)->update(['account_id' => $destAccount->id]); // update destination transaction(s) to be new expense account. - DB::table('transactions') - ->where('transaction_journal_id', '=', $journal->id) - ->where('amount', '>', 0) - ->update(['account_id' => $opposingAccount->id]) - ; + DB::table('transactions')->where('transaction_journal_id', '=', $journal->id)->where('amount', '>', 0)->update(['account_id' => $opposingAccount->id]); // change transaction type of journal: $newType = TransactionType::whereType(TransactionTypeEnum::WITHDRAWAL->value)->first(); @@ -218,11 +210,7 @@ class ConvertToWithdrawal implements ActionInterface Log::debug(sprintf('ConvertToWithdrawal. Action value is "%s", destination name is "%s"', $actionValue, $opposingName)); // update destination transaction(s) to be new expense account. - DB::table('transactions') - ->where('transaction_journal_id', '=', $journal->id) - ->where('amount', '>', 0) - ->update(['account_id' => $opposingAccount->id]) - ; + DB::table('transactions')->where('transaction_journal_id', '=', $journal->id)->where('amount', '>', 0)->update(['account_id' => $opposingAccount->id]); // change transaction type of journal: $newType = TransactionType::whereType(TransactionTypeEnum::WITHDRAWAL->value)->first(); diff --git a/app/TransactionRules/Actions/LinkToBill.php b/app/TransactionRules/Actions/LinkToBill.php index 7029e60874..0f2cc0c4f8 100644 --- a/app/TransactionRules/Actions/LinkToBill.php +++ b/app/TransactionRules/Actions/LinkToBill.php @@ -61,11 +61,7 @@ class LinkToBill implements ActionInterface $type = $object->transactionType->type; if (null !== $bill && TransactionTypeEnum::WITHDRAWAL->value === $type) { - $count = DB::table('transaction_journals') - ->where('id', '=', $journal['transaction_journal_id']) - ->where('bill_id', $bill->id) - ->count() - ; + $count = DB::table('transaction_journals')->where('id', '=', $journal['transaction_journal_id'])->where('bill_id', $bill->id)->count(); if (0 !== $count) { Log::error(sprintf( 'RuleAction LinkToBill could not set the bill of journal #%d to bill "%s": already set.', diff --git a/app/TransactionRules/Actions/PrependDescription.php b/app/TransactionRules/Actions/PrependDescription.php index 1444faf293..3971caa08f 100644 --- a/app/TransactionRules/Actions/PrependDescription.php +++ b/app/TransactionRules/Actions/PrependDescription.php @@ -45,11 +45,7 @@ class PrependDescription implements ActionInterface { $before = $journal['description']; $after = sprintf('%s%s', $this->action->getValue($journal), $journal['description']); - DB::table('transaction_journals') - ->where('id', $journal['transaction_journal_id']) - ->limit(1) - ->update(['description' => $after]) - ; + DB::table('transaction_journals')->where('id', $journal['transaction_journal_id'])->limit(1)->update(['description' => $after]); // journal /** @var TransactionJournal $object */ diff --git a/app/TransactionRules/Actions/RemoveTag.php b/app/TransactionRules/Actions/RemoveTag.php index 943bdd98d5..6d0ea05907 100644 --- a/app/TransactionRules/Actions/RemoveTag.php +++ b/app/TransactionRules/Actions/RemoveTag.php @@ -62,11 +62,7 @@ class RemoveTag implements ActionInterface return false; } - $count = DB::table('tag_transaction_journal') - ->where('transaction_journal_id', $journal['transaction_journal_id']) - ->where('tag_id', $tag->id) - ->count() - ; + $count = DB::table('tag_transaction_journal')->where('transaction_journal_id', $journal['transaction_journal_id'])->where('tag_id', $tag->id)->count(); if (0 === $count) { Log::debug(sprintf( 'RuleAction RemoveTag tried to remove tag "%s" from journal #%d but no such tag is linked.', @@ -79,11 +75,7 @@ class RemoveTag implements ActionInterface } Log::debug(sprintf('RuleAction RemoveTag removed tag #%d ("%s") from journal #%d.', $tag->id, $tag->tag, $journal['transaction_journal_id'])); - DB::table('tag_transaction_journal') - ->where('transaction_journal_id', $journal['transaction_journal_id']) - ->where('tag_id', $tag->id) - ->delete() - ; + DB::table('tag_transaction_journal')->where('transaction_journal_id', $journal['transaction_journal_id'])->where('tag_id', $tag->id)->delete(); /** @var TransactionJournal $object */ $object = TransactionJournal::where('user_id', $journal['user_id'])->find($journal['transaction_journal_id']); diff --git a/app/TransactionRules/Actions/SetDestinationAccount.php b/app/TransactionRules/Actions/SetDestinationAccount.php index 8b4409389f..3e342c54b6 100644 --- a/app/TransactionRules/Actions/SetDestinationAccount.php +++ b/app/TransactionRules/Actions/SetDestinationAccount.php @@ -124,11 +124,7 @@ class SetDestinationAccount implements ActionInterface event(new TransactionGroupRequestsAuditLogEntry($this->action->rule, $object, 'set_destination', null, $newAccount->name)); // update destination transaction with new destination account: - DB::table('transactions') - ->where('transaction_journal_id', '=', $object->id) - ->where('amount', '>', 0) - ->update(['account_id' => $newAccount->id]) - ; + DB::table('transactions')->where('transaction_journal_id', '=', $object->id)->where('amount', '>', 0)->update(['account_id' => $newAccount->id]); Log::debug(sprintf('Updated journal #%d (group #%d) and gave it new destination account ID.', $object->id, $object->transaction_group_id)); diff --git a/app/TransactionRules/Actions/SetDestinationToCashAccount.php b/app/TransactionRules/Actions/SetDestinationToCashAccount.php index 6999f47d78..44d680111c 100644 --- a/app/TransactionRules/Actions/SetDestinationToCashAccount.php +++ b/app/TransactionRules/Actions/SetDestinationToCashAccount.php @@ -105,11 +105,7 @@ class SetDestinationToCashAccount implements ActionInterface event(new TransactionGroupRequestsAuditLogEntry($this->action->rule, $object, 'set_destination', null, $cashAccount->name)); // update destination transaction with new destination account: - DB::table('transactions') - ->where('transaction_journal_id', '=', $object->id) - ->where('amount', '>', 0) - ->update(['account_id' => $cashAccount->id]) - ; + DB::table('transactions')->where('transaction_journal_id', '=', $object->id)->where('amount', '>', 0)->update(['account_id' => $cashAccount->id]); Log::debug(sprintf('Updated journal #%d (group #%d) and gave it new destination account ID.', $object->id, $object->transaction_group_id)); diff --git a/app/TransactionRules/Actions/SetSourceAccount.php b/app/TransactionRules/Actions/SetSourceAccount.php index e90106df26..c9f2aa7e6f 100644 --- a/app/TransactionRules/Actions/SetSourceAccount.php +++ b/app/TransactionRules/Actions/SetSourceAccount.php @@ -113,11 +113,7 @@ class SetSourceAccount implements ActionInterface Log::debug(sprintf('New source account is #%d ("%s").', $newAccount->id, $newAccount->name)); // update source transaction with new source account: - DB::table('transactions') - ->where('transaction_journal_id', '=', $object->id) - ->where('amount', '<', 0) - ->update(['account_id' => $newAccount->id]) - ; + DB::table('transactions')->where('transaction_journal_id', '=', $object->id)->where('amount', '<', 0)->update(['account_id' => $newAccount->id]); event(new TransactionGroupRequestsAuditLogEntry($this->action->rule, $object, 'set_source', null, $newAccount->name)); diff --git a/app/TransactionRules/Actions/SetSourceToCashAccount.php b/app/TransactionRules/Actions/SetSourceToCashAccount.php index 6b2dc38d51..74ffc0724f 100644 --- a/app/TransactionRules/Actions/SetSourceToCashAccount.php +++ b/app/TransactionRules/Actions/SetSourceToCashAccount.php @@ -105,11 +105,7 @@ class SetSourceToCashAccount implements ActionInterface event(new TransactionGroupRequestsAuditLogEntry($this->action->rule, $object, 'set_source', null, $cashAccount->name)); // update destination transaction with new destination account: - DB::table('transactions') - ->where('transaction_journal_id', '=', $object->id) - ->where('amount', '<', 0) - ->update(['account_id' => $cashAccount->id]) - ; + DB::table('transactions')->where('transaction_journal_id', '=', $object->id)->where('amount', '<', 0)->update(['account_id' => $cashAccount->id]); Log::debug(sprintf('Updated journal #%d (group #%d) and gave it new source account ID.', $object->id, $object->transaction_group_id)); diff --git a/app/User.php b/app/User.php index 86a5a22c55..119ae3bdf2 100644 --- a/app/User.php +++ b/app/User.php @@ -497,12 +497,7 @@ class User extends Authenticatable $dbRolesIds = $dbRoles->pluck('id')->toArray(); $dbRolesTitles = $dbRoles->pluck('title')->toArray(); - $groupMemberships = $this - ->groupMemberships() - ->whereIn('user_role_id', $dbRolesIds) - ->where('user_group_id', $userGroup->id) - ->get() - ; + $groupMemberships = $this->groupMemberships()->whereIn('user_role_id', $dbRolesIds)->where('user_group_id', $userGroup->id)->get(); if (0 === $groupMemberships->count()) { Log::error(sprintf( 'User #%d "%s" does not have roles %s in user group #%d "%s"', diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index 249ed2d9af..7799c7ae3c 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -109,11 +109,7 @@ class FireflyValidator extends Validator if (0 === (int) $value) { return true; } - $count = DB::table($parameters[0]) - ->where('user_id', auth()->user()->id) - ->where($field, $value) - ->count() - ; + $count = DB::table($parameters[0])->where('user_id', auth()->user()->id)->where($field, $value)->count(); return 1 === $count; } @@ -634,11 +630,7 @@ class FireflyValidator extends Validator */ public function validateUniqueCurrency(string $field, string $attribute, string $value): bool { - return 0 === DB::table('transaction_currencies') - ->where($field, $value) - ->whereNull('deleted_at') - ->count() - ; + return 0 === DB::table('transaction_currencies')->where($field, $value)->whereNull('deleted_at')->count(); } /** diff --git a/app/Validation/TransactionValidation.php b/app/Validation/TransactionValidation.php index 53f99b9ce0..f044d4dedf 100644 --- a/app/Validation/TransactionValidation.php +++ b/app/Validation/TransactionValidation.php @@ -495,22 +495,14 @@ trait TransactionValidation } /** @var null|Transaction $source */ - $source = Transaction::where('transaction_journal_id', $journalId) - ->where('amount', '<', 0) - ->with(['account']) - ->first() - ; + $source = Transaction::where('transaction_journal_id', $journalId)->where('amount', '<', 0)->with(['account'])->first(); if (null !== $source) { $return['source_id'] = $source->account_id; $return['source_name'] = $source->account->name; } /** @var null|Transaction $destination */ - $destination = Transaction::where('transaction_journal_id', $journalId) - ->where('amount', '>', 0) - ->with(['account']) - ->first() - ; + $destination = Transaction::where('transaction_journal_id', $journalId)->where('amount', '>', 0)->with(['account'])->first(); if (null !== $destination) { $return['destination_id'] = $destination->account_id; $return['destination_name'] = $destination->account->name; diff --git a/composer.lock b/composer.lock index b1efd7b984..7a9668ca9d 100644 --- a/composer.lock +++ b/composer.lock @@ -1009,16 +1009,16 @@ }, { "name": "firebase/php-jwt", - "version": "v7.0.4", + "version": "v7.0.5", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "e41f1bd7dbe3c5455c3f72d4338cfeb083b71931" + "reference": "47ad26bab5e7c70ae8a6f08ed25ff83631121380" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/e41f1bd7dbe3c5455c3f72d4338cfeb083b71931", - "reference": "e41f1bd7dbe3c5455c3f72d4338cfeb083b71931", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/47ad26bab5e7c70ae8a6f08ed25ff83631121380", + "reference": "47ad26bab5e7c70ae8a6f08ed25ff83631121380", "shasum": "" }, "require": { @@ -1067,9 +1067,9 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v7.0.4" + "source": "https://github.com/firebase/php-jwt/tree/v7.0.5" }, - "time": "2026-03-27T21:17:19+00:00" + "time": "2026-04-01T20:38:03+00:00" }, { "name": "fruitcake/php-cors", @@ -10174,16 +10174,16 @@ }, { "name": "cloudcreativity/json-api-testing", - "version": "v6.3.0", + "version": "v6.4.0", "source": { "type": "git", "url": "https://github.com/cloudcreativity/json-api-testing.git", - "reference": "c6f1460dae648a28217b182195f8ca4ed0ee9bd5" + "reference": "e7626f6d4e54094d7bfaf3751ef7e50cf5c0af1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cloudcreativity/json-api-testing/zipball/c6f1460dae648a28217b182195f8ca4ed0ee9bd5", - "reference": "c6f1460dae648a28217b182195f8ca4ed0ee9bd5", + "url": "https://api.github.com/repos/cloudcreativity/json-api-testing/zipball/e7626f6d4e54094d7bfaf3751ef7e50cf5c0af1f", + "reference": "e7626f6d4e54094d7bfaf3751ef7e50cf5c0af1f", "shasum": "" }, "require": { @@ -10191,7 +10191,7 @@ "illuminate/contracts": "^10.0|^11.0|^12.0|^13.0", "illuminate/support": "^10.0|^11.0|^12.0|^13.0", "php": "^8.2", - "phpunit/phpunit": "^10.5|^11.0|^12.0" + "phpunit/phpunit": "^10.5|^11.0|^12.0|^13.0" }, "type": "library", "extra": { @@ -10226,9 +10226,9 @@ ], "support": { "issues": "https://github.com/cloudcreativity/json-api/issues", - "source": "https://github.com/cloudcreativity/json-api-testing/tree/v6.3.0" + "source": "https://github.com/cloudcreativity/json-api-testing/tree/v6.4.0" }, - "time": "2026-03-28T18:04:28+00:00" + "time": "2026-04-02T09:17:01+00:00" }, { "name": "composer/class-map-generator", @@ -10552,16 +10552,16 @@ }, { "name": "fruitcake/laravel-debugbar", - "version": "v4.2.1", + "version": "v4.2.2", "source": { "type": "git", "url": "https://github.com/fruitcake/laravel-debugbar.git", - "reference": "cc54fc0bde936e817bb5767c8aa2a66e13a06d06" + "reference": "3831a10476663d8c2a6b9fa4f4b646879eb57199" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/cc54fc0bde936e817bb5767c8aa2a66e13a06d06", - "reference": "cc54fc0bde936e817bb5767c8aa2a66e13a06d06", + "url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/3831a10476663d8c2a6b9fa4f4b646879eb57199", + "reference": "3831a10476663d8c2a6b9fa4f4b646879eb57199", "shasum": "" }, "require": { @@ -10638,7 +10638,7 @@ ], "support": { "issues": "https://github.com/fruitcake/laravel-debugbar/issues", - "source": "https://github.com/fruitcake/laravel-debugbar/tree/v4.2.1" + "source": "https://github.com/fruitcake/laravel-debugbar/tree/v4.2.2" }, "funding": [ { @@ -10650,7 +10650,7 @@ "type": "github" } ], - "time": "2026-03-30T10:18:44+00:00" + "time": "2026-04-01T16:27:33+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -11220,16 +11220,16 @@ }, { "name": "php-debugbar/php-debugbar", - "version": "v3.6.1", + "version": "v3.6.3", "source": { "type": "git", "url": "https://github.com/php-debugbar/php-debugbar.git", - "reference": "2e1c66ba07183cf4134df479f6f246f820a463a8" + "reference": "e8fb14e0641a364c7834de8ef7d4e7ac17525235" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/2e1c66ba07183cf4134df479f6f246f820a463a8", - "reference": "2e1c66ba07183cf4134df479f6f246f820a463a8", + "url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/e8fb14e0641a364c7834de8ef7d4e7ac17525235", + "reference": "e8fb14e0641a364c7834de8ef7d4e7ac17525235", "shasum": "" }, "require": { @@ -11306,7 +11306,7 @@ ], "support": { "issues": "https://github.com/php-debugbar/php-debugbar/issues", - "source": "https://github.com/php-debugbar/php-debugbar/tree/v3.6.1" + "source": "https://github.com/php-debugbar/php-debugbar/tree/v3.6.3" }, "funding": [ { @@ -11318,7 +11318,7 @@ "type": "github" } ], - "time": "2026-03-30T18:25:29+00:00" + "time": "2026-04-02T18:44:47+00:00" }, { "name": "php-debugbar/symfony-bridge", @@ -11436,11 +11436,11 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.45", + "version": "2.1.46", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/f8cdfd9421b7edb7686a2d150a234870464eac70", - "reference": "f8cdfd9421b7edb7686a2d150a234870464eac70", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a193923fc2d6325ef4e741cf3af8c3e8f54dbf25", + "reference": "a193923fc2d6325ef4e741cf3af8c3e8f54dbf25", "shasum": "" }, "require": { @@ -11485,7 +11485,7 @@ "type": "github" } ], - "time": "2026-03-30T13:22:02+00:00" + "time": "2026-04-01T09:25:14+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -11936,16 +11936,16 @@ }, { "name": "phpunit/phpunit", - "version": "12.5.15", + "version": "12.5.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "aeb6899ffdbbf4b4ff5e6b6ebb77b35c51bb6d9a" + "reference": "b2429f58ae75cae980b5bb9873abe4de6aac8b58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/aeb6899ffdbbf4b4ff5e6b6ebb77b35c51bb6d9a", - "reference": "aeb6899ffdbbf4b4ff5e6b6ebb77b35c51bb6d9a", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b2429f58ae75cae980b5bb9873abe4de6aac8b58", + "reference": "b2429f58ae75cae980b5bb9873abe4de6aac8b58", "shasum": "" }, "require": { @@ -12014,7 +12014,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.15" + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.16" }, "funding": [ { @@ -12022,7 +12022,7 @@ "type": "other" } ], - "time": "2026-03-31T06:41:33+00:00" + "time": "2026-04-03T05:26:42+00:00" }, { "name": "rector/rector", diff --git a/config/firefly.php b/config/firefly.php index 25ef45d20f..69d873fdd8 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -78,8 +78,8 @@ return [ 'running_balance_column' => (bool)envDefaultWhenEmpty(env('USE_RUNNING_BALANCE'), true), // this is only the default value, is not used. // see cer.php for exchange rates feature flag. ], - 'version' => 'develop/2026-04-01', - 'build_time' => 1775021114, + 'version' => 'develop/2026-04-03', + 'build_time' => 1775194095, 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 28, // field is no longer used. diff --git a/package-lock.json b/package-lock.json index 067ee2a209..2e91440e56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1703,22 +1703,22 @@ } }, "node_modules/@emnapi/core": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.1.tgz", - "integrity": "sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.2.tgz", + "integrity": "sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==", "dev": true, "license": "MIT", "optional": true, "peer": true, "dependencies": { - "@emnapi/wasi-threads": "1.2.0", + "@emnapi/wasi-threads": "1.2.1", "tslib": "^2.4.0" } }, "node_modules/@emnapi/runtime": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.1.tgz", - "integrity": "sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.2.tgz", + "integrity": "sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==", "dev": true, "license": "MIT", "optional": true, @@ -1728,9 +1728,9 @@ } }, "node_modules/@emnapi/wasi-threads": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.0.tgz", - "integrity": "sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", + "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", "dev": true, "license": "MIT", "optional": true, @@ -3385,9 +3385,9 @@ } }, "node_modules/alpinejs": { - "version": "3.15.9", - "resolved": "https://registry.npmjs.org/alpinejs/-/alpinejs-3.15.9.tgz", - "integrity": "sha512-O30m8Tw/aARbLXmeTnISAFgrNm0K71PT7bZy/1NgRqFD36QGb34VJ4a6WBL1iIO/bofN+LkIkKLikUTkfPL2wQ==", + "version": "3.15.11", + "resolved": "https://registry.npmjs.org/alpinejs/-/alpinejs-3.15.11.tgz", + "integrity": "sha512-m26gkTg/MId8O+F4jHKK3vB3SjbFxxk/JHP+qzmw1H6aQrZuPAg4CUoAefnASzzp/eNroBjrRQe7950bNeaBJw==", "license": "MIT", "dependencies": { "@vue/reactivity": "~3.1.1" @@ -5338,9 +5338,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.330", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.330.tgz", - "integrity": "sha512-jFNydB5kFtYUobh4IkWUnXeyDbjf/r9gcUEXe1xcrcUxIGfTdzPXA+ld6zBRbwvgIGVzDll/LTIiDztEtckSnA==", + "version": "1.5.331", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.331.tgz", + "integrity": "sha512-IbxXrsTlD3hRodkLnbxAPP4OuJYdWCeM3IOdT+CpcMoIwIoDfCmRpEtSPfwBXxVkg9xmBeY7Lz2Eo2TDn/HC3Q==", "dev": true, "license": "ISC" }, @@ -7397,9 +7397,9 @@ } }, "node_modules/laravel-vite-plugin": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/laravel-vite-plugin/-/laravel-vite-plugin-3.0.0.tgz", - "integrity": "sha512-eO6B/IPH448XNjyA5OmJsFAeJH3MeQGWodNMzejx44+rhV44cs0op05t4yku9ifaRnikDkSHLOLXszJL0tiW3w==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/laravel-vite-plugin/-/laravel-vite-plugin-3.0.1.tgz", + "integrity": "sha512-Bx8sVcLIaZT1d0eisABcmjQ1GZdJpaXcV66A8RhXGp9JgR3iL8jDnvakVDXuH87Tn5S9KNx3VOhmJZW1CSexOg==", "dev": true, "license": "MIT", "dependencies": { @@ -7755,9 +7755,9 @@ } }, "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", "dev": true, "license": "MIT" }, @@ -8270,9 +8270,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.36", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.36.tgz", - "integrity": "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==", + "version": "2.0.37", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.37.tgz", + "integrity": "sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg==", "dev": true, "license": "MIT" }, @@ -9982,9 +9982,9 @@ "license": "MIT" }, "node_modules/sass": { - "version": "1.98.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.98.0.tgz", - "integrity": "sha512-+4N/u9dZ4PrgzGgPlKnaaRQx64RO0JBKs9sDhQ2pLgN6JQZ25uPQZKQYaBJU48Kd5BxgXoJ4e09Dq7nMcOUW3A==", + "version": "1.99.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.99.0.tgz", + "integrity": "sha512-kgW13M54DUB7IsIRM5LvJkNlpH+WhMpooUcaWGFARkF1Tc82v9mIWkCbCYf+MBvpIUBSeSOTilpZjEPr2VYE6Q==", "dev": true, "license": "MIT", "dependencies": { diff --git a/tests/integration/Api/Models/Account/ListControllerTest.php b/tests/integration/Api/Models/Account/ListControllerTest.php index e18fca9397..1f19172f6c 100644 --- a/tests/integration/Api/Models/Account/ListControllerTest.php +++ b/tests/integration/Api/Models/Account/ListControllerTest.php @@ -68,11 +68,7 @@ final class ListControllerTest extends TestCase $this->user = $this->createAuthenticatedUser(); $this->actingAs($this->user); - $this->account = Account::factory() - ->for($this->user) - ->withType(AccountTypeEnum::ASSET) - ->create() - ; + $this->account = Account::factory()->for($this->user)->withType(AccountTypeEnum::ASSET)->create(); app(AttachmentFactory::class) ->setUser($this->user) ->create([ diff --git a/tests/integration/Api/Models/Account/ShowControllerTest.php b/tests/integration/Api/Models/Account/ShowControllerTest.php index f2b3aae24f..26b17feef6 100644 --- a/tests/integration/Api/Models/Account/ShowControllerTest.php +++ b/tests/integration/Api/Models/Account/ShowControllerTest.php @@ -77,29 +77,10 @@ final class ShowControllerTest extends TestCase $this->user = $this->createAuthenticatedUser(); $this->actingAs($this->user); - Account::factory() - ->for($this->user) - ->withType(AccountTypeEnum::ASSET) - ->create() - ; - Account::factory() - ->for($this->user) - ->withType(AccountTypeEnum::REVENUE) - ->create() - ; - Account::factory() - ->for($this->user) - ->withType(AccountTypeEnum::EXPENSE) - ->create() - ; - Account::factory() - ->for($this->user) - ->withType(AccountTypeEnum::DEBT) - ->create() - ; - Account::factory() - ->for($this->user) - ->withType(AccountTypeEnum::ASSET) - ->create(); + Account::factory()->for($this->user)->withType(AccountTypeEnum::ASSET)->create(); + Account::factory()->for($this->user)->withType(AccountTypeEnum::REVENUE)->create(); + Account::factory()->for($this->user)->withType(AccountTypeEnum::EXPENSE)->create(); + Account::factory()->for($this->user)->withType(AccountTypeEnum::DEBT)->create(); + Account::factory()->for($this->user)->withType(AccountTypeEnum::ASSET)->create(); } } diff --git a/tests/unit/Support/NavigationEndOfPeriodTest.php b/tests/unit/Support/NavigationEndOfPeriodTest.php index 2ea8e0bf1f..bc1540a7aa 100644 --- a/tests/unit/Support/NavigationEndOfPeriodTest.php +++ b/tests/unit/Support/NavigationEndOfPeriodTest.php @@ -59,109 +59,73 @@ final class NavigationEndOfPeriodTest extends TestCase yield '1W' => [ '1W', Carbon::now(), - Carbon::now() - ->addWeek() - ->subDay() - ->endOfDay(), + Carbon::now()->addWeek()->subDay()->endOfDay(), ]; yield 'week' => [ 'week', Carbon::now(), - Carbon::now() - ->addWeek() - ->subDay() - ->endOfDay(), + Carbon::now()->addWeek()->subDay()->endOfDay(), ]; yield 'weekly' => [ 'weekly', Carbon::now(), - Carbon::now() - ->addWeek() - ->subDay() - ->endOfDay(), + Carbon::now()->addWeek()->subDay()->endOfDay(), ]; yield 'month' => [ 'month', Carbon::now(), - Carbon::now() - ->addMonth() - ->subDay() - ->endOfDay(), + Carbon::now()->addMonth()->subDay()->endOfDay(), ]; yield '1M' => [ '1M', Carbon::now(), - Carbon::now() - ->addMonth() - ->subDay() - ->endOfDay(), + Carbon::now()->addMonth()->subDay()->endOfDay(), ]; yield 'monthly' => [ 'monthly', Carbon::now(), - Carbon::now() - ->addMonth() - ->subDay() - ->endOfDay(), + Carbon::now()->addMonth()->subDay()->endOfDay(), ]; yield '3M' => [ '3M', Carbon::now(), - Carbon::now() - ->addQuarter() - ->subDay() - ->endOfDay(), + Carbon::now()->addQuarter()->subDay()->endOfDay(), ]; yield 'quarter' => [ 'quarter', Carbon::now(), - Carbon::now() - ->addQuarter() - ->subDay() - ->endOfDay(), + Carbon::now()->addQuarter()->subDay()->endOfDay(), ]; yield 'quarterly' => [ 'quarterly', Carbon::now(), - Carbon::now() - ->addQuarter() - ->subDay() - ->endOfDay(), + Carbon::now()->addQuarter()->subDay()->endOfDay(), ]; yield 'year' => [ 'year', Carbon::now(), - Carbon::now() - ->addYearNoOverflow() - ->subDay() - ->endOfDay(), + Carbon::now()->addYearNoOverflow()->subDay()->endOfDay(), ]; yield 'yearly' => [ 'yearly', Carbon::now(), - Carbon::now() - ->addYearNoOverflow() - ->subDay() - ->endOfDay(), + Carbon::now()->addYearNoOverflow()->subDay()->endOfDay(), ]; yield '1Y' => [ '1Y', Carbon::now(), - Carbon::now() - ->addYearNoOverflow() - ->subDay() - ->endOfDay(), + Carbon::now()->addYearNoOverflow()->subDay()->endOfDay(), ]; yield 'half-year' => ['half-year', Carbon::parse('2023-05-20'), Carbon::parse('2023-11-19')->endOfDay()];