mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-19 10:53:31 +00:00
chore: reformat code.
This commit is contained in:
@@ -50,7 +50,7 @@ class RuleTransformer extends AbstractTransformer
|
||||
/**
|
||||
* Transform the rule.
|
||||
*
|
||||
* @param Rule $rule
|
||||
* @param Rule $rule
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
@@ -77,40 +77,14 @@ class RuleTransformer extends AbstractTransformer
|
||||
'links' => [
|
||||
[
|
||||
'rel' => 'self',
|
||||
'uri' => '/rules/'.$rule->id,
|
||||
'uri' => '/rules/' . $rule->id,
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
* @param Rule $rule
|
||||
*
|
||||
* @return string
|
||||
* @throws FireflyException
|
||||
@@ -133,7 +107,7 @@ class RuleTransformer extends AbstractTransformer
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Rule $rule
|
||||
* @param Rule $rule
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@@ -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