Code Duplication    Length = 17-17 lines in 2 locations

src/Valdi/Validator/Max.php 1 location

@@ 17-33 (lines=17) @@
14
/**
15
 * Validator for max values.
16
 */
17
class Max extends Comparator {
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    protected function compare($a, $parameters) {
23
        return $this->allNumeric($a, $parameters[0]) && $a <= $parameters[0];
24
    }
25
26
    /**
27
     * Constructor.
28
     */
29
    public function __construct() {
30
        parent::__construct();
31
        $this->type = 'max';
32
    }
33
}
34

src/Valdi/Validator/Min.php 1 location

@@ 17-33 (lines=17) @@
14
/**
15
 * Validator for min values.
16
 */
17
class Min extends Comparator {
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    protected function compare($a, $parameters) {
23
        return $this->allNumeric($a, $parameters[0]) && $a >= $parameters[0];
24
    }
25
26
    /**
27
     * Constructor.
28
     */
29
    public function __construct() {
30
        parent::__construct();
31
        $this->type = 'min';
32
    }
33
}
34