src/BoolOr.php
public static function val($value1, $value2, $_ = null)
    {
        if (!static::is($value1) || !static::is($value2)) {
            throw new \InvalidArgumentException("All parameters must be of type bool.");
        }

        $ret = ($value1 || $value2);
        $args = array_slice(func_get_args(), 2);
        while (!$ret && ($bool = array_shift($args)) !== null) {
            if (!static::is($bool)) {
                throw new \InvalidArgumentException("All parameters must be of type bool.");
            }

            $ret = ($ret || $bool);
        }

        return $ret;
    }
public static function val($value1, $value2, $_ = null)
    {
        if (!static::is($value1) || !static::is($value2)) {
            throw new \InvalidArgumentException("All parameters must be of type bool.");
        }

        $ret = ($value1 || $value2);
        $args = array_slice(func_get_args(), 2);
        while (!$ret && ($bool = array_shift($args)) !== null) {
            if (!static::is($bool)) {
                throw new \InvalidArgumentException("All parameters must be of type bool.");
            }

            $ret = ($ret || $bool);
        }

        return $ret;
    }
public static function val ( $ value1 , $ value2 , $ _ = null ) { if ( ! static :: is ( $ value1 ) || ! static :: is ( $ value2 ) ) { throw new \ InvalidArgumentException ( "All parameters must be of type bool." ) ; } $ ret = ( $ value1 || $ value2 ) ; $ args = array_slice ( func_get_args ( ) , 2 ) ; while ( ! $ ret && ( $ bool = array_shift ( $ args ) ) !== null ) { if ( ! static :: is ( $ bool ) ) { throw new \ InvalidArgumentException ( "All parameters must be of type bool." ) ; } $ ret = ( $ ret || $ bool ) ; } return $ ret ; }
Applies the OR operation to the given values.

The function is optimized to return early (if a true is found the function returns true immediately),
therefore we can't assume that all values had been tested for validity.

@param bool $value1 The left operand to apply the operation to.
@param bool $value2 The right operand to apply the operation to.
@param null $_      More values to apply the operation in cascade.

@return bool The result of applying the operation to the given values.
@throws \InvalidArgumentException
@SuppressWarnings(PHPMD.CamelCaseParameterName)
@SuppressWarnings(PHPMD.ShortVariable)
@SuppressWarnings(PHPMD.UnusedFormalParameter)
Applies the OR operation to the given values .