Code Duplication    Length = 11-13 lines in 2 locations

src/Assert.php 2 locations

@@ 1094-1104 (lines=11) @@
1091
     *
1092
     * @throws InvalidArgumentException
1093
     */
1094
    public static function range($value, $min, $max, $message = '')
1095
    {
1096
        if ($value < $min || $value > $max) {
1097
            static::reportInvalidArgument(\sprintf(
1098
                $message ?: 'Expected a value between %2$s and %3$s. Got: %s',
1099
                static::valueToString($value),
1100
                static::valueToString($min),
1101
                static::valueToString($max)
1102
            ));
1103
        }
1104
    }
1105
1106
    /**
1107
     * Does strict comparison, so Assert::oneOf(3, ['3']) does not pass the assertion.
@@ 1550-1562 (lines=13) @@
1547
     *
1548
     * @throws InvalidArgumentException
1549
     */
1550
    public static function lengthBetween($value, $min, $max, $message = '')
1551
    {
1552
        $length = static::strlen($value);
1553
1554
        if ($length < $min || $length > $max) {
1555
            static::reportInvalidArgument(\sprintf(
1556
                $message ?: 'Expected a value to contain between %2$s and %3$s characters. Got: %s',
1557
                static::valueToString($value),
1558
                $min,
1559
                $max
1560
            ));
1561
        }
1562
    }
1563
1564
    /**
1565
     * Will also pass if $value is a directory, use Assert::file() instead if you need to be sure it is a file.