respect-validation/library/Exceptions/GroupedValidationException.php
Henrique Moody ae1620b23d
Refactor "AbstractComposite" class
The class had too much complexity and some duplication on its children.

I started doing this because I'm refactoring the tests to upgrade
PHPUnit later, and then I made some improvements along the way.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2024-01-28 03:59:23 +01:00

30 lines
796 B
PHP

<?php
/*
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
* SPDX-License-Identifier: MIT
*/
declare(strict_types=1);
namespace Respect\Validation\Exceptions;
class GroupedValidationException extends NestedValidationException
{
public const NONE = 'none';
public const SOME = 'some';
/**
* @var array<string, array<string, string>>
*/
protected array $defaultTemplates = [
self::MODE_DEFAULT => [
self::NONE => 'All of the required rules must pass for {{name}}',
self::SOME => 'These rules must pass for {{name}}',
],
self::MODE_NEGATIVE => [
self::NONE => 'None of there rules must pass for {{name}}',
self::SOME => 'These rules must not pass for {{name}}',
],
];
}