From 3927a74d6b7089b398218ec8d3d41e8a13baf455 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 5 Jun 2019 16:30:22 +0200 Subject: [PATCH] fix scrunitizer --- htdocs/core/class/cstate.class.php | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/htdocs/core/class/cstate.class.php b/htdocs/core/class/cstate.class.php index 2487d87137f..3278eb037f9 100644 --- a/htdocs/core/class/cstate.class.php +++ b/htdocs/core/class/cstate.class.php @@ -247,25 +247,20 @@ class Cstate // extends CommonObject // } //} - // Commit or rollback - if ($error) - { - foreach($this->errors as $errmsg) - { - dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); - $this->error.=($this->error?', '.$errmsg:$errmsg); - } - $this->db->rollback(); - return -1*$error; - } - else - { - $this->db->commit(); - return 1; - } + // Commit or rollback + if ($error) { + foreach ($this->errors as $errmsg) { + dol_syslog(get_class($this) . "::update " . $errmsg, LOG_ERR); + $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); + } + $this->db->rollback(); + return -1 * $error; + } else { + $this->db->commit(); + return 1; + } } - /** * Delete object in database *