[TASK] Add comments to Condition::applies
authorOliver Eglseder <oliver.eglseder@in2code.de>
Tue, 8 Sep 2015 14:30:48 +0000 (16:30 +0200)
committerOliver Eglseder <oliver.eglseder@in2code.de>
Tue, 8 Sep 2015 14:30:48 +0000 (16:30 +0200)
Classes/Domain/Model/Condition.php

index bba5c70..c5957c9 100644 (file)
@@ -238,15 +238,18 @@ class Condition extends AbstractEntity {
                foreach ($this->rules as $rule) {
                        if ($rule->applies($form)) {
                                if ($isOr === TRUE) {
-                                       // if it is
-                                       // the first matching rule in an OR conjunction return TRUE
+
+                                       // if it is the first matching rule in an OR conjunction return TRUE
                                        return TRUE;
                                }
                        } elseif ($isOr === FALSE) {
+
                                // if it is the first NOT matching rule in an AND conjunction return FALSE
                                return FALSE;
                        }
                }
+               // if OR and no field matched return TRUE
+               // if AND and no field matched NOT return FALSE
                return ($isOr !== TRUE);
        }