mirror of
https://github.com/Respect/Validation.git
synced 2024-06-27 17:50:13 +02:00
The "Between" rule was extending the "AllOf" rule and adding "Max" and "Min" rules to the chain. Because of that, when the rule failed we could get the "MinException" or the "MaxException" exception, and only if both failed that we would get the "BetweenException". With this change it will always get the "BetweenException" which makes it more explicit. Also, the "Between" is not using the same standard required in the Contribution Guidelines.
34 lines
857 B
PHP
34 lines
857 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 {{minimum}} and {{maximum}}',
|
|
],
|
|
self::MODE_NEGATIVE => [
|
|
self::STANDARD => '{{name}} must not be between {{minimum}} and {{maximum}}',
|
|
],
|
|
];
|
|
}
|