mirror of
https://github.com/Respect/Validation.git
synced 2024-06-04 23:02:16 +02:00
Make default templates non-static and protected
The only reason why those templates are static is so users can overwrite the exception messages. That was useful when we didn't have a handy translator, but now that we can define a translator through the Factory, this is not needed anymore. Besides, having those properties public adds complexity to the code. Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
parent
c522f6235c
commit
f3bc39066b
|
@ -115,7 +115,7 @@ final class HelloWorldException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a Hello World',
|
||||
],
|
||||
|
|
|
@ -280,7 +280,7 @@ use \Respect\Validation\Exceptions\ValidationException;
|
|||
|
||||
class MyRuleException extends ValidationException
|
||||
{
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => 'Validation message if MyRule fails validation.',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ class AllOfException extends GroupedValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::NONE => 'All of the required rules must pass for {{name}}',
|
||||
self::SOME => 'These rules must pass for {{name}}',
|
||||
|
|
|
@ -22,7 +22,7 @@ final class AlnumException extends FilteredValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $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}}',
|
||||
|
|
|
@ -22,7 +22,7 @@ final class AlphaException extends FilteredValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must contain only letters (a-z)',
|
||||
self::EXTRA => '{{name}} must contain only letters (a-z) and {{additionalChars}}',
|
||||
|
|
|
@ -25,7 +25,7 @@ final class AlwaysInvalidException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} is always invalid',
|
||||
self::SIMPLE => '{{name}} is not valid',
|
||||
|
|
|
@ -23,7 +23,7 @@ final class AlwaysValidException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} is always valid',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class AnyOfException extends NestedValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => 'At least one of these rules must pass for {{name}}',
|
||||
],
|
||||
|
|
|
@ -24,7 +24,7 @@ final class ArrayTypeException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be of type array',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class ArrayValException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be an array value',
|
||||
],
|
||||
|
|
|
@ -28,7 +28,7 @@ final class AttributeException extends NestedValidationException implements NonO
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::NOT_PRESENT => 'Attribute {{name}} must be present',
|
||||
self::INVALID => 'Attribute {{name}} must be valid',
|
||||
|
|
|
@ -23,7 +23,7 @@ final class Base64Exception extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be Base64-encoded',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class BaseException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a number in the base {{base}}',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class BetweenException extends NestedValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be between {{minValue}} and {{maxValue}}',
|
||||
],
|
||||
|
|
|
@ -24,7 +24,7 @@ final class BoolTypeException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be of type boolean',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class BoolValException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a boolean value',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class BsnException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a BSN',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class CallException extends NestedValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{input}} must be valid when executed with {{callable}}',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class CallableTypeException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be callable',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class CharsetException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be in the {{charset}} charset',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class CnhException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid CNH number',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class CnpjException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid CNPJ number',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class ConsonantException extends FilteredValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must contain only consonants',
|
||||
self::EXTRA => '{{name}} must contain only consonants and {{additionalChars}}',
|
||||
|
|
|
@ -21,7 +21,7 @@ final class ContainsAnyException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must contain at least one of the values {{needles}}',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class ContainsException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must contain the value {{containsValue}}',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class ControlException extends FilteredValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must contain only control characters',
|
||||
self::EXTRA => '{{name}} must contain only control characters and {{additionalChars}}',
|
||||
|
|
|
@ -23,7 +23,7 @@ final class CountableException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be countable',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class CountryCodeException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid country',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class CpfException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid CPF number',
|
||||
],
|
||||
|
|
|
@ -27,7 +27,7 @@ final class CreditCardException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid Credit Card number',
|
||||
self::BRANDED => '{{name}} must be a valid {{brand}} Credit Card number',
|
||||
|
|
|
@ -23,7 +23,7 @@ final class CurrencyCodeException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid currency',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class DateException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid date in the format {{sample}}',
|
||||
],
|
||||
|
|
|
@ -24,7 +24,7 @@ final class DateTimeException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid date/time',
|
||||
self::FORMAT => '{{name}} must be a valid date/time in the format {{sample}}',
|
||||
|
|
|
@ -22,7 +22,7 @@ final class DigitException extends FilteredValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must contain only digits (0-9)',
|
||||
self::EXTRA => '{{name}} must contain only digits (0-9) and {{additionalChars}}',
|
||||
|
|
|
@ -22,7 +22,7 @@ final class DirectoryException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a directory',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class DomainException extends NestedValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid domain',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class EachException extends NestedValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => 'Each item in {{name}} must be valid',
|
||||
],
|
||||
|
|
|
@ -27,7 +27,7 @@ final class EmailException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be valid email',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class EndsWithException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must end with {{endValue}}',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class EqualsException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must equal {{compareTo}}',
|
||||
],
|
||||
|
|
|
@ -21,7 +21,7 @@ final class EquivalentException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be equivalent to {{compareTo}}',
|
||||
],
|
||||
|
|
|
@ -25,7 +25,7 @@ final class EvenException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be an even number',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class ExecutableException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be an executable file',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class ExistsException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must exists',
|
||||
],
|
||||
|
|
|
@ -24,7 +24,7 @@ final class ExtensionException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must have {{extension}} extension',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class FactorException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a factor of {{dividend}}',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class FalseValException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} is not considered as "False"',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class FibonacciException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid Fibonacci number',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class FileException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a file',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class FiniteException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a finite number',
|
||||
],
|
||||
|
|
|
@ -24,7 +24,7 @@ final class FloatTypeException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be of type float',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class FloatValException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a float number',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class GraphException extends FilteredValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must contain only graphical characters',
|
||||
self::EXTRA => '{{name}} must contain only graphical characters and {{additionalChars}}',
|
||||
|
|
|
@ -21,7 +21,7 @@ final class GreaterThanException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be greater than {{compareTo}}',
|
||||
],
|
||||
|
|
|
@ -27,7 +27,7 @@ class GroupedValidationException extends NestedValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::NONE => 'All of the required rules must pass for {{name}}',
|
||||
self::SOME => 'These rules must pass for {{name}}',
|
||||
|
|
|
@ -22,7 +22,7 @@ final class HexRgbColorException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a hex RGB color',
|
||||
],
|
||||
|
|
|
@ -21,7 +21,7 @@ final class IbanException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid IBAN',
|
||||
],
|
||||
|
|
|
@ -21,7 +21,7 @@ final class IdenticalException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be identical as {{compareTo}}',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class ImageException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid image',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class ImeiException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid IMEI',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class InException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be in {{haystack}}',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class InfiniteException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be an infinite number',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class InstanceException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be an instance of {{instanceName}}',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class IntTypeException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be of type integer',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class IntValException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be an integer number',
|
||||
],
|
||||
|
|
|
@ -26,7 +26,7 @@ final class IpException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be an IP address',
|
||||
self::NETWORK_RANGE => '{{name}} must be an IP address in the {{range}} range',
|
||||
|
|
|
@ -22,7 +22,7 @@ final class IsbnException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a ISBN',
|
||||
],
|
||||
|
|
|
@ -21,7 +21,7 @@ final class IterableTypeException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be iterable',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class JsonException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid JSON string',
|
||||
],
|
||||
|
|
|
@ -28,7 +28,7 @@ final class KeyException extends NestedValidationException implements NonOmissib
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::NOT_PRESENT => 'Key {{name}} must be present',
|
||||
self::INVALID => 'Key {{name}} must be valid',
|
||||
|
|
|
@ -28,7 +28,7 @@ final class KeyNestedException extends NestedValidationException implements NonO
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::NOT_PRESENT => 'No items were found for key chain {{name}}',
|
||||
self::INVALID => 'Key chain {{name}} is not valid',
|
||||
|
|
|
@ -25,7 +25,7 @@ final class KeySetException extends GroupedValidationException implements NonOmi
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::NONE => 'All of the required rules must pass for {{name}}',
|
||||
self::SOME => 'These rules must pass for {{name}}',
|
||||
|
|
|
@ -23,7 +23,7 @@ final class KeyValueException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => 'Key {{name}} must be present',
|
||||
self::COMPONENT => '{{baseKey}} must be valid to validate {{comparedKey}}',
|
||||
|
|
|
@ -23,7 +23,7 @@ final class LanguageCodeException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid ISO 639 {{set}} language code',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class LeapDateException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be leap date',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class LeapYearException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a leap year',
|
||||
],
|
||||
|
|
|
@ -31,7 +31,7 @@ final class LengthException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::BOTH => '{{name}} must have a length between {{minValue}} and {{maxValue}}',
|
||||
self::LOWER => '{{name}} must have a length greater than {{minValue}}',
|
||||
|
|
|
@ -21,7 +21,7 @@ final class LessThanException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be less than {{compareTo}}',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class LowercaseException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be lowercase',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class LuhnException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid Luhn number',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class MacAddressException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid MAC address',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class MaxAgeException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be {{age}} years or less',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class MaxException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be less than or equal to {{compareTo}}',
|
||||
],
|
||||
|
|
|
@ -24,7 +24,7 @@ final class MimetypeException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must have {{mimetype}} MIME type',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class MinAgeException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be {{age}} years or more',
|
||||
],
|
||||
|
|
|
@ -24,7 +24,7 @@ final class MinException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be greater than or equal to {{compareTo}}',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class MultipleException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be multiple of {{multipleOf}}',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class NegativeException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be negative',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class NfeAccessKeyException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid NFe access key',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class NifException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a NIF',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class NipException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be a valid Polish VAT identification number',
|
||||
],
|
||||
|
|
|
@ -21,7 +21,7 @@ final class NoException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} is not considered as "No"',
|
||||
],
|
||||
|
|
|
@ -23,7 +23,7 @@ final class NoWhitespaceException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must not contain whitespace',
|
||||
],
|
||||
|
|
|
@ -22,7 +22,7 @@ final class NoneOfException extends NestedValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => 'None of these rules must pass for {{name}}',
|
||||
],
|
||||
|
|
|
@ -24,7 +24,7 @@ final class NotBlankException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => 'The value must not be blank',
|
||||
self::NAMED => '{{name}} must not be blank',
|
||||
|
|
|
@ -21,7 +21,7 @@ final class NotEmojiException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must not contain an Emoji',
|
||||
],
|
||||
|
|
|
@ -25,7 +25,7 @@ final class NotEmptyException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => 'The value must not be empty',
|
||||
self::NAMED => '{{name}} must not be empty',
|
||||
|
|
|
@ -24,7 +24,7 @@ final class NotOptionalException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => 'The value must not be optional',
|
||||
self::NAMED => '{{name}} must not be optional',
|
||||
|
|
|
@ -24,7 +24,7 @@ final class NullTypeException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be null',
|
||||
],
|
||||
|
|
|
@ -24,7 +24,7 @@ final class NullableException extends ValidationException
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static $defaultTemplates = [
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => 'The value must be nullable',
|
||||
self::NAMED => '{{name}} must be nullable',
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue