mirror of
https://github.com/Respect/Validation.git
synced 2024-06-26 01:00:19 +02:00
-Several improvements on the messaging system and error reporting, lots of refactored code. -Validators can now be safely named $val->setName('My Field'), and that name will reflect on the validation message ("My Field must be bla bla bla" instead of "incorrect value" must be bla bla bla)
25 lines
633 B
PHP
25 lines
633 B
PHP
<?php
|
|
|
|
namespace Respect\Validation\Exceptions;
|
|
|
|
class MaxException extends ValidationException
|
|
{
|
|
const INCLUSIVE = 1;
|
|
|
|
public static $defaultTemplates = array(
|
|
self::STANDARD => '%s must be lower than %s',
|
|
self::INCLUSIVE => '%s must be lower than %s (inclusive)',
|
|
);
|
|
|
|
public function cnofigure($name, $max, $inclusive)
|
|
{
|
|
return parent::configure($name, ValidationException::stringify($max),
|
|
$inclusive);//TODO find a better way
|
|
}
|
|
|
|
public function chooseTemplate($name, $max, $inclusive)
|
|
{
|
|
return $inclusive ? static::INCLUSIVE : static::STANDARD;
|
|
}
|
|
|
|
} |