mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 11:48:05 +00:00
Fix phpstan things
This commit is contained in:
@@ -99,7 +99,7 @@ class AccountController extends Controller
|
|||||||
/** @var TransactionCurrency $default */
|
/** @var TransactionCurrency $default */
|
||||||
$default = app('amount')->getDefaultCurrency();
|
$default = app('amount')->getDefaultCurrency();
|
||||||
$params = $request->getAll();
|
$params = $request->getAll();
|
||||||
/** @var Collection $preSet */
|
/** @var Collection $accounts */
|
||||||
$accounts = $params['accounts'];
|
$accounts = $params['accounts'];
|
||||||
$chartData = [];
|
$chartData = [];
|
||||||
|
|
||||||
|
@@ -426,20 +426,20 @@ class TransactionJournalFactory
|
|||||||
app('log')->debug('Both accounts exist, simply return them.');
|
app('log')->debug('Both accounts exist, simply return them.');
|
||||||
return [$sourceAccount, $destinationAccount];
|
return [$sourceAccount, $destinationAccount];
|
||||||
}
|
}
|
||||||
if (null !== $sourceAccount && null === $destinationAccount) {
|
if (null === $destinationAccount) { // @phpstan-ignore-line
|
||||||
app('log')->debug('Destination account is NULL, source account is not.');
|
app('log')->debug('Destination account is NULL, source account is not.');
|
||||||
$account = $this->accountRepository->getReconciliation($sourceAccount);
|
$account = $this->accountRepository->getReconciliation($sourceAccount);
|
||||||
app('log')->debug(sprintf('Will return account #%d ("%s") of type "%s"', $account->id, $account->name, $account->accountType->type));
|
app('log')->debug(sprintf('Will return account #%d ("%s") of type "%s"', $account->id, $account->name, $account->accountType->type));
|
||||||
return [$sourceAccount, $account];
|
return [$sourceAccount, $account];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null === $sourceAccount && null !== $destinationAccount) {
|
if (null === $sourceAccount) { // @phpstan-ignore-line
|
||||||
app('log')->debug('Source account is NULL, destination account is not.');
|
app('log')->debug('Source account is NULL, destination account is not.');
|
||||||
$account = $this->accountRepository->getReconciliation($destinationAccount);
|
$account = $this->accountRepository->getReconciliation($destinationAccount);
|
||||||
app('log')->debug(sprintf('Will return account #%d ("%s") of type "%s"', $account->id, $account->name, $account->accountType->type));
|
app('log')->debug(sprintf('Will return account #%d ("%s") of type "%s"', $account->id, $account->name, $account->accountType->type));
|
||||||
return [$account, $destinationAccount];
|
return [$account, $destinationAccount];
|
||||||
}
|
}
|
||||||
app('log')->debug('Unused fallback');
|
app('log')->debug('Unused fallback'); // @phpstan-ignore-line
|
||||||
return [$sourceAccount, $destinationAccount];
|
return [$sourceAccount, $destinationAccount];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -952,8 +952,8 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
break;
|
break;
|
||||||
case '-tag_is':
|
case '-tag_is':
|
||||||
case 'tag_is_not':
|
case 'tag_is_not':
|
||||||
$result = $this->tagRepository->searchTag($value);
|
$result = $this->tagRepository->findByTag($value);
|
||||||
if ($result->count() > 0) {
|
if (null !== $result) {
|
||||||
$this->excludeTags[] = $result->id;
|
$this->excludeTags[] = $result->id;
|
||||||
$this->excludeTags = array_unique($this->excludeTags);
|
$this->excludeTags = array_unique($this->excludeTags);
|
||||||
}
|
}
|
||||||
|
@@ -53,7 +53,7 @@ class SetDestinationToCashAccount implements ActionInterface
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
#[\Override] public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
{
|
{
|
||||||
/** @var User $user */
|
/** @var User $user */
|
||||||
$user = User::find($journal['user_id']);
|
$user = User::find($journal['user_id']);
|
||||||
@@ -91,7 +91,7 @@ class SetDestinationToCashAccount implements ActionInterface
|
|||||||
event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.cannot_find_source_transaction_account')));
|
event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.cannot_find_source_transaction_account')));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (null !== $cashAccount && $cashAccount->id === $source->account_id) {
|
if ($cashAccount->id === $source->account_id) {
|
||||||
app('log')->error(
|
app('log')->error(
|
||||||
sprintf(
|
sprintf(
|
||||||
'New destination account ID #%d and current source account ID #%d are the same. Do nothing.',
|
'New destination account ID #%d and current source account ID #%d are the same. Do nothing.',
|
||||||
|
@@ -52,7 +52,7 @@ class SetSourceToCashAccount implements ActionInterface
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
#[\Override] public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
{
|
{
|
||||||
/** @var User $user */
|
/** @var User $user */
|
||||||
$user = User::find($journal['user_id']);
|
$user = User::find($journal['user_id']);
|
||||||
@@ -90,7 +90,7 @@ class SetSourceToCashAccount implements ActionInterface
|
|||||||
event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.cannot_find_destination_transaction_account')));
|
event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.cannot_find_destination_transaction_account')));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (null !== $cashAccount && $cashAccount->id === $destination->account_id) {
|
if ($cashAccount->id === $destination->account_id) {
|
||||||
app('log')->error(
|
app('log')->error(
|
||||||
sprintf(
|
sprintf(
|
||||||
'New source account ID #%d and current destination account ID #%d are the same. Do nothing.',
|
'New source account ID #%d and current destination account ID #%d are the same. Do nothing.',
|
||||||
|
Reference in New Issue
Block a user