Make request code more uniform.

This commit is contained in:
James Cole
2017-01-21 08:32:23 +01:00
parent d1d573c408
commit 71f6ba3418
15 changed files with 172 additions and 129 deletions

View File

@@ -38,17 +38,17 @@ class RuleFormRequest extends Request
public function getRuleData(): array
{
return [
'title' => $this->getFieldOrEmptyString('title'),
'active' => intval($this->get('active')) == 1,
'trigger' => $this->getFieldOrEmptyString('trigger'),
'description' => $this->getFieldOrEmptyString('description'),
'title' => $this->string('title'),
'active' => $this->boolean('active'),
'trigger' => $this->string('trigger'),
'description' => $this->string('description'),
'rule-triggers' => $this->get('rule-trigger'),
'rule-trigger-values' => $this->get('rule-trigger-value'),
'rule-trigger-stop' => $this->get('rule-trigger-stop'),
'rule-actions' => $this->get('rule-action'),
'rule-action-values' => $this->get('rule-action-value'),
'rule-action-stop' => $this->get('rule-action-stop'),
'stop_processing' => intval($this->get('stop_processing')) === 1,
'stop_processing' => $this->boolean('stop_processing'),
];
}