diff --git a/include/class_Combinations.inc b/include/class_Combinations.inc index d0ef2ac59839c0074c3adeb860d36b93d3e8d782..2821f6df5717e39ad4d3ff69feb0ae1f30de5da4 100644 --- a/include/class_Combinations.inc +++ b/include/class_Combinations.inc @@ -28,7 +28,7 @@ class Combinations implements Iterator protected $size = 0; protected $pos = 0; - function __construct($input, $size) + function __construct(array $input, $size) { $this->input = array_values($input); $this->n = count($this->input); diff --git a/include/class_ldap.inc b/include/class_ldap.inc index a3cdde57fedbb0ec47ac77a3b161bbf4e9121ece..8f3dbfc1a243b6de2496f593337516ea0618b1f6 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -673,9 +673,9 @@ class LDAP /*! * \brief Modify a entry of the directory LDAP * - * \param string $attrs The new entry + * \param array $attrs The new entry */ - function modify($attrs) + function modify(array $attrs) { if (count($attrs) == 0) { return 0; diff --git a/include/class_msgPool.inc b/include/class_msgPool.inc index d98e1a5b64ed0c32aa84ab7ebfed5c0ad9f30d45..75b56b8ab18f4a049d8df1b21983668fefd1778e 100644 --- a/include/class_msgPool.inc +++ b/include/class_msgPool.inc @@ -577,24 +577,15 @@ class msgPool { * * \param array $depends Contains all the settings enabled */ - public static function featuresEnabled($name, $depends = "") + public static function featuresEnabled($name, $depends = '') { - if (($depends == "") || (is_array($depends) && count($depends) == 0)) { + if (($depends == "") || (is_array($depends) && (count($depends) == 0))) { return sprintf(_("This account has %s settings enabled. You can disable them by clicking below."), $name); } else { - if (count($depends) == 1) { - if (is_array($depends)) { - $depends = $depends[0]; - } - return sprintf(_("This account has %s settings enabled. To disable them, you'll need to remove the %s settings first!"), $name, $depends); - } else { - $deps = ""; - foreach ($depends as $dep) { - $deps .= "$dep / "; - } - $deps = preg_replace("/ \/ $/", "", $deps); - return sprintf(_("This account has %s settings enabled. To disable them, you'll need to remove the %s settings first!"), $name, $deps); + if (is_array($depends)) { + $depends = implode(' / ', $depends); } + return sprintf(_("This account has %s settings enabled. To disable them, you'll need to remove the %s settings first!"), $name, $depends); } } diff --git a/include/class_objects.inc b/include/class_objects.inc index e93415b0c1c8fb67264ec90cf9c60360b3f3defa..d4646291a994806593eb87bef909549befb7e545 100644 --- a/include/class_objects.inc +++ b/include/class_objects.inc @@ -75,8 +75,7 @@ class objects $attrs = array_unique($attrs); if (count($attrs) == 1) { $attrs = $attrs[0]; - } - if (count($attrs) == 0) { + } elseif (count($attrs) == 0) { $attrs = array('dn' => 'raw'); } } elseif ($checkAcl) { diff --git a/include/functions.inc b/include/functions.inc index 8d0656e191d6957bc8889ddb8abbfa3d5e7b4016..757762ae60e8c03d872d3072eaa5168c756d4c67 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -714,7 +714,7 @@ function get_locks($objects, $allow_readonly = FALSE) { global $config; - if (is_array($objects) && count($objects == 1)) { + if (is_array($objects) && (count($objects) == 1)) { $objects = reset($objects); } if (is_array($objects)) { diff --git a/include/simpleplugin/class_simplePlugin.inc b/include/simpleplugin/class_simplePlugin.inc index a302778aa8b0ab6a6d06c1dc6a7a36b19be78114..26e204eefa892cc2d8b7475ed63716f81f083ecf 100644 --- a/include/simpleplugin/class_simplePlugin.inc +++ b/include/simpleplugin/class_simplePlugin.inc @@ -1157,7 +1157,7 @@ class simplePlugin /* Convert arrays with one element to non arrays, if the saved attributes are no array, too */ if (is_array($this->attrs[$index]) && - count ($this->attrs[$index]) == 1 && + (count($this->attrs[$index]) == 1) && isset($this->saved_attributes[$index]) && !is_array($this->saved_attributes[$index])) { $this->attrs[$index] = $this->attrs[$index][0]; @@ -1165,7 +1165,7 @@ class simplePlugin /* Remove emtpy arrays if they do not differ */ if (is_array($this->attrs[$index]) && - count($this->attrs[$index]) == 0 && + (count($this->attrs[$index]) == 0) && !isset($this->saved_attributes[$index])) { unset ($this->attrs[$index]); continue; @@ -1175,7 +1175,7 @@ class simplePlugin if (!is_array($this->attrs[$index]) && isset($this->saved_attributes[$index]) && !is_array($this->saved_attributes[$index]) && - $this->attrs[$index] == $this->saved_attributes[$index]) { + ($this->attrs[$index] == $this->saved_attributes[$index])) { unset ($this->attrs[$index]); continue; }