Source of file LessRule.php
Size: 0,952 Bytes - Last Modified: 2017-11-08T13:54:24+00:00
/home/travis/build/bluzphp/framework/src/Validator/Rule/LessRule.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 | <?php /** * Bluz Framework Component * * @copyright Bluz PHP Team * @link https://github.com/bluzphp/framework */ declare(strict_types=1); namespace Bluz\Validator\Rule; /** * Check for maximum * * @package Bluz\Validator\Rule */ class LessRule extends AbstractCompareRule { /** * @var mixed maximum value */ protected $maxValue; /** * Setup validation rule * * @param mixed $maxValue */ public function __construct($maxValue) { $this->maxValue = $maxValue; } /** * Check input data * * @param NumericRule $input * * @return bool */ public function validate($input): bool { return $this->less($input, $this->maxValue); } /** * Get error template * * @return string */ public function getDescription() : string { return __('must be lower than "%s"', $this->maxValue); } } |