Code Duplication    Length = 14-14 lines in 2 locations

src/Constraints/Max.php 1 location

@@ 71-84 (lines=14) @@
68
     *
69
     * @return \League\JsonGuard\ValidationError|null
70
     */
71
    private function validateExclusiveMax($value, $parameter, $pointer)
72
    {
73
        if (!is_numeric($value) || bccomp($value, $parameter, $this->precision) === -1) {
74
            return null;
75
        }
76
77
        return new ValidationError(
78
            'Value {value} is not less than {exclusive_max}',
79
            self::EXCLUSIVE_KEYWORD,
80
            $value,
81
            $pointer,
82
            ['value' => $value, 'exclusive_max' => $parameter]
83
        );
84
    }
85
}
86

src/Constraints/Min.php 1 location

@@ 71-84 (lines=14) @@
68
     *
69
     * @return \League\JsonGuard\ValidationError|null
70
     */
71
    private function validateExclusiveMin($value, $parameter, $pointer = null)
72
    {
73
        if (!is_numeric($value) || bccomp($value, $parameter, $this->precision) === 1) {
74
            return null;
75
        }
76
77
        return new ValidationError(
78
            'Number {value} is not at least greater than {exclusive_min}',
79
            self::EXCLUSIVE_KEYWORD,
80
            $value,
81
            $pointer,
82
            ['value' => $value, 'exclusive_min' => $parameter]
83
        );
84
    }
85
}
86