mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-11 09:29:34 +00:00
Various code cleanup and fixed alignments.
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user