Remove static references

This commit is contained in:
James Cole
2023-10-29 06:33:43 +01:00
parent 075d459b7c
commit 4f2159b54d
205 changed files with 1287 additions and 1287 deletions

View File

@@ -44,7 +44,7 @@ trait DepositValidation
$accountName = array_key_exists('name', $array) ? $array['name'] : null;
$accountIban = array_key_exists('iban', $array) ? $array['iban'] : null;
Log::debug('Now in validateDepositDestination', $array);
app('log')->debug('Now in validateDepositDestination', $array);
// source can be any of the following types.
$validTypes = $this->combinations[$this->transactionType][$this->source->accountType->type] ?? [];
@@ -57,7 +57,7 @@ trait DepositValidation
}
// if the account can be created anyway we don't need to search.
if (null === $result && true === $this->canCreateTypes($validTypes)) {
Log::debug('Can create some of these types, so return true.');
app('log')->debug('Can create some of these types, so return true.');
$result = true;
}
@@ -65,17 +65,17 @@ trait DepositValidation
// otherwise try to find the account:
$search = $this->findExistingAccount($validTypes, $array);
if (null === $search) {
Log::debug('findExistingAccount() returned NULL, so the result is false.');
app('log')->debug('findExistingAccount() returned NULL, so the result is false.');
$this->destError = (string)trans('validation.deposit_dest_bad_data', ['id' => $accountId, 'name' => $accountName]);
$result = false;
}
if (null !== $search) {
Log::debug(sprintf('findExistingAccount() returned #%d ("%s"), so the result is true.', $search->id, $search->name));
app('log')->debug(sprintf('findExistingAccount() returned #%d ("%s"), so the result is true.', $search->id, $search->name));
$this->setDestination($search);
$result = true;
}
}
Log::debug(sprintf('validateDepositDestination will return %s', var_export($result, true)));
app('log')->debug(sprintf('validateDepositDestination will return %s', var_export($result, true)));
return $result;
}
@@ -106,7 +106,7 @@ trait DepositValidation
$accountName = array_key_exists('name', $array) ? $array['name'] : null;
$accountIban = array_key_exists('iban', $array) ? $array['iban'] : null;
$accountNumber = array_key_exists('number', $array) ? $array['number'] : null;
Log::debug('Now in validateDepositSource', $array);
app('log')->debug('Now in validateDepositSource', $array);
// null = we found nothing at all or didn't even search
// false = invalid results
@@ -141,11 +141,11 @@ trait DepositValidation
if (null !== $accountId) {
$search = $this->getRepository()->find($accountId);
if (null !== $search && !in_array($search->accountType->type, $validTypes, true)) {
Log::debug(sprintf('User submitted an ID (#%d), which is a "%s", so this is not a valid source.', $accountId, $search->accountType->type));
Log::debug(sprintf('Firefly III accepts ID #%d as valid account data.', $accountId));
app('log')->debug(sprintf('User submitted an ID (#%d), which is a "%s", so this is not a valid source.', $accountId, $search->accountType->type));
app('log')->debug(sprintf('Firefly III accepts ID #%d as valid account data.', $accountId));
}
if (null !== $search && in_array($search->accountType->type, $validTypes, true)) {
Log::debug('ID result is not null and seems valid, save as source account.');
app('log')->debug('ID result is not null and seems valid, save as source account.');
$this->setSource($search);
$result = true;
}
@@ -155,11 +155,11 @@ trait DepositValidation
if (null !== $accountIban) {
$search = $this->getRepository()->findByIbanNull($accountIban, $validTypes);
if (null !== $search && !in_array($search->accountType->type, $validTypes, true)) {
Log::debug(sprintf('User submitted IBAN ("%s"), which is a "%s", so this is not a valid source.', $accountIban, $search->accountType->type));
app('log')->debug(sprintf('User submitted IBAN ("%s"), which is a "%s", so this is not a valid source.', $accountIban, $search->accountType->type));
$result = false;
}
if (null !== $search && in_array($search->accountType->type, $validTypes, true)) {
Log::debug('IBAN result is not null and seems valid, save as source account.');
app('log')->debug('IBAN result is not null and seems valid, save as source account.');
$this->setSource($search);
$result = true;
}
@@ -169,13 +169,13 @@ trait DepositValidation
if (null !== $accountNumber && '' !== $accountNumber) {
$search = $this->getRepository()->findByAccountNumber($accountNumber, $validTypes);
if (null !== $search && !in_array($search->accountType->type, $validTypes, true)) {
Log::debug(
app('log')->debug(
sprintf('User submitted number ("%s"), which is a "%s", so this is not a valid source.', $accountNumber, $search->accountType->type)
);
$result = false;
}
if (null !== $search && in_array($search->accountType->type, $validTypes, true)) {
Log::debug('Number result is not null and seems valid, save as source account.');
app('log')->debug('Number result is not null and seems valid, save as source account.');
$this->setSource($search);
$result = true;
}