Commit 7ee453c1 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

🚑 fix(simpleplugin) Limit Cognitive Complexity

Should fix Sonar warning

issue #5817
parent bca8a84a
......@@ -1816,10 +1816,9 @@ class simplePlugin
/* Build DN with multiple attributes */
$usableAttributes = array();
foreach ($this->attributes as $attr) {
if (($attr == $attribute) || ($this->$attr == '') || is_array($this->$attr)) {
continue;
if (($attr != $attribute) && is_string($this->$attr) && ($this->$attr != '')) {
$usableAttributes[] = $attr;
}
$usableAttributes[] = $attr;
}
for ($i = 2; $i < count($usableAttributes); $i++) {
foreach (new Combinations($usableAttributes, $i) as $attrs) {
......
Supports Markdown
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