respect-validation/library/Exceptions/BetweenException.php
Henrique Moody da6abf4bdd
Make "Between" always inclusive
Generally speaking it makes more sense to have it always inclusive. Even
though the word "between" does not imply that it is inclusive or
exclusive it's more natural this way.

Besides, users can always use "GreaterThan" and "LessThan" rules in case
that is necessary.

Removing this boolean parameter reduces a bit of the complexity of the
rule.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-05-31 15:10:59 +02:00

34 lines
861 B
PHP

<?php
/*
* This file is part of Respect/Validation.
*
* (c) Alexandre Gomes Gaigalas <alexandre@gaigalas.net>
*
* For the full copyright and license information, please view the "LICENSE.md"
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Respect\Validation\Exceptions;
/**
* @author Alexandre Gomes Gaigalas <alexandre@gaigalas.net>
* @author Henrique Moody <henriquemoody@gmail.com>
*/
final class BetweenException extends NestedValidationException
{
/**
* {@inheritdoc}
*/
public static $defaultTemplates = [
self::MODE_DEFAULT => [
self::STANDARD => '{{name}} must be between {{minValue}} and {{maxValue}}',
],
self::MODE_NEGATIVE => [
self::STANDARD => '{{name}} must not be between {{minValue}} and {{maxValue}}',
],
];
}