diff --git a/Constraints/AbstractComparisonValidator.php b/Constraints/AbstractComparisonValidator.php index 4e2c27198..1424d3259 100644 --- a/Constraints/AbstractComparisonValidator.php +++ b/Constraints/AbstractComparisonValidator.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException; +use Symfony\Component\PropertyAccess\Exception\UninitializedPropertyException; use Symfony\Component\PropertyAccess\PropertyAccess; use Symfony\Component\PropertyAccess\PropertyAccessorInterface; use Symfony\Component\Validator\Constraint; @@ -56,6 +57,8 @@ public function validate(mixed $value, Constraint $constraint) $comparedValue = $this->getPropertyAccessor()->getValue($object, $path); } catch (NoSuchPropertyException $e) { throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: ', $path, get_debug_type($constraint)).$e->getMessage(), 0, $e); + } catch (UninitializedPropertyException) { + $comparedValue = null; } } else { $comparedValue = $constraint->value; diff --git a/Constraints/AtLeastOneOfValidator.php b/Constraints/AtLeastOneOfValidator.php index 94ad5eaca..5348527c7 100644 --- a/Constraints/AtLeastOneOfValidator.php +++ b/Constraints/AtLeastOneOfValidator.php @@ -42,9 +42,11 @@ public function validate(mixed $value, Constraint $constraint) continue; } + $context = $this->context; $executionContext = clone $this->context; $executionContext->setNode($value, $this->context->getObject(), $this->context->getMetadata(), $this->context->getPropertyPath()); $violations = $validator->inContext($executionContext)->validate($value, $item, $this->context->getGroup())->getViolations(); + $this->context = $context; if (\count($this->context->getViolations()) === \count($violations)) { return; diff --git a/Constraints/BicValidator.php b/Constraints/BicValidator.php index 045df64b5..7be4dc400 100644 --- a/Constraints/BicValidator.php +++ b/Constraints/BicValidator.php @@ -13,6 +13,7 @@ use Symfony\Component\Intl\Countries; use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException; +use Symfony\Component\PropertyAccess\Exception\UninitializedPropertyException; use Symfony\Component\PropertyAccess\PropertyAccess; use Symfony\Component\PropertyAccess\PropertyAccessor; use Symfony\Component\Validator\Constraint; @@ -102,16 +103,6 @@ public function validate(mixed $value, Constraint $constraint) return; } - // first 4 letters must be alphabetic (bank code) - if (!ctype_alpha(substr($canonicalize, 0, 4))) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Bic::INVALID_BANK_CODE_ERROR) - ->addViolation(); - - return; - } - $bicCountryCode = substr($canonicalize, 4, 2); if (!isset(self::BIC_COUNTRY_TO_IBAN_COUNTRY_MAP[$bicCountryCode]) && !Countries::exists($bicCountryCode)) { $this->context->buildViolation($constraint->message) @@ -140,6 +131,8 @@ public function validate(mixed $value, Constraint $constraint) $iban = $this->getPropertyAccessor()->getValue($object, $path); } catch (NoSuchPropertyException $e) { throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: ', $path, get_debug_type($constraint)).$e->getMessage(), 0, $e); + } catch (UninitializedPropertyException) { + $iban = null; } } if (!$iban) { diff --git a/Constraints/CardSchemeValidator.php b/Constraints/CardSchemeValidator.php index 3e5105015..22de0d8db 100644 --- a/Constraints/CardSchemeValidator.php +++ b/Constraints/CardSchemeValidator.php @@ -29,65 +29,65 @@ class CardSchemeValidator extends ConstraintValidator protected $schemes = [ // American Express card numbers start with 34 or 37 and have 15 digits. CardScheme::AMEX => [ - '/^3[47][0-9]{13}$/', + '/^3[47][0-9]{13}$/D', ], // China UnionPay cards start with 62 and have between 16 and 19 digits. // Please note that these cards do not follow Luhn Algorithm as a checksum. CardScheme::CHINA_UNIONPAY => [ - '/^62[0-9]{14,17}$/', + '/^62[0-9]{14,17}$/D', ], // Diners Club card numbers begin with 300 through 305, 36 or 38. All have 14 digits. // There are Diners Club cards that begin with 5 and have 16 digits. // These are a joint venture between Diners Club and MasterCard, and should be processed like a MasterCard. CardScheme::DINERS => [ - '/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/', + '/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/D', ], // Discover card numbers begin with 6011, 622126 through 622925, 644 through 649 or 65. // All have 16 digits. CardScheme::DISCOVER => [ - '/^6011[0-9]{12}$/', - '/^64[4-9][0-9]{13}$/', - '/^65[0-9]{14}$/', - '/^622(12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|91[0-9]|92[0-5])[0-9]{10}$/', + '/^6011[0-9]{12}$/D', + '/^64[4-9][0-9]{13}$/D', + '/^65[0-9]{14}$/D', + '/^622(12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|91[0-9]|92[0-5])[0-9]{10}$/D', ], // InstaPayment cards begin with 637 through 639 and have 16 digits. CardScheme::INSTAPAYMENT => [ - '/^63[7-9][0-9]{13}$/', + '/^63[7-9][0-9]{13}$/D', ], // JCB cards beginning with 2131 or 1800 have 15 digits. // JCB cards beginning with 35 have 16 digits. CardScheme::JCB => [ - '/^(?:2131|1800|35[0-9]{3})[0-9]{11}$/', + '/^(?:2131|1800|35[0-9]{3})[0-9]{11}$/D', ], // Laser cards begin with either 6304, 6706, 6709 or 6771 and have between 16 and 19 digits. CardScheme::LASER => [ - '/^(6304|670[69]|6771)[0-9]{12,15}$/', + '/^(6304|670[69]|6771)[0-9]{12,15}$/D', ], // Maestro international cards begin with 675900..675999 and have between 12 and 19 digits. // Maestro UK cards begin with either 500000..509999 or 560000..699999 and have between 12 and 19 digits. CardScheme::MAESTRO => [ - '/^(6759[0-9]{2})[0-9]{6,13}$/', - '/^(50[0-9]{4})[0-9]{6,13}$/', - '/^5[6-9][0-9]{10,17}$/', - '/^6[0-9]{11,18}$/', + '/^(6759[0-9]{2})[0-9]{6,13}$/D', + '/^(50[0-9]{4})[0-9]{6,13}$/D', + '/^5[6-9][0-9]{10,17}$/D', + '/^6[0-9]{11,18}$/D', ], // All MasterCard numbers start with the numbers 51 through 55. All have 16 digits. // October 2016 MasterCard numbers can also start with 222100 through 272099. CardScheme::MASTERCARD => [ - '/^5[1-5][0-9]{14}$/', - '/^2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12})$/', + '/^5[1-5][0-9]{14}$/D', + '/^2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12})$/D', ], // Payment system MIR numbers start with 220, then 1 digit from 0 to 4, then between 12 and 15 digits CardScheme::MIR => [ - '/^220[0-4][0-9]{12,15}$/', + '/^220[0-4][0-9]{12,15}$/D', ], // All UATP card numbers start with a 1 and have a length of 15 digits. CardScheme::UATP => [ - '/^1[0-9]{14}$/', + '/^1[0-9]{14}$/D', ], // All Visa card numbers start with a 4 and have a length of 13, 16, or 19 digits. CardScheme::VISA => [ - '/^4([0-9]{12}|[0-9]{15}|[0-9]{18})$/', + '/^4([0-9]{12}|[0-9]{15}|[0-9]{18})$/D', ], ]; diff --git a/Constraints/CssColorValidator.php b/Constraints/CssColorValidator.php index 9e8b1b55c..78563a92c 100644 --- a/Constraints/CssColorValidator.php +++ b/Constraints/CssColorValidator.php @@ -21,21 +21,21 @@ */ class CssColorValidator extends ConstraintValidator { - private const PATTERN_HEX_LONG = '/^#[0-9a-f]{6}$/i'; - private const PATTERN_HEX_LONG_WITH_ALPHA = '/^#[0-9a-f]{8}$/i'; - private const PATTERN_HEX_SHORT = '/^#[0-9a-f]{3}$/i'; - private const PATTERN_HEX_SHORT_WITH_ALPHA = '/^#[0-9a-f]{4}$/i'; + private const PATTERN_HEX_LONG = '/^#[0-9a-f]{6}$/iD'; + private const PATTERN_HEX_LONG_WITH_ALPHA = '/^#[0-9a-f]{8}$/iD'; + private const PATTERN_HEX_SHORT = '/^#[0-9a-f]{3}$/iD'; + private const PATTERN_HEX_SHORT_WITH_ALPHA = '/^#[0-9a-f]{4}$/iD'; // List comes from https://www.w3.org/wiki/CSS/Properties/color/keywords#Basic_Colors - private const PATTERN_BASIC_NAMED_COLORS = '/^(black|silver|gray|white|maroon|red|purple|fuchsia|green|lime|olive|yellow|navy|blue|teal|aqua)$/i'; + private const PATTERN_BASIC_NAMED_COLORS = '/^(black|silver|gray|white|maroon|red|purple|fuchsia|green|lime|olive|yellow|navy|blue|teal|aqua)$/iD'; // List comes from https://www.w3.org/wiki/CSS/Properties/color/keywords#Extended_colors - private const PATTERN_EXTENDED_NAMED_COLORS = '/^(aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen)$/i'; + private const PATTERN_EXTENDED_NAMED_COLORS = '/^(aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen)$/iD'; // List comes from https://drafts.csswg.org/css-color/#css-system-colors - private const PATTERN_SYSTEM_COLORS = '/^(Canvas|CanvasText|LinkText|VisitedText|ActiveText|ButtonFace|ButtonText|ButtonBorder|Field|FieldText|Highlight|HighlightText|SelectedItem|SelectedItemText|Mark|MarkText|GrayText)$/i'; - private const PATTERN_KEYWORDS = '/^(transparent|currentColor)$/i'; - private const PATTERN_RGB = '/^rgb\(\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d)\s*\)$/i'; - private const PATTERN_RGBA = '/^rgba\(\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|0?\.\d+|1(\.0)?)\s*\)$/i'; - private const PATTERN_HSL = '/^hsl\(\s*(0|360|35\d|3[0-4]\d|[12]\d\d|0?\d?\d),\s*(0|100|\d{1,2})%,\s*(0|100|\d{1,2})%\s*\)$/i'; - private const PATTERN_HSLA = '/^hsla\(\s*(0|360|35\d|3[0-4]\d|[12]\d\d|0?\d?\d),\s*(0|100|\d{1,2})%,\s*(0|100|\d{1,2})%,\s*(0|0?\.\d+|1(\.0)?)\s*\)$/i'; + private const PATTERN_SYSTEM_COLORS = '/^(Canvas|CanvasText|LinkText|VisitedText|ActiveText|ButtonFace|ButtonText|ButtonBorder|Field|FieldText|Highlight|HighlightText|SelectedItem|SelectedItemText|Mark|MarkText|GrayText)$/iD'; + private const PATTERN_KEYWORDS = '/^(transparent|currentColor)$/iD'; + private const PATTERN_RGB = '/^rgb\(\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d)\s*\)$/iD'; + private const PATTERN_RGBA = '/^rgba\(\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|0?\.\d+|1(\.0)?)\s*\)$/iD'; + private const PATTERN_HSL = '/^hsl\(\s*(0|360|35\d|3[0-4]\d|[12]\d\d|0?\d?\d),\s*(0|100|\d{1,2})%,\s*(0|100|\d{1,2})%\s*\)$/iD'; + private const PATTERN_HSLA = '/^hsla\(\s*(0|360|35\d|3[0-4]\d|[12]\d\d|0?\d?\d),\s*(0|100|\d{1,2})%,\s*(0|100|\d{1,2})%,\s*(0|0?\.\d+|1(\.0)?)\s*\)$/iD'; private const COLOR_PATTERNS = [ CssColor::HEX_LONG => self::PATTERN_HEX_LONG, diff --git a/Constraints/DateValidator.php b/Constraints/DateValidator.php index 0e3d84843..65dc9648a 100644 --- a/Constraints/DateValidator.php +++ b/Constraints/DateValidator.php @@ -21,7 +21,7 @@ */ class DateValidator extends ConstraintValidator { - public const PATTERN = '/^(?\d{4})-(?\d{2})-(?\d{2})$/'; + public const PATTERN = '/^(?\d{4})-(?\d{2})-(?\d{2})$/D'; /** * Checks whether a date is valid. diff --git a/Constraints/Email.php b/Constraints/Email.php index 302aa5220..ddc740abf 100644 --- a/Constraints/Email.php +++ b/Constraints/Email.php @@ -68,6 +68,10 @@ public function __construct( throw new InvalidArgumentException('The "mode" parameter value is not valid.'); } + if (null !== $mode && !\in_array($mode, self::VALIDATION_MODES, true)) { + throw new InvalidArgumentException('The "mode" parameter value is not valid.'); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/EmailValidator.php b/Constraints/EmailValidator.php index 8c0ff7730..a6ee53f7a 100644 --- a/Constraints/EmailValidator.php +++ b/Constraints/EmailValidator.php @@ -26,9 +26,9 @@ */ class EmailValidator extends ConstraintValidator { - private const PATTERN_HTML5_ALLOW_NO_TLD = '/^[a-zA-Z0-9.!#$%&\'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/'; - private const PATTERN_HTML5 = '/^[a-zA-Z0-9.!#$%&\'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/'; - private const PATTERN_LOOSE = '/^.+\@\S+\.\S+$/'; + private const PATTERN_HTML5_ALLOW_NO_TLD = '/^[a-zA-Z0-9.!#$%&\'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/D'; + private const PATTERN_HTML5 = '/^[a-zA-Z0-9.!#$%&\'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/D'; + private const PATTERN_LOOSE = '/^.+\@\S+\.\S+$/D'; private const EMAIL_PATTERNS = [ Email::VALIDATION_MODE_LOOSE => self::PATTERN_LOOSE, diff --git a/Constraints/File.php b/Constraints/File.php index c55ceece7..863e306f2 100644 --- a/Constraints/File.php +++ b/Constraints/File.php @@ -41,6 +41,7 @@ class File extends Constraint self::EMPTY_ERROR => 'EMPTY_ERROR', self::TOO_LARGE_ERROR => 'TOO_LARGE_ERROR', self::INVALID_MIME_TYPE_ERROR => 'INVALID_MIME_TYPE_ERROR', + self::INVALID_EXTENSION_ERROR => 'INVALID_EXTENSION_ERROR', self::FILENAME_TOO_LONG => 'FILENAME_TOO_LONG', ]; diff --git a/Constraints/IbanValidator.php b/Constraints/IbanValidator.php index b4744b4b5..11619efd8 100644 --- a/Constraints/IbanValidator.php +++ b/Constraints/IbanValidator.php @@ -73,6 +73,7 @@ class IbanValidator extends ConstraintValidator 'EG' => 'EG\d{2}\d{4}\d{4}\d{17}', // Egypt 'ES' => 'ES\d{2}\d{4}\d{4}\d{1}\d{1}\d{10}', // Spain 'FI' => 'FI\d{2}\d{3}\d{11}', // Finland + 'FK' => 'FK\d{2}[A-Z]{2}\d{12}', // Falkland Islands 'FO' => 'FO\d{2}\d{4}\d{9}\d{1}', // Faroe Islands 'FR' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // France 'GA' => 'GA\d{2}\d{23}', // Gabon @@ -117,6 +118,7 @@ class IbanValidator extends ConstraintValidator 'MG' => 'MG\d{2}\d{23}', // Madagascar 'MK' => 'MK\d{2}\d{3}[\dA-Z]{10}\d{2}', // Macedonia 'ML' => 'ML\d{2}[\dA-Z]{2}\d{22}', // Mali + 'MN' => 'MN\d{2}\d{4}\d{12}', // Mongolia 'MQ' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // France 'MR' => 'MR\d{2}\d{5}\d{5}\d{11}\d{2}', // Mauritania 'MT' => 'MT\d{2}[A-Z]{4}\d{5}[\dA-Z]{18}', // Malta @@ -127,6 +129,7 @@ class IbanValidator extends ConstraintValidator 'NI' => 'NI\d{2}[A-Z]{4}\d{24}', // Nicaragua 'NL' => 'NL\d{2}[A-Z]{4}\d{10}', // Netherlands (The) 'NO' => 'NO\d{2}\d{4}\d{6}\d{1}', // Norway + 'OM' => 'OM\d{2}\d{3}[\dA-Z]{16}', // Oman 'PF' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // France 'PK' => 'PK\d{2}[A-Z]{4}[\dA-Z]{16}', // Pakistan 'PL' => 'PL\d{2}\d{8}\d{16}', // Poland @@ -160,6 +163,7 @@ class IbanValidator extends ConstraintValidator 'VG' => 'VG\d{2}[A-Z]{4}\d{16}', // Virgin Islands 'WF' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // France 'XK' => 'XK\d{2}\d{4}\d{10}\d{2}', // Kosovo + 'YE' => 'YE\d{2}[A-Z]{4}\d{4}[\dA-Z]{18}', // Yemen 'YT' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // France ]; @@ -228,6 +232,18 @@ public function validate(mixed $value, Constraint $constraint) return; } + // Check digits should always between 2 and 98 + // A ECBS document (https://www.ecbs.org/Download/EBS204_V3.PDF) replicates part of the ISO/IEC 7064:2003 standard as a method for generating check digits in the range 02 to 98. + $checkDigits = (int) substr($canonicalized, 2, 2); + if ($checkDigits < 2 || $checkDigits > 98) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::CHECKSUM_FAILED_ERROR) + ->addViolation(); + + return; + } + // Move the first four characters to the end // e.g. CH93 0076 2011 6238 5295 7 // -> 0076 2011 6238 5295 7 CH93 diff --git a/Constraints/Range.php b/Constraints/Range.php index 6a4cd9000..32c62104a 100644 --- a/Constraints/Range.php +++ b/Constraints/Range.php @@ -95,7 +95,7 @@ public function __construct( throw new LogicException(sprintf('The "%s" constraint requires the Symfony PropertyAccess component to use the "minPropertyPath" or "maxPropertyPath" option. Try running "composer require symfony/property-access".', static::class)); } - if (null !== $this->min && null !== $this->max && ($minMessage || $maxMessage)) { + if (null !== $this->min && null !== $this->max && ($minMessage || $maxMessage || isset($options['minMessage']) || isset($options['maxMessage']))) { throw new ConstraintDefinitionException(sprintf('The "%s" constraint can not use "minMessage" and "maxMessage" when the "min" and "max" options are both set. Use "notInRangeMessage" instead.', static::class)); } } diff --git a/Constraints/RangeValidator.php b/Constraints/RangeValidator.php index 3aae44dc8..449ddb383 100644 --- a/Constraints/RangeValidator.php +++ b/Constraints/RangeValidator.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException; +use Symfony\Component\PropertyAccess\Exception\UninitializedPropertyException; use Symfony\Component\PropertyAccess\PropertyAccess; use Symfony\Component\PropertyAccess\PropertyAccessorInterface; use Symfony\Component\Validator\Constraint; @@ -162,6 +163,8 @@ private function getLimit(?string $propertyPath, mixed $default, Constraint $con return $this->getPropertyAccessor()->getValue($object, $propertyPath); } catch (NoSuchPropertyException $e) { throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: ', $propertyPath, get_debug_type($constraint)).$e->getMessage(), 0, $e); + } catch (UninitializedPropertyException) { + return null; } } diff --git a/Constraints/TimeValidator.php b/Constraints/TimeValidator.php index 473c9e8e0..ef422cdf5 100644 --- a/Constraints/TimeValidator.php +++ b/Constraints/TimeValidator.php @@ -21,8 +21,8 @@ */ class TimeValidator extends ConstraintValidator { - public const PATTERN = '/^(\d{2}):(\d{2}):(\d{2})$/'; - public const PATTERN_WITHOUT_SECONDS = '/^(\d{2}):(\d{2})$/'; + public const PATTERN = '/^(\d{2}):(\d{2}):(\d{2})$/D'; + public const PATTERN_WITHOUT_SECONDS = '/^(\d{2}):(\d{2})$/D'; /** * Checks whether a time is valid. diff --git a/Constraints/UniqueValidator.php b/Constraints/UniqueValidator.php index 1e692fe68..94d6a8965 100644 --- a/Constraints/UniqueValidator.php +++ b/Constraints/UniqueValidator.php @@ -43,15 +43,15 @@ public function validate(mixed $value, Constraint $constraint) $collectionElements = []; $normalizer = $this->getNormalizer($constraint); foreach ($value as $element) { + $element = $normalizer($element); + if ($fields && !$element = $this->reduceElementKeys($fields, $element)) { continue; } - $element = $normalizer($element); - if (\in_array($element, $collectionElements, true)) { $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) + ->setParameter('{{ value }}', $this->formatValue($element)) ->setCode(Unique::IS_NOT_UNIQUE) ->addViolation(); diff --git a/Constraints/UrlValidator.php b/Constraints/UrlValidator.php index 4a73040a2..09173835d 100644 --- a/Constraints/UrlValidator.php +++ b/Constraints/UrlValidator.php @@ -40,10 +40,10 @@ class UrlValidator extends ConstraintValidator \] # an IPv6 address ) (:[0-9]+)? # a port (optional) - (?:/ (?:[\pL\pN\-._\~!$&\'()*+,;=:@]|%%[0-9A-Fa-f]{2})* )* # a path + (?:/ (?:[\pL\pN\pS\pM\-._\~!$&\'()*+,;=:@]|%%[0-9A-Fa-f]{2})* )* # a path (?:\? (?:[\pL\pN\-._\~!$&\'\[\]()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a query (optional) (?:\# (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a fragment (optional) - $~ixu'; + $~ixuD'; /** * @return void diff --git a/Context/ExecutionContext.php b/Context/ExecutionContext.php index f21ed90fb..8ab1ec4d5 100644 --- a/Context/ExecutionContext.php +++ b/Context/ExecutionContext.php @@ -139,7 +139,7 @@ public function setConstraint(Constraint $constraint): void $this->constraint = $constraint; } - public function addViolation(string $message, array $parameters = []): void + public function addViolation(string|\Stringable $message, array $parameters = []): void { $this->violations->add(new ConstraintViolation( $this->translator->trans($message, $parameters, $this->translationDomain), @@ -154,7 +154,7 @@ public function addViolation(string $message, array $parameters = []): void )); } - public function buildViolation(string $message, array $parameters = []): ConstraintViolationBuilderInterface + public function buildViolation(string|\Stringable $message, array $parameters = []): ConstraintViolationBuilderInterface { return new ConstraintViolationBuilder( $this->violations, diff --git a/Mapping/ClassMetadata.php b/Mapping/ClassMetadata.php index 3a6c7181b..5da2fd79a 100644 --- a/Mapping/ClassMetadata.php +++ b/Mapping/ClassMetadata.php @@ -198,7 +198,7 @@ public function addConstraint(Constraint $constraint): static continue; } - if ($property->hasType() && (('array' === $type = $property->getType()->getName()) || class_exists($type))) { + if ($this->canCascade($property->getType())) { $this->addPropertyConstraint($property->getName(), new Valid()); } } @@ -487,4 +487,33 @@ private function checkConstraint(Constraint $constraint): void } } } + + private function canCascade(?\ReflectionType $type = null): bool + { + if (null === $type) { + return false; + } + + if ($type instanceof \ReflectionIntersectionType) { + foreach ($type->getTypes() as $nestedType) { + if ($this->canCascade($nestedType)) { + return true; + } + } + + return false; + } + + if ($type instanceof \ReflectionUnionType) { + foreach ($type->getTypes() as $nestedType) { + if (!$this->canCascade($nestedType)) { + return false; + } + } + + return true; + } + + return $type instanceof \ReflectionNamedType && (\in_array($type->getName(), ['array', 'null'], true) || class_exists($type->getName())); + } } diff --git a/Mapping/Loader/AbstractLoader.php b/Mapping/Loader/AbstractLoader.php index 3f0c0aa46..146b0dc9e 100644 --- a/Mapping/Loader/AbstractLoader.php +++ b/Mapping/Loader/AbstractLoader.php @@ -87,6 +87,18 @@ protected function newConstraint(string $name, mixed $options = null): Constrain } if ($this->namedArgumentsCache[$className] ??= (bool) (new \ReflectionMethod($className, '__construct'))->getAttributes(HasNamedArguments::class)) { + if (null === $options) { + return new $className(); + } + + if (!\is_array($options)) { + return new $className($options); + } + + if (1 === \count($options) && isset($options['value'])) { + return new $className($options['value']); + } + return new $className(...$options); } diff --git a/Mapping/Loader/XmlFileLoader.php b/Mapping/Loader/XmlFileLoader.php index 94d3f071e..1c5f52873 100644 --- a/Mapping/Loader/XmlFileLoader.php +++ b/Mapping/Loader/XmlFileLoader.php @@ -80,7 +80,9 @@ protected function parseConstraints(\SimpleXMLElement $nodes): array foreach ($nodes as $node) { if (\count($node) > 0) { if (\count($node->value) > 0) { - $options = $this->parseValues($node->value); + $options = [ + 'value' => $this->parseValues($node->value), + ]; } elseif (\count($node->constraint) > 0) { $options = $this->parseConstraints($node->constraint); } elseif (\count($node->option) > 0) { @@ -94,6 +96,10 @@ protected function parseConstraints(\SimpleXMLElement $nodes): array $options = null; } + if (isset($options['groups']) && !\is_array($options['groups'])) { + $options['groups'] = (array) $options['groups']; + } + $constraints[] = $this->newConstraint((string) $node['name'], $options); } diff --git a/Mapping/Loader/YamlFileLoader.php b/Mapping/Loader/YamlFileLoader.php index e610b4542..d17f96ef4 100644 --- a/Mapping/Loader/YamlFileLoader.php +++ b/Mapping/Loader/YamlFileLoader.php @@ -91,6 +91,12 @@ protected function parseNodes(array $nodes): array $options = $this->parseNodes($options); } + if (null !== $options && (!\is_array($options) || array_is_list($options))) { + $options = [ + 'value' => $options, + ]; + } + $values[] = $this->newConstraint(key($childNodes), $options); } else { if (\is_array($childNodes)) { diff --git a/Resources/bin/sync-iban-formats.php b/Resources/bin/sync-iban-formats.php index 4042bddf2..f41373cf2 100755 --- a/Resources/bin/sync-iban-formats.php +++ b/Resources/bin/sync-iban-formats.php @@ -168,7 +168,7 @@ public function getIbanFormats(): array $formats = []; foreach ($this->readIbanFormatsTable() as $item) { - if (!preg_match('/^([A-Z]{2})/', $item['Example'], $matches)) { + if (!preg_match('/^([A-Z]{2})/', $item['IBAN Fields'], $matches)) { continue; } diff --git a/Resources/translations/validators.af.xlf b/Resources/translations/validators.af.xlf index 387fb9a64..706f0ca49 100644 --- a/Resources/translations/validators.af.xlf +++ b/Resources/translations/validators.af.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Hierdie waarde is nie 'n geldige MAC-adres nie. + + This URL is missing a top-level domain. + Die URL mis 'n topvlakdomein. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.ar.xlf b/Resources/translations/validators.ar.xlf index 6ac303a77..6c684d98d 100644 --- a/Resources/translations/validators.ar.xlf +++ b/Resources/translations/validators.ar.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - هذه القيمة ليست عنوان IP صالحًا. + هذا ليس عنوان IP صحيح. This value is not a valid language. @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini, or the configured folder does not exist. - لم يتم تكوين مجلد مؤقت في ملف php.ini، أو المجلد المعد لا يوجد. + لم يتم تكوين مجلد مؤقت في ملف php.ini. Cannot write temporary file to disk. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - هذه القيمة ليست رقم حساب بنكي دولي (IBAN) صالحًا. + هذه القيمة ليست رقم حساب بنكي دولي (IBAN) صالحًا. This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - هذه القيمة ليست رمز معرف الأعمال (BIC) صالحًا. + هذه القيمة ليست رمز معرف أعمال (BIC) صالحًا. Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - هذه القيمة ليست UUID صالحًا. + هذه القيمة ليست UUID صالحًا. This value should be a multiple of {{ compared_value }}. @@ -432,11 +432,39 @@ The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. - تم اكتشاف ترميز الأحرف غير صالح ({{ detected }}). الترميزات المسموح بها هي {{ encodings }}. + تم اكتشاف ترميز أحرف غير صالح ({{ detected }}). الترميزات المسموح بها هي {{ encodings }}. This value is not a valid MAC address. - هذه القيمة ليست عنوان MAC صالحًا. + هذه القيمة ليست عنوان MAC صالحًا. + + + This URL is missing a top-level domain. + هذا الرابط يفتقر إلى نطاق المستوى الأعلى. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". diff --git a/Resources/translations/validators.az.xlf b/Resources/translations/validators.az.xlf index b6152e99d..0b149024c 100644 --- a/Resources/translations/validators.az.xlf +++ b/Resources/translations/validators.az.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Bu dəyər etibarlı bir MAC ünvanı deyil. + + This URL is missing a top-level domain. + Bu URL yuxarı səviyyəli domeni çatışmır. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.be.xlf b/Resources/translations/validators.be.xlf index ea7001957..3db0ddc20 100644 --- a/Resources/translations/validators.be.xlf +++ b/Resources/translations/validators.be.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Гэта значэнне не з'яўляецца сапраўдным MAC-адрасам. + + This URL is missing a top-level domain. + Гэтаму URL бракуе дамен верхняга ўзроўню. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.bg.xlf b/Resources/translations/validators.bg.xlf index 5705364f8..e0792e209 100644 --- a/Resources/translations/validators.bg.xlf +++ b/Resources/translations/validators.bg.xlf @@ -68,7 +68,7 @@ The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - Mime типа на файла е невалиден ({{ type }}). Разрешени mime типове са {{ types }}. + Mime типът на файла е невалиден ({{ type }}). Разрешени mime типове са {{ types }}. This value should be {{ limit }} or less. @@ -136,7 +136,7 @@ This value is not a valid IP address. - Тази стойност не е валиден IP адрес. + Стойността не е валиден IP адрес. This value is not a valid language. @@ -156,7 +156,7 @@ The size of the image could not be detected. - Размера на изображението не може да бъде определен. + Размерът на изображението не може да бъде определен. The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini, or the configured folder does not exist. - В php.ini не е конфигурирана временна директория, или конфигурираната директория не съществува. + В php.ini не е конфигурирана временна директория или конфигурираната директория не съществува. Cannot write temporary file to disk. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Тази стойност не е валиден международен банков сметка номер (IBAN). + Стойността не е валиден Международен номер на банкова сметка (IBAN). This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Тази стойност не е валиден код за идентификация на бизнеса (BIC). + Стойността не е валиден Бизнес идентификационен код (BIC). Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Тази стойност не е валиден UUID. + Стойността не е валиден UUID. This value should be a multiple of {{ compared_value }}. @@ -328,7 +328,7 @@ This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Бизнес идентификационния код (BIC) не е свързан с IBAN {{ iban }}. + Бизнес идентификационният код (BIC) не е свързан с IBAN {{ iban }}. This value should be valid JSON. @@ -360,7 +360,7 @@ This password has been leaked in a data breach, it must not be used. Please use another password. - Тази парола е компрометирана, не трябва да бъде използвана. Моля използвайте друга парола. + Тази парола е компрометирана, не може да бъде използвана. Моля използвайте друга парола. This value should be between {{ min }} and {{ max }}. @@ -436,7 +436,35 @@ This value is not a valid MAC address. - Тази стойност не е валиден MAC адрес. + Стойността не е валиден MAC адрес. + + + This URL is missing a top-level domain. + На този URL липсва домейн от най-високо ниво. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". diff --git a/Resources/translations/validators.bs.xlf b/Resources/translations/validators.bs.xlf index bff1c8b44..150025d03 100644 --- a/Resources/translations/validators.bs.xlf +++ b/Resources/translations/validators.bs.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Ova vrijednost nije valjana MAC adresa. + + This URL is missing a top-level domain. + Ovom URL-u nedostaje domena najvišeg nivoa. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.ca.xlf b/Resources/translations/validators.ca.xlf index 2f301e784..fb3c41dbc 100644 --- a/Resources/translations/validators.ca.xlf +++ b/Resources/translations/validators.ca.xlf @@ -108,7 +108,7 @@ This value is not a valid URL. - Aquest valor no és una URL vàlida. + Aquest valor no és un URL vàlid. The two values should be equal. @@ -116,7 +116,7 @@ The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. - L'arxiu és massa gran. El tamany màxim permés és {{ limit }} {{ suffix }}. + L'arxiu és massa gran. La mida màxima permesa és {{ limit }} {{ suffix }}. The file is too large. @@ -136,7 +136,7 @@ This value is not a valid IP address. - Aquest valor no és una adreça IP vàlida. + Aquest valor no és una adreça IP vàlida. This value is not a valid language. @@ -160,19 +160,19 @@ The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - L'amplària de la imatge és massa gran ({{ width }}px). L'amplària màxima permesa són {{ max_width }}px. + L'amplària de la imatge és massa gran ({{ width }}px). L'amplària màxima permesa és {{ max_width }}px. The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - L'amplària de la imatge és massa petita ({{ width }}px). L'amplària mínima requerida són {{ min_width }}px. + L'amplària de la imatge és massa petita ({{ width }}px). L'amplària mínima requerida és {{ min_width }}px. The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - L'altura de la imatge és massa gran ({{ height }}px). L'altura màxima permesa són {{ max_height }}px. + L'altura de la imatge és massa gran ({{ height }}px). L'altura màxima permesa és {{ max_height }}px. The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - L'altura de la imatge és massa petita ({{ height }}px). L'altura mínima requerida són {{ min_height }}px. + L'altura de la imatge és massa petita ({{ height }}px). L'altura mínima requerida és {{ min_height }}px. This value should be the user's current password. @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini, or the configured folder does not exist. - No s'ha configurat cap carpeta temporal en php.ini, o la carpeta configurada no existeix. + No s'ha configurat cap carpeta temporal en php.ini, o la carpeta configurada no existeix. Cannot write temporary file to disk. @@ -200,7 +200,7 @@ A PHP extension caused the upload to fail. - Una extensió de PHP va fer que la pujada fallara. + Una extensió de PHP va fer que la pujada fallarà. This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Aquest valor no és un Número de Compte Bancari Internacional (IBAN) vàlid. + Aquest valor no és un Número de Compte Bancari Internacional (IBAN) vàlid. This value is not a valid ISBN-10. @@ -276,31 +276,31 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - Aquest valor no hauria de idèntic a {{ compared_value_type }} {{ compared_value }}. + Aquest valor no hauria de ser idèntic a {{ compared_value_type }} {{ compared_value }}. The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - La proporció de l'imatge és massa gran ({{ ratio }}). La màxima proporció permesa és {{ max_ratio }}. + La proporció de la imatge és massa gran ({{ ratio }}). La màxima proporció permesa és {{ max_ratio }}. The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - La proporció de l'imatge és massa petita ({{ ratio }}). La mínima proporció permesa és {{ max_ratio }}. + La proporció de la imatge és massa petita ({{ ratio }}). La mínima proporció permesa és {{ min_ratio }}. The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - L'imatge és quadrada({{ width }}x{{ height }}px). Les imatges quadrades no estan permeses. + La imatge és quadrada({{ width }}x{{ height }}px). Les imatges quadrades no estan permeses. The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - L'imatge està orientada horitzontalment ({{ width }}x{{ height }}px). Les imatges orientades horitzontalment no estan permeses. + La imatge està orientada horitzontalment ({{ width }}x{{ height }}px). Les imatges orientades horitzontalment no estan permeses. The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - L'imatge està orientada verticalment ({{ width }}x{{ height }}px). Les imatges orientades verticalment no estan permeses. + La imatge està orientada verticalment ({{ width }}x{{ height }}px). Les imatges orientades verticalment no estan permeses. An empty file is not allowed. - No està permès un fixter buit. + No està permès un fitxer buit. The host could not be resolved. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Aquest valor no és un Codi d'Identificador de Negocis (BIC) vàlid. + Aquest valor no és un Codi d'identificació bancari (BIC) vàlid. Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Aquest valor no és un UUID vàlid. + Aquest valor no és un UUID vàlid. This value should be a multiple of {{ compared_value }}. @@ -428,15 +428,43 @@ The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}. - L'extensió del fitxer no és vàlida ({{ extension }}). Les extensions permeses són {{ extensions }}. + L'extensió del fitxer no és vàlida ({{ extension }}). Les extensions permeses són {{ extensions }}. The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. - S'ha detectat que la codificació de caràcters no és vàlida ({{ detected }}). Les codificacions permeses són {{ encodings }}. + S'ha detectat que la codificació de caràcters no és vàlida ({{ detected }}). Les codificacions permeses són {{ encodings }}. This value is not a valid MAC address. - Aquest valor no és una adreça MAC vàlida. + Aquest valor no és una adreça MAC vàlida. + + + This URL is missing a top-level domain. + Aquesta URL no conté un domini de primer nivell. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + Aquest valor és massa curt. Ha de contenir almenys una paraula.|Aquest valor és massa curt. Ha de contenir almenys {{ min }} paraules. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + Aquest valor és massa llarg. Ha de contenir una paraula.|Aquest valor és massa llarg. Ha de contenir {{ max }} paraules o menys. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". diff --git a/Resources/translations/validators.cs.xlf b/Resources/translations/validators.cs.xlf index 9ca83564e..e99d3236e 100644 --- a/Resources/translations/validators.cs.xlf +++ b/Resources/translations/validators.cs.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Tato hodnota není platnou MAC adresou. + + This URL is missing a top-level domain. + Této URL chybí doména nejvyššího řádu. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.cy.xlf b/Resources/translations/validators.cy.xlf index fd984989e..667f4a6d4 100644 --- a/Resources/translations/validators.cy.xlf +++ b/Resources/translations/validators.cy.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Nid yw'r gwerth hwn yn gyfeiriad MAC dilys. + + This URL is missing a top-level domain. + Mae'r URL hwn yn colli parth lefel uchaf. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.da.xlf b/Resources/translations/validators.da.xlf index 826ef10c9..5d08a01df 100644 --- a/Resources/translations/validators.da.xlf +++ b/Resources/translations/validators.da.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Denne værdi er ikke en gyldig MAC-adresse. + + This URL is missing a top-level domain. + Denne URL mangler et topdomæne. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.de.xlf b/Resources/translations/validators.de.xlf index 9f145fdee..301ee496e 100644 --- a/Resources/translations/validators.de.xlf +++ b/Resources/translations/validators.de.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Dieser Wert ist keine gültige MAC-Adresse. + + This URL is missing a top-level domain. + Dieser URL fehlt eine Top-Level-Domain. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + Dieser Wert ist zu kurz. Er muss aus mindestens einem Wort bestehen.|Dieser Wert ist zu kurz. Er muss mindestens {{ min }} Wörter enthalten. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + Dieser Wert ist zu lang. Er darf maximal aus einem Wort bestehen.|Dieser Wert ist zu lang. Er darf maximal {{ max }} Wörter enthalten. + + + This value does not represent a valid week in the ISO 8601 format. + Dieser Wert ist keine Wochenangabe im ISO 8601-Format. + + + This value is not a valid week. + Dieser Wert ist keine gültige Woche. + + + This value should not be before week "{{ min }}". + Dieser Wert darf nicht vor der Woche "{{ min }}" sein. + + + This value should not be after week "{{ max }}". + Dieser Wert darf nicht nach der Woche "{{ max }}" sein. + diff --git a/Resources/translations/validators.el.xlf b/Resources/translations/validators.el.xlf index f7677fabf..e58dd3d77 100644 --- a/Resources/translations/validators.el.xlf +++ b/Resources/translations/validators.el.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - Αυτή η τιμή δεν είναι έγκυρη διεύθυνση IP. + Αυτή η IP διεύθυνση δεν είναι έγκυρη. This value is not a valid language. @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini, or the configured folder does not exist. - Δεν ρυθμίστηκε προσωρινός φάκελος στο php.ini, ή ο ρυθμισμένος φάκελος δεν υπάρχει. + Δεν έχει ρυθμιστεί προσωρινός φάκελος στο php.ini, ή ο ρυθμισμένος φάκελος δεν υπάρχει. Cannot write temporary file to disk. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Αυτή η τιμή δεν είναι έγκυρος Διεθνής Αριθμός Τραπεζικού Λογαριασμού (IBAN). + Αυτός δεν είναι έγκυρος διεθνής αριθμός τραπεζικού λογαριασμού (IBAN). This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Αυτή η τιμή δεν είναι έγκυρος Κωδικός Ταυτοποίησης Επιχείρησης (BIC). + Αυτός ο αριθμός δεν είναι έγκυρος Κωδικός Ταυτοποίησης Επιχείρησης (BIC). Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Αυτή η τιμή δεν είναι έγκυρη UUID. + Αυτός ο αριθμός δεν είναι έγκυρη UUID. This value should be a multiple of {{ compared_value }}. @@ -436,7 +436,35 @@ This value is not a valid MAC address. - Αυτή η τιμή δεν είναι έγκυρη διεύθυνση MAC. + Αυτός ο αριθμός δεν είναι έγκυρη διεύθυνση MAC. + + + This URL is missing a top-level domain. + Αυτή η διεύθυνση URL λείπει ένας τομέας ανώτατου επιπέδου. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". diff --git a/Resources/translations/validators.en.xlf b/Resources/translations/validators.en.xlf index 35196e572..faf549e48 100644 --- a/Resources/translations/validators.en.xlf +++ b/Resources/translations/validators.en.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. This value is not a valid MAC address. + + This URL is missing a top-level domain. + This URL is missing a top-level domain. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.es.xlf b/Resources/translations/validators.es.xlf index abe75d530..fa26c7210 100644 --- a/Resources/translations/validators.es.xlf +++ b/Resources/translations/validators.es.xlf @@ -404,7 +404,7 @@ The filename is too long. It should have {{ filename_max_length }} character or less.|The filename is too long. It should have {{ filename_max_length }} characters or less. - El nombre del archivo es demasido largo. Debe tener {{ filename_max_length }} carácter o menos.|El nombre del archivo es demasido largo. Debe tener {{ filename_max_length }} caracteres o menos. + El nombre del archivo es demasiado largo. Debe tener {{ filename_max_length }} carácter o menos.|El nombre del archivo es demasiado largo. Debe tener {{ filename_max_length }} caracteres o menos. The password strength is too low. Please use a stronger password. @@ -438,6 +438,34 @@ This value is not a valid MAC address. Este valor no es una dirección MAC válida. + + This URL is missing a top-level domain. + Esta URL no contiene una extensión de dominio (TLD). + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + Este valor es demasiado corto. Debe contener al menos una palabra.|Este valor es demasiado corto. Debe contener al menos {{ min }} palabras. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + Este valor es demasiado largo. Debe contener una palabra.|Este valor es demasiado largo. Debe contener {{ max }} palabras o menos. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.et.xlf b/Resources/translations/validators.et.xlf index 0af593467..774445dd0 100644 --- a/Resources/translations/validators.et.xlf +++ b/Resources/translations/validators.et.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. See väärtus ei ole kehtiv MAC-aadress. + + This URL is missing a top-level domain. + Sellel URL-il puudub ülataseme domeen. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.eu.xlf b/Resources/translations/validators.eu.xlf index 6094d1cbc..3e1a544c8 100644 --- a/Resources/translations/validators.eu.xlf +++ b/Resources/translations/validators.eu.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Balio hau ez da MAC helbide baliozko bat. + + This URL is missing a top-level domain. + URL honek ez du goi-mailako domeinurik. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.fa.xlf b/Resources/translations/validators.fa.xlf index 1db553c9f..98486482b 100644 --- a/Resources/translations/validators.fa.xlf +++ b/Resources/translations/validators.fa.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. این مقدار یک آدرس MAC معتبر نیست. + + This URL is missing a top-level domain. + این URL فاقد دامنه سطح بالا است. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.fi.xlf b/Resources/translations/validators.fi.xlf index 324df2c27..2dac5b5b8 100644 --- a/Resources/translations/validators.fi.xlf +++ b/Resources/translations/validators.fi.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Tämä arvo ei ole kelvollinen MAC-osoite. + + This URL is missing a top-level domain. + Tästä URL-osoitteesta puuttuu ylätason verkkotunnus. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.fr.xlf b/Resources/translations/validators.fr.xlf index e2d747a49..2fb4eeac1 100644 --- a/Resources/translations/validators.fr.xlf +++ b/Resources/translations/validators.fr.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Cette valeur n'est pas une adresse MAC valide. + + This URL is missing a top-level domain. + Cette URL doit contenir un domaine de premier niveau. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + Cette valeur est trop courte. Elle doit contenir au moins un mot.|Cette valeur est trop courte. Elle doit contenir au moins {{ min }} mots. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + Cette valeur est trop longue. Elle doit contenir au maximum un mot.|Cette valeur est trop longue. Elle doit contenir au maximum {{ max }} mots. + + + This value does not represent a valid week in the ISO 8601 format. + Cette valeur ne représente pas une semaine valide au format ISO 8601. + + + This value is not a valid week. + Cette valeur n'est pas une semaine valide. + + + This value should not be before week "{{ min }}". + Cette valeur ne doit pas être antérieure à la semaine "{{ min }}". + + + This value should not be after week "{{ max }}". + Cette valeur ne doit pas être postérieure à la semaine "{{ max }}". + diff --git a/Resources/translations/validators.gl.xlf b/Resources/translations/validators.gl.xlf index 2723983c5..1a48093dc 100644 --- a/Resources/translations/validators.gl.xlf +++ b/Resources/translations/validators.gl.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Este valor non é un enderezo MAC válido. + + This URL is missing a top-level domain. + Esta URL non contén un dominio de nivel superior. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.he.xlf b/Resources/translations/validators.he.xlf index b1bb894a7..73ccca53f 100644 --- a/Resources/translations/validators.he.xlf +++ b/Resources/translations/validators.he.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. ערך זה אינו כתובת MAC תקפה. + + This URL is missing a top-level domain. + לכתובת URL זו חסר דומיין רמה עליונה. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.hr.xlf b/Resources/translations/validators.hr.xlf index eed237ce2..147f4313c 100644 --- a/Resources/translations/validators.hr.xlf +++ b/Resources/translations/validators.hr.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Ova vrijednost nije valjana MAC adresa. + + This URL is missing a top-level domain. + Ovom URL-u nedostaje vršna domena. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.hu.xlf b/Resources/translations/validators.hu.xlf index df39afd70..185ebf02b 100644 --- a/Resources/translations/validators.hu.xlf +++ b/Resources/translations/validators.hu.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Ez az érték nem érvényes MAC-cím. + + This URL is missing a top-level domain. + Az URL-ből hiányzik a legfelső szintű tartomány (top-level domain). + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.hy.xlf b/Resources/translations/validators.hy.xlf index 707301d18..24423b082 100644 --- a/Resources/translations/validators.hy.xlf +++ b/Resources/translations/validators.hy.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Այս արժեքը վավեր MAC հասցե չէ։ + + This URL is missing a top-level domain. + Այս URL-ը չունի վերին մակարդակի դոմեյն: + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.id.xlf b/Resources/translations/validators.id.xlf index 1cc60c4d8..3bffae84d 100644 --- a/Resources/translations/validators.id.xlf +++ b/Resources/translations/validators.id.xlf @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini, or the configured folder does not exist. - Tidak ada folder sementara yang dikonfigurasi di php.ini, atau folder yang dikonfigurasi tidak ada. + Tidak ada folder sementara yang dikonfigurasi di php.ini, atau folder yang dikonfigurasi tidak ada. Cannot write temporary file to disk. @@ -438,6 +438,34 @@ This value is not a valid MAC address. Nilai ini bukan alamat MAC yang valid. + + This URL is missing a top-level domain. + URL ini tidak memiliki domain tingkat atas. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.it.xlf b/Resources/translations/validators.it.xlf index bd7b25882..1e77aba17 100644 --- a/Resources/translations/validators.it.xlf +++ b/Resources/translations/validators.it.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Questo valore non è un indirizzo MAC valido. + + This URL is missing a top-level domain. + Questo URL è privo di un dominio di primo livello. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.ja.xlf b/Resources/translations/validators.ja.xlf index 0524cd051..26cb6e593 100644 --- a/Resources/translations/validators.ja.xlf +++ b/Resources/translations/validators.ja.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - この値は有効なIPアドレスではありません。 + 有効なIPアドレスではありません。 This value is not a valid language. @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini, or the configured folder does not exist. - php.iniに一時フォルダが設定されていないか、設定されたフォルダが存在しません。 + php.iniに一時フォルダが設定されていないか、設定されたフォルダが存在しません。 Cannot write temporary file to disk. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - この値は有効な国際銀行口座番号(IBAN)ではありません。 + 有効な国際銀行勘定番号(IBAN)ではありません。 This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - この値は有効なビジネス識別コード(BIC)ではありません。 + 有効なSWIFTコードではありません。 Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - この値は有効なUUIDではありません。 + 有効なUUIDではありません。 This value should be a multiple of {{ compared_value }}. @@ -436,7 +436,35 @@ This value is not a valid MAC address. - この値は有効なMACアドレスではありません。 + 有効なMACアドレスではありません。 + + + This URL is missing a top-level domain. + このURLはトップレベルドメインがありません。 + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". diff --git a/Resources/translations/validators.lb.xlf b/Resources/translations/validators.lb.xlf index 548d82da4..8b0b6a244 100644 --- a/Resources/translations/validators.lb.xlf +++ b/Resources/translations/validators.lb.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Dëse Wäert ass keng gülteg MAC-Adress. + + This URL is missing a top-level domain. + Dësen URL feelt eng Top-Level-Domain. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.lt.xlf b/Resources/translations/validators.lt.xlf index b3ee199fe..e30f8a6ae 100644 --- a/Resources/translations/validators.lt.xlf +++ b/Resources/translations/validators.lt.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - Ši vertė nėra galiojantis IP adresas. + Ši reikšmė nėra tinkamas IP adresas. This value is not a valid language. @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini, or the configured folder does not exist. - php.ini nesukonfigūruotas laikinas aplankas, arba sukonfigūruotas aplankas neegzistuoja. + php.ini nesukonfigūruotas laikinas aplankas arba sukonfigūruotas aplankas neegzistuoja. Cannot write temporary file to disk. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Ši vertė nėra galiojantis Tarptautinis Banko Sąskaitos Numeris (IBAN). + Ši reikšmė nėra tinkamas Tarptautinis Banko Sąskaitos Numeris (IBAN). This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Ši vertė nėra galiojantis Verslo Identifikavimo Kodas (BIC). + Ši reikšmė nėra tinkamas Verslo Identifikavimo Kodas (BIC). Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Ši vertė nėra galiojantis UUID. + Ši reikšmė nėra tinkamas UUID. This value should be a multiple of {{ compared_value }}. @@ -432,11 +432,39 @@ The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. - Nustatyta simbolių koduotė yra netinkama ({{ detected }}). Leidžiamos koduotės yra {{ encodings }}. + Aptikta simbolių koduotė yra netinkama ({{ detected }}). Leidžiamos koduotės yra {{ encodings }}. This value is not a valid MAC address. - Ši vertė nėra galiojantis MAC adresas. + Ši reikšmė nėra tinkamas MAC adresas. + + + This URL is missing a top-level domain. + Šiam URL trūksta aukščiausio lygio domeno. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + Per mažas žodžių skaičius. Turi susidaryti bent iš 1 žodžio.|Per mažas žodžių skaičius. Turi susidaryti iš {{ min }} arba daugiau žodžių. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + Per didelis žodžių skaičius. Turi susidaryti iš 1 žodžio.|Per didelis žodžių skaičius. Turi susidaryti iš {{ max }} arba mažiau žodžių. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". diff --git a/Resources/translations/validators.lv.xlf b/Resources/translations/validators.lv.xlf index d1222f02b..fef1c3662 100644 --- a/Resources/translations/validators.lv.xlf +++ b/Resources/translations/validators.lv.xlf @@ -48,7 +48,7 @@ This value is not a valid datetime. - Šī vērtība ir nederīgs datums un laiks + Šī vērtība ir nederīgs datums un laiks. This value is not a valid email address. @@ -438,6 +438,34 @@ This value is not a valid MAC address. Šī vērtība nav derīga MAC adrese. + + This URL is missing a top-level domain. + Šim URL trūkst augšējā līmeņa domēna. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + Šī vērtība ir pārāk īsa. Tai būtu jābūt vismaz vienu vārdu garai.|Šī vērtība ir pārāk īsa. Tai būtu jābūt ne mazāk kā {{ min }} vārdus garai. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + Šī vērtība ir pārāk gara. Tai būtu jābūt vienam vārdam.|Šī vērtība ir pārāk gara. Tai būtu jābūt ne vairāk kā {{ max }} vārdus garai. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.mk.xlf b/Resources/translations/validators.mk.xlf index 9d6dec628..722c9a789 100644 --- a/Resources/translations/validators.mk.xlf +++ b/Resources/translations/validators.mk.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Оваа вредност не е валидна MAC адреса. + + This URL is missing a top-level domain. + На овој URL недостасува домен од највисоко ниво. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.mn.xlf b/Resources/translations/validators.mn.xlf index 4984bb127..0c9f8c84d 100644 --- a/Resources/translations/validators.mn.xlf +++ b/Resources/translations/validators.mn.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Энэ утга хүчинтэй MAC хаяг биш юм. + + This URL is missing a top-level domain. + Энэ URL дээд түвшингийн домейн дутуу байна. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.my.xlf b/Resources/translations/validators.my.xlf index e4858336c..89bb0906e 100644 --- a/Resources/translations/validators.my.xlf +++ b/Resources/translations/validators.my.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. ဤတန်ဖိုးသည် မှန်ကန်သော MAC လိပ်စာ မဟုတ်ပါ။ + + This URL is missing a top-level domain. + ဤ URL တွင် အမြင့်ဆုံးအဆင့်ဒိုမိန်း ပါဝင်မရှိပါ။ + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.nb.xlf b/Resources/translations/validators.nb.xlf index 8b317449e..d0a0e6509 100644 --- a/Resources/translations/validators.nb.xlf +++ b/Resources/translations/validators.nb.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Denne verdien er ikke en gyldig MAC-adresse. + + This URL is missing a top-level domain. + Denne URL-en mangler et toppnivådomene. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.nl.xlf b/Resources/translations/validators.nl.xlf index 81d57cab4..fdea10f0e 100644 --- a/Resources/translations/validators.nl.xlf +++ b/Resources/translations/validators.nl.xlf @@ -64,11 +64,11 @@ The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. - Het bestand is te groot ({{ size }} {{ suffix }}). Toegestane maximum grootte is {{ limit }} {{ suffix }}. + Het bestand is te groot ({{ size }} {{ suffix }}). De maximale grootte is {{ limit }} {{ suffix }}. The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - Het mime type van het bestand is ongeldig ({{ type }}). Toegestane mime types zijn {{ types }}. + Het mediatype van het bestand is ongeldig ({{ type }}). De toegestane mediatypes zijn {{ types }}. This value should be {{ limit }} or less. @@ -116,7 +116,7 @@ The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. - Het bestand is te groot. Toegestane maximum grootte is {{ limit }} {{ suffix }}. + Het bestand is te groot. De maximale grootte is {{ limit }} {{ suffix }}. The file is too large. @@ -144,7 +144,7 @@ This value is not a valid locale. - Deze waarde is geen geldige locale. + Deze waarde is geen geldige landinstelling. This value is not a valid country. @@ -160,7 +160,7 @@ The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - De afbeelding is te breed ({{ width }}px). De maximaal toegestane breedte is {{ max_width }}px. + De afbeelding is te breed ({{ width }}px). De maximaal breedte is {{ max_width }}px. The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. @@ -168,7 +168,7 @@ The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - De afbeelding is te hoog ({{ height }}px). De maximaal toegestane hoogte is {{ max_height }}px. + De afbeelding is te hoog ({{ height }}px). De maximaal hoogte is {{ max_height }}px. The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. @@ -280,11 +280,11 @@ The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - De afbeeldingsverhouding is te groot ({{ ratio }}). Maximale verhouding is {{ max_ratio }}. + De afbeeldingsverhouding is te groot ({{ ratio }}). De maximale verhouding is {{ max_ratio }}. The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - De afbeeldingsverhouding is te klein ({{ ratio }}). Minimale verhouding is {{ min_ratio }}. + De afbeeldingsverhouding is te klein ({{ ratio }}). De minimale verhouding is {{ min_ratio }}. The image is square ({{ width }}x{{ height }}px). Square images are not allowed. @@ -324,7 +324,7 @@ This value should be a multiple of {{ compared_value }}. - Deze waarde zou een meervoud van {{ compared_value }} moeten zijn. + Deze waarde moet een meervoud van {{ compared_value }} zijn. This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. @@ -336,7 +336,7 @@ This collection should contain only unique elements. - Deze collectie moet alleen unieke elementen bevatten. + Deze collectie mag alleen unieke elementen bevatten. This value should be positive. @@ -396,7 +396,7 @@ This value is not a valid CIDR notation. - Deze waarde is geen geldige CIDR notatie. + Deze waarde is geen geldige CIDR-notatie. The value of the netmask should be between {{ min }} and {{ max }}. @@ -404,11 +404,11 @@ The filename is too long. It should have {{ filename_max_length }} character or less.|The filename is too long. It should have {{ filename_max_length }} characters or less. - De bestandsnaam is te lang. Het moet {{ filename_max_length }} karakter of minder zijn. + De bestandsnaam is te lang. Het moet {{ filename_max_length }} karakter of minder zijn.|De bestandsnaam is te lang. Het moet {{ filename_max_length }} karakters of minder zijn. The password strength is too low. Please use a stronger password. - De wachtwoordsterkte is te laag. Gebruik alstublieft een sterker wachtwoord. + Het wachtwoord is niet sterk genoeg. Probeer een sterker wachtwoord. This value contains characters that are not allowed by the current restriction-level. @@ -428,16 +428,44 @@ The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}. - De extensie van het bestand is ongeldig ({{ extension }}). Toegestane extensies zijn {{ extensions }}. + De bestandsextensie is ongeldig ({{ extension }}). De toegestane extensies zijn {{ extensions }}. The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. - De gedetecteerde karaktercodering is ongeldig ({{ detected }}). Toegestane coderingen zijn {{ encodings }}. + De gedetecteerde karaktercodering is ongeldig ({{ detected }}). De toegestane coderingen zijn {{ encodings }}. This value is not a valid MAC address. Deze waarde is geen geldig MAC-adres. + + This URL is missing a top-level domain. + Deze URL mist een top-level domein. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + Deze waarde is te kort. Het moet ten minste één woord bevatten.|Deze waarde is te kort. Het moet ten minste {{ min }} woorden bevatten. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + Deze waarde is te lang. Het moet één woord zijn.|Deze waarde is te lang. Het mag maximaal {{ max }} woorden bevatten. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.nn.xlf b/Resources/translations/validators.nn.xlf index 4e1a41dab..8ff78c5a0 100644 --- a/Resources/translations/validators.nn.xlf +++ b/Resources/translations/validators.nn.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Denne verdien er ikkje ein gyldig MAC-adresse. + + This URL is missing a top-level domain. + Denne URL-en manglar eit toppnivådomene. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.no.xlf b/Resources/translations/validators.no.xlf index 8b317449e..d0a0e6509 100644 --- a/Resources/translations/validators.no.xlf +++ b/Resources/translations/validators.no.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Denne verdien er ikke en gyldig MAC-adresse. + + This URL is missing a top-level domain. + Denne URL-en mangler et toppnivådomene. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.pl.xlf b/Resources/translations/validators.pl.xlf index 29180984e..541a35d73 100644 --- a/Resources/translations/validators.pl.xlf +++ b/Resources/translations/validators.pl.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Ta wartość nie jest prawidłowym adresem MAC. + + This URL is missing a top-level domain. + Podany URL nie zawiera domeny najwyższego poziomu. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + Podana wartość jest zbyt krótka. Powinna zawierać co najmniej jedno słowo.|Podana wartość jest zbyt krótka. Powinna zawierać co najmniej {{ min }} słów. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + Podana wartość jest zbyt długa. Powinna zawierać jedno słowo.|Podana wartość jest zbyt długa. Powinna zawierać {{ max }} słów lub mniej. + + + This value does not represent a valid week in the ISO 8601 format. + Podana wartość nie jest poprawnym oznaczeniem tygodnia w formacie ISO 8601. + + + This value is not a valid week. + Podana wartość nie jest poprawnym oznaczeniem tygodnia. + + + This value should not be before week "{{ min }}". + Podana wartość nie powinna być przed tygodniem "{{ min }}". + + + This value should not be after week "{{ max }}". + Podana wartość nie powinna być po tygodniu "{{ max }}". + diff --git a/Resources/translations/validators.pt.xlf b/Resources/translations/validators.pt.xlf index 5861a6d14..bb3208cfa 100644 --- a/Resources/translations/validators.pt.xlf +++ b/Resources/translations/validators.pt.xlf @@ -88,7 +88,7 @@ This value should not be blank. - Este valor não deveria ser branco/vazio. + Este valor não deveria ser vazio. This value should not be null. @@ -108,7 +108,7 @@ This value is not a valid URL. - Este valor não é um URL válido. + Este valor não é uma URL válida. The two values should be equal. @@ -120,11 +120,11 @@ The file is too large. - O ficheiro é muito grande. + O arquivo é muito grande. The file could not be uploaded. - Não foi possível carregar o ficheiro. + Não foi possível enviar o arquivo. This value should be a valid number. @@ -132,7 +132,7 @@ This file is not a valid image. - Este ficheiro não é uma imagem. + Este arquivo não é uma imagem. This value is not a valid IP address. @@ -144,11 +144,11 @@ This value is not a valid locale. - Este valor não é um 'locale' válido. + Este valor não é uma localidade válida. This value is not a valid country. - Este valor não é um País válido. + Este valor não é um país válido. This value is already used. @@ -156,7 +156,7 @@ The size of the image could not be detected. - O tamanho da imagem não foi detetado. + O tamanho da imagem não foi detectado. The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. @@ -164,7 +164,7 @@ The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - A largura da imagem ({{ width }}px) é muito pequena. A largura miníma da imagem é de: {{ min_width }}px. + A largura da imagem ({{ width }}px) é muito pequena. A largura mínima da imagem é de: {{ min_width }}px. The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. @@ -172,7 +172,7 @@ The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - A altura da imagem ({{ height }}px) é muito pequena. A altura miníma da imagem é de: {{ min_height }}px. + A altura da imagem ({{ height }}px) é muito pequena. A altura mínima da imagem é de: {{ min_height }}px. This value should be the user's current password. @@ -180,7 +180,7 @@ This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - Este valor deve possuir exatamente {{ limit }} caracteres. + Este valor deve possuir exatamente {{ limit }} caractere.|Este valor deve possuir exatamente {{ limit }} caracteres. The file was only partially uploaded. @@ -308,7 +308,7 @@ This value does not match the expected {{ charset }} charset. - O valor não corresponde ao conjunto de caracteres {{ charset }} esperado. + Este valor não corresponde ao conjunto de caracteres {{ charset }} esperado. This value is not a valid Business Identifier Code (BIC). @@ -340,7 +340,7 @@ This value should be positive. - Este valor deve ser estritamente positivo. + Este valor deve ser positivo. This value should be either positive or zero. @@ -348,7 +348,7 @@ This value should be negative. - Este valor deve ser estritamente negativo. + Este valor deve ser negativo. This value should be either negative or zero. @@ -360,11 +360,11 @@ This password has been leaked in a data breach, it must not be used. Please use another password. - Esta senha foi divulgada durante uma fuga de dados, não deve ser usada de novamente. Por favor usar uma senha outra. + Esta senha foi divulgada durante um vazamento de dados, não deve ser usada de novamente. Por favor usar uma senha outra. This value should be between {{ min }} and {{ max }}. - Este valor deve situar-se entre {{ min }} e {{ max }}. + Este valor deve estar entre {{ min }} e {{ max }}. This value is not a valid hostname. @@ -376,7 +376,7 @@ This value should satisfy at least one of the following constraints: - Este valor deve satisfazer pelo menos uma das seguintes restrições : + Este valor deve satisfazer pelo menos uma das seguintes restrições: Each element of this collection should satisfy its own set of constraints. @@ -428,16 +428,44 @@ The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}. - A extensão do ficheiro é inválida ({{ extension }}). As extensões permitidas são {{ extensions }}. + A extensão do arquivo é inválida ({{ extension }}). As extensões permitidas são {{ extensions }}. The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. - A codificação de carateres detetada é inválida ({{ detected }}). As codificações permitidas são {{ encodings }}. + A codificação de carateres detectada é inválida ({{ detected }}). As codificações permitidas são {{ encodings }}. This value is not a valid MAC address. Este valor não é um endereço MAC válido. + + This URL is missing a top-level domain. + Esta URL está faltando o domínio de nível superior. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.pt_BR.xlf b/Resources/translations/validators.pt_BR.xlf index 437288508..c427f95d3 100644 --- a/Resources/translations/validators.pt_BR.xlf +++ b/Resources/translations/validators.pt_BR.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Este valor não é um endereço MAC válido. + + This URL is missing a top-level domain. + Esta URL está faltando o domínio de nível superior. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.ro.xlf b/Resources/translations/validators.ro.xlf index 426f6319c..741361965 100644 --- a/Resources/translations/validators.ro.xlf +++ b/Resources/translations/validators.ro.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Această valoare nu este o adresă MAC validă. + + This URL is missing a top-level domain. + Acestui URL îi lipsește un domeniu de nivel superior. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.ru.xlf b/Resources/translations/validators.ru.xlf index 22900d5c2..e8dd03116 100644 --- a/Resources/translations/validators.ru.xlf +++ b/Resources/translations/validators.ru.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Это значение не является действительным MAC-адресом. + + This URL is missing a top-level domain. + В этом URL отсутствует домен верхнего уровня. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.sk.xlf b/Resources/translations/validators.sk.xlf index 9b06bdfb8..aeda9c94b 100644 --- a/Resources/translations/validators.sk.xlf +++ b/Resources/translations/validators.sk.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Táto hodnota nie je platnou MAC adresou. + + This URL is missing a top-level domain. + Tomuto URL chýba doména najvyššej úrovne. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.sl.xlf b/Resources/translations/validators.sl.xlf index 596a66166..1a8cb8d57 100644 --- a/Resources/translations/validators.sl.xlf +++ b/Resources/translations/validators.sl.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Ta vrednost ni veljaven MAC naslov. + + This URL is missing a top-level domain. + Temu URL manjka domena najvišje ravni. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.sq.xlf b/Resources/translations/validators.sq.xlf index 3ac360314..debbe5feb 100644 --- a/Resources/translations/validators.sq.xlf +++ b/Resources/translations/validators.sq.xlf @@ -447,6 +447,34 @@ This value is not a valid MAC address. Kjo nuk është një adresë e vlefshme e Kontrollit të Qasjes në Media (MAC). + + This URL is missing a top-level domain. + Kësaj URL i mungon një domain i nivelit të lartë. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.sr_Cyrl.xlf b/Resources/translations/validators.sr_Cyrl.xlf index b73cde9ba..2e601246e 100644 --- a/Resources/translations/validators.sr_Cyrl.xlf +++ b/Resources/translations/validators.sr_Cyrl.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - Ова вредност није валидна IP адреса. + Ова вредност није валидна IP адреса. This value is not a valid language. @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini, or the configured folder does not exist. - Привремени директоријум није конфигурисан у php.ini, или конфигурисани директоријум не постоји. + Привремени директоријум није конфигурисан у php.ini, или конфигурисани директоријум не постоји. Cannot write temporary file to disk. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Ова вредност није валидан Међународни број банкарског рачуна (IBAN). + Ова вредност није валидан Међународни број банковног рачуна (IBAN). This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Ова вредност није валидан Код за идентификацију бизниса (BIC). + Ова вредност није валидна Код за идентификацију бизниса (BIC). Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Ова вредност није валидан UUID. + Ова вредност није валидан UUID. This value should be a multiple of {{ compared_value }}. @@ -438,6 +438,34 @@ This value is not a valid MAC address. Ова вредност није валидна MAC адреса. + + This URL is missing a top-level domain. + Овом УРЛ-у недостаје домен највишег нивоа. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + Ова вредност је прекратка. Треба да садржи макар једну реч.|Ова вредност је прекратка. Треба да садржи макар {{ min }} речи. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + Ова вредност је предугачка. Треба да садржи само једну реч.|Ова вредност је предугачка. Треба да садржи највише {{ max }} речи. + + + This value does not represent a valid week in the ISO 8601 format. + Ова вредност не представља валидну недељу у ISO 8601 формату. + + + This value is not a valid week. + Ова вредност није валидна недеља. + + + This value should not be before week "{{ min }}". + Ова вредност не би требала да буде пре недеље "{{ min }}". + + + This value should not be after week "{{ max }}". + Ова вредност не би требала да буде после недеље "{{ max }}". + diff --git a/Resources/translations/validators.sr_Latn.xlf b/Resources/translations/validators.sr_Latn.xlf index cd4ccfb3f..8e27e114c 100644 --- a/Resources/translations/validators.sr_Latn.xlf +++ b/Resources/translations/validators.sr_Latn.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - Ova vrednost nije validna IP adresa. + Ova vrednost nije validna IP adresa. This value is not a valid language. @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini, or the configured folder does not exist. - Privremeni direktorijum nije konfigurisan u php.ini, ili konfigurisani direktorijum ne postoji. + Privremeni direktorijum nije konfigurisan u php.ini, ili direktorijum koji je konfigurisan ne postoji. Cannot write temporary file to disk. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Ova vrednost nije validan Međunarodni broj bankovnog računa (IBAN). + Ova vrednost nije validan Međunarodni broj bankovnog računa (IBAN). This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Ova vrednost nije validan Kod za identifikaciju biznisa (BIC). + Ova vrednost nije validan Kod za identifikaciju biznisa (BIC). Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Ova vrednost nije validan UUID. + Ova vrednost nije validan UUID. This value should be a multiple of {{ compared_value }}. @@ -436,7 +436,35 @@ This value is not a valid MAC address. - Ova vrednost nije validna MAC adresa. + Ova vrednost nije validna MAC adresa. + + + This URL is missing a top-level domain. + Ovom URL nedostaje domen najvišeg nivoa. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + Ova vrednost je prekratka. Treba da sadrži makar jednu reč.|Ova vrednost je prekratka. Treba da sadrži makar {{ min }} reči. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + Ova vrednost je predugačka. Treba da sadrži samo jednu reč.|Ova vrednost je predugačka. Treba da sadrži najviše {{ max }} reči. + + + This value does not represent a valid week in the ISO 8601 format. + Ova vrednost ne predstavlja validnu nedelju u ISO 8601 formatu. + + + This value is not a valid week. + Ova vrednost nije validna nedelja + + + This value should not be before week "{{ min }}". + Ova vrednost ne bi trebala da bude pre nedelje "{{ min }}". + + + This value should not be after week "{{ max }}". + Ova vrednost ne bi trebala da bude posle nedelje "{{ max }}". diff --git a/Resources/translations/validators.sv.xlf b/Resources/translations/validators.sv.xlf index ec106fa78..ac08eff2a 100644 --- a/Resources/translations/validators.sv.xlf +++ b/Resources/translations/validators.sv.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Värdet är inte en giltig MAC-adress. + + This URL is missing a top-level domain. + Denna URL saknar en toppdomän. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.th.xlf b/Resources/translations/validators.th.xlf index f109024bf..ded3a0086 100644 --- a/Resources/translations/validators.th.xlf +++ b/Resources/translations/validators.th.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. ค่านี้ไม่ใช่ที่อยู่ MAC ที่ถูกต้อง + + This URL is missing a top-level domain. + URL นี้ขาดโดเมนระดับสูงสุด. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.tl.xlf b/Resources/translations/validators.tl.xlf index 632efbc3f..4ac6bb456 100644 --- a/Resources/translations/validators.tl.xlf +++ b/Resources/translations/validators.tl.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Ang halagang ito ay hindi isang wastong MAC address. + + This URL is missing a top-level domain. + Kulang ang URL na ito sa top-level domain. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.tr.xlf b/Resources/translations/validators.tr.xlf index 4d66ce8bc..af59485b3 100644 --- a/Resources/translations/validators.tr.xlf +++ b/Resources/translations/validators.tr.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Bu değer geçerli bir MAC adresi değil. + + This URL is missing a top-level domain. + Bu URL bir üst düzey alan adı eksik. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.uk.xlf b/Resources/translations/validators.uk.xlf index fcf63e0f6..4775d04f4 100644 --- a/Resources/translations/validators.uk.xlf +++ b/Resources/translations/validators.uk.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - Це значення не є дійсною IP-адресою. + Це значення не є дійсною IP-адресою. This value is not a valid language. @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini, or the configured folder does not exist. - У php.ini не було налаштовано тимчасової теки, або налаштована тека не існує. + У php.ini не було налаштовано тимчасової теки, або налаштована тека не існує. Cannot write temporary file to disk. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Це значення не є дійсним Міжнародним банківським рахунком (IBAN). + Це значення не є дійсним міжнародним номером банківського рахунку (IBAN). This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Це значення не є дійсним Кодом ідентифікації бізнесу (BIC). + Це значення не є дійсним банківським кодом (BIC). Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Це значення не є дійсним UUID. + Це значення не є дійсним UUID. This value should be a multiple of {{ compared_value }}. @@ -436,7 +436,35 @@ This value is not a valid MAC address. - Це значення не є дійсною MAC-адресою. + Це значення не є дійсною MAC-адресою. + + + This URL is missing a top-level domain. + Цьому URL не вистачає домену верхнього рівня. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". diff --git a/Resources/translations/validators.ur.xlf b/Resources/translations/validators.ur.xlf index 65719c64e..a1669de01 100644 --- a/Resources/translations/validators.ur.xlf +++ b/Resources/translations/validators.ur.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. یہ قیمت کوئی درست MAC پتہ نہیں ہے۔ + + This URL is missing a top-level domain. + اس URL میں ٹاپ لیول ڈومین موجود نہیں ہے۔ + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.uz.xlf b/Resources/translations/validators.uz.xlf index bf5a2d5f4..d3012c64e 100644 --- a/Resources/translations/validators.uz.xlf +++ b/Resources/translations/validators.uz.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Bu qiymat haqiqiy MAC manzil emas. + + This URL is missing a top-level domain. + Bu URL yuqori darajali domenni o'z ichiga olmaydi. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.vi.xlf b/Resources/translations/validators.vi.xlf index eadf61467..70a7eedcf 100644 --- a/Resources/translations/validators.vi.xlf +++ b/Resources/translations/validators.vi.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. Giá trị này không phải là địa chỉ MAC hợp lệ. + + This URL is missing a top-level domain. + URL này thiếu miền cấp cao. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.zh_CN.xlf b/Resources/translations/validators.zh_CN.xlf index 155871cd3..3c078d3f5 100644 --- a/Resources/translations/validators.zh_CN.xlf +++ b/Resources/translations/validators.zh_CN.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. 该值不是有效的MAC地址。 + + This URL is missing a top-level domain. + 此URL缺少顶级域名。 + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Resources/translations/validators.zh_TW.xlf b/Resources/translations/validators.zh_TW.xlf index 1a9067862..8c7caa523 100644 --- a/Resources/translations/validators.zh_TW.xlf +++ b/Resources/translations/validators.zh_TW.xlf @@ -438,6 +438,34 @@ This value is not a valid MAC address. 這不是一個有效的MAC地址。 + + This URL is missing a top-level domain. + 此URL缺少頂級域名。 + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + + + This value does not represent a valid week in the ISO 8601 format. + This value does not represent a valid week in the ISO 8601 format. + + + This value is not a valid week. + This value is not a valid week. + + + This value should not be before week "{{ min }}". + This value should not be before week "{{ min }}". + + + This value should not be after week "{{ max }}". + This value should not be after week "{{ max }}". + diff --git a/Test/ConstraintValidatorTestCase.php b/Test/ConstraintValidatorTestCase.php index bb036277d..5cbae0a25 100644 --- a/Test/ConstraintValidatorTestCase.php +++ b/Test/ConstraintValidatorTestCase.php @@ -83,8 +83,10 @@ protected function setUp(): void $this->validator = $this->createValidator(); $this->validator->initialize($this->context); - $this->defaultLocale = \Locale::getDefault(); - \Locale::setDefault('en'); + if (class_exists(\Locale::class)) { + $this->defaultLocale = \Locale::getDefault(); + \Locale::setDefault('en'); + } $this->expectedViolations = []; $this->call = 0; @@ -96,7 +98,9 @@ protected function tearDown(): void { $this->restoreDefaultTimezone(); - \Locale::setDefault($this->defaultLocale); + if (class_exists(\Locale::class)) { + \Locale::setDefault($this->defaultLocale); + } } protected function setDefaultTimezone(?string $defaultTimezone) diff --git a/Tests/Constraints/AbstractComparisonValidatorTestCase.php b/Tests/Constraints/AbstractComparisonValidatorTestCase.php index 1b823eacb..fa44b8a4b 100644 --- a/Tests/Constraints/AbstractComparisonValidatorTestCase.php +++ b/Tests/Constraints/AbstractComparisonValidatorTestCase.php @@ -16,6 +16,7 @@ use Symfony\Component\Validator\Constraints\AbstractComparison; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Test\ConstraintValidatorTestCase; +use Symfony\Component\Validator\Tests\Constraints\Fixtures\TypedDummy; class ComparisonTest_Class { @@ -265,6 +266,31 @@ public function testCompareWithNullValueAtPropertyAt($dirtyValue, $dirtyValueAsS } } + /** + * @dataProvider provideComparisonsToNullValueAtPropertyPath + */ + public function testCompareWithUninitializedPropertyAtPropertyPath($dirtyValue, $dirtyValueAsString, $isValid) + { + $this->setObject(new TypedDummy()); + + $this->validator->validate($dirtyValue, $this->createConstraint([ + 'message' => 'Constraint Message', + 'propertyPath' => 'value', + ])); + + if ($isValid) { + $this->assertNoViolation(); + } else { + $this->buildViolation('Constraint Message') + ->setParameter('{{ value }}', $dirtyValueAsString) + ->setParameter('{{ compared_value }}', 'null') + ->setParameter('{{ compared_value_type }}', 'null') + ->setParameter('{{ compared_value_path }}', 'value') + ->setCode($this->getErrorCode()) + ->assertRaised(); + } + } + public static function provideAllInvalidComparisons(): array { // The provider runs before setUp(), so we need to manually fix diff --git a/Tests/Constraints/AtLeastOneOfValidatorTest.php b/Tests/Constraints/AtLeastOneOfValidatorTest.php index 9e2da70f7..1c0c650b9 100644 --- a/Tests/Constraints/AtLeastOneOfValidatorTest.php +++ b/Tests/Constraints/AtLeastOneOfValidatorTest.php @@ -14,6 +14,7 @@ use Symfony\Component\Validator\Constraints\AtLeastOneOf; use Symfony\Component\Validator\Constraints\AtLeastOneOfValidator; use Symfony\Component\Validator\Constraints\Choice; +use Symfony\Component\Validator\Constraints\Collection; use Symfony\Component\Validator\Constraints\Count; use Symfony\Component\Validator\Constraints\Country; use Symfony\Component\Validator\Constraints\DivisibleBy; @@ -27,9 +28,11 @@ use Symfony\Component\Validator\Constraints\Length; use Symfony\Component\Validator\Constraints\LessThan; use Symfony\Component\Validator\Constraints\Negative; +use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotNull; use Symfony\Component\Validator\Constraints\Range; use Symfony\Component\Validator\Constraints\Regex; +use Symfony\Component\Validator\Constraints\Type; use Symfony\Component\Validator\Constraints\Unique; use Symfony\Component\Validator\Constraints\Valid; use Symfony\Component\Validator\ConstraintViolation; @@ -296,6 +299,35 @@ public function trans(?string $id, array $parameters = [], ?string $domain = nul $this->assertCount(1, $violations); $this->assertSame('Dummy translation: [1] Dummy violation.', $violations->get(0)->getMessage()); } + + public function testValidateNestedAtLeaseOneOfConstraints() + { + $data = [ + 'foo' => [ + 'bar' => 'foo.bar', + 'baz' => 'foo.baz', + ], + ]; + + $constraints = new Collection([ + 'foo' => new AtLeastOneOf([ + new Collection([ + 'bar' => new AtLeastOneOf([ + new Type('int'), + new Choice(['test1', 'test2']) + ]), + ]), + new Collection([ + 'baz' => new Type('int'), + ]), + ]), + ]); + + $validator = Validation::createValidator(); + $violations = $validator->validate($data, $constraints); + + self::assertCount(1, $violations); + } } class ExpressionConstraintNested diff --git a/Tests/Constraints/BicValidatorTest.php b/Tests/Constraints/BicValidatorTest.php index 699979f3e..7859400d6 100644 --- a/Tests/Constraints/BicValidatorTest.php +++ b/Tests/Constraints/BicValidatorTest.php @@ -18,6 +18,7 @@ use Symfony\Component\Validator\Mapping\ClassMetadata; use Symfony\Component\Validator\Mapping\Loader\AttributeLoader; use Symfony\Component\Validator\Test\ConstraintValidatorTestCase; +use Symfony\Component\Validator\Tests\Constraints\Fixtures\BicTypedDummy; class BicValidatorTest extends ConstraintValidatorTestCase { @@ -89,6 +90,15 @@ public function testInvalidComparisonToPropertyPathFromAttribute() ->assertRaised(); } + public function testPropertyPathReferencingUninitializedProperty() + { + $this->setObject(new BicTypedDummy()); + + $this->validator->validate('UNCRIT2B912', new Bic(['ibanPropertyPath' => 'iban'])); + + $this->assertNoViolation(); + } + public function testValidComparisonToValue() { $constraint = new Bic(['iban' => 'FR14 2004 1010 0505 0001 3M02 606']); @@ -190,7 +200,6 @@ public function testValidBics($bic) public static function getValidBics() { - // http://formvalidation.io/validators/bic/ return [ ['ASPKAT2LXXX'], ['ASPKAT2L'], @@ -198,6 +207,7 @@ public static function getValidBics() ['UNCRIT2B912'], ['DABADKKK'], ['RZOOAT2L303'], + ['1SBACNBXSHA'], ]; } @@ -241,11 +251,6 @@ public static function getInvalidBics() ['ASPKAT2LX', Bic::INVALID_LENGTH_ERROR], ['ASPKAT2LXXX1', Bic::INVALID_LENGTH_ERROR], ['DABADKK', Bic::INVALID_LENGTH_ERROR], - ['1SBACNBXSHA', Bic::INVALID_BANK_CODE_ERROR], - ['RZ00AT2L303', Bic::INVALID_BANK_CODE_ERROR], - ['D2BACNBXSHA', Bic::INVALID_BANK_CODE_ERROR], - ['DS3ACNBXSHA', Bic::INVALID_BANK_CODE_ERROR], - ['DSB4CNBXSHA', Bic::INVALID_BANK_CODE_ERROR], ['DEUT12HH', Bic::INVALID_COUNTRY_CODE_ERROR], ['DSBAC6BXSHA', Bic::INVALID_COUNTRY_CODE_ERROR], ['DSBA5NBXSHA', Bic::INVALID_COUNTRY_CODE_ERROR], diff --git a/Tests/Constraints/CardSchemeValidatorTest.php b/Tests/Constraints/CardSchemeValidatorTest.php index 7b28ca9dd..15f4fa634 100644 --- a/Tests/Constraints/CardSchemeValidatorTest.php +++ b/Tests/Constraints/CardSchemeValidatorTest.php @@ -46,6 +46,19 @@ public function testValidNumbers($scheme, $number) $this->assertNoViolation(); } + /** + * @dataProvider getValidNumbers + */ + public function testValidNumbersWithNewLine($scheme, $number) + { + $this->validator->validate($number."\n", new CardScheme(['schemes' => $scheme, 'message' => 'myMessage'])); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$number."\n\"") + ->setCode(CardScheme::INVALID_FORMAT_ERROR) + ->assertRaised(); + } + public function testValidNumberWithOrderedArguments() { $this->validator->validate( diff --git a/Tests/Constraints/CssColorValidatorTest.php b/Tests/Constraints/CssColorValidatorTest.php index 5c7904a80..ce121977c 100644 --- a/Tests/Constraints/CssColorValidatorTest.php +++ b/Tests/Constraints/CssColorValidatorTest.php @@ -52,6 +52,19 @@ public function testValidAnyColor($cssColor) $this->assertNoViolation(); } + /** + * @dataProvider getValidAnyColor + */ + public function testValidAnyColorWithNewLine($cssColor) + { + $this->validator->validate($cssColor."\n", new CssColor([], 'myMessage')); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$cssColor."\n\"") + ->setCode(CssColor::INVALID_FORMAT_ERROR) + ->assertRaised(); + } + public static function getValidAnyColor(): array { return [ @@ -396,7 +409,7 @@ public static function getInvalidHSL(): array } /** - * @dataProvider getInvalidHSL + * @dataProvider getInvalidHSLA */ public function testInvalidHSLA($cssColor) { diff --git a/Tests/Constraints/DateValidatorTest.php b/Tests/Constraints/DateValidatorTest.php index e8642f04a..93dab41f2 100644 --- a/Tests/Constraints/DateValidatorTest.php +++ b/Tests/Constraints/DateValidatorTest.php @@ -53,6 +53,19 @@ public function testValidDates($date) $this->assertNoViolation(); } + /** + * @dataProvider getValidDates + */ + public function testValidDatesWithNewLine(string $date) + { + $this->validator->validate($date."\n", new Date(['message' => 'myMessage'])); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$date."\n\"") + ->setCode(Date::INVALID_FORMAT_ERROR) + ->assertRaised(); + } + public static function getValidDates() { return [ diff --git a/Tests/Constraints/EmailTest.php b/Tests/Constraints/EmailTest.php index b6f710ffc..8489f9cfe 100644 --- a/Tests/Constraints/EmailTest.php +++ b/Tests/Constraints/EmailTest.php @@ -40,6 +40,13 @@ public function testUnknownModesTriggerException() new Email(['mode' => 'Unknown Mode']); } + public function testUnknownModeArgumentsTriggerException() + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('The "mode" parameter value is not valid.'); + new Email(null, null, 'Unknown Mode'); + } + public function testNormalizerCanBeSet() { $email = new Email(['normalizer' => 'trim']); diff --git a/Tests/Constraints/EmailValidatorTest.php b/Tests/Constraints/EmailValidatorTest.php index 6bf8fec6c..565af9561 100644 --- a/Tests/Constraints/EmailValidatorTest.php +++ b/Tests/Constraints/EmailValidatorTest.php @@ -73,6 +73,19 @@ public function testValidEmails($email) $this->assertNoViolation(); } + /** + * @dataProvider getValidEmails + */ + public function testValidEmailsWithNewLine($email) + { + $this->validator->validate($email."\n", new Email()); + + $this->buildViolation('This value is not a valid email address.') + ->setParameter('{{ value }}', '"'.$email."\n\"") + ->setCode(Email::INVALID_FORMAT_ERROR) + ->assertRaised(); + } + public static function getValidEmails() { return [ diff --git a/Tests/Constraints/Fixtures/BicTypedDummy.php b/Tests/Constraints/Fixtures/BicTypedDummy.php new file mode 100644 index 000000000..90ad4009c --- /dev/null +++ b/Tests/Constraints/Fixtures/BicTypedDummy.php @@ -0,0 +1,17 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints\Fixtures; + +class BicTypedDummy +{ + public string $iban; +} diff --git a/Tests/Constraints/Fixtures/MinMaxTyped.php b/Tests/Constraints/Fixtures/MinMaxTyped.php new file mode 100644 index 000000000..1595030fa --- /dev/null +++ b/Tests/Constraints/Fixtures/MinMaxTyped.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints\Fixtures; + +class MinMaxTyped +{ + public int $min; + public int $max; +} diff --git a/Tests/Constraints/Fixtures/TypedDummy.php b/Tests/Constraints/Fixtures/TypedDummy.php new file mode 100644 index 000000000..73d254337 --- /dev/null +++ b/Tests/Constraints/Fixtures/TypedDummy.php @@ -0,0 +1,17 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints\Fixtures; + +class TypedDummy +{ + public mixed $value; +} diff --git a/Tests/Constraints/GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest.php b/Tests/Constraints/GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest.php index 39e540594..92b21bd5e 100644 --- a/Tests/Constraints/GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest.php +++ b/Tests/Constraints/GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest.php @@ -23,7 +23,7 @@ class GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest extends Greate { protected static function createConstraint(?array $options = null): Constraint { - return new PositiveOrZero(); + return new PositiveOrZero($options); } public static function provideValidComparisons(): array @@ -86,6 +86,11 @@ public function testInvalidValuePath() $this->markTestSkipped('PropertyPath option is not used in PositiveOrZero constraint'); } + public static function provideAllValidComparisons(): array + { + self::markTestSkipped('The "value" option cannot be used in the PositiveOrZero constraint'); + } + /** * @dataProvider provideValidComparisonsToPropertyPath */ @@ -94,6 +99,11 @@ public function testValidComparisonToPropertyPath($comparedValue) $this->markTestSkipped('PropertyPath option is not used in PositiveOrZero constraint'); } + public function testNoViolationOnNullObjectWithPropertyPath() + { + $this->markTestSkipped('PropertyPath option is not used in PositiveOrZero constraint'); + } + /** * @dataProvider throwsOnInvalidStringDatesProvider */ @@ -106,4 +116,19 @@ public function testInvalidComparisonToPropertyPathAddsPathAsParameter() { $this->markTestSkipped('PropertyPath option is not used in PositiveOrZero constraint'); } + + public static function throwsOnInvalidStringDatesProvider(): array + { + self::markTestSkipped('The "value" option cannot be used in the PositiveOrZero constraint'); + } + + public static function provideAllInvalidComparisons(): array + { + self::markTestSkipped('The "value" option cannot be used in the Negative constraint'); + } + + public static function provideComparisonsToNullValueAtPropertyPath(): array + { + self::markTestSkipped('PropertyPath option is not used in PositiveOrZero constraint'); + } } diff --git a/Tests/Constraints/GreaterThanValidatorWithPositiveConstraintTest.php b/Tests/Constraints/GreaterThanValidatorWithPositiveConstraintTest.php index b8738470d..bd826e33f 100644 --- a/Tests/Constraints/GreaterThanValidatorWithPositiveConstraintTest.php +++ b/Tests/Constraints/GreaterThanValidatorWithPositiveConstraintTest.php @@ -23,7 +23,7 @@ class GreaterThanValidatorWithPositiveConstraintTest extends GreaterThanValidato { protected static function createConstraint(?array $options = null): Constraint { - return new Positive(); + return new Positive($options); } public static function provideValidComparisons(): array @@ -89,6 +89,11 @@ public function testInvalidValuePath() $this->markTestSkipped('PropertyPath option is not used in Positive constraint'); } + public static function provideAllValidComparisons(): array + { + self::markTestSkipped('The "value" option cannot be used in the Positive constraint'); + } + /** * @dataProvider provideValidComparisonsToPropertyPath */ @@ -109,4 +114,19 @@ public function testInvalidComparisonToPropertyPathAddsPathAsParameter() { $this->markTestSkipped('PropertyPath option is not used in Positive constraint'); } + + public static function throwsOnInvalidStringDatesProvider(): array + { + self::markTestSkipped('The "value" option cannot be used in the Positive constraint'); + } + + public static function provideAllInvalidComparisons(): array + { + self::markTestSkipped('The "value" option cannot be used in the Positive constraint'); + } + + public static function provideComparisonsToNullValueAtPropertyPath(): array + { + self::markTestSkipped('PropertyPath option is not used in PositiveOrZero constraint'); + } } diff --git a/Tests/Constraints/IbanValidatorTest.php b/Tests/Constraints/IbanValidatorTest.php index 212d5329f..a9f59b09c 100644 --- a/Tests/Constraints/IbanValidatorTest.php +++ b/Tests/Constraints/IbanValidatorTest.php @@ -48,6 +48,19 @@ public function testValidIbans($iban) $this->assertNoViolation(); } + /** + * @dataProvider getValidIbans + */ + public function testValidIbansWithNewLine(string $iban) + { + $this->validator->validate($iban."\n", new Iban()); + + $this->buildViolation('This is not a valid International Bank Account Number (IBAN).') + ->setParameter('{{ value }}', '"'.$iban."\n\"") + ->setCode(Iban::INVALID_CHARACTERS_ERROR) + ->assertRaised(); + } + public static function getValidIbans() { return [ @@ -73,6 +86,7 @@ public static function getValidIbans() ['CZ65 0800 0000 1920 0014 5399'], // Czech Republic ['DK50 0040 0440 1162 43'], // Denmark ['EE38 2200 2210 2014 5685'], // Estonia + ['FK12 SC98 7654 3210 98'], // Falkland Islands ['FO97 5432 0388 8999 44'], // Faroe Islands ['FI21 1234 5600 0007 85'], // Finland ['FR14 2004 1010 0505 0001 3M02 606'], // France @@ -96,9 +110,11 @@ public static function getValidIbans() ['MU17 BOMM 0101 1010 3030 0200 000M UR'], // Mauritius ['MD24 AG00 0225 1000 1310 4168'], // Moldova ['MC93 2005 2222 1001 1223 3M44 555'], // Monaco + ['MN14 0005 0051 6384 7716'], // Mongolia ['ME25 5050 0001 2345 6789 51'], // Montenegro ['NL39 RABO 0300 0652 64'], // Netherlands ['NO93 8601 1117 947'], // Norway + ['OM04 0280 0000 1234 5678 901'], // Oman ['PK36 SCBL 0000 0011 2345 6702'], // Pakistan ['PL60 1020 1026 0000 0422 7020 1111'], // Poland ['PT50 0002 0123 1234 5678 9015 4'], // Portugal @@ -115,6 +131,7 @@ public static function getValidIbans() ['TR33 0006 1005 1978 6457 8413 26'], // Turkey ['AE07 0331 2345 6789 0123 456'], // UAE ['GB12 CPBK 0892 9965 0449 91'], // United Kingdom + ['YE09 CBKU 0000 0000 0000 1234 5601 01'], // Yemen ['DJ21 0001 0000 0001 5400 0100 186'], // Djibouti ['EG38 0019 0005 0000 0000 2631 8000 2'], // Egypt @@ -401,6 +418,12 @@ public static function getIbansWithValidFormatButIncorrectChecksum() ['UA213223130000026007233566002'], // Ukraine ['AE260211000000230064017'], // United Arab Emirates ['VA59001123000012345671'], // Vatican City State + + // Checksum digits not between 02 and 98 + ['FO00 5432 0388 8999 44'], // Faroe Islands + ['NL01INGB0001393698'], // Netherlands + ['NL01RABO0331811235'], // Netherlands + ['RU99 0445 2560 0407 0281 0412 3456 7890 1'], // Russia ]; } diff --git a/Tests/Constraints/LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest.php b/Tests/Constraints/LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest.php index 406cb53e2..a85c5ae7d 100644 --- a/Tests/Constraints/LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest.php +++ b/Tests/Constraints/LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest.php @@ -23,7 +23,7 @@ class LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest extends LessThanO { protected static function createConstraint(?array $options = null): Constraint { - return new NegativeOrZero(); + return new NegativeOrZero($options); } public static function provideValidComparisons(): array @@ -89,6 +89,11 @@ public function testInvalidValuePath() $this->markTestSkipped('PropertyPath option is not used in NegativeOrZero constraint'); } + public static function provideAllValidComparisons(): array + { + self::markTestSkipped('The "value" option cannot be used in the NegativeOrZero constraint'); + } + /** * @dataProvider provideValidComparisonsToPropertyPath */ @@ -97,12 +102,9 @@ public function testValidComparisonToPropertyPath($comparedValue) $this->markTestSkipped('PropertyPath option is not used in NegativeOrZero constraint'); } - /** - * @dataProvider throwsOnInvalidStringDatesProvider - */ - public function testThrowsOnInvalidStringDates(AbstractComparison $constraint, $expectedMessage, $value) + public function testInvalidComparisonToPropertyPathAddsPathAsParameter() { - $this->markTestSkipped('The compared value cannot be an invalid string date because it is hardcoded to 0.'); + $this->markTestSkipped('PropertyPath option is not used in NegativeOrZero constraint'); } /** @@ -113,8 +115,21 @@ public function testCompareWithNullValueAtPropertyAt($dirtyValue, $dirtyValueAsS $this->markTestSkipped('PropertyPath option is not used in NegativeOrZero constraint'); } - public function testInvalidComparisonToPropertyPathAddsPathAsParameter() + /** + * @dataProvider provideComparisonsToNullValueAtPropertyPath + */ + public function testCompareWithUninitializedPropertyAtPropertyPath($dirtyValue, $dirtyValueAsString, $isValid) { $this->markTestSkipped('PropertyPath option is not used in NegativeOrZero constraint'); } + + public static function throwsOnInvalidStringDatesProvider(): array + { + self::markTestSkipped('The "value" option cannot be used in the NegativeOrZero constraint'); + } + + public static function provideAllInvalidComparisons(): array + { + self::markTestSkipped('The "value" option cannot be used in the NegativeOrZero constraint'); + } } diff --git a/Tests/Constraints/LessThanValidatorWithNegativeConstraintTest.php b/Tests/Constraints/LessThanValidatorWithNegativeConstraintTest.php index a2e988257..46b6099b2 100644 --- a/Tests/Constraints/LessThanValidatorWithNegativeConstraintTest.php +++ b/Tests/Constraints/LessThanValidatorWithNegativeConstraintTest.php @@ -23,7 +23,7 @@ class LessThanValidatorWithNegativeConstraintTest extends LessThanValidatorTest { protected static function createConstraint(?array $options = null): Constraint { - return new Negative(); + return new Negative($options); } public static function provideValidComparisons(): array @@ -89,6 +89,11 @@ public function testInvalidValuePath() $this->markTestSkipped('PropertyPath option is not used in Negative constraint'); } + public static function provideAllValidComparisons(): array + { + self::markTestSkipped('The "value" option cannot be used in the Negative constraint'); + } + /** * @dataProvider provideValidComparisonsToPropertyPath */ @@ -97,18 +102,23 @@ public function testValidComparisonToPropertyPath($comparedValue) $this->markTestSkipped('PropertyPath option is not used in Negative constraint'); } + public static function throwsOnInvalidStringDatesProvider(): array + { + self::markTestSkipped('The "value" option cannot be used in the Negative constraint'); + } + /** - * @dataProvider throwsOnInvalidStringDatesProvider + * @dataProvider provideComparisonsToNullValueAtPropertyPath */ - public function testThrowsOnInvalidStringDates(AbstractComparison $constraint, $expectedMessage, $value) + public function testCompareWithNullValueAtPropertyAt($dirtyValue, $dirtyValueAsString, $isValid) { - $this->markTestSkipped('The compared value cannot be an invalid string date because it is hardcoded to 0.'); + $this->markTestSkipped('PropertyPath option is not used in Negative constraint'); } /** * @dataProvider provideComparisonsToNullValueAtPropertyPath */ - public function testCompareWithNullValueAtPropertyAt($dirtyValue, $dirtyValueAsString, $isValid) + public function testCompareWithUninitializedPropertyAtPropertyPath($dirtyValue, $dirtyValueAsString, $isValid) { $this->markTestSkipped('PropertyPath option is not used in Negative constraint'); } @@ -117,4 +127,9 @@ public function testInvalidComparisonToPropertyPathAddsPathAsParameter() { $this->markTestSkipped('PropertyPath option is not used in Negative constraint'); } + + public static function provideAllInvalidComparisons(): array + { + self::markTestSkipped('The "value" option cannot be used in the Negative constraint'); + } } diff --git a/Tests/Constraints/NoSuspiciousCharactersValidatorTest.php b/Tests/Constraints/NoSuspiciousCharactersValidatorTest.php index 6894d2f95..d15e41660 100644 --- a/Tests/Constraints/NoSuspiciousCharactersValidatorTest.php +++ b/Tests/Constraints/NoSuspiciousCharactersValidatorTest.php @@ -56,14 +56,26 @@ public static function provideNonSuspiciousStrings(): iterable /** * @dataProvider provideSuspiciousStrings */ - public function testSuspiciousStrings(string $string, array $options, string $errorCode, string $errorMessage) + public function testSuspiciousStrings(string $string, array $options, array $errors) { $this->validator->validate($string, new NoSuspiciousCharacters($options)); - $this->buildViolation($errorMessage) - ->setCode($errorCode) - ->setParameter('{{ value }}', '"'.$string.'"') - ->assertRaised(); + $violations = null; + + foreach ($errors as $code => $message) { + if (null === $violations) { + $violations = $this->buildViolation($message); + } else { + $violations = $violations->buildNextViolation($message); + } + + $violations = $violations + ->setCode($code) + ->setParameter('{{ value }}', '"'.$string.'"') + ; + } + + $violations->assertRaised(); } public static function provideSuspiciousStrings(): iterable @@ -71,8 +83,7 @@ public static function provideSuspiciousStrings(): iterable yield 'Fails RESTRICTION_LEVEL check because of character outside ASCII range' => [ 'à', ['restrictionLevel' => NoSuspiciousCharacters::RESTRICTION_LEVEL_ASCII], - NoSuspiciousCharacters::RESTRICTION_LEVEL_ERROR, - 'This value contains characters that are not allowed by the current restriction-level.', + [NoSuspiciousCharacters::RESTRICTION_LEVEL_ERROR => 'This value contains characters that are not allowed by the current restriction-level.'], ]; yield 'Fails RESTRICTION_LEVEL check because of mixed-script string' => [ @@ -81,8 +92,7 @@ public static function provideSuspiciousStrings(): iterable 'restrictionLevel' => NoSuspiciousCharacters::RESTRICTION_LEVEL_SINGLE_SCRIPT, 'locales' => ['en', 'zh_Hant_TW'], ], - NoSuspiciousCharacters::RESTRICTION_LEVEL_ERROR, - 'This value contains characters that are not allowed by the current restriction-level.', + [NoSuspiciousCharacters::RESTRICTION_LEVEL_ERROR => 'This value contains characters that are not allowed by the current restriction-level.'], ]; yield 'Fails RESTRICTION_LEVEL check because RESTRICTION_LEVEL_HIGH disallows Armenian script' => [ @@ -91,8 +101,7 @@ public static function provideSuspiciousStrings(): iterable 'restrictionLevel' => NoSuspiciousCharacters::RESTRICTION_LEVEL_HIGH, 'locales' => ['en', 'hy_AM'], ], - NoSuspiciousCharacters::RESTRICTION_LEVEL_ERROR, - 'This value contains characters that are not allowed by the current restriction-level.', + [NoSuspiciousCharacters::RESTRICTION_LEVEL_ERROR => 'This value contains characters that are not allowed by the current restriction-level.'], ]; yield 'Fails RESTRICTION_LEVEL check because RESTRICTION_LEVEL_MODERATE disallows Greek script' => [ @@ -101,8 +110,7 @@ public static function provideSuspiciousStrings(): iterable 'restrictionLevel' => NoSuspiciousCharacters::RESTRICTION_LEVEL_MODERATE, 'locales' => ['en', 'el_GR'], ], - NoSuspiciousCharacters::RESTRICTION_LEVEL_ERROR, - 'This value contains characters that are not allowed by the current restriction-level.', + [NoSuspiciousCharacters::RESTRICTION_LEVEL_ERROR => 'This value contains characters that are not allowed by the current restriction-level.'], ]; yield 'Fails RESTRICTION_LEVEL check because of characters missing from the configured locales’ scripts' => [ @@ -111,8 +119,7 @@ public static function provideSuspiciousStrings(): iterable 'restrictionLevel' => NoSuspiciousCharacters::RESTRICTION_LEVEL_MINIMAL, 'locales' => ['en'], ], - NoSuspiciousCharacters::RESTRICTION_LEVEL_ERROR, - 'This value contains characters that are not allowed by the current restriction-level.', + [NoSuspiciousCharacters::RESTRICTION_LEVEL_ERROR => 'This value contains characters that are not allowed by the current restriction-level.'], ]; yield 'Fails INVISIBLE check because of duplicated non-spacing mark' => [ @@ -120,8 +127,7 @@ public static function provideSuspiciousStrings(): iterable [ 'checks' => NoSuspiciousCharacters::CHECK_INVISIBLE, ], - NoSuspiciousCharacters::INVISIBLE_ERROR, - 'Using invisible characters is not allowed.', + [NoSuspiciousCharacters::INVISIBLE_ERROR => 'Using invisible characters is not allowed.'], ]; yield 'Fails MIXED_NUMBERS check because of different numbering systems' => [ @@ -129,8 +135,7 @@ public static function provideSuspiciousStrings(): iterable [ 'checks' => NoSuspiciousCharacters::CHECK_MIXED_NUMBERS, ], - NoSuspiciousCharacters::MIXED_NUMBERS_ERROR, - 'Mixing numbers from different scripts is not allowed.', + [NoSuspiciousCharacters::MIXED_NUMBERS_ERROR => 'Mixing numbers from different scripts is not allowed.'], ]; yield 'Fails HIDDEN_OVERLAY check because of hidden combining character' => [ @@ -138,8 +143,19 @@ public static function provideSuspiciousStrings(): iterable [ 'checks' => NoSuspiciousCharacters::CHECK_HIDDEN_OVERLAY, ], - NoSuspiciousCharacters::HIDDEN_OVERLAY_ERROR, - 'Using hidden overlay characters is not allowed.', + [NoSuspiciousCharacters::HIDDEN_OVERLAY_ERROR => 'Using hidden overlay characters is not allowed.'], + ]; + + yield 'Fails both HIDDEN_OVERLAY and RESTRICTION_LEVEL checks' => [ + 'i̇', + [ + 'checks' => NoSuspiciousCharacters::CHECK_HIDDEN_OVERLAY, + 'restrictionLevel' => NoSuspiciousCharacters::RESTRICTION_LEVEL_ASCII, + ], + [ + NoSuspiciousCharacters::RESTRICTION_LEVEL_ERROR => 'This value contains characters that are not allowed by the current restriction-level.', + NoSuspiciousCharacters::HIDDEN_OVERLAY_ERROR => 'Using hidden overlay characters is not allowed.', + ], ]; } diff --git a/Tests/Constraints/RangeTest.php b/Tests/Constraints/RangeTest.php index 132be131d..a306b104a 100644 --- a/Tests/Constraints/RangeTest.php +++ b/Tests/Constraints/RangeTest.php @@ -30,7 +30,7 @@ public function testThrowsConstraintExceptionIfBothMinLimitAndPropertyPath() public function testThrowsConstraintExceptionIfBothMinLimitAndPropertyPathNamed() { - $this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class); + $this->expectException(ConstraintDefinitionException::class); $this->expectExceptionMessage('requires only one of the "min" or "minPropertyPath" options to be set, not both.'); new Range(min: 'min', minPropertyPath: 'minPropertyPath'); } @@ -47,7 +47,7 @@ public function testThrowsConstraintExceptionIfBothMaxLimitAndPropertyPath() public function testThrowsConstraintExceptionIfBothMaxLimitAndPropertyPathNamed() { - $this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class); + $this->expectException(ConstraintDefinitionException::class); $this->expectExceptionMessage('requires only one of the "max" or "maxPropertyPath" options to be set, not both.'); new Range(max: 'max', maxPropertyPath: 'maxPropertyPath'); } @@ -65,10 +65,58 @@ public function testThrowsNoDefaultOptionConfiguredException() new Range('value'); } - public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMinMessageOrMaxMessage() + public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMinMessageAndMaxMessage() { - $this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class); + $this->expectException(ConstraintDefinitionException::class); $this->expectExceptionMessage('can not use "minMessage" and "maxMessage" when the "min" and "max" options are both set. Use "notInRangeMessage" instead.'); new Range(min: 'min', max: 'max', minMessage: 'minMessage', maxMessage: 'maxMessage'); } + + public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMinMessage() + { + $this->expectException(ConstraintDefinitionException::class); + $this->expectExceptionMessage('can not use "minMessage" and "maxMessage" when the "min" and "max" options are both set. Use "notInRangeMessage" instead.'); + new Range(min: 'min', max: 'max', minMessage: 'minMessage'); + } + + public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMaxMessage() + { + $this->expectException(ConstraintDefinitionException::class); + $this->expectExceptionMessage('can not use "minMessage" and "maxMessage" when the "min" and "max" options are both set. Use "notInRangeMessage" instead.'); + new Range(min: 'min', max: 'max', maxMessage: 'maxMessage'); + } + + public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMinMessageAndMaxMessageOptions() + { + $this->expectException(ConstraintDefinitionException::class); + $this->expectExceptionMessage('can not use "minMessage" and "maxMessage" when the "min" and "max" options are both set. Use "notInRangeMessage" instead.'); + new Range([ + 'min' => 'min', + 'minMessage' => 'minMessage', + 'max' => 'max', + 'maxMessage' => 'maxMessage', + ]); + } + + public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMinMessageOptions() + { + $this->expectException(ConstraintDefinitionException::class); + $this->expectExceptionMessage('can not use "minMessage" and "maxMessage" when the "min" and "max" options are both set. Use "notInRangeMessage" instead.'); + new Range([ + 'min' => 'min', + 'minMessage' => 'minMessage', + 'max' => 'max', + ]); + } + + public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMaxMessageOptions() + { + $this->expectException(ConstraintDefinitionException::class); + $this->expectExceptionMessage('can not use "minMessage" and "maxMessage" when the "min" and "max" options are both set. Use "notInRangeMessage" instead.'); + new Range([ + 'min' => 'min', + 'max' => 'max', + 'maxMessage' => 'maxMessage', + ]); + } } diff --git a/Tests/Constraints/RangeValidatorTest.php b/Tests/Constraints/RangeValidatorTest.php index 876595c37..e0fff6f85 100644 --- a/Tests/Constraints/RangeValidatorTest.php +++ b/Tests/Constraints/RangeValidatorTest.php @@ -16,6 +16,7 @@ use Symfony\Component\Validator\Constraints\RangeValidator; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Test\ConstraintValidatorTestCase; +use Symfony\Component\Validator\Tests\Constraints\Fixtures\MinMaxTyped; use Symfony\Component\Validator\Tests\IcuCompatibilityTrait; class RangeValidatorTest extends ConstraintValidatorTestCase @@ -1020,6 +1021,28 @@ public function testInvalidDatesCombinedMinPropertyPath($value, $dateTimeAsStrin ->assertRaised(); } + public function testMinPropertyPathReferencingUninitializedProperty() + { + $object = new MinMaxTyped(); + $object->max = 5; + $this->setObject($object); + + $this->validator->validate(5, new Range(['minPropertyPath' => 'min', 'maxPropertyPath' => 'max'])); + + $this->assertNoViolation(); + } + + public function testMaxPropertyPathReferencingUninitializedProperty() + { + $object = new MinMaxTyped(); + $object->min = 5; + $this->setObject($object); + + $this->validator->validate(5, new Range(['minPropertyPath' => 'min', 'maxPropertyPath' => 'max'])); + + $this->assertNoViolation(); + } + public static function provideMessageIfMinAndMaxSet(): array { $notInRangeMessage = (new Range(['min' => '']))->notInRangeMessage; @@ -1037,30 +1060,6 @@ public static function provideMessageIfMinAndMaxSet(): array 'not_in_range_message', Range::NOT_IN_RANGE_ERROR, ], - [ - ['minMessage' => 'min_message'], - 0, - $notInRangeMessage, - Range::NOT_IN_RANGE_ERROR, - ], - [ - ['maxMessage' => 'max_message'], - 0, - $notInRangeMessage, - Range::NOT_IN_RANGE_ERROR, - ], - [ - ['minMessage' => 'min_message'], - 15, - $notInRangeMessage, - Range::NOT_IN_RANGE_ERROR, - ], - [ - ['maxMessage' => 'max_message'], - 15, - $notInRangeMessage, - Range::NOT_IN_RANGE_ERROR, - ], ]; } diff --git a/Tests/Constraints/TimeValidatorTest.php b/Tests/Constraints/TimeValidatorTest.php index 91d6778ed..5d9027a17 100644 --- a/Tests/Constraints/TimeValidatorTest.php +++ b/Tests/Constraints/TimeValidatorTest.php @@ -60,6 +60,19 @@ public function testValidTimes($time) $this->assertNoViolation(); } + /** + * @dataProvider getValidTimes + */ + public function testValidTimesWithNewLine(string $time) + { + $this->validator->validate($time."\n", new Time()); + + $this->buildViolation('This value is not a valid time.') + ->setParameter('{{ value }}', '"'.$time."\n".'"') + ->setCode(Time::INVALID_FORMAT_ERROR) + ->assertRaised(); + } + public static function getValidTimes() { return [ @@ -81,6 +94,19 @@ public function testValidTimesWithoutSeconds(string $time) $this->assertNoViolation(); } + /** + * @dataProvider getValidTimesWithoutSeconds + */ + public function testValidTimesWithoutSecondsWithNewLine(string $time) + { + $this->validator->validate($time."\n", new Time(withSeconds: false)); + + $this->buildViolation('This value is not a valid time.') + ->setParameter('{{ value }}', '"'.$time."\n".'"') + ->setCode(Time::INVALID_FORMAT_ERROR) + ->assertRaised(); + } + public static function getValidTimesWithoutSeconds() { return [ diff --git a/Tests/Constraints/UniqueValidatorTest.php b/Tests/Constraints/UniqueValidatorTest.php index 35bde67d9..0d5ccdb8e 100644 --- a/Tests/Constraints/UniqueValidatorTest.php +++ b/Tests/Constraints/UniqueValidatorTest.php @@ -16,6 +16,7 @@ use Symfony\Component\Validator\Exception\UnexpectedTypeException; use Symfony\Component\Validator\Exception\UnexpectedValueException; use Symfony\Component\Validator\Test\ConstraintValidatorTestCase; +use Symfony\Component\Validator\Tests\Dummy\DummyClassOne; class UniqueValidatorTest extends ConstraintValidatorTestCase { @@ -60,7 +61,7 @@ public static function getValidValues() /** * @dataProvider getInvalidValues */ - public function testInvalidValues($value) + public function testInvalidValues($value, $expectedMessageParam) { $constraint = new Unique([ 'message' => 'myMessage', @@ -68,7 +69,7 @@ public function testInvalidValues($value) $this->validator->validate($value, $constraint); $this->buildViolation('myMessage') - ->setParameter('{{ value }}', 'array') + ->setParameter('{{ value }}', $expectedMessageParam) ->setCode(Unique::IS_NOT_UNIQUE) ->assertRaised(); } @@ -78,12 +79,12 @@ public static function getInvalidValues() $object = new \stdClass(); return [ - yield 'not unique booleans' => [[true, true]], - yield 'not unique integers' => [[1, 2, 3, 3]], - yield 'not unique floats' => [[0.1, 0.2, 0.1]], - yield 'not unique string' => [['a', 'b', 'a']], - yield 'not unique arrays' => [[[1, 1], [2, 3], [1, 1]]], - yield 'not unique objects' => [[$object, $object]], + yield 'not unique booleans' => [[true, true], 'true'], + yield 'not unique integers' => [[1, 2, 3, 3], 3], + yield 'not unique floats' => [[0.1, 0.2, 0.1], 0.1], + yield 'not unique string' => [['a', 'b', 'a'], '"a"'], + yield 'not unique arrays' => [[[1, 1], [2, 3], [1, 1]], 'array'], + yield 'not unique objects' => [[$object, $object], 'object'], ]; } @@ -93,7 +94,7 @@ public function testInvalidValueNamed() $this->validator->validate([1, 2, 3, 3], $constraint); $this->buildViolation('myMessage') - ->setParameter('{{ value }}', 'array') + ->setParameter('{{ value }}', '3') ->setCode(Unique::IS_NOT_UNIQUE) ->assertRaised(); } @@ -173,7 +174,7 @@ public function testExpectsInvalidNonStrictComparison() ])); $this->buildViolation('myMessage') - ->setParameter('{{ value }}', 'array') + ->setParameter('{{ value }}', '1') ->setCode(Unique::IS_NOT_UNIQUE) ->assertRaised(); } @@ -199,7 +200,7 @@ public function testExpectsInvalidCaseInsensitiveComparison() ])); $this->buildViolation('myMessage') - ->setParameter('{{ value }}', 'array') + ->setParameter('{{ value }}', '"hello"') ->setCode(Unique::IS_NOT_UNIQUE) ->assertRaised(); } @@ -245,14 +246,14 @@ public static function getInvalidFieldNames(): array /** * @dataProvider getInvalidCollectionValues */ - public function testInvalidCollectionValues(array $value, array $fields) + public function testInvalidCollectionValues(array $value, array $fields, string $expectedMessageParam) { $this->validator->validate($value, new Unique([ 'message' => 'myMessage', ], fields: $fields)); $this->buildViolation('myMessage') - ->setParameter('{{ value }}', 'array') + ->setParameter('{{ value }}', $expectedMessageParam) ->setCode(Unique::IS_NOT_UNIQUE) ->assertRaised(); } @@ -263,26 +264,58 @@ public static function getInvalidCollectionValues(): array 'unique string' => [[ ['lang' => 'eng', 'translation' => 'hi'], ['lang' => 'eng', 'translation' => 'hello'], - ], ['lang']], + ], ['lang'], 'array'], 'unique floats' => [[ ['latitude' => 51.509865, 'longitude' => -0.118092, 'poi' => 'capital'], ['latitude' => 52.520008, 'longitude' => 13.404954], ['latitude' => 51.509865, 'longitude' => -0.118092], - ], ['latitude', 'longitude']], + ], ['latitude', 'longitude'], 'array'], 'unique int' => [[ ['id' => 1, 'email' => 'bar@email.com'], ['id' => 1, 'email' => 'foo@email.com'], - ], ['id']], + ], ['id'], 'array'], 'unique null' => [ [null, null], [], + 'null', ], 'unique field null' => [ [['nullField' => null], ['nullField' => null]], ['nullField'], + 'array', ], ]; } + + public function testArrayOfObjectsUnique() + { + $array = [ + new DummyClassOne(), + new DummyClassOne(), + new DummyClassOne(), + ]; + + $array[0]->code = '1'; + $array[1]->code = '2'; + $array[2]->code = '3'; + + $this->validator->validate( + $array, + new Unique( + normalizer: [self::class, 'normalizeDummyClassOne'], + fields: 'code' + ) + ); + + $this->assertNoViolation(); + } + + public static function normalizeDummyClassOne(DummyClassOne $obj): array + { + return [ + 'code' => $obj->code, + ]; + } } class CallableClass diff --git a/Tests/Constraints/UrlValidatorTest.php b/Tests/Constraints/UrlValidatorTest.php index 18d6e9a49..e2ffcb4ae 100644 --- a/Tests/Constraints/UrlValidatorTest.php +++ b/Tests/Constraints/UrlValidatorTest.php @@ -60,6 +60,19 @@ public function testValidUrls($url) $this->assertNoViolation(); } + /** + * @dataProvider getValidUrls + */ + public function testValidUrlsWithNewLine($url) + { + $this->validator->validate($url."\n", new Url()); + + $this->buildViolation('This value is not a valid URL.') + ->setParameter('{{ value }}', '"'.$url."\n".'"') + ->setCode(Url::INVALID_URL_ERROR) + ->assertRaised(); + } + /** * @dataProvider getValidUrlsWithWhitespaces */ @@ -85,6 +98,24 @@ public function testValidRelativeUrl($url) $this->assertNoViolation(); } + /** + * @dataProvider getValidRelativeUrls + * @dataProvider getValidUrls + */ + public function testValidRelativeUrlWithNewLine(string $url) + { + $constraint = new Url([ + 'relativeProtocol' => true, + ]); + + $this->validator->validate($url."\n", $constraint); + + $this->buildViolation('This value is not a valid URL.') + ->setParameter('{{ value }}', '"'.$url."\n".'"') + ->setCode(Url::INVALID_URL_ERROR) + ->assertRaised(); + } + public static function getValidRelativeUrls() { return [ @@ -174,6 +205,8 @@ public static function getValidUrls() ['http://symfony.com/#one_more%20test'], ['http://example.com/exploit.html?hello[0]=test'], ['http://বিডিআইএ.বাংলা'], + ['http://www.example.com/คนแซ่ลี้/'], + ['http://www.example.com/か/'], ]; } diff --git a/Tests/Constraints/UuidValidatorTest.php b/Tests/Constraints/UuidValidatorTest.php index 7c2e587cf..da78e4cc7 100644 --- a/Tests/Constraints/UuidValidatorTest.php +++ b/Tests/Constraints/UuidValidatorTest.php @@ -45,7 +45,7 @@ public function testEmptyStringIsValid() public function testExpectsUuidConstraintCompatibleType() { $this->expectException(UnexpectedTypeException::class); - $constraint = $this->getMockForAbstractClass(Constraint::class); + $constraint = $this->createStub(Constraint::class); $this->validator->validate('216fff40-98d9-11e3-a5e2-0800200c9a66', $constraint); } diff --git a/Tests/Fixtures/CascadingEntityIntersection.php b/Tests/Fixtures/CascadingEntityIntersection.php new file mode 100644 index 000000000..9478f647c --- /dev/null +++ b/Tests/Fixtures/CascadingEntityIntersection.php @@ -0,0 +1,17 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +class CascadingEntityIntersection +{ + public CascadedChild&\stdClass $classes; +} diff --git a/Tests/Fixtures/CascadingEntityUnion.php b/Tests/Fixtures/CascadingEntityUnion.php new file mode 100644 index 000000000..03c808fca --- /dev/null +++ b/Tests/Fixtures/CascadingEntityUnion.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +class CascadingEntityUnion +{ + public CascadedChild|\stdClass $classes; + public CascadedChild|array $classAndArray; + public CascadedChild|null $classAndNull; + public array|null $arrayAndNull; + public CascadedChild|array|null $classAndArrayAndNull; + public int|string $scalars; + public int|null $scalarAndNull; + public CascadedChild|int $classAndScalar; + public array|int $arrayAndScalar; +} diff --git a/Tests/Fixtures/ConstraintWithRequiredArgument.php b/Tests/Fixtures/ConstraintWithRequiredArgument.php index 3048ae5ce..f8abc8a56 100644 --- a/Tests/Fixtures/ConstraintWithRequiredArgument.php +++ b/Tests/Fixtures/ConstraintWithRequiredArgument.php @@ -20,7 +20,7 @@ final class ConstraintWithRequiredArgument extends Constraint public string $requiredArg; #[HasNamedArguments] - public function __construct(string $requiredArg, array $groups = null, mixed $payload = null) + public function __construct(string $requiredArg, ?array $groups = null, mixed $payload = null) { parent::__construct([], $groups, $payload); diff --git a/Tests/Fixtures/CustomArrayObject.php b/Tests/Fixtures/CustomArrayObject.php index ee5b9c22d..dab811dc2 100644 --- a/Tests/Fixtures/CustomArrayObject.php +++ b/Tests/Fixtures/CustomArrayObject.php @@ -19,7 +19,7 @@ class CustomArrayObject implements \ArrayAccess, \IteratorAggregate, \Countable { private $array; - public function __construct(array $array = null) + public function __construct(?array $array = null) { $this->array = $array ?: []; } diff --git a/Tests/Mapping/ClassMetadataTest.php b/Tests/Mapping/ClassMetadataTest.php index 815f4a1f5..a94295728 100644 --- a/Tests/Mapping/ClassMetadataTest.php +++ b/Tests/Mapping/ClassMetadataTest.php @@ -22,6 +22,8 @@ use Symfony\Component\Validator\Mapping\CascadingStrategy; use Symfony\Component\Validator\Mapping\ClassMetadata; use Symfony\Component\Validator\Tests\Fixtures\CascadingEntity; +use Symfony\Component\Validator\Tests\Fixtures\CascadingEntityIntersection; +use Symfony\Component\Validator\Tests\Fixtures\CascadingEntityUnion; use Symfony\Component\Validator\Tests\Fixtures\ClassConstraint; use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; use Symfony\Component\Validator\Tests\Fixtures\ConstraintB; @@ -342,6 +344,34 @@ public function testCascadeConstraint() ], $metadata->getConstrainedProperties()); } + public function testCascadeConstraintWithUnionTypeProperties() + { + $metadata = new ClassMetadata(CascadingEntityUnion::class); + $metadata->addConstraint(new Cascade()); + + $this->assertSame(CascadingStrategy::CASCADE, $metadata->getCascadingStrategy()); + $this->assertCount(5, $metadata->properties); + $this->assertSame([ + 'classes', + 'classAndArray', + 'classAndNull', + 'arrayAndNull', + 'classAndArrayAndNull', + ], $metadata->getConstrainedProperties()); + } + + public function testCascadeConstraintWithIntersectionTypeProperties() + { + $metadata = new ClassMetadata(CascadingEntityIntersection::class); + $metadata->addConstraint(new Cascade()); + + $this->assertSame(CascadingStrategy::CASCADE, $metadata->getCascadingStrategy()); + $this->assertCount(1, $metadata->properties); + $this->assertSame([ + 'classes', + ], $metadata->getConstrainedProperties()); + } + public function testCascadeConstraintWithExcludedProperties() { $metadata = new ClassMetadata(CascadingEntity::class); diff --git a/Tests/Mapping/Loader/FilesLoaderTest.php b/Tests/Mapping/Loader/FilesLoaderTest.php index 43863edcb..765b84fd6 100644 --- a/Tests/Mapping/Loader/FilesLoaderTest.php +++ b/Tests/Mapping/Loader/FilesLoaderTest.php @@ -36,11 +36,11 @@ public function testCallsActualFileLoaderForMetadata() public function getFilesLoader(LoaderInterface $loader) { - return $this->getMockForAbstractClass(FilesLoader::class, [[ + return new class([ __DIR__.'/constraint-mapping.xml', __DIR__.'/constraint-mapping.yaml', __DIR__.'/constraint-mapping.test', __DIR__.'/constraint-mapping.txt', - ], $loader]); + ], $loader) extends FilesLoader {}; } } diff --git a/Tests/Mapping/Loader/Fixtures/ConstraintWithNamedArguments.php b/Tests/Mapping/Loader/Fixtures/ConstraintWithNamedArguments.php new file mode 100644 index 000000000..70579011c --- /dev/null +++ b/Tests/Mapping/Loader/Fixtures/ConstraintWithNamedArguments.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping\Loader\Fixtures; + +use Symfony\Component\Validator\Attribute\HasNamedArguments; +use Symfony\Component\Validator\Constraint; + +class ConstraintWithNamedArguments extends Constraint +{ + public $choices; + + #[HasNamedArguments] + public function __construct(array|string|null $choices = [], ?array $groups = null) + { + parent::__construct([], $groups); + + $this->choices = $choices; + } + + public function getTargets(): string + { + return self::CLASS_CONSTRAINT; + } +} diff --git a/Tests/Mapping/Loader/Fixtures/ConstraintWithoutValueWithNamedArguments.php b/Tests/Mapping/Loader/Fixtures/ConstraintWithoutValueWithNamedArguments.php new file mode 100644 index 000000000..af950fc13 --- /dev/null +++ b/Tests/Mapping/Loader/Fixtures/ConstraintWithoutValueWithNamedArguments.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping\Loader\Fixtures; + +use Symfony\Component\Validator\Attribute\HasNamedArguments; +use Symfony\Component\Validator\Constraint; + +class ConstraintWithoutValueWithNamedArguments extends Constraint +{ + #[HasNamedArguments] + public function __construct(?array $groups = null) + { + parent::__construct([], $groups); + } + + public function getTargets(): string + { + return self::CLASS_CONSTRAINT; + } +} diff --git a/Tests/Mapping/Loader/PropertyInfoLoaderTest.php b/Tests/Mapping/Loader/PropertyInfoLoaderTest.php index d07994c15..f6a9e8411 100644 --- a/Tests/Mapping/Loader/PropertyInfoLoaderTest.php +++ b/Tests/Mapping/Loader/PropertyInfoLoaderTest.php @@ -54,9 +54,10 @@ public function testLoadClassMetadata() 'noAutoMapping', ]) ; + $propertyInfoStub ->method('getTypes') - ->will($this->onConsecutiveCalls( + ->willReturn( [new Type(Type::BUILTIN_TYPE_STRING, true)], [new Type(Type::BUILTIN_TYPE_STRING)], [new Type(Type::BUILTIN_TYPE_STRING, true), new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_BOOL)], @@ -69,11 +70,12 @@ public function testLoadClassMetadata() [new Type(Type::BUILTIN_TYPE_ARRAY, true, null, true, null, new Type(Type::BUILTIN_TYPE_FLOAT))], [new Type(Type::BUILTIN_TYPE_STRING)], [new Type(Type::BUILTIN_TYPE_STRING)] - )) + ) ; + $propertyInfoStub ->method('isWritable') - ->will($this->onConsecutiveCalls( + ->willReturn( true, true, true, @@ -86,7 +88,7 @@ public function testLoadClassMetadata() true, false, true - )) + ) ; $propertyInfoLoader = new PropertyInfoLoader($propertyInfoStub, $propertyInfoStub, $propertyInfoStub, '{.*}'); @@ -221,9 +223,10 @@ public function testClassNoAutoMapping() ->method('getProperties') ->willReturn(['string', 'autoMappingExplicitlyEnabled']) ; + $propertyInfoStub ->method('getTypes') - ->willReturnOnConsecutiveCalls( + ->willReturn( [new Type(Type::BUILTIN_TYPE_STRING)], [new Type(Type::BUILTIN_TYPE_BOOL)] ); diff --git a/Tests/Mapping/Loader/XmlFileLoaderTest.php b/Tests/Mapping/Loader/XmlFileLoaderTest.php index 5ba519ab1..2385dc888 100644 --- a/Tests/Mapping/Loader/XmlFileLoaderTest.php +++ b/Tests/Mapping/Loader/XmlFileLoaderTest.php @@ -32,6 +32,8 @@ use Symfony\Component\Validator\Tests\Fixtures\Entity_81; use Symfony\Component\Validator\Tests\Fixtures\NestedAttribute\Entity; use Symfony\Component\Validator\Tests\Fixtures\NestedAttribute\GroupSequenceProviderEntity; +use Symfony\Component\Validator\Tests\Mapping\Loader\Fixtures\ConstraintWithNamedArguments; +use Symfony\Component\Validator\Tests\Mapping\Loader\Fixtures\ConstraintWithoutValueWithNamedArguments; class XmlFileLoaderTest extends TestCase { @@ -66,6 +68,9 @@ public function testLoadClassMetadata() $expected->addConstraint(new Callback('validateMeStatic')); $expected->addConstraint(new Callback(['Symfony\Component\Validator\Tests\Fixtures\CallbackClass', 'callback'])); $expected->addConstraint(new Traverse(false)); + $expected->addConstraint(new ConstraintWithNamedArguments('foo')); + $expected->addConstraint(new ConstraintWithNamedArguments(['foo', 'bar'])); + $expected->addConstraint(new ConstraintWithoutValueWithNamedArguments(['foo'])); $expected->addPropertyConstraint('firstName', new NotNull()); $expected->addPropertyConstraint('firstName', new Range(['min' => 3])); $expected->addPropertyConstraint('firstName', new Choice(['A', 'B'])); diff --git a/Tests/Mapping/Loader/YamlFileLoaderTest.php b/Tests/Mapping/Loader/YamlFileLoaderTest.php index a5c983939..e34e5466e 100644 --- a/Tests/Mapping/Loader/YamlFileLoaderTest.php +++ b/Tests/Mapping/Loader/YamlFileLoaderTest.php @@ -29,6 +29,8 @@ use Symfony\Component\Validator\Tests\Fixtures\Entity_81; use Symfony\Component\Validator\Tests\Fixtures\NestedAttribute\Entity; use Symfony\Component\Validator\Tests\Fixtures\NestedAttribute\GroupSequenceProviderEntity; +use Symfony\Component\Validator\Tests\Mapping\Loader\Fixtures\ConstraintWithNamedArguments; +use Symfony\Component\Validator\Tests\Mapping\Loader\Fixtures\ConstraintWithoutValueWithNamedArguments; class YamlFileLoaderTest extends TestCase { @@ -109,6 +111,9 @@ public function testLoadClassMetadata() $expected->addConstraint(new Callback('validateMe')); $expected->addConstraint(new Callback('validateMeStatic')); $expected->addConstraint(new Callback(['Symfony\Component\Validator\Tests\Fixtures\CallbackClass', 'callback'])); + $expected->addConstraint(new ConstraintWithoutValueWithNamedArguments()); + $expected->addConstraint(new ConstraintWithNamedArguments('foo')); + $expected->addConstraint(new ConstraintWithNamedArguments(['foo', 'bar'])); $expected->addPropertyConstraint('firstName', new NotNull()); $expected->addPropertyConstraint('firstName', new Range(['min' => 3])); $expected->addPropertyConstraint('firstName', new Choice(['A', 'B'])); diff --git a/Tests/Mapping/Loader/constraint-mapping.xml b/Tests/Mapping/Loader/constraint-mapping.xml index 6183b074a..8a7975f11 100644 --- a/Tests/Mapping/Loader/constraint-mapping.xml +++ b/Tests/Mapping/Loader/constraint-mapping.xml @@ -36,6 +36,22 @@ false + + + foo + + + + + foo + bar + + + + + + + diff --git a/Tests/Mapping/Loader/constraint-mapping.yml b/Tests/Mapping/Loader/constraint-mapping.yml index 0cf87cffe..af091a89f 100644 --- a/Tests/Mapping/Loader/constraint-mapping.yml +++ b/Tests/Mapping/Loader/constraint-mapping.yml @@ -15,6 +15,12 @@ Symfony\Component\Validator\Tests\Fixtures\NestedAttribute\Entity: - Callback: validateMe - Callback: validateMeStatic - Callback: [Symfony\Component\Validator\Tests\Fixtures\CallbackClass, callback] + # Constraint with named arguments support without value + - Symfony\Component\Validator\Tests\Mapping\Loader\Fixtures\ConstraintWithoutValueWithNamedArguments: ~ + # Constraint with named arguments support with scalar value + - Symfony\Component\Validator\Tests\Mapping\Loader\Fixtures\ConstraintWithNamedArguments: foo + # Constraint with named arguments support with array value + - Symfony\Component\Validator\Tests\Mapping\Loader\Fixtures\ConstraintWithNamedArguments: [foo, bar] properties: firstName: diff --git a/composer.json b/composer.json index a36e3d5d5..ece01e2fd 100644 --- a/composer.json +++ b/composer.json @@ -56,7 +56,8 @@ "autoload": { "psr-4": { "Symfony\\Component\\Validator\\": "" }, "exclude-from-classmap": [ - "/Tests/" + "/Tests/", + "/Resources/bin/" ] }, "minimum-stability": "dev" pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy