Code cleanup before release.

This commit is contained in:
James Cole
2018-03-29 19:01:47 +02:00
parent 40266c6821
commit 170d23d768
76 changed files with 181 additions and 171 deletions

View File

@@ -185,13 +185,13 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface
$order = $ruleGroup->order;
// find the rule with order+1 and give it order-1
$other = $this->user->ruleGroups()->where('order', ($order + 1))->first();
$other = $this->user->ruleGroups()->where('order', $order + 1)->first();
if ($other) {
$other->order = ($other->order - 1);
--$other->order;
$other->save();
}
$ruleGroup->order = ($ruleGroup->order + 1);
++$ruleGroup->order;
$ruleGroup->save();
$this->resetRuleGroupOrder();
@@ -208,13 +208,13 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface
$order = $ruleGroup->order;
// find the rule with order-1 and give it order+1
$other = $this->user->ruleGroups()->where('order', ($order - 1))->first();
$other = $this->user->ruleGroups()->where('order', $order - 1)->first();
if ($other) {
$other->order = ($other->order + 1);
++$other->order;
$other->save();
}
$ruleGroup->order = ($ruleGroup->order - 1);
--$ruleGroup->order;
$ruleGroup->save();
$this->resetRuleGroupOrder();
@@ -286,7 +286,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface
'user_id' => $this->user->id,
'title' => $data['title'],
'description' => $data['description'],
'order' => ($order + 1),
'order' => $order + 1,
'active' => 1,
]
);