mirror of
https://github.com/Respect/Validation.git
synced 2024-06-04 14:52:17 +02:00
3601adf6db
All the classes that were extending "AbstractFilterRule" were throwing exceptions that were extending "AlphaException". That can cause some issues when the user has a validation chain with "Alpha" and another child of "AbstractFilterRule" and expects "AlphaException" specifically. This commit creates "FilteredValidationException" that can be used as the parent of the exceptions thrown by rules that extend the class "AbstractFilterRule". Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
29 lines
848 B
PHP
29 lines
848 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;
|
|
|
|
class ConsonantException extends FilteredValidationException
|
|
{
|
|
public static $defaultTemplates = [
|
|
self::MODE_DEFAULT => [
|
|
self::STANDARD => '{{name}} must contain only consonants',
|
|
self::EXTRA => '{{name}} must contain only consonants and "{{additionalChars}}"',
|
|
],
|
|
self::MODE_NEGATIVE => [
|
|
self::STANDARD => '{{name}} must not contain consonants',
|
|
self::EXTRA => '{{name}} must not contain consonants or "{{additionalChars}}"',
|
|
],
|
|
];
|
|
}
|