mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Code cleanup
This commit is contained in:
@@ -50,9 +50,6 @@ class RuleRepository implements RuleRepositoryInterface
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws \Exception
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function destroy(Rule $rule): bool
|
||||
{
|
||||
@@ -99,7 +96,7 @@ class RuleRepository implements RuleRepositoryInterface
|
||||
*/
|
||||
public function getHighestOrderInRuleGroup(RuleGroup $ruleGroup): int
|
||||
{
|
||||
return intval($ruleGroup->rules()->max('order'));
|
||||
return (int)$ruleGroup->rules()->max('order');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -261,7 +258,7 @@ class RuleRepository implements RuleRepositoryInterface
|
||||
$rule->rule_group_id = $data['rule_group_id'];
|
||||
$rule->order = ($order + 1);
|
||||
$rule->active = 1;
|
||||
$rule->stop_processing = 1 === intval($data['stop_processing']);
|
||||
$rule->stop_processing = 1 === (int)$data['stop_processing'];
|
||||
$rule->title = $data['title'];
|
||||
$rule->description = strlen($data['description']) > 0 ? $data['description'] : null;
|
||||
|
||||
@@ -290,7 +287,7 @@ class RuleRepository implements RuleRepositoryInterface
|
||||
$ruleAction->active = 1;
|
||||
$ruleAction->stop_processing = $values['stopProcessing'];
|
||||
$ruleAction->action_type = $values['action'];
|
||||
$ruleAction->action_value = null === $values['value'] ? '' : $values['value'];
|
||||
$ruleAction->action_value = $values['value'] ?? '';
|
||||
$ruleAction->save();
|
||||
|
||||
return $ruleAction;
|
||||
@@ -310,7 +307,7 @@ class RuleRepository implements RuleRepositoryInterface
|
||||
$ruleTrigger->active = 1;
|
||||
$ruleTrigger->stop_processing = $values['stopProcessing'];
|
||||
$ruleTrigger->trigger_type = $values['action'];
|
||||
$ruleTrigger->trigger_value = null === $values['value'] ? '' : $values['value'];
|
||||
$ruleTrigger->trigger_value = $values['value'] ?? '';
|
||||
$ruleTrigger->save();
|
||||
|
||||
return $ruleTrigger;
|
||||
|
Reference in New Issue
Block a user