Code Duplication    Length = 14-14 lines in 2 locations

src/Valdi/Validator/Max.php 1 location

@@ 17-30 (lines=14) @@
14
/**
15
 * Validator for max values.
16
 */
17
class Max extends AbstractComparator {
18
19
    /**
20
     * Holds the type of the validator.
21
     */
22
    protected $type = 'max';
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    protected function isValidComparison($value, $parameters) {
28
        return $this->isAllNumeric($value, $parameters[0]) && $value <= $parameters[0];
29
    }
30
}
31

src/Valdi/Validator/Min.php 1 location

@@ 17-30 (lines=14) @@
14
/**
15
 * Validator for min values.
16
 */
17
class Min extends AbstractComparator {
18
19
    /**
20
     * Holds the type of the validator.
21
     */
22
    protected $type = 'min';
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    protected function isValidComparison($value, $parameters) {
28
        return $this->isAllNumeric($value, $parameters[0]) && $value >= $parameters[0];
29
    }
30
}
31