mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 12:11:19 +00:00
Code cleanup.
This commit is contained in:
@@ -29,16 +29,9 @@ use FireflyIII\Models\RuleAction;
|
||||
|
||||
/**
|
||||
* Trait BillServiceTrait
|
||||
*
|
||||
|
||||
*/
|
||||
trait BillServiceTrait
|
||||
{
|
||||
/**
|
||||
* @param Bill $bill
|
||||
* @param string $oldName
|
||||
* @param string $newName
|
||||
*/
|
||||
public function updateBillActions(Bill $bill, string $oldName, string $newName): void
|
||||
{
|
||||
if ($oldName === $newName) {
|
||||
@@ -46,8 +39,9 @@ trait BillServiceTrait
|
||||
}
|
||||
$ruleIds = $bill->user->rules()->get(['id'])->pluck('id')->toArray();
|
||||
$set = RuleAction::whereIn('rule_id', $ruleIds)
|
||||
->where('action_type', 'link_to_bill')
|
||||
->where('action_value', $oldName)->get();
|
||||
->where('action_type', 'link_to_bill')
|
||||
->where('action_value', $oldName)->get()
|
||||
;
|
||||
|
||||
/** @var RuleAction $ruleAction */
|
||||
foreach ($set as $ruleAction) {
|
||||
@@ -57,12 +51,6 @@ trait BillServiceTrait
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Bill $bill
|
||||
* @param string $note
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function updateNote(Bill $bill, string $note): bool
|
||||
{
|
||||
if ('' === $note) {
|
||||
|
Reference in New Issue
Block a user