Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Always great when using conflicting tools
James Colece023f2580b8
diff --git a/.ci/phpstan.neon b/.ci/phpstan.neonindex ac8d1f7205..7e804a9a43 100644--- a/.ci/phpstan.neon+++ b/.ci/phpstan.neon@@ -13,6 +13,7 @@ parameters:- '#is not allowed to extend#'- '#switch is forbidden to use#'- '#is neither abstract nor final#'+ - '#on left side of \?\?\= always exists and is not nullable#'- '#has a nullable return type declaration#' # perhaps throw errors instead?- '#with a nullable type declaration#' # decide what action should be if param is null.- '#with null as default value#'diff --git a/app/Console/Commands/Correction/FixAccountTypes.php b/app/Console/Commands/Correction/FixAccountTypes.phpindex d8f9fe72cc..b7bb806317 100644--- a/app/Console/Commands/Correction/FixAccountTypes.php+++ b/app/Console/Commands/Correction/FixAccountTypes.php@@ -43,8 +43,8 @@ class FixAccountTypes extends Command{use ShowsFriendlyMessages;- protected $description = 'Make sure all journals have the correct from/to account types.';- protected $signature = 'firefly-iii:fix-account-types';+ protected $description = 'Make sure all journals have the correct from/to account types.';+ protected $signature = 'firefly-iii:fix-account-types';private int $count;private array $expected;private AccountFactory $factory;diff --git a/app/Console/Commands/Correction/FixIbans.php b/app/Console/Commands/Correction/FixIbans.phpindex 717a0e1269..0717441a5a 100644--- a/app/Console/Commands/Correction/FixIbans.php+++ b/app/Console/Commands/Correction/FixIbans.php@@ -37,8 +37,8 @@ class FixIbans extends Command{use ShowsFriendlyMessages;- protected $description = 'Removes spaces from IBANs';- protected $signature = 'firefly-iii:fix-ibans';+ protected $description = 'Removes spaces from IBANs';+ protected $signature = 'firefly-iii:fix-ibans';private int $count = 0;/**diff --git a/app/Console/Commands/Correction/FixRecurringTransactions.php b/app/Console/Commands/Correction/FixRecurringTransactions.phpindex 8777946f7c..ac2fc02cf8 100644--- a/app/Console/Commands/Correction/FixRecurringTransactions.php+++ b/app/Console/Commands/Correction/FixRecurringTransactions.php@@ -40,8 +40,8 @@ class FixRecurringTransactions extends Command{use ShowsFriendlyMessages;- protected $description = 'Fixes recurring transactions with the wrong transaction type.';- protected $signature = 'firefly-iii:fix-recurring-transactions';+ protected $description = 'Fixes recurring transactions with the wrong transaction type.';+ protected $signature = 'firefly-iii:fix-recurring-transactions';private int $count = 0;private RecurringRepositoryInterface $recurringRepos;private UserRepositoryInterface $userRepos;diff --git a/app/Console/Commands/Export/ExportData.php b/app/Console/Commands/Export/ExportData.phpindex b191cb48e3..8589dcb336 100644--- a/app/Console/Commands/Export/ExportData.php+++ b/app/Console/Commands/Export/ExportData.php@@ -51,7 +51,7 @@ class ExportData extends Commandprotected $description = 'Command to export data from Firefly III.';- protected $signature = 'firefly-iii:export-data+ protected $signature = 'firefly-iii:export-data{--user=1 : The user ID that the export should run for.}{--token= : The user\'s access token.}{--start= : First transaction to export. Defaults to your very first transaction. Only applies to transaction export.}diff --git a/app/Console/Commands/System/CreateFirstUser.php b/app/Console/Commands/System/CreateFirstUser.phpindex 06e158f468..0cdc5370e6 100644--- a/app/Console/Commands/System/CreateFirstUser.php+++ b/app/Console/Commands/System/CreateFirstUser.php@@ -42,7 +42,7 @@ class CreateFirstUser extends Commandprotected $description = 'Creates a new user and gives admin rights. Outputs the password on the command line. Strictly for testing.';- protected $signature = 'firefly-iii:create-first-user {email}';+ protected $signature = 'firefly-iii:create-first-user {email}';private UserRepositoryInterface $repository;/**diff --git a/app/Console/Commands/System/ForceDecimalSize.php b/app/Console/Commands/System/ForceDecimalSize.phpindex 361fb03278..08e86cc706 100644--- a/app/Console/Commands/System/ForceDecimalSize.php+++ b/app/Console/Commands/System/ForceDecimalSize.php@@ -53,8 +53,8 @@ class ForceDecimalSize extends Command{use ShowsFriendlyMessages;- protected $description = 'This command resizes DECIMAL columns in MySQL or PostgreSQL and correct amounts (only MySQL).';- protected $signature = 'firefly-iii:force-decimal-size';+ protected $description = 'This command resizes DECIMAL columns in MySQL or PostgreSQL and correct amounts (only MySQL).';+ protected $signature = 'firefly-iii:force-decimal-size';private string $cast;private array $classes= [diff --git a/app/Console/Commands/Tools/ApplyRules.php b/app/Console/Commands/Tools/ApplyRules.phpindex 3a83a8b3b9..eaa50b94bd 100644--- a/app/Console/Commands/Tools/ApplyRules.php+++ b/app/Console/Commands/Tools/ApplyRules.php@@ -50,7 +50,7 @@ class ApplyRules extends Commandprotected $description = 'This command will apply your rules and rule groups on a selection of your transactions.';- protected $signature+ protected $signature= 'firefly-iii:apply-rules{--user=1 : The user ID.}{--token= : The user\'s access token.}diff --git a/app/Console/Commands/Upgrade/AccountCurrencies.php b/app/Console/Commands/Upgrade/AccountCurrencies.phpindex 4b11a59c19..37305ff4e8 100644--- a/app/Console/Commands/Upgrade/AccountCurrencies.php+++ b/app/Console/Commands/Upgrade/AccountCurrencies.php@@ -46,8 +46,8 @@ class AccountCurrencies extends Commandpublic const string CONFIG_NAME = '480_account_currencies';- protected $description = 'Give all accounts proper currency info.';- protected $signature = 'firefly-iii:account-currencies {--F|force : Force the execution of this command.}';+ protected $description = 'Give all accounts proper currency info.';+ protected $signature = 'firefly-iii:account-currencies {--F|force : Force the execution of this command.}';private AccountRepositoryInterface $accountRepos;private int $count;private UserRepositoryInterface $userRepos;diff --git a/app/Console/Commands/Upgrade/MigrateToGroups.php b/app/Console/Commands/Upgrade/MigrateToGroups.phpindex e5aa55b1ff..8da1102421 100644--- a/app/Console/Commands/Upgrade/MigrateToGroups.php+++ b/app/Console/Commands/Upgrade/MigrateToGroups.php@@ -51,8 +51,8 @@ class MigrateToGroups extends Commanduse ShowsFriendlyMessages;public const string CONFIG_NAME = '480_migrated_to_groups';- protected $description = 'Migrates a pre-4.7.8 transaction structure to the 4.7.8+ transaction structure.';- protected $signature = 'firefly-iii:migrate-to-groups {--F|force : Force the migration, even if it fired before.}';+ protected $description = 'Migrates a pre-4.7.8 transaction structure to the 4.7.8+ transaction structure.';+ protected $signature = 'firefly-iii:migrate-to-groups {--F|force : Force the migration, even if it fired before.}';private JournalCLIRepositoryInterface $cliRepository;private int $count;private TransactionGroupFactory $groupFactory;diff --git a/app/Console/Commands/Upgrade/MigrateToRules.php b/app/Console/Commands/Upgrade/MigrateToRules.phpindex f85ee4497b..94ec5bd1e0 100644--- a/app/Console/Commands/Upgrade/MigrateToRules.php+++ b/app/Console/Commands/Upgrade/MigrateToRules.php@@ -48,7 +48,7 @@ class MigrateToRules extends Commandprotected $description = 'Migrate bills to rules.';- protected $signature = 'firefly-iii:bills-to-rules {--F|force : Force the execution of this command.}';+ protected $signature = 'firefly-iii:bills-to-rules {--F|force : Force the execution of this command.}';private BillRepositoryInterface $billRepository;private int $count;private RuleGroupRepositoryInterface $ruleGroupRepository;diff --git a/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php b/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.phpindex 649263bc7a..18e01b6119 100644--- a/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php+++ b/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php@@ -45,8 +45,8 @@ class OtherCurrenciesCorrections extends Commanduse ShowsFriendlyMessages;public const string CONFIG_NAME = '480_other_currencies';- protected $description = 'Update all journal currency information.';- protected $signature = 'firefly-iii:other-currencies {--F|force : Force the execution of this command.}';+ protected $description = 'Update all journal currency information.';+ protected $signature = 'firefly-iii:other-currencies {--F|force : Force the execution of this command.}';private array $accountCurrencies;private AccountRepositoryInterface $accountRepos;private JournalCLIRepositoryInterface $cliRepos;diff --git a/app/Console/Commands/Upgrade/TransactionIdentifier.php b/app/Console/Commands/Upgrade/TransactionIdentifier.phpindex ac2dad56f0..eb21a358b5 100644--- a/app/Console/Commands/Upgrade/TransactionIdentifier.php+++ b/app/Console/Commands/Upgrade/TransactionIdentifier.php@@ -42,8 +42,8 @@ class TransactionIdentifier extends Commanduse ShowsFriendlyMessages;public const string CONFIG_NAME = '480_transaction_identifier';- protected $description = 'Fixes transaction identifiers.';- protected $signature = 'firefly-iii:transaction-identifiers {--F|force : Force the execution of this command.}';+ protected $description = 'Fixes transaction identifiers.';+ protected $signature = 'firefly-iii:transaction-identifiers {--F|force : Force the execution of this command.}';private JournalCLIRepositoryInterface $cliRepository;private int $count;diff --git a/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php b/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.phpindex ab166617b4..a87f658ff8 100644--- a/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php+++ b/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php@@ -43,8 +43,8 @@ class TransferCurrenciesCorrections extends Commanduse ShowsFriendlyMessages;public const string CONFIG_NAME = '480_transfer_currencies';- protected $description = 'Updates transfer currency information.';- protected $signature = 'firefly-iii:transfer-currencies {--F|force : Force the execution of this command.}';+ protected $description = 'Updates transfer currency information.';+ protected $signature = 'firefly-iii:transfer-currencies {--F|force : Force the execution of this command.}';private array $accountCurrencies;private AccountRepositoryInterface $accountRepos;private JournalCLIRepositoryInterface $cliRepos;diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.phpindex 84ccd70489..d62e81247f 100644--- a/app/Exceptions/Handler.php+++ b/app/Exceptions/Handler.php@@ -232,11 +232,11 @@ class Handler extends ExceptionHandlerprivate function shouldntReportLocal(Throwable $e): bool{return null !== Arr::first(- $this->dontReport,- static function ($type) use ($e) {+ $this->dontReport,+ static function ($type) use ($e) {return $e instanceof $type;}- );+ );}/**diff --git a/app/Handlers/Events/Model/BudgetLimitHandler.php b/app/Handlers/Events/Model/BudgetLimitHandler.phpindex c1bc0d047b..52d9a8f7d3 100644--- a/app/Handlers/Events/Model/BudgetLimitHandler.php+++ b/app/Handlers/Events/Model/BudgetLimitHandler.php@@ -190,8 +190,8 @@ class BudgetLimitHandler);// overlap in days:$limitPeriod = Period::make(- $budgetLimit->start_date,- $budgetLimit->end_date,+ $budgetLimit->start_date,+ $budgetLimit->end_date,precision : Precision::DAY(),boundaries: Boundaries::EXCLUDE_NONE());@@ -236,8 +236,8 @@ class BudgetLimitHandlerreturn '0';}$limitPeriod = Period::make(- $budgetLimit->start_date,- $budgetLimit->end_date,+ $budgetLimit->start_date,+ $budgetLimit->end_date,precision : Precision::DAY(),boundaries: Boundaries::EXCLUDE_NONE());diff --git a/app/Helpers/Collector/Extensions/AttachmentCollection.php b/app/Helpers/Collector/Extensions/AttachmentCollection.phpindex 1f9e84894c..4d929fb4db 100644--- a/app/Helpers/Collector/Extensions/AttachmentCollection.php+++ b/app/Helpers/Collector/Extensions/AttachmentCollection.php@@ -56,9 +56,9 @@ trait AttachmentCollection/** @var array $attachment */foreach ($transaction['attachments'] as $attachment) {$result = str_contains(strtolower($attachment['filename']), strtolower($name)) || str_contains(- strtolower($attachment['title']),- strtolower($name)- );+ strtolower($attachment['title']),+ strtolower($name)+ );if (true === $result) {return true;}@@ -142,9 +142,9 @@ trait AttachmentCollection/** @var array $attachment */foreach ($transaction['attachments'] as $attachment) {$result = !str_contains(strtolower($attachment['filename']), strtolower($name)) && !str_contains(- strtolower($attachment['title']),- strtolower($name)- );+ strtolower($attachment['title']),+ strtolower($name)+ );if (true === $result) {return true;}@@ -179,9 +179,9 @@ trait AttachmentCollection/** @var array $attachment */foreach ($transaction['attachments'] as $attachment) {$result = !str_ends_with(strtolower($attachment['filename']), strtolower($name)) && !str_ends_with(- strtolower($attachment['title']),- strtolower($name)- );+ strtolower($attachment['title']),+ strtolower($name)+ );if (true === $result) {return true;}@@ -216,9 +216,9 @@ trait AttachmentCollection/** @var array $attachment */foreach ($transaction['attachments'] as $attachment) {$result = !str_starts_with(strtolower($attachment['filename']), strtolower($name)) && !str_starts_with(- strtolower($attachment['title']),- strtolower($name)- );+ strtolower($attachment['title']),+ strtolower($name)+ );if (true === $result) {return true;}@@ -246,9 +246,9 @@ trait AttachmentCollection/** @var array $attachment */foreach ($transaction['attachments'] as $attachment) {$result = str_ends_with(strtolower($attachment['filename']), strtolower($name)) || str_ends_with(- strtolower($attachment['title']),- strtolower($name)- );+ strtolower($attachment['title']),+ strtolower($name)+ );if (true === $result) {return true;}@@ -330,9 +330,9 @@ trait AttachmentCollection/** @var array $attachment */foreach ($transaction['attachments'] as $attachment) {$result = str_starts_with(strtolower($attachment['filename']), strtolower($name)) || str_starts_with(- strtolower($attachment['title']),- strtolower($name)- );+ strtolower($attachment['title']),+ strtolower($name)+ );if (true === $result) {return true;}diff --git a/app/Http/Controllers/Budget/IndexController.php b/app/Http/Controllers/Budget/IndexController.phpindex e082379c76..4a8ce7c181 100644--- a/app/Http/Controllers/Budget/IndexController.php+++ b/app/Http/Controllers/Budget/IndexController.php@@ -135,7 +135,7 @@ class IndexController extends Controller// get budgeted for default currency:if (0 === count($availableBudgets)) {- $budgeted = $this->blRepository->budgeted($start, $end, $defaultCurrency,);+ $budgeted = $this->blRepository->budgeted($start, $end, $defaultCurrency, );$spentArr = $this->opsRepository->sumExpenses($start, $end, null, null, $defaultCurrency);$spent = $spentArr[$defaultCurrency->id]['sum'] ?? '0';unset($spentArr);@@ -194,7 +194,7 @@ class IndexController extends Controller$array['spent'] = $spentArr[$entry->transaction_currency_id]['sum'] ?? '0';// budgeted in period:- $budgeted = $this->blRepository->budgeted($entry->start_date, $entry->end_date, $entry->transactionCurrency,);+ $budgeted = $this->blRepository->budgeted($entry->start_date, $entry->end_date, $entry->transactionCurrency, );$array['budgeted'] = $budgeted;$availableBudgets[] = $array;unset($spentArr);diff --git a/app/Http/Controllers/Json/BoxController.php b/app/Http/Controllers/Json/BoxController.phpindex 5533aa02e0..aa29ecd438 100644--- a/app/Http/Controllers/Json/BoxController.php+++ b/app/Http/Controllers/Json/BoxController.php@@ -86,12 +86,12 @@ class BoxController extends Controllerstatic function (AvailableBudget $availableBudget) use ($currency) { // @phpstan-ignore-lineif ($availableBudget->transaction_currency_id === $currency->id) {app('log')->debug(sprintf(- 'Will include AB #%d: from %s-%s amount %s',- $availableBudget->id,- $availableBudget->start_date->format('Y-m-d'),- $availableBudget->end_date->format('Y-m-d'),- $availableBudget->amount- ));+ 'Will include AB #%d: from %s-%s amount %s',+ $availableBudget->id,+ $availableBudget->start_date->format('Y-m-d'),+ $availableBudget->end_date->format('Y-m-d'),+ $availableBudget->amount+ ));return $availableBudget;}diff --git a/app/Http/Controllers/Transaction/ShowController.php b/app/Http/Controllers/Transaction/ShowController.phpindex f4c1746566..cf67431732 100644--- a/app/Http/Controllers/Transaction/ShowController.php+++ b/app/Http/Controllers/Transaction/ShowController.php@@ -161,9 +161,9 @@ class ShowController extends Controller$amounts[$symbol]['amount'] = bcadd($amounts[$symbol]['amount'], $transaction['amount']);if (null !== $transaction['foreign_amount'] && '' !== $transaction['foreign_amount']&& bccomp(- '0',- $transaction['foreign_amount']- ) !== 0) {+ '0',+ $transaction['foreign_amount']+ ) !== 0) {// same for foreign currency:$foreignSymbol = $transaction['foreign_currency_symbol'];if (!array_key_exists($foreignSymbol, $amounts)) {diff --git a/app/Models/Account.php b/app/Models/Account.phpindex e55bd5a772..376090edf7 100644--- a/app/Models/Account.php+++ b/app/Models/Account.php@@ -127,7 +127,7 @@ class Account extends Modelprotected $fillable = ['user_id', 'user_group_id', 'account_type_id', 'name', 'active', 'virtual_balance', 'iban'];- protected $hidden = ['encrypted'];+ protected $hidden = ['encrypted'];private bool $joinedAccountTypes = false;/**diff --git a/app/Models/TransactionCurrency.php b/app/Models/TransactionCurrency.phpindex cfbd363700..ca84cce988 100644--- a/app/Models/TransactionCurrency.php+++ b/app/Models/TransactionCurrency.php@@ -84,7 +84,7 @@ class TransactionCurrency extends Modelpublic ?bool $userDefault;public ?bool $userEnabled;- protected $casts+ protected $casts= ['created_at' => 'datetime','updated_at' => 'datetime',diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.phpindex a6b137d86b..356542d0b2 100644--- a/app/Repositories/Bill/BillRepository.php+++ b/app/Repositories/Bill/BillRepository.php@@ -373,12 +373,12 @@ class BillRepository implements BillRepositoryInterfacereturn $bill->transactionJournals()->before($end)->after($start)->get(- [+ ['transaction_journals.id','transaction_journals.date','transaction_journals.transaction_group_id',]- );+ );}/**diff --git a/app/Repositories/Budget/BudgetLimitRepository.php b/app/Repositories/Budget/BudgetLimitRepository.phpindex eed2f8167b..8efc508858 100644--- a/app/Repositories/Budget/BudgetLimitRepository.php+++ b/app/Repositories/Budget/BudgetLimitRepository.php@@ -60,7 +60,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface// same complex where query as below.->where(- static function (Builder $q5) use ($start, $end) {+ static function (Builder $q5) use ($start, $end) {$q5->where(static function (Builder $q1) use ($start, $end) {$q1->where(@@ -85,7 +85,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface});}- )+ )->where('budget_limits.transaction_currency_id', $currency->id)->whereNull('budgets.deleted_at')->where('budgets.active', true)@@ -252,11 +252,11 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface)// budget limit start within period->orWhere(- static function (Builder $q3) use ($start, $end) {+ static function (Builder $q3) use ($start, $end) {$q3->where('budget_limits.start_date', '>=', $start->format('Y-m-d 00:00:00'));$q3->where('budget_limits.start_date', '<=', $end->format('Y-m-d 23:59:59'));}- );+ );})->orWhere(diff --git a/app/Services/Internal/Update/JournalUpdateService.php b/app/Services/Internal/Update/JournalUpdateService.phpindex 5ab0375721..b02401cf79 100644--- a/app/Services/Internal/Update/JournalUpdateService.php+++ b/app/Services/Internal/Update/JournalUpdateService.php@@ -497,9 +497,9 @@ class JournalUpdateService{$type = $this->transactionJournal->transactionType->type;if ((- array_key_exists('bill_id', $this->data)+ array_key_exists('bill_id', $this->data)|| array_key_exists('bill_name', $this->data)- )+ )&& TransactionType::WITHDRAWAL === $type) {$billId = (int)($this->data['bill_id'] ?? 0);diff --git a/app/Support/Navigation.php b/app/Support/Navigation.phpindex aed2c5e088..712deef93d 100644--- a/app/Support/Navigation.php+++ b/app/Support/Navigation.php@@ -89,10 +89,10 @@ class Navigationif (!array_key_exists($repeatFreq, $functionMap)) {Log::error(sprintf(- 'The periodicity %s is unknown. Choose one of available periodicity: %s',- $repeatFreq,- implode(', ', array_keys($functionMap))- ));+ 'The periodicity %s is unknown. Choose one of available periodicity: %s',+ $repeatFreq,+ implode(', ', array_keys($functionMap))+ ));return $theDate;}@@ -352,12 +352,12 @@ class Navigationpublic function diffInPeriods(string $period, int $skip, Carbon $beginning, Carbon $end): int{Log::debug(sprintf(- 'diffInPeriods: %s (skip: %d), between %s and %s.',- $period,- $skip,- $beginning->format('Y-m-d'),- $end->format('Y-m-d')- ));+ 'diffInPeriods: %s (skip: %d), between %s and %s.',+ $period,+ $skip,+ $beginning->format('Y-m-d'),+ $end->format('Y-m-d')+ ));$map = ['daily' => 'floatDiffInDays','weekly' => 'floatDiffInWeeks',@@ -394,11 +394,11 @@ class Navigation$parameter = $skip + 1;$diff = ceil($diff / $parameter) * $parameter;Log::debug(sprintf(- 'diffInPeriods: skip is %d, so param is %d, and diff becomes %d',- $skip,- $parameter,- $diff- ));+ 'diffInPeriods: skip is %d, so param is %d, and diff becomes %d',+ $skip,+ $parameter,+ $diff+ ));}return (int)$diff;diff --git a/app/Support/Steam.php b/app/Support/Steam.phpindex f8baace830..59faf20c14 100644--- a/app/Support/Steam.php+++ b/app/Support/Steam.php@@ -326,15 +326,15 @@ class Steam$balances[$format] = $currentBalance;app('log')->debug(sprintf(- '%s: transaction in %s(!). Conversion rate is %s. %s %s = %s %s',- $format,- $currency->code,- $rate,- $currency->code,- $transaction['amount'],- $native->code,- $convertedAmount- ));+ '%s: transaction in %s(!). Conversion rate is %s. %s %s = %s %s',+ $format,+ $currency->code,+ $rate,+ $currency->code,+ $transaction['amount'],+ $native->code,+ $convertedAmount+ ));}diff --git a/app/User.php b/app/User.phpindex e99fd3aee3..4ce095271c 100644--- a/app/User.php+++ b/app/User.php@@ -416,37 +416,37 @@ class User extends Authenticatable->where('user_group_id', $userGroup->id)->get();if (0 === $groupMemberships->count()) {app('log')->error(sprintf(- 'User #%d "%s" does not have roles %s in user group #%d "%s"',- $this->id,- $this->email,- implode(', ', $roles),- $userGroup->id,- $userGroup->title- ));+ 'User #%d "%s" does not have roles %s in user group #%d "%s"',+ $this->id,+ $this->email,+ implode(', ', $roles),+ $userGroup->id,+ $userGroup->title+ ));return false;}foreach ($groupMemberships as $membership) {app('log')->debug(sprintf(- 'User #%d "%s" has role "%s" in user group #%d "%s"',- $this->id,- $this->email,- $membership->userRole->title,- $userGroup->id,- $userGroup->title- ));+ 'User #%d "%s" has role "%s" in user group #%d "%s"',+ $this->id,+ $this->email,+ $membership->userRole->title,+ $userGroup->id,+ $userGroup->title+ ));if (in_array($membership->userRole->title, $dbRolesTitles, true)) {app('log')->debug(sprintf('Return true, found role "%s"', $membership->userRole->title));return true;}}app('log')->error(sprintf(- 'User #%d "%s" does not have roles %s in user group #%d "%s"',- $this->id,- $this->email,- implode(', ', $roles),- $userGroup->id,- $userGroup->title- ));+ 'User #%d "%s" does not have roles %s in user group #%d "%s"',+ $this->id,+ $this->email,+ implode(', ', $roles),+ $userGroup->id,+ $userGroup->title+ ));return false;}@@ -696,7 +696,7 @@ class User extends Authenticatable*/public function userGroup(): BelongsTo{- return $this->belongsTo(UserGroup::class,);+ return $this->belongsTo(UserGroup::class, );}/**