(mvc) some style fixes in ApiMutableModelControllerBase.php from https://github.com/opnsense/core/pull/1134

This commit is contained in:
Ad Schellevis 2016-10-22 14:41:10 +02:00
parent e14a6b7e57
commit f67ef5e787

View File

@ -164,7 +164,6 @@ abstract class ApiMutableModelControllerBase extends ApiControllerBase
* setAction is called. This hook is called after a model has been
* constructed and validated but before it serialized to the configuration
* 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
*/
protected function setActionHook()
@ -184,9 +183,9 @@ abstract class ApiMutableModelControllerBase extends ApiControllerBase
$mdl->setNodes($this->request->getPost(static::$internalModelName));
$result = $this->validate();
if (empty($result['result'])) {
$errorMessage = $this->setActionHook();
if (!empty($errorMessage)) {
$result['error'] = $errorMessage;
$hookErrorMessage = $this->setActionHook();
if (!empty($hookErrorMessage)) {
$result['error'] = $hookErrorMessage;
} else {
return $this->save();
}