mirror of
https://github.com/Respect/Validation.git
synced 2024-06-27 09:40:05 +02:00
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
868 B
PHP
29 lines
868 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 SpaceException extends FilteredValidationException
|
|
{
|
|
public static $defaultTemplates = [
|
|
self::MODE_DEFAULT => [
|
|
self::STANDARD => '{{name}} must contain only space characters',
|
|
self::EXTRA => '{{name}} must contain only space characters and "{{additionalChars}}"',
|
|
],
|
|
self::MODE_NEGATIVE => [
|
|
self::STANDARD => '{{name}} must not contain space characters',
|
|
self::EXTRA => '{{name}} must not contain space characters or "{{additionalChars}}"',
|
|
],
|
|
];
|
|
}
|