Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
5 / 5 |
GreaterThanEqual | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
3 | |
100.00% |
5 / 5 |
evaluate | |
100.00% |
1 / 1 |
3 | |
100.00% |
5 / 5 |
<?php | |
/** | |
* Pop PHP Framework (http://www.popphp.org/) | |
* | |
* @link https://github.com/popphp/popphp-framework | |
* @author Nick Sagona, III <dev@nolainteractive.com> | |
* @copyright Copyright (c) 2009-2019 NOLA Interactive, LLC. (http://www.nolainteractive.com) | |
* @license http://www.popphp.org/license New BSD License | |
*/ | |
/** | |
* @namespace | |
*/ | |
namespace Pop\Validator; | |
/** | |
* Greater than or equal validator class | |
* | |
* @category Pop | |
* @package Pop\Validator | |
* @author Nick Sagona, III <dev@nolainteractive.com> | |
* @copyright Copyright (c) 2009-2019 NOLA Interactive, LLC. (http://www.nolainteractive.com) | |
* @license http://www.popphp.org/license New BSD License | |
* @version 3.0.2 | |
*/ | |
class GreaterThanEqual extends AbstractValidator | |
{ | |
/** | |
* Method to evaluate the validator | |
* | |
* @param mixed $input | |
* @return boolean | |
*/ | |
public function evaluate($input = null) | |
{ | |
// Set the input, if passed | |
if (null !== $input) { | |
$this->input = $input; | |
} | |
// Set the default message | |
if (null === $this->message) { | |
$this->message = 'The value must be greater than or equal to ' . $this->value . '.'; | |
} | |
return ($this->input >= $this->value); | |
} | |
} |