Code Duplication    Length = 9-9 lines in 2 locations

src/Valdi/Validator/MaxLength.php 1 location

@@ 17-25 (lines=9) @@
14
/**
15
 * Validator for strings of a max length.
16
 */
17
class MaxLength extends Comparator {
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    protected function compare($a, $parameters) {
23
        return is_numeric($parameters[0]) && strlen($a) <= $parameters[0];
24
    }
25
}
26

src/Valdi/Validator/MinLength.php 1 location

@@ 17-25 (lines=9) @@
14
/**
15
 * Validator for strings of a min length.
16
 */
17
class MinLength extends Comparator {
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    protected function compare($a, $parameters) {
23
        return is_numeric($parameters[0]) && strlen($a) >= $parameters[0];
24
    }
25
}
26