34 if (count($args) == 0) {
38 $args = array_filter($args,
function ($value) {
39 return $value !== null || (is_string($value) && trim($value) ==
'');
42 $returnValue = self::countTrueValues($args);
43 if (is_string($returnValue)) {
46 $argCount = count($args);
48 return ($returnValue > 0) && ($returnValue == $argCount);
75 if (count($args) == 0) {
79 $args = array_filter($args,
function ($value) {
80 return $value !== null || (is_string($value) && trim($value) ==
'');
83 $returnValue = self::countTrueValues($args);
84 if (is_string($returnValue)) {
88 return $returnValue > 0;
117 if (count($args) == 0) {
121 $args = array_filter($args,
function ($value) {
122 return $value !== null || (is_string($value) && trim($value) ==
'');
125 $returnValue = self::countTrueValues($args);
126 if (is_string($returnValue)) {
130 return $returnValue % 2 == 1;
152 public static function NOT($logical =
false)
156 if (is_string($logical)) {
157 $logical = mb_strtoupper($logical,
'UTF-8');
177 foreach ($args as $arg) {
180 $trueValueCount += $arg;
181 } elseif ((is_numeric($arg)) && (!is_string($arg))) {
182 $trueValueCount += ((int) $arg != 0);
183 } elseif (is_string($arg)) {
184 $arg = mb_strtoupper($arg,
'UTF-8');
192 $trueValueCount += ($arg != 0);
196 return $trueValueCount;
static logicalAnd(... $args)
LOGICAL_AND.
static logicalOr(... $args)
LOGICAL_OR.
static logicalXor(... $args)
LOGICAL_XOR.
static flattenArray($array)
Convert a multi-dimensional array to a simple 1-dimensional array.
static getFALSE()
Return the locale-specific translation of FALSE.
static getTRUE()
Return the locale-specific translation of TRUE.
static countTrueValues(array $args)
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.
static NOT($logical=false)
NOT.