final protected function parseConditionalLogic($condition)
    {
        if ($condition === null) {
            return null;
        }

        if (is_bool($condition)) {
            return $condition;
        }

        $not = false;
        if (is_string($condition)) {
            $not = ($condition[0] === '!');
            if ($not) {
                $condition = ltrim($condition, '!');
            }
        }

        $result = $this->resolveConditionalLogic($condition);

        return (($not === true) ? !$result : $result);
    }