Commit f67ef5e7 authored by Ad Schellevis's avatar Ad Schellevis

(mvc) some style fixes in ApiMutableModelControllerBase.php from...

(mvc) some style fixes in ApiMutableModelControllerBase.php from https://github.com/opnsense/core/pull/1134
parent e14a6b7e
...@@ -164,7 +164,6 @@ abstract class ApiMutableModelControllerBase extends ApiControllerBase ...@@ -164,7 +164,6 @@ abstract class ApiMutableModelControllerBase extends ApiControllerBase
* setAction is called. This hook is called after a model has been * setAction is called. This hook is called after a model has been
* constructed and validated but before it serialized to the configuration * constructed and validated but before it serialized to the configuration
* and written to disk * and written to disk
* @param $mdl The validated model containing the new state of the model
* @return Error message on error, or null/void on success * @return Error message on error, or null/void on success
*/ */
protected function setActionHook() protected function setActionHook()
...@@ -184,9 +183,9 @@ abstract class ApiMutableModelControllerBase extends ApiControllerBase ...@@ -184,9 +183,9 @@ abstract class ApiMutableModelControllerBase extends ApiControllerBase
$mdl->setNodes($this->request->getPost(static::$internalModelName)); $mdl->setNodes($this->request->getPost(static::$internalModelName));
$result = $this->validate(); $result = $this->validate();
if (empty($result['result'])) { if (empty($result['result'])) {
$errorMessage = $this->setActionHook(); $hookErrorMessage = $this->setActionHook();
if (!empty($errorMessage)) { if (!empty($hookErrorMessage)) {
$result['error'] = $errorMessage; $result['error'] = $hookErrorMessage;
} else { } else {
return $this->save(); return $this->save();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment