Cleanup reverse boolean expressions
[civicrm-core.git] / CRM / Utils / Rule.php
index cbe4ed8f8291617583981eebf006b776a14a457f..81b0de6d673349d24ed6f989bbb55ca521a541dc 100644 (file)
@@ -449,7 +449,7 @@ class CRM_Utils_Rule {
    */
   public static function positiveInteger($value) {
     if (is_int($value)) {
-      return ($value < 0) ? FALSE : TRUE;
+      return !($value < 0);
     }
 
     // CRM-13460
@@ -458,11 +458,7 @@ class CRM_Utils_Rule {
       return FALSE;
     }
 
-    if (preg_match('/^\d+$/', $value)) {
-      return TRUE;
-    }
-
-    return FALSE;
+    return (bool) preg_match('/^\d+$/', $value);
   }
 
   /**