mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Various PSR12 code cleanup
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user