mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Code cleanup
This commit is contained in:
@@ -64,7 +64,7 @@ class RuleTransformer extends AbstractTransformer
|
||||
'id' => (string)$rule->id,
|
||||
'created_at' => $rule->created_at->toAtomString(),
|
||||
'updated_at' => $rule->updated_at->toAtomString(),
|
||||
'rule_group_id' => (string) $rule->rule_group_id,
|
||||
'rule_group_id' => (string)$rule->rule_group_id,
|
||||
'title' => $rule->title,
|
||||
'description' => $rule->description,
|
||||
'order' => (int)$rule->order,
|
||||
@@ -83,32 +83,6 @@ class RuleTransformer extends AbstractTransformer
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Rule $rule
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function actions(Rule $rule): array
|
||||
{
|
||||
$result = [];
|
||||
$actions = $this->ruleRepository->getRuleActions($rule);
|
||||
/** @var RuleAction $ruleAction */
|
||||
foreach ($actions as $ruleAction) {
|
||||
$result[] = [
|
||||
'id' => (string)$ruleAction->id,
|
||||
'created_at' => $ruleAction->created_at->toAtomString(),
|
||||
'updated_at' => $ruleAction->updated_at->toAtomString(),
|
||||
'type' => $ruleAction->action_type,
|
||||
'value' => $ruleAction->action_value,
|
||||
'order' => $ruleAction->order,
|
||||
'active' => $ruleAction->active,
|
||||
'stop_processing' => $ruleAction->stop_processing,
|
||||
];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Rule $rule
|
||||
*
|
||||
@@ -160,4 +134,30 @@ class RuleTransformer extends AbstractTransformer
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Rule $rule
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function actions(Rule $rule): array
|
||||
{
|
||||
$result = [];
|
||||
$actions = $this->ruleRepository->getRuleActions($rule);
|
||||
/** @var RuleAction $ruleAction */
|
||||
foreach ($actions as $ruleAction) {
|
||||
$result[] = [
|
||||
'id' => (string)$ruleAction->id,
|
||||
'created_at' => $ruleAction->created_at->toAtomString(),
|
||||
'updated_at' => $ruleAction->updated_at->toAtomString(),
|
||||
'type' => $ruleAction->action_type,
|
||||
'value' => $ruleAction->action_value,
|
||||
'order' => $ruleAction->order,
|
||||
'active' => $ruleAction->active,
|
||||
'stop_processing' => $ruleAction->stop_processing,
|
||||
];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user