Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
DateTimeGreaterThanEqual | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
3 | |
100.00% |
1 / 1 |
evaluate | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
3 |
1 | <?php |
2 | /** |
3 | * Pop PHP Framework (http://www.popphp.org/) |
4 | * |
5 | * @link https://github.com/popphp/popphp-framework |
6 | * @author Nick Sagona, III <dev@noladev.com> |
7 | * @copyright Copyright (c) 2009-2025 NOLA Interactive, LLC. |
8 | * @license http://www.popphp.org/license New BSD License |
9 | */ |
10 | |
11 | /** |
12 | * @namespace |
13 | */ |
14 | namespace Pop\Validator; |
15 | |
16 | /** |
17 | * Date-time greater than or equal validator class |
18 | * |
19 | * @category Pop |
20 | * @package Pop\Validator |
21 | * @author Nick Sagona, III <dev@noladev.com> |
22 | * @copyright Copyright (c) 2009-2025 NOLA Interactive, LLC. |
23 | * @license http://www.popphp.org/license New BSD License |
24 | * @version 4.5.0 |
25 | */ |
26 | class DateTimeGreaterThanEqual extends GreaterThanEqual |
27 | { |
28 | |
29 | /** |
30 | * Traits |
31 | */ |
32 | use DateTimeTrait; |
33 | |
34 | /** |
35 | * Method to evaluate the validator |
36 | * |
37 | * @param mixed $input |
38 | * @return bool |
39 | */ |
40 | public function evaluate(mixed $input = null): bool |
41 | { |
42 | if ($input !== null) { |
43 | $input = strtotime($input); |
44 | } |
45 | if ($this->value !== null) { |
46 | $this->message = 'The value must be greater than or equal to ' . $this->getValue() . '.'; |
47 | } |
48 | return parent::evaluate($input); |
49 | } |
50 | |
51 | } |