Various PSR12 code cleanup

This commit is contained in:
James Cole
2022-12-29 19:42:26 +01:00
parent dbf3e76ecc
commit 6cfdc58cb1
415 changed files with 7462 additions and 6874 deletions

View File

@@ -1,4 +1,5 @@
<?php
/**
* LinkToBill.php
* Copyright (c) 2019 james@firefly-iii.org
@@ -43,7 +44,7 @@ class LinkToBill implements ActionInterface
*
* @codeCoverageIgnore
*
* @param RuleAction $action
* @param RuleAction $action
*/
public function __construct(RuleAction $action)
{
@@ -59,14 +60,20 @@ class LinkToBill implements ActionInterface
/** @var BillRepositoryInterface $repository */
$repository = app(BillRepositoryInterface::class);
$repository->setUser($user);
$billName = (string) $this->action->action_value;
$billName = (string)$this->action->action_value;
$bill = $repository->findByName($billName);
if (null !== $bill && $journal['transaction_type_type'] === TransactionType::WITHDRAWAL) {
$count = DB::table('transaction_journals')->where('id', '=', $journal['transaction_journal_id'])
->where('bill_id', $bill->id)->count();
if (0 !== $count) {
Log::error(sprintf('RuleAction LinkToBill could not set the bill of journal #%d to bill "%s": already set.', $journal['transaction_journal_id'], $billName));
Log::error(
sprintf(
'RuleAction LinkToBill could not set the bill of journal #%d to bill "%s": already set.',
$journal['transaction_journal_id'],
$billName
)
);
return false;
}