protected static function evaluateCondition($condition)
    {
        if (is_string($condition)) {
            // Should be extended for functions, extensions???
            return self::safeClassExists($condition);
        }
        if (is_callable($condition)) {
            return (bool) $condition();
        }
        if (is_bool($condition)) {
            return $condition;
        }
        if (is_array($condition)) {
            foreach ($condition as $c) {
                if (false === static::evaluateCondition($c)) {
                    // Immediately stop execution if the condition is false
                    return false;
                }
            }

            return true;
        }

        return false;
    }
protected static function evaluateCondition($condition)
    {
        if (is_string($condition)) {
            // Should be extended for functions, extensions???
            return self::safeClassExists($condition);
        }
        if (is_callable($condition)) {
            return (bool) $condition();
        }
        if (is_bool($condition)) {
            return $condition;
        }
        if (is_array($condition)) {
            foreach ($condition as $c) {
                if (false === static::evaluateCondition($c)) {
                    // Immediately stop execution if the condition is false
                    return false;
                }
            }

            return true;
        }

        return false;
    }
protected static function evaluateCondition ( $ condition ) { if ( is_string ( $ condition ) ) { // Should be extended for functions, extensions??? return self :: safeClassExists ( $ condition ) ; } if ( is_callable ( $ condition ) ) { return ( bool ) $ condition ( ) ; } if ( is_bool ( $ condition ) ) { return $ condition ; } if ( is_array ( $ condition ) ) { foreach ( $ condition as $ c ) { if ( false === static :: evaluateCondition ( $ c ) ) { // Immediately stop execution if the condition is false return false ; } } return true ; } return false ; }
Evaluates conditions to boolean.

@param mixed $condition

@return bool
Evaluates conditions to boolean .