mirror of
https://github.com/Respect/Validation.git
synced 2024-06-15 20:15:06 +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>
36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
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 AlnumException extends FilteredValidationException
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public static $defaultTemplates = [
|
|
self::MODE_DEFAULT => [
|
|
self::STANDARD => '{{name}} must contain only letters (a-z) and digits (0-9)',
|
|
self::EXTRA => '{{name}} must contain only letters (a-z), digits (0-9) and {{additionalChars}}',
|
|
],
|
|
self::MODE_NEGATIVE => [
|
|
self::STANDARD => '{{name}} must not contain letters (a-z) or digits (0-9)',
|
|
self::EXTRA => '{{name}} must not contain letters (a-z), digits (0-9) or {{additionalChars}}',
|
|
],
|
|
];
|
|
}
|