Various code cleanup and fixed alignments.

This commit is contained in:
James Cole
2024-01-01 14:43:56 +01:00
parent 1368aafe5f
commit f963ac63f1
443 changed files with 3668 additions and 3672 deletions

View File

@@ -48,7 +48,7 @@ class BelongsUser implements ValidationRule
}
app('log')->debug(sprintf('Going to validate %s', $attribute));
$result = match ($attribute) {
$result = match ($attribute) {
'piggy_bank_id' => $this->validatePiggyBankId((int)$value),
'piggy_bank_name' => $this->validatePiggyBankName($value),
'bill_id' => $this->validateBillId((int)$value),
@@ -78,7 +78,7 @@ class BelongsUser implements ValidationRule
if (PiggyBank::class !== $class) {
$objects = $class::where('user_id', '=', auth()->user()->id)->get();
}
$count = 0;
$count = 0;
foreach ($objects as $object) {
$objectValue = trim((string)$object->{$field}); // @phpstan-ignore-line
app('log')->debug(sprintf('Comparing object "%s" with value "%s"', $objectValue, $value));

View File

@@ -61,7 +61,7 @@ class BelongsUserGroup implements ValidationRule
}
app('log')->debug(sprintf('Group: Going to validate "%s"', $attribute));
$result = match ($attribute) {
$result = match ($attribute) {
'piggy_bank_id' => $this->validatePiggyBankId((int)$value),
'piggy_bank_name' => $this->validatePiggyBankName($value),
'bill_id' => $this->validateBillId((int)$value),
@@ -91,7 +91,7 @@ class BelongsUserGroup implements ValidationRule
if (PiggyBank::class !== $class) {
$objects = $class::where('user_group_id', '=', $this->userGroup->id)->get();
}
$count = 0;
$count = 0;
foreach ($objects as $object) {
$objectValue = trim((string)$object->{$field}); // @phpstan-ignore-line
app('log')->debug(sprintf('Comparing object "%s" with value "%s"', $objectValue, $value));

View File

@@ -40,7 +40,7 @@ class IsAssetAccountId implements ValidationRule
$accountId = (int)$value;
/** @var null|Account $account */
$account = Account::with('accountType')->find($accountId);
$account = Account::with('accountType')->find($accountId);
if (null === $account) {
$fail('validation.no_asset_account')->translate();

View File

@@ -41,7 +41,7 @@ class IsTransferAccount implements ValidationRule
app('log')->debug(sprintf('Now in %s(%s)', __METHOD__, $value));
/** @var AccountValidator $validator */
$validator = app(AccountValidator::class);
$validator = app(AccountValidator::class);
$validator->setTransactionType(TransactionType::TRANSFER);
$validator->setUser(auth()->user());

View File

@@ -145,7 +145,7 @@ class UniqueIban implements ValidationRule
$typesArray = [AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE];
}
$query
= auth()->user()
= auth()->user()
->accounts()
->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')
->where('accounts.iban', $iban)

View File

@@ -78,8 +78,8 @@ class ValidRecurrenceRepetitionValue implements ValidationRule
if (2 !== count($parameters)) {
return false;
}
$nthDay = (int)($parameters[0] ?? 0.0);
$dayOfWeek = (int)($parameters[1] ?? 0.0);
$nthDay = (int)($parameters[0] ?? 0.0);
$dayOfWeek = (int)($parameters[1] ?? 0.0);
if ($nthDay < 1 || $nthDay > 5) {
return false;
}