mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Code cleanup
This commit is contained in:
@@ -43,7 +43,7 @@ trait WithdrawalValidation
|
||||
if (null === $accountId && null === $accountName && null === $accountIban && false === $this->canCreateTypes($validTypes)) {
|
||||
// if both values are NULL we return TRUE
|
||||
// because we assume the user doesn't want to submit / change anything.
|
||||
$this->sourceError = (string)trans('validation.withdrawal_source_need_data');
|
||||
$this->sourceError = (string) trans('validation.withdrawal_source_need_data');
|
||||
app('log')->warning('[a] Not a valid source. Need more data.');
|
||||
|
||||
return false;
|
||||
@@ -52,7 +52,7 @@ trait WithdrawalValidation
|
||||
// otherwise try to find the account:
|
||||
$search = $this->findExistingAccount($validTypes, $array);
|
||||
if (null === $search) {
|
||||
$this->sourceError = (string)trans('validation.withdrawal_source_bad_data', ['id' => $accountId, 'name' => $accountName]);
|
||||
$this->sourceError = (string) trans('validation.withdrawal_source_bad_data', ['id' => $accountId, 'name' => $accountName]);
|
||||
app('log')->warning('Not a valid source. Cant find it.', $validTypes);
|
||||
|
||||
return false;
|
||||
@@ -80,7 +80,7 @@ trait WithdrawalValidation
|
||||
if (null === $accountId && null === $accountName && null === $accountIban && null === $accountNumber && false === $this->canCreateTypes($validTypes)) {
|
||||
// if both values are NULL return false,
|
||||
// because the destination of a withdrawal can never be created automatically.
|
||||
$this->destError = (string)trans('validation.withdrawal_dest_need_data');
|
||||
$this->destError = (string) trans('validation.withdrawal_dest_need_data');
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ trait WithdrawalValidation
|
||||
return true;
|
||||
}
|
||||
// todo explain error in log message.
|
||||
$this->destError = (string)trans('validation.withdrawal_dest_bad_data', ['id' => $accountId, 'name' => $accountName]);
|
||||
$this->destError = (string) trans('validation.withdrawal_dest_bad_data', ['id' => $accountId, 'name' => $accountName]);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ trait WithdrawalValidation
|
||||
// the inverse flag reverses the search, searching for everything that is NOT a valid type.
|
||||
$existing = $this->findExistingAccount($validTypes, ['iban' => $accountIban], true);
|
||||
if (null !== $existing) {
|
||||
$this->destError = (string)trans('validation.withdrawal_dest_iban_exists');
|
||||
$this->destError = (string) trans('validation.withdrawal_dest_iban_exists');
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ trait WithdrawalValidation
|
||||
if (null === $accountId && null === $accountName && null === $accountNumber && null === $accountIban && false === $this->canCreateTypes($validTypes)) {
|
||||
// if both values are NULL we return false,
|
||||
// because the source of a withdrawal can't be created.
|
||||
$this->sourceError = (string)trans('validation.withdrawal_source_need_data');
|
||||
$this->sourceError = (string) trans('validation.withdrawal_source_need_data');
|
||||
app('log')->warning('[b] Not a valid source. Need more data.');
|
||||
|
||||
return false;
|
||||
@@ -140,7 +140,7 @@ trait WithdrawalValidation
|
||||
// otherwise try to find the account:
|
||||
$search = $this->findExistingAccount($validTypes, $array);
|
||||
if (null === $search) {
|
||||
$this->sourceError = (string)trans('validation.withdrawal_source_bad_data', ['id' => $accountId, 'name' => $accountName]);
|
||||
$this->sourceError = (string) trans('validation.withdrawal_source_bad_data', ['id' => $accountId, 'name' => $accountName]);
|
||||
app('log')->warning('Not a valid source. Cant find it.', $validTypes);
|
||||
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user