chore: code cleanup.

This commit is contained in:
James Cole
2023-05-29 13:56:55 +02:00
parent 7f7644c92f
commit 1b52147a05
295 changed files with 12418 additions and 12324 deletions

View File

@@ -32,6 +32,21 @@ use Illuminate\Support\Facades\Log;
*/
trait DepositValidation
{
/**
* @param array $accountTypes
*
* @return bool
*/
abstract protected function canCreateTypes(array $accountTypes): bool;
/**
* @param array $validTypes
* @param array $data
*
* @return Account|null
*/
abstract protected function findExistingAccount(array $validTypes, array $data): ?Account;
/**
* @param array $array
*
@@ -71,7 +86,7 @@ trait DepositValidation
if (null !== $search) {
Log::debug(sprintf('findExistingAccount() returned #%d ("%s"), so the result is true.', $search->id, $search->name));
$this->setDestination($search);
$result = true;
$result = true;
}
}
Log::debug(sprintf('validateDepositDestination will return %s', var_export($result, true)));
@@ -79,21 +94,6 @@ trait DepositValidation
return $result;
}
/**
* @param array $accountTypes
*
* @return bool
*/
abstract protected function canCreateTypes(array $accountTypes): bool;
/**
* @param array $validTypes
* @param array $data
*
* @return Account|null
*/
abstract protected function findExistingAccount(array $validTypes, array $data): ?Account;
/**
* @param array $array
*
@@ -132,7 +132,7 @@ trait DepositValidation
if (null !== $search && in_array($search->accountType->type, $validTypes, true)) {
Log::debug('ID result is not null and seems valid, save as source account.');
$this->setSource($search);
$result = true;
$result = true;
}
}
@@ -146,7 +146,7 @@ trait DepositValidation
if (null !== $search && in_array($search->accountType->type, $validTypes, true)) {
Log::debug('IBAN result is not null and seems valid, save as source account.');
$this->setSource($search);
$result = true;
$result = true;
}
}
@@ -162,7 +162,7 @@ trait DepositValidation
if (null !== $search && in_array($search->accountType->type, $validTypes, true)) {
Log::debug('Number result is not null and seems valid, save as source account.');
$this->setSource($search);
$result = true;
$result = true;
}
}