mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
chore: code cleanup.
This commit is contained in:
@@ -33,6 +33,13 @@ use Illuminate\Support\Facades\Log;
|
||||
*/
|
||||
trait OBValidation
|
||||
{
|
||||
/**
|
||||
* @param array $accountTypes
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract protected function canCreateTypes(array $accountTypes): bool;
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
*
|
||||
@@ -71,7 +78,7 @@ trait OBValidation
|
||||
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('validateOBDestination(%d, "%s") will return %s', $accountId, $accountName, var_export($result, true)));
|
||||
@@ -79,13 +86,6 @@ trait OBValidation
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $accountTypes
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract protected function canCreateTypes(array $accountTypes): bool;
|
||||
|
||||
/**
|
||||
* Source of an opening balance can either be an asset account
|
||||
* or an "initial balance account". The latter can be created.
|
||||
@@ -128,7 +128,7 @@ trait OBValidation
|
||||
if (null !== $search && in_array($search->accountType->type, $validTypes, true)) {
|
||||
Log::debug(sprintf('Found account of correct type: #%d, "%s"', $search->id, $search->name));
|
||||
$this->setSource($search);
|
||||
$result = true;
|
||||
$result = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user