From: Hypolite Petovan Date: Mon, 17 Oct 2016 20:53:37 +0000 (-0400) Subject: Enforce coding standards in Config.php and PConfig.php X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c168d7d4cafe56178beb15de93dc3b0764b2b5b9;p=friendica.git Enforce coding standards in Config.php and PConfig.php --- diff --git a/include/Core/Config.php b/include/Core/Config.php index a93f188148..bc2bc1fad7 100644 --- a/include/Core/Config.php +++ b/include/Core/Config.php @@ -70,7 +70,7 @@ class Config { * If true the config is loaded from the db and not from the cache (default: false) * @return mixed Stored value or null if it does not exist */ - public static function get($family, $key, $default_value=null, $refresh = false) { + public static function get($family, $key, $default_value = null, $refresh = false) { global $a; @@ -123,14 +123,14 @@ class Config { * The value to store * @return mixed Stored $value or false if the database update failed */ - public static function set($family,$key,$value) { + public static function set($family, $key, $value) { global $a; $a->config[$family][$key] = $value; // manage array value - $dbvalue = (is_array($value)?serialize($value):$value); - $dbvalue = (is_bool($dbvalue) ? intval($dbvalue) : $dbvalue); + $dbvalue = is_array($value) ? serialize($value) : $value; + $dbvalue = is_bool($dbvalue) ? intval($dbvalue) : $dbvalue; $ret = q("INSERT INTO `config` ( `cat`, `k`, `v` ) VALUES ( '%s', '%s', '%s' ) ON DUPLICATE KEY UPDATE `v` = '%s'", @@ -139,8 +139,9 @@ ON DUPLICATE KEY UPDATE `v` = '%s'", dbesc($dbvalue), dbesc($dbvalue) ); - if($ret) + if ($ret) { return $value; + } return $ret; } diff --git a/include/Core/PConfig.php b/include/Core/PConfig.php index de8994d1de..c6821a2667 100644 --- a/include/Core/PConfig.php +++ b/include/Core/PConfig.php @@ -119,7 +119,7 @@ class PConfig { * The value to store * @return mixed Stored $value or false */ - public static function set($uid,$family,$key,$value) { + public static function set($uid, $family, $key, $value) { global $a; @@ -136,8 +136,9 @@ ON DUPLICATE KEY UPDATE `v` = '%s'", dbesc($dbvalue), dbesc($dbvalue) ); - if($ret) + if ($ret) { return $value; + } return $ret; }