JmesPath\TreeInterpreter::relativeCmp PHP Method

relativeCmp() private static method

private static relativeCmp ( $left, $right, $cmp ) : boolean
return boolean
    private static function relativeCmp($left, $right, $cmp)
    {
        if (!(is_int($left) || is_float($left)) || !(is_int($right) || is_float($right))) {
            return false;
        }
        switch ($cmp) {
            case '>':
                return $left > $right;
            case '>=':
                return $left >= $right;
            case '<':
                return $left < $right;
            case '<=':
                return $left <= $right;
            default:
                throw new \RuntimeException("Invalid comparison: {$cmp}");
        }
    }