From 6036f24941aa2f5bc6d2cf274f04521273485dec Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Wed, 11 Dec 2024 14:08:35 +0100 Subject: [PATCH 01/74] chore: PHP CS Fixer fixes --- Constraints/ChoiceValidator.php | 4 ++-- Constraints/WeekValidator.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Constraints/ChoiceValidator.php b/Constraints/ChoiceValidator.php index 367cc6567..916c0732a 100644 --- a/Constraints/ChoiceValidator.php +++ b/Constraints/ChoiceValidator.php @@ -53,8 +53,8 @@ public function validate(mixed $value, Constraint $constraint): void throw new ConstraintDefinitionException('The Choice constraint expects a valid callback.'); } $choices = $choices(); - if (!is_array($choices)) { - throw new ConstraintDefinitionException(sprintf('The Choice constraint callback "%s" is expected to return an array, but returned "%s".', trim($this->formatValue($constraint->callback), '"'), get_debug_type($choices))); + if (!\is_array($choices)) { + throw new ConstraintDefinitionException(\sprintf('The Choice constraint callback "%s" is expected to return an array, but returned "%s".', trim($this->formatValue($constraint->callback), '"'), get_debug_type($choices))); } } else { $choices = $constraint->choices; diff --git a/Constraints/WeekValidator.php b/Constraints/WeekValidator.php index 83052c1a9..8139b156e 100644 --- a/Constraints/WeekValidator.php +++ b/Constraints/WeekValidator.php @@ -43,8 +43,8 @@ public function validate(mixed $value, Constraint $constraint): void return; } - [$year, $weekNumber] = \explode('-W', $value, 2); - $weeksInYear = (int) \date('W', \mktime(0, 0, 0, 12, 28, $year)); + [$year, $weekNumber] = explode('-W', $value, 2); + $weeksInYear = (int) date('W', mktime(0, 0, 0, 12, 28, $year)); if ($weekNumber > $weeksInYear) { $this->context->buildViolation($constraint->invalidWeekNumberMessage) @@ -56,7 +56,7 @@ public function validate(mixed $value, Constraint $constraint): void } if ($constraint->min) { - [$minYear, $minWeekNumber] = \explode('-W', $constraint->min, 2); + [$minYear, $minWeekNumber] = explode('-W', $constraint->min, 2); if ($year < $minYear || ($year === $minYear && $weekNumber < $minWeekNumber)) { $this->context->buildViolation($constraint->tooLowMessage) ->setCode(Week::TOO_LOW_ERROR) @@ -69,7 +69,7 @@ public function validate(mixed $value, Constraint $constraint): void } if ($constraint->max) { - [$maxYear, $maxWeekNumber] = \explode('-W', $constraint->max, 2); + [$maxYear, $maxWeekNumber] = explode('-W', $constraint->max, 2); if ($year > $maxYear || ($year === $maxYear && $weekNumber > $maxWeekNumber)) { $this->context->buildViolation($constraint->tooHighMessage) ->setCode(Week::TOO_HIGH_ERROR) From bf859ce6bdb96796a5a41265c3714f60c5025067 Mon Sep 17 00:00:00 2001 From: Maxime COLIN Date: Thu, 19 Dec 2024 11:01:08 +0100 Subject: [PATCH 02/74] [Validator] Validate SVG ratio in Image validator --- CHANGELOG.md | 5 + Constraints/ImageValidator.php | 70 ++++++++- Tests/Constraints/Fixtures/test_landscape.svg | 2 + .../Fixtures/test_landscape_height.svg | 2 + .../Fixtures/test_landscape_width.svg | 2 + .../Fixtures/test_landscape_width_height.svg | 2 + Tests/Constraints/Fixtures/test_no_size.svg | 2 + Tests/Constraints/Fixtures/test_portrait.svg | 2 + Tests/Constraints/Fixtures/test_square.svg | 2 + Tests/Constraints/ImageValidatorTest.php | 136 ++++++++++++++++++ 10 files changed, 218 insertions(+), 7 deletions(-) create mode 100644 Tests/Constraints/Fixtures/test_landscape.svg create mode 100644 Tests/Constraints/Fixtures/test_landscape_height.svg create mode 100644 Tests/Constraints/Fixtures/test_landscape_width.svg create mode 100644 Tests/Constraints/Fixtures/test_landscape_width_height.svg create mode 100644 Tests/Constraints/Fixtures/test_no_size.svg create mode 100644 Tests/Constraints/Fixtures/test_portrait.svg create mode 100644 Tests/Constraints/Fixtures/test_square.svg diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b5be184c..5e480139e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +7.3 +--- + + * Add support for ratio checks for SVG files to the `Image` constraint + 7.2 --- diff --git a/Constraints/ImageValidator.php b/Constraints/ImageValidator.php index a715471d9..219ad620c 100644 --- a/Constraints/ImageValidator.php +++ b/Constraints/ImageValidator.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\HttpFoundation\File\File; +use Symfony\Component\Mime\MimeTypes; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Exception\LogicException; @@ -50,7 +52,13 @@ public function validate(mixed $value, Constraint $constraint): void return; } - $size = @getimagesize($value); + $isSvg = $this->isSvg($value); + + if ($isSvg) { + $size = $this->getSvgSize($value); + } else { + $size = @getimagesize($value); + } if (!$size || (0 === $size[0]) || (0 === $size[1])) { $this->context->buildViolation($constraint->sizeNotDetectedMessage) @@ -63,7 +71,7 @@ public function validate(mixed $value, Constraint $constraint): void $width = $size[0]; $height = $size[1]; - if ($constraint->minWidth) { + if (!$isSvg && $constraint->minWidth) { if (!ctype_digit((string) $constraint->minWidth)) { throw new ConstraintDefinitionException(\sprintf('"%s" is not a valid minimum width.', $constraint->minWidth)); } @@ -79,7 +87,7 @@ public function validate(mixed $value, Constraint $constraint): void } } - if ($constraint->maxWidth) { + if (!$isSvg && $constraint->maxWidth) { if (!ctype_digit((string) $constraint->maxWidth)) { throw new ConstraintDefinitionException(\sprintf('"%s" is not a valid maximum width.', $constraint->maxWidth)); } @@ -95,7 +103,7 @@ public function validate(mixed $value, Constraint $constraint): void } } - if ($constraint->minHeight) { + if (!$isSvg && $constraint->minHeight) { if (!ctype_digit((string) $constraint->minHeight)) { throw new ConstraintDefinitionException(\sprintf('"%s" is not a valid minimum height.', $constraint->minHeight)); } @@ -111,7 +119,7 @@ public function validate(mixed $value, Constraint $constraint): void } } - if ($constraint->maxHeight) { + if (!$isSvg && $constraint->maxHeight) { if (!ctype_digit((string) $constraint->maxHeight)) { throw new ConstraintDefinitionException(\sprintf('"%s" is not a valid maximum height.', $constraint->maxHeight)); } @@ -127,7 +135,7 @@ public function validate(mixed $value, Constraint $constraint): void $pixels = $width * $height; - if (null !== $constraint->minPixels) { + if (!$isSvg && null !== $constraint->minPixels) { if (!ctype_digit((string) $constraint->minPixels)) { throw new ConstraintDefinitionException(\sprintf('"%s" is not a valid minimum amount of pixels.', $constraint->minPixels)); } @@ -143,7 +151,7 @@ public function validate(mixed $value, Constraint $constraint): void } } - if (null !== $constraint->maxPixels) { + if (!$isSvg && null !== $constraint->maxPixels) { if (!ctype_digit((string) $constraint->maxPixels)) { throw new ConstraintDefinitionException(\sprintf('"%s" is not a valid maximum amount of pixels.', $constraint->maxPixels)); } @@ -231,4 +239,52 @@ public function validate(mixed $value, Constraint $constraint): void imagedestroy($resource); } } + + private function isSvg(mixed $value): bool + { + if ($value instanceof File) { + $mime = $value->getMimeType(); + } elseif (class_exists(MimeTypes::class)) { + $mime = MimeTypes::getDefault()->guessMimeType($value); + } elseif (!class_exists(File::class)) { + return false; + } else { + $mime = (new File($value))->getMimeType(); + } + + return 'image/svg+xml' === $mime; + } + + /** + * @return array{int, int}|null index 0 and 1 contains respectively the width and the height of the image, null if size can't be found + */ + private function getSvgSize(mixed $value): ?array + { + if ($value instanceof File) { + $content = $value->getContent(); + } elseif (!class_exists(File::class)) { + return null; + } else { + $content = (new File($value))->getContent(); + } + + if (1 === preg_match('/]+width="(?[0-9]+)"[^<>]*>/', $content, $widthMatches)) { + $width = (int) $widthMatches['width']; + } + + if (1 === preg_match('/]+height="(?[0-9]+)"[^<>]*>/', $content, $heightMatches)) { + $height = (int) $heightMatches['height']; + } + + if (1 === preg_match('/]+viewBox="-?[0-9]+ -?[0-9]+ (?-?[0-9]+) (?-?[0-9]+)"[^<>]*>/', $content, $viewBoxMatches)) { + $width ??= (int) $viewBoxMatches['width']; + $height ??= (int) $viewBoxMatches['height']; + } + + if (isset($width) && isset($height)) { + return [$width, $height]; + } + + return null; + } } diff --git a/Tests/Constraints/Fixtures/test_landscape.svg b/Tests/Constraints/Fixtures/test_landscape.svg new file mode 100644 index 000000000..e1212da08 --- /dev/null +++ b/Tests/Constraints/Fixtures/test_landscape.svg @@ -0,0 +1,2 @@ + + diff --git a/Tests/Constraints/Fixtures/test_landscape_height.svg b/Tests/Constraints/Fixtures/test_landscape_height.svg new file mode 100644 index 000000000..7a54631f1 --- /dev/null +++ b/Tests/Constraints/Fixtures/test_landscape_height.svg @@ -0,0 +1,2 @@ + + diff --git a/Tests/Constraints/Fixtures/test_landscape_width.svg b/Tests/Constraints/Fixtures/test_landscape_width.svg new file mode 100644 index 000000000..a64c0b1e0 --- /dev/null +++ b/Tests/Constraints/Fixtures/test_landscape_width.svg @@ -0,0 +1,2 @@ + + diff --git a/Tests/Constraints/Fixtures/test_landscape_width_height.svg b/Tests/Constraints/Fixtures/test_landscape_width_height.svg new file mode 100644 index 000000000..ec7b52445 --- /dev/null +++ b/Tests/Constraints/Fixtures/test_landscape_width_height.svg @@ -0,0 +1,2 @@ + + diff --git a/Tests/Constraints/Fixtures/test_no_size.svg b/Tests/Constraints/Fixtures/test_no_size.svg new file mode 100644 index 000000000..e0af766e8 --- /dev/null +++ b/Tests/Constraints/Fixtures/test_no_size.svg @@ -0,0 +1,2 @@ + + diff --git a/Tests/Constraints/Fixtures/test_portrait.svg b/Tests/Constraints/Fixtures/test_portrait.svg new file mode 100644 index 000000000..d17c991be --- /dev/null +++ b/Tests/Constraints/Fixtures/test_portrait.svg @@ -0,0 +1,2 @@ + + diff --git a/Tests/Constraints/Fixtures/test_square.svg b/Tests/Constraints/Fixtures/test_square.svg new file mode 100644 index 000000000..ffac7f14a --- /dev/null +++ b/Tests/Constraints/Fixtures/test_square.svg @@ -0,0 +1,2 @@ + + diff --git a/Tests/Constraints/ImageValidatorTest.php b/Tests/Constraints/ImageValidatorTest.php index 908517081..d18d81eea 100644 --- a/Tests/Constraints/ImageValidatorTest.php +++ b/Tests/Constraints/ImageValidatorTest.php @@ -498,4 +498,140 @@ public static function provideInvalidMimeTypeWithNarrowedSet() ]), ]; } + + /** @dataProvider provideSvgWithViolation */ + public function testSvgWithViolation(string $image, Image $constraint, string $violation, array $parameters = []) + { + $this->validator->validate($image, $constraint); + + $this->buildViolation('myMessage') + ->setCode($violation) + ->setParameters($parameters) + ->assertRaised(); + } + + public static function provideSvgWithViolation(): iterable + { + yield 'No size svg' => [ + __DIR__.'/Fixtures/test_no_size.svg', + new Image(allowLandscape: false, sizeNotDetectedMessage: 'myMessage'), + Image::SIZE_NOT_DETECTED_ERROR, + ]; + + yield 'Landscape SVG not allowed' => [ + __DIR__.'/Fixtures/test_landscape.svg', + new Image(allowLandscape: false, allowLandscapeMessage: 'myMessage'), + Image::LANDSCAPE_NOT_ALLOWED_ERROR, + [ + '{{ width }}' => 500, + '{{ height }}' => 200, + ], + ]; + + yield 'Portrait SVG not allowed' => [ + __DIR__.'/Fixtures/test_portrait.svg', + new Image(allowPortrait: false, allowPortraitMessage: 'myMessage'), + Image::PORTRAIT_NOT_ALLOWED_ERROR, + [ + '{{ width }}' => 200, + '{{ height }}' => 500, + ], + ]; + + yield 'Square SVG not allowed' => [ + __DIR__.'/Fixtures/test_square.svg', + new Image(allowSquare: false, allowSquareMessage: 'myMessage'), + Image::SQUARE_NOT_ALLOWED_ERROR, + [ + '{{ width }}' => 500, + '{{ height }}' => 500, + ], + ]; + + yield 'Landscape with width attribute SVG allowed' => [ + __DIR__.'/Fixtures/test_landscape_width.svg', + new Image(allowLandscape: false, allowLandscapeMessage: 'myMessage'), + Image::LANDSCAPE_NOT_ALLOWED_ERROR, + [ + '{{ width }}' => 600, + '{{ height }}' => 200, + ], + ]; + + yield 'Landscape with height attribute SVG not allowed' => [ + __DIR__.'/Fixtures/test_landscape_height.svg', + new Image(allowLandscape: false, allowLandscapeMessage: 'myMessage'), + Image::LANDSCAPE_NOT_ALLOWED_ERROR, + [ + '{{ width }}' => 500, + '{{ height }}' => 300, + ], + ]; + + yield 'Landscape with width and height attribute SVG not allowed' => [ + __DIR__.'/Fixtures/test_landscape_width_height.svg', + new Image(allowLandscape: false, allowLandscapeMessage: 'myMessage'), + Image::LANDSCAPE_NOT_ALLOWED_ERROR, + [ + '{{ width }}' => 600, + '{{ height }}' => 300, + ], + ]; + + yield 'SVG Min ratio 2' => [ + __DIR__.'/Fixtures/test_square.svg', + new Image(minRatio: 2, minRatioMessage: 'myMessage'), + Image::RATIO_TOO_SMALL_ERROR, + [ + '{{ ratio }}' => '1', + '{{ min_ratio }}' => '2', + ], + ]; + + yield 'SVG Min ratio 0.5' => [ + __DIR__.'/Fixtures/test_square.svg', + new Image(maxRatio: 0.5, maxRatioMessage: 'myMessage'), + Image::RATIO_TOO_BIG_ERROR, + [ + '{{ ratio }}' => '1', + '{{ max_ratio }}' => '0.5', + ], + ]; + } + + /** @dataProvider provideSvgWithoutViolation */ + public function testSvgWithoutViolation(string $image, Image $constraint) + { + $this->validator->validate($image, $constraint); + + $this->assertNoViolation(); + } + + public static function provideSvgWithoutViolation(): iterable + { + yield 'Landscape SVG allowed' => [ + __DIR__.'/Fixtures/test_landscape.svg', + new Image(allowLandscape: true, allowLandscapeMessage: 'myMessage'), + ]; + + yield 'Portrait SVG allowed' => [ + __DIR__.'/Fixtures/test_portrait.svg', + new Image(allowPortrait: true, allowPortraitMessage: 'myMessage'), + ]; + + yield 'Square SVG allowed' => [ + __DIR__.'/Fixtures/test_square.svg', + new Image(allowSquare: true, allowSquareMessage: 'myMessage'), + ]; + + yield 'SVG Min ratio 1' => [ + __DIR__.'/Fixtures/test_square.svg', + new Image(minRatio: 1, minRatioMessage: 'myMessage'), + ]; + + yield 'SVG Max ratio 1' => [ + __DIR__.'/Fixtures/test_square.svg', + new Image(maxRatio: 1, maxRatioMessage: 'myMessage'), + ]; + } } From fa6ce06c5ae3884d037b0fa33aed1afda6689da9 Mon Sep 17 00:00:00 2001 From: sauliusnord Date: Mon, 14 Oct 2024 10:54:55 +0300 Subject: [PATCH 03/74] [Validator] [DateTime] Add `format` to error messages --- CHANGELOG.md | 1 + Constraints/DateTimeValidator.php | 4 ++++ Tests/Constraints/DateTimeValidatorTest.php | 3 +++ 3 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e480139e..b5e79134e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ CHANGELOG * Add the `Week` constraint * Add `CompoundConstraintTestCase` to ease testing Compound Constraints * Add context variable to `WhenValidator` + * Add `format` parameter to `DateTime` constraint violation message 7.1 --- diff --git a/Constraints/DateTimeValidator.php b/Constraints/DateTimeValidator.php index 9784a5797..f5765cbf6 100644 --- a/Constraints/DateTimeValidator.php +++ b/Constraints/DateTimeValidator.php @@ -44,6 +44,7 @@ public function validate(mixed $value, Constraint $constraint): void if (0 < $errors['error_count']) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) + ->setParameter('{{ format }}', $this->formatValue($constraint->format)) ->setCode(DateTime::INVALID_FORMAT_ERROR) ->addViolation(); @@ -58,16 +59,19 @@ public function validate(mixed $value, Constraint $constraint): void if ('The parsed date was invalid' === $warning) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) + ->setParameter('{{ format }}', $this->formatValue($constraint->format)) ->setCode(DateTime::INVALID_DATE_ERROR) ->addViolation(); } elseif ('The parsed time was invalid' === $warning) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) + ->setParameter('{{ format }}', $this->formatValue($constraint->format)) ->setCode(DateTime::INVALID_TIME_ERROR) ->addViolation(); } else { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) + ->setParameter('{{ format }}', $this->formatValue($constraint->format)) ->setCode(DateTime::INVALID_FORMAT_ERROR) ->addViolation(); } diff --git a/Tests/Constraints/DateTimeValidatorTest.php b/Tests/Constraints/DateTimeValidatorTest.php index 8da07c424..42519ffd4 100644 --- a/Tests/Constraints/DateTimeValidatorTest.php +++ b/Tests/Constraints/DateTimeValidatorTest.php @@ -53,6 +53,7 @@ public function testDateTimeWithDefaultFormat() $this->buildViolation('This value is not a valid datetime.') ->setParameter('{{ value }}', '"1995-03-24"') + ->setParameter('{{ format }}', '"Y-m-d H:i:s"') ->setCode(DateTime::INVALID_FORMAT_ERROR) ->assertRaised(); } @@ -96,6 +97,7 @@ public function testInvalidDateTimes($format, $dateTime, $code) $this->buildViolation('myMessage') ->setParameter('{{ value }}', '"'.$dateTime.'"') + ->setParameter('{{ format }}', '"'.$format.'"') ->setCode($code) ->assertRaised(); } @@ -124,6 +126,7 @@ public function testInvalidDateTimeNamed() $this->buildViolation('myMessage') ->setParameter('{{ value }}', '"2010-01-01 00:00:00"') + ->setParameter('{{ format }}', '"Y-m-d"') ->setCode(DateTime::INVALID_FORMAT_ERROR) ->assertRaised(); } From 9ef1ad0bfb365d11101b51b6fde98b59a7920515 Mon Sep 17 00:00:00 2001 From: Raffaele Carelle Date: Fri, 11 Oct 2024 14:24:50 +0200 Subject: [PATCH 04/74] [Validator] Add `Slug` constraint --- CHANGELOG.md | 1 + Constraints/Slug.php | 41 +++++++++ Constraints/SlugValidator.php | 47 +++++++++++ Tests/Constraints/SlugTest.php | 47 +++++++++++ Tests/Constraints/SlugValidatorTest.php | 106 ++++++++++++++++++++++++ 5 files changed, 242 insertions(+) create mode 100644 Constraints/Slug.php create mode 100644 Constraints/SlugValidator.php create mode 100644 Tests/Constraints/SlugTest.php create mode 100644 Tests/Constraints/SlugValidatorTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index b5e79134e..70468d4d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ CHANGELOG --- * Add support for ratio checks for SVG files to the `Image` constraint + * Add the `Slug` constraint 7.2 --- diff --git a/Constraints/Slug.php b/Constraints/Slug.php new file mode 100644 index 000000000..68dcf9925 --- /dev/null +++ b/Constraints/Slug.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * Validates that a value is a valid slug. + * + * @author Raffaele Carelle + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Slug extends Constraint +{ + public const NOT_SLUG_ERROR = '14e6df1e-c8ab-4395-b6ce-04b132a3765e'; + + public string $message = 'This value is not a valid slug.'; + public string $regex = '/^[a-z0-9]+(?:-[a-z0-9]+)*$/'; + + public function __construct( + ?array $options = null, + ?string $regex = null, + ?string $message = null, + ?array $groups = null, + mixed $payload = null, + ) { + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->regex = $regex ?? $this->regex; + } +} diff --git a/Constraints/SlugValidator.php b/Constraints/SlugValidator.php new file mode 100644 index 000000000..b914cad31 --- /dev/null +++ b/Constraints/SlugValidator.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Raffaele Carelle + */ +class SlugValidator extends ConstraintValidator +{ + public function validate(mixed $value, Constraint $constraint): void + { + if (!$constraint instanceof Slug) { + throw new UnexpectedTypeException($constraint, Slug::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!\is_scalar($value) && !$value instanceof \Stringable) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + + if (0 === preg_match($constraint->regex, $value)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Slug::NOT_SLUG_ERROR) + ->addViolation(); + } + } +} diff --git a/Tests/Constraints/SlugTest.php b/Tests/Constraints/SlugTest.php new file mode 100644 index 000000000..a2c5b07d3 --- /dev/null +++ b/Tests/Constraints/SlugTest.php @@ -0,0 +1,47 @@ + + * + * 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; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraints\Slug; +use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Validator\Mapping\Loader\AttributeLoader; + +class SlugTest extends TestCase +{ + public function testAttributes() + { + $metadata = new ClassMetadata(SlugDummy::class); + $loader = new AttributeLoader(); + self::assertTrue($loader->loadClassMetadata($metadata)); + + [$bConstraint] = $metadata->properties['b']->getConstraints(); + self::assertSame('myMessage', $bConstraint->message); + self::assertSame(['Default', 'SlugDummy'], $bConstraint->groups); + + [$cConstraint] = $metadata->properties['c']->getConstraints(); + self::assertSame(['my_group'], $cConstraint->groups); + self::assertSame('some attached data', $cConstraint->payload); + } +} + +class SlugDummy +{ + #[Slug] + private $a; + + #[Slug(message: 'myMessage')] + private $b; + + #[Slug(groups: ['my_group'], payload: 'some attached data')] + private $c; +} diff --git a/Tests/Constraints/SlugValidatorTest.php b/Tests/Constraints/SlugValidatorTest.php new file mode 100644 index 000000000..8a2270ff2 --- /dev/null +++ b/Tests/Constraints/SlugValidatorTest.php @@ -0,0 +1,106 @@ + + * + * 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; + +use Symfony\Component\Validator\Constraints\Slug; +use Symfony\Component\Validator\Constraints\SlugValidator; +use Symfony\Component\Validator\Exception\UnexpectedValueException; +use Symfony\Component\Validator\Test\ConstraintValidatorTestCase; + +class SlugValidatorTest extends ConstraintValidatorTestCase +{ + protected function createValidator(): SlugValidator + { + return new SlugValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Slug()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Slug()); + + $this->assertNoViolation(); + } + + public function testExpectsStringCompatibleType() + { + $this->expectException(UnexpectedValueException::class); + $this->validator->validate(new \stdClass(), new Slug()); + } + + /** + * @testWith ["test-slug"] + * ["slug-123-test"] + * ["slug"] + */ + public function testValidSlugs($slug) + { + $this->validator->validate($slug, new Slug()); + + $this->assertNoViolation(); + } + + /** + * @testWith ["NotASlug"] + * ["Not a slug"] + * ["not-á-slug"] + * ["not-@-slug"] + */ + public function testInvalidSlugs($slug) + { + $constraint = new Slug([ + 'message' => 'myMessage', + ]); + + $this->validator->validate($slug, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$slug.'"') + ->setCode(Slug::NOT_SLUG_ERROR) + ->assertRaised(); + } + + /** + * @testWith ["test-slug", true] + * ["slug-123-test", true] + */ + public function testCustomRegexInvalidSlugs($slug) + { + $constraint = new Slug(regex: '/^[a-z0-9]+$/i'); + + $this->validator->validate($slug, $constraint); + + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', '"'.$slug.'"') + ->setCode(Slug::NOT_SLUG_ERROR) + ->assertRaised(); + } + + /** + * @testWith ["slug"] + * @testWith ["test1234"] + */ + public function testCustomRegexValidSlugs($slug) + { + $constraint = new Slug(regex: '/^[a-z0-9]+$/i'); + + $this->validator->validate($slug, $constraint); + + $this->assertNoViolation(); + } +} From a2a27c12b3bd86f10a5ed17c54fd1348768a4cff Mon Sep 17 00:00:00 2001 From: Jan Rosier Date: Mon, 6 Jan 2025 15:35:18 +0100 Subject: [PATCH 05/74] Use spl_object_id() instead of spl_object_hash() --- Tests/Fixtures/FakeMetadataFactory.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Tests/Fixtures/FakeMetadataFactory.php b/Tests/Fixtures/FakeMetadataFactory.php index 6e673ee9f..f905b66fd 100644 --- a/Tests/Fixtures/FakeMetadataFactory.php +++ b/Tests/Fixtures/FakeMetadataFactory.php @@ -21,10 +21,10 @@ class FakeMetadataFactory implements MetadataFactoryInterface public function getMetadataFor($class): MetadataInterface { - $hash = null; + $objectId = null; if (\is_object($class)) { - $hash = spl_object_hash($class); + $objectId = spl_object_id($class); $class = $class::class; } @@ -33,8 +33,8 @@ public function getMetadataFor($class): MetadataInterface } if (!isset($this->metadatas[$class])) { - if (isset($this->metadatas[$hash])) { - return $this->metadatas[$hash]; + if (isset($this->metadatas[$objectId])) { + return $this->metadatas[$objectId]; } throw new NoSuchMetadataException(sprintf('No metadata for "%s"', $class)); @@ -45,10 +45,10 @@ public function getMetadataFor($class): MetadataInterface public function hasMetadataFor($class): bool { - $hash = null; + $objectId = null; if (\is_object($class)) { - $hash = spl_object_hash($class); + $objectId = spl_object_id($class); $class = $class::class; } @@ -56,7 +56,7 @@ public function hasMetadataFor($class): bool return false; } - return isset($this->metadatas[$class]) || isset($this->metadatas[$hash]); + return isset($this->metadatas[$class]) || isset($this->metadatas[$objectId]); } public function addMetadata($metadata) @@ -66,7 +66,7 @@ public function addMetadata($metadata) public function addMetadataForValue($value, MetadataInterface $metadata) { - $key = \is_object($value) ? spl_object_hash($value) : $value; + $key = \is_object($value) ? spl_object_id($value) : $value; $this->metadatas[$key] = $metadata; } } From 67a6f134a034e121a809cc6516ad9f8242a102e7 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 7 Jan 2025 09:33:41 +0100 Subject: [PATCH 06/74] fix named arguments support for the Slug constraint --- Constraints/Slug.php | 5 +++-- Tests/Constraints/SlugValidatorTest.php | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Constraints/Slug.php b/Constraints/Slug.php index 68dcf9925..52a5d94c2 100644 --- a/Constraints/Slug.php +++ b/Constraints/Slug.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -26,14 +27,14 @@ class Slug extends Constraint public string $message = 'This value is not a valid slug.'; public string $regex = '/^[a-z0-9]+(?:-[a-z0-9]+)*$/'; + #[HasNamedArguments] public function __construct( - ?array $options = null, ?string $regex = null, ?string $message = null, ?array $groups = null, mixed $payload = null, ) { - parent::__construct($options, $groups, $payload); + parent::__construct([], $groups, $payload); $this->message = $message ?? $this->message; $this->regex = $regex ?? $this->regex; diff --git a/Tests/Constraints/SlugValidatorTest.php b/Tests/Constraints/SlugValidatorTest.php index 8a2270ff2..e8d210b83 100644 --- a/Tests/Constraints/SlugValidatorTest.php +++ b/Tests/Constraints/SlugValidatorTest.php @@ -63,9 +63,7 @@ public function testValidSlugs($slug) */ public function testInvalidSlugs($slug) { - $constraint = new Slug([ - 'message' => 'myMessage', - ]); + $constraint = new Slug(message: 'myMessage'); $this->validator->validate($slug, $constraint); From bf6aecc2f873951e2def51a0c62d425046a41638 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 24 Apr 2024 12:12:14 +0200 Subject: [PATCH 07/74] deprecate the use of option arrays to configure validation constraints --- Constraints/AbstractComparison.php | 14 +- Constraints/All.php | 6 + Constraints/AtLeastOneOf.php | 4 + Constraints/Bic.php | 6 + Constraints/Blank.php | 6 + Constraints/Callback.php | 16 +- Constraints/CardScheme.php | 16 +- Constraints/Cascade.php | 8 + Constraints/Choice.php | 5 + Constraints/Cidr.php | 6 + Constraints/Collection.php | 4 + Constraints/Count.php | 14 +- Constraints/CountValidator.php | 8 +- Constraints/Country.php | 6 + Constraints/CssColor.php | 4 + Constraints/Currency.php | 6 + Constraints/Date.php | 6 + Constraints/DateTime.php | 16 +- Constraints/DisableAutoMapping.php | 10 +- Constraints/Email.php | 6 + Constraints/EnableAutoMapping.php | 10 +- Constraints/Expression.php | 16 +- Constraints/ExpressionSyntax.php | 6 + Constraints/File.php | 6 + Constraints/Hostname.php | 6 + Constraints/Iban.php | 6 + Constraints/Ip.php | 6 + Constraints/IsFalse.php | 6 + Constraints/IsNull.php | 6 + Constraints/IsTrue.php | 6 + Constraints/Isbn.php | 16 +- Constraints/Isin.php | 6 + Constraints/Issn.php | 6 + Constraints/Json.php | 6 + Constraints/Language.php | 6 + Constraints/Length.php | 14 +- Constraints/Locale.php | 6 + Constraints/Luhn.php | 6 + Constraints/NoSuspiciousCharacters.php | 6 + Constraints/NotBlank.php | 6 + Constraints/NotCompromisedPassword.php | 6 + Constraints/NotNull.php | 6 + Constraints/PasswordStrength.php | 6 + Constraints/Range.php | 6 + Constraints/Regex.php | 16 +- Constraints/Sequentially.php | 4 + Constraints/Time.php | 6 + Constraints/Timezone.php | 16 +- Constraints/Traverse.php | 10 +- Constraints/Type.php | 18 +- Constraints/Ulid.php | 6 + Constraints/Unique.php | 6 + Constraints/Url.php | 6 + Constraints/Uuid.php | 6 + Constraints/Valid.php | 6 + Constraints/When.php | 16 +- Constraints/ZeroComparisonConstraintTrait.php | 10 +- Context/ExecutionContextInterface.php | 2 +- Mapping/Loader/AbstractLoader.php | 12 +- Mapping/Loader/PropertyInfoLoader.php | 20 +- Tests/Constraints/AllValidatorTest.php | 8 +- .../Constraints/AtLeastOneOfValidatorTest.php | 106 ++-- Tests/Constraints/BicValidatorTest.php | 30 +- Tests/Constraints/BlankValidatorTest.php | 6 +- Tests/Constraints/CallbackValidatorTest.php | 42 +- Tests/Constraints/CardSchemeValidatorTest.php | 16 +- Tests/Constraints/ChoiceValidatorTest.php | 266 ++++---- Tests/Constraints/CidrTest.php | 26 +- Tests/Constraints/CidrValidatorTest.php | 14 +- Tests/Constraints/CollectionTest.php | 64 +- .../CollectionValidatorTestCase.php | 110 ++-- Tests/Constraints/CompositeTest.php | 18 +- Tests/Constraints/CompoundTest.php | 5 +- Tests/Constraints/CountValidatorTestCase.php | 36 +- Tests/Constraints/CountryValidatorTest.php | 16 +- Tests/Constraints/CurrencyValidatorTest.php | 4 +- Tests/Constraints/DateTimeValidatorTest.php | 16 +- Tests/Constraints/DateValidatorTest.php | 6 +- Tests/Constraints/DisableAutoMappingTest.php | 3 + .../Constraints/DivisibleByValidatorTest.php | 6 +- Tests/Constraints/EmailTest.php | 14 +- Tests/Constraints/EmailValidatorTest.php | 38 +- Tests/Constraints/EnableAutoMappingTest.php | 3 + Tests/Constraints/EqualToValidatorTest.php | 6 +- Tests/Constraints/ExpressionSyntaxTest.php | 12 +- .../ExpressionSyntaxValidatorTest.php | 44 +- Tests/Constraints/ExpressionValidatorTest.php | 88 +-- Tests/Constraints/FileTest.php | 12 +- Tests/Constraints/FileValidatorPathTest.php | 6 +- Tests/Constraints/FileValidatorTestCase.php | 115 ++-- .../GreaterThanOrEqualValidatorTest.php | 6 +- ...idatorWithPositiveOrZeroConstraintTest.php | 6 + .../Constraints/GreaterThanValidatorTest.php | 6 +- ...hanValidatorWithPositiveConstraintTest.php | 6 + Tests/Constraints/HostnameValidatorTest.php | 34 +- Tests/Constraints/IbanValidatorTest.php | 4 +- .../Constraints/IdenticalToValidatorTest.php | 6 +- Tests/Constraints/ImageValidatorTest.php | 400 ++++++------ Tests/Constraints/IpTest.php | 8 +- Tests/Constraints/IpValidatorTest.php | 152 +++-- Tests/Constraints/IsFalseValidatorTest.php | 24 +- Tests/Constraints/IsNullValidatorTest.php | 4 +- Tests/Constraints/IsTrueValidatorTest.php | 22 +- Tests/Constraints/IsbnValidatorTest.php | 33 +- Tests/Constraints/IsinValidatorTest.php | 4 +- Tests/Constraints/IssnValidatorTest.php | 20 +- Tests/Constraints/JsonValidatorTest.php | 4 +- Tests/Constraints/LanguageValidatorTest.php | 20 +- Tests/Constraints/LengthTest.php | 20 +- Tests/Constraints/LengthValidatorTest.php | 66 +- .../LessThanOrEqualValidatorTest.php | 6 +- ...idatorWithNegativeOrZeroConstraintTest.php | 6 + Tests/Constraints/LessThanValidatorTest.php | 6 +- ...hanValidatorWithNegativeConstraintTest.php | 6 + Tests/Constraints/LocaleValidatorTest.php | 24 +- Tests/Constraints/LuhnValidatorTest.php | 4 +- .../NoSuspiciousCharactersValidatorTest.php | 4 +- Tests/Constraints/NotBlankTest.php | 8 +- Tests/Constraints/NotBlankValidatorTest.php | 40 +- .../NotCompromisedPasswordValidatorTest.php | 36 +- Tests/Constraints/NotEqualToValidatorTest.php | 6 +- .../NotIdenticalToValidatorTest.php | 6 +- Tests/Constraints/NotNullValidatorTest.php | 22 +- Tests/Constraints/RangeTest.php | 15 + Tests/Constraints/RangeValidatorTest.php | 222 +++---- Tests/Constraints/RegexTest.php | 24 +- Tests/Constraints/RegexValidatorTest.php | 10 +- .../Constraints/SequentiallyValidatorTest.php | 30 +- Tests/Constraints/TimeValidatorTest.php | 8 +- Tests/Constraints/TimezoneTest.php | 22 +- Tests/Constraints/TimezoneValidatorTest.php | 56 +- Tests/Constraints/TypeValidatorTest.php | 47 +- Tests/Constraints/UlidValidatorTest.php | 4 +- Tests/Constraints/UniqueTest.php | 6 + Tests/Constraints/UniqueValidatorTest.php | 47 +- Tests/Constraints/UrlTest.php | 8 +- Tests/Constraints/UrlValidatorTest.php | 46 +- Tests/Constraints/UuidTest.php | 8 +- Tests/Constraints/UuidValidatorTest.php | 22 +- Tests/Constraints/ValidTest.php | 2 +- Tests/Constraints/WhenTest.php | 41 +- Tests/Constraints/WhenValidatorTest.php | 96 ++- Tests/Fixtures/DummyCompoundConstraint.php | 2 +- ...yEntityConstraintWithoutNamedArguments.php | 16 + Tests/Fixtures/EntityStaticCar.php | 2 +- Tests/Fixtures/EntityStaticCarTurbo.php | 2 +- Tests/Fixtures/EntityStaticVehicle.php | 2 +- .../LazyLoadingMetadataFactoryTest.php | 28 +- Tests/Mapping/Loader/AttributeLoaderTest.php | 56 +- .../ConstraintWithoutNamedArguments.php | 22 + Tests/Mapping/Loader/XmlFileLoaderTest.php | 39 +- Tests/Mapping/Loader/YamlFileLoaderTest.php | 39 +- ...traint-without-named-arguments-support.xml | 10 + ...traint-without-named-arguments-support.yml | 4 + Tests/Mapping/MemberMetadataTest.php | 4 +- Tests/Validator/RecursiveValidatorTest.php | 583 +++++++++--------- 156 files changed, 2429 insertions(+), 1752 deletions(-) create mode 100644 Tests/Fixtures/DummyEntityConstraintWithoutNamedArguments.php create mode 100644 Tests/Mapping/Loader/Fixtures/ConstraintWithoutNamedArguments.php create mode 100644 Tests/Mapping/Loader/constraint-without-named-arguments-support.xml create mode 100644 Tests/Mapping/Loader/constraint-without-named-arguments-support.yml diff --git a/Constraints/AbstractComparison.php b/Constraints/AbstractComparison.php index 4d34b1401..1b4629c43 100644 --- a/Constraints/AbstractComparison.php +++ b/Constraints/AbstractComparison.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\PropertyAccess\PropertyAccess; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Exception\LogicException; @@ -28,11 +29,20 @@ abstract class AbstractComparison extends Constraint public mixed $value = null; public ?string $propertyPath = null; - public function __construct(mixed $value = null, ?string $propertyPath = null, ?string $message = null, ?array $groups = null, mixed $payload = null, array $options = []) + #[HasNamedArguments] + public function __construct(mixed $value = null, ?string $propertyPath = null, ?string $message = null, ?array $groups = null, mixed $payload = null, ?array $options = null) { if (\is_array($value)) { - $options = array_merge($value, $options); + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + + $options = array_merge($value, $options ?? []); } elseif (null !== $value) { + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } else { + $options = []; + } + $options['value'] = $value; } diff --git a/Constraints/All.php b/Constraints/All.php index 1da939dd5..bbaa9a9a5 100644 --- a/Constraints/All.php +++ b/Constraints/All.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -28,8 +29,13 @@ class All extends Composite * @param array|array|null $constraints * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct(mixed $constraints = null, ?array $groups = null, mixed $payload = null) { + if (\is_array($constraints) && !array_is_list($constraints)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($constraints ?? [], $groups, $payload); } diff --git a/Constraints/AtLeastOneOf.php b/Constraints/AtLeastOneOf.php index 7fe57972d..a03ca7f7a 100644 --- a/Constraints/AtLeastOneOf.php +++ b/Constraints/AtLeastOneOf.php @@ -41,6 +41,10 @@ class AtLeastOneOf extends Composite */ public function __construct(mixed $constraints = null, ?array $groups = null, mixed $payload = null, ?string $message = null, ?string $messageCollection = null, ?bool $includeInternalMessages = null) { + if (\is_array($constraints) && !array_is_list($constraints)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($constraints ?? [], $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/Bic.php b/Constraints/Bic.php index 692d83117..34121af75 100644 --- a/Constraints/Bic.php +++ b/Constraints/Bic.php @@ -13,6 +13,7 @@ use Symfony\Component\Intl\Countries; use Symfony\Component\PropertyAccess\PropertyAccess; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Exception\InvalidArgumentException; @@ -70,6 +71,7 @@ class Bic extends Constraint * @param string[]|null $groups * @param self::VALIDATION_MODE_*|null $mode The mode used to validate the BIC; pass null to use the default mode (strict) */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $message = null, @@ -90,6 +92,10 @@ public function __construct( throw new InvalidArgumentException('The "mode" parameter value is not valid.'); } + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/Blank.php b/Constraints/Blank.php index 283164fc1..09c5a5fac 100644 --- a/Constraints/Blank.php +++ b/Constraints/Blank.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -33,8 +34,13 @@ class Blank extends Constraint * @param array|null $options * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options ?? [], $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/Callback.php b/Constraints/Callback.php index 5ef48d880..ff02183bd 100644 --- a/Constraints/Callback.php +++ b/Constraints/Callback.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -30,17 +31,28 @@ class Callback extends Constraint * @param string|string[]|callable|array|null $callback The callback definition * @param string[]|null $groups */ - public function __construct(array|string|callable|null $callback = null, ?array $groups = null, mixed $payload = null, array $options = []) + #[HasNamedArguments] + public function __construct(array|string|callable|null $callback = null, ?array $groups = null, mixed $payload = null, ?array $options = null) { // Invocation through attributes with an array parameter only if (\is_array($callback) && 1 === \count($callback) && isset($callback['value'])) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + $callback = $callback['value']; } if (!\is_array($callback) || (!isset($callback['callback']) && !isset($callback['groups']) && !isset($callback['payload']))) { + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } else { + $options = []; + } + $options['callback'] = $callback; } else { - $options = array_merge($callback, $options); + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + + $options = array_merge($callback, $options ?? []); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/CardScheme.php b/Constraints/CardScheme.php index 86085ee2e..0944761d8 100644 --- a/Constraints/CardScheme.php +++ b/Constraints/CardScheme.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -49,13 +50,22 @@ class CardScheme extends Constraint /** * @param non-empty-string|non-empty-string[]|array|null $schemes Name(s) of the number scheme(s) used to validate the credit card number * @param string[]|null $groups - * @param array $options + * @param array|null $options */ - public function __construct(array|string|null $schemes, ?string $message = null, ?array $groups = null, mixed $payload = null, array $options = []) + #[HasNamedArguments] + public function __construct(array|string|null $schemes, ?string $message = null, ?array $groups = null, mixed $payload = null, ?array $options = null) { if (\is_array($schemes) && \is_string(key($schemes))) { - $options = array_merge($schemes, $options); + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + + $options = array_merge($schemes, $options ?? []); } else { + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } else { + $options = []; + } + $options['value'] = $schemes; } diff --git a/Constraints/Cascade.php b/Constraints/Cascade.php index 8879ca657..016b7e7ef 100644 --- a/Constraints/Cascade.php +++ b/Constraints/Cascade.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; @@ -28,11 +29,18 @@ class Cascade extends Constraint * @param non-empty-string[]|non-empty-string|array|null $exclude Properties excluded from validation * @param array|null $options */ + #[HasNamedArguments] public function __construct(array|string|null $exclude = null, ?array $options = null) { if (\is_array($exclude) && !array_is_list($exclude)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + $options = array_merge($exclude, $options ?? []); } else { + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + $this->exclude = array_flip((array) $exclude); } diff --git a/Constraints/Choice.php b/Constraints/Choice.php index 18570c5c9..d17e5f654 100644 --- a/Constraints/Choice.php +++ b/Constraints/Choice.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -59,6 +60,7 @@ public function getDefaultOption(): ?string * @param string[]|null $groups * @param bool|null $match Whether to validate the values are part of the choices or not (defaults to true) */ + #[HasNamedArguments] public function __construct( string|array $options = [], ?array $choices = null, @@ -78,7 +80,10 @@ public function __construct( if (\is_array($options) && $options && array_is_list($options)) { $choices ??= $options; $options = []; + } elseif (\is_array($options) && [] !== $options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } + if (null !== $choices) { $options['value'] = $choices; } diff --git a/Constraints/Cidr.php b/Constraints/Cidr.php index 349c29b66..82d52317a 100644 --- a/Constraints/Cidr.php +++ b/Constraints/Cidr.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Exception\InvalidArgumentException; @@ -74,6 +75,7 @@ class Cidr extends Constraint /** @var callable|null */ public $normalizer; + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $version = null, @@ -84,6 +86,10 @@ public function __construct( $payload = null, ?callable $normalizer = null, ) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + $this->version = $version ?? $options['version'] ?? $this->version; if (!\array_key_exists($this->version, self::NET_MAXES)) { diff --git a/Constraints/Collection.php b/Constraints/Collection.php index 3ffd0a6fc..4253697ef 100644 --- a/Constraints/Collection.php +++ b/Constraints/Collection.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -41,10 +42,13 @@ class Collection extends Composite * @param bool|null $allowExtraFields Whether to allow additional keys not declared in the configured fields (defaults to false) * @param bool|null $allowMissingFields Whether to allow the collection to lack some fields declared in the configured fields (defaults to false) */ + #[HasNamedArguments] public function __construct(mixed $fields = null, ?array $groups = null, mixed $payload = null, ?bool $allowExtraFields = null, ?bool $allowMissingFields = null, ?string $extraFieldsMessage = null, ?string $missingFieldsMessage = null) { if (self::isFieldsOption($fields)) { $fields = ['fields' => $fields]; + } else { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($fields, $groups, $payload); diff --git a/Constraints/Count.php b/Constraints/Count.php index 38ea8d6e7..31479b578 100644 --- a/Constraints/Count.php +++ b/Constraints/Count.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\MissingOptionsException; @@ -48,8 +49,9 @@ class Count extends Constraint * @param int<0, max>|null $max Maximum expected number of elements * @param positive-int|null $divisibleBy The number the collection count should be divisible by * @param string[]|null $groups - * @param array $options + * @param array|null $options */ + #[HasNamedArguments] public function __construct( int|array|null $exactly = null, ?int $min = null, @@ -61,11 +63,17 @@ public function __construct( ?string $divisibleByMessage = null, ?array $groups = null, mixed $payload = null, - array $options = [], + ?array $options = null, ) { if (\is_array($exactly)) { - $options = array_merge($exactly, $options); + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + + $options = array_merge($exactly, $options ?? []); $exactly = $options['value'] ?? null; + } elseif (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } else { + $options = []; } $min ??= $options['min'] ?? null; diff --git a/Constraints/CountValidator.php b/Constraints/CountValidator.php index 04f539333..40d889fe9 100644 --- a/Constraints/CountValidator.php +++ b/Constraints/CountValidator.php @@ -70,10 +70,10 @@ public function validate(mixed $value, Constraint $constraint): void ->getValidator() ->inContext($this->context) ->validate($count, [ - new DivisibleBy([ - 'value' => $constraint->divisibleBy, - 'message' => $constraint->divisibleByMessage, - ]), + new DivisibleBy( + value: $constraint->divisibleBy, + message: $constraint->divisibleByMessage, + ), ], $this->context->getGroup()); } } diff --git a/Constraints/Country.php b/Constraints/Country.php index cb0016212..dcbdd01a1 100644 --- a/Constraints/Country.php +++ b/Constraints/Country.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Intl\Countries; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\LogicException; @@ -41,6 +42,7 @@ class Country extends Constraint * * @see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Current_codes */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $message = null, @@ -52,6 +54,10 @@ public function __construct( throw new LogicException('The Intl component is required to use the Country constraint. Try running "composer require symfony/intl".'); } + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/CssColor.php b/Constraints/CssColor.php index 4f61df18f..302e779eb 100644 --- a/Constraints/CssColor.php +++ b/Constraints/CssColor.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\InvalidArgumentException; @@ -66,6 +67,7 @@ class CssColor extends Constraint * @param string[]|null $groups * @param array|null $options */ + #[HasNamedArguments] public function __construct(array|string $formats = [], ?string $message = null, ?array $groups = null, $payload = null, ?array $options = null) { $validationModesAsString = implode(', ', self::$validationModes); @@ -73,6 +75,8 @@ public function __construct(array|string $formats = [], ?string $message = null, if (!$formats) { $options['value'] = self::$validationModes; } elseif (\is_array($formats) && \is_string(key($formats))) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + $options = array_merge($formats, $options ?? []); } elseif (\is_array($formats)) { if ([] === array_intersect(self::$validationModes, $formats)) { diff --git a/Constraints/Currency.php b/Constraints/Currency.php index 337481543..c9b034d6d 100644 --- a/Constraints/Currency.php +++ b/Constraints/Currency.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Intl\Currencies; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\LogicException; @@ -38,12 +39,17 @@ class Currency extends Constraint * @param array|null $options * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { if (!class_exists(Currencies::class)) { throw new LogicException('The Intl component is required to use the Currency constraint. Try running "composer require symfony/intl".'); } + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/Date.php b/Constraints/Date.php index add108079..98d42ad72 100644 --- a/Constraints/Date.php +++ b/Constraints/Date.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -37,8 +38,13 @@ class Date extends Constraint * @param array|null $options * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/DateTime.php b/Constraints/DateTime.php index 5b3fd1b0b..863b5d119 100644 --- a/Constraints/DateTime.php +++ b/Constraints/DateTime.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -39,13 +40,22 @@ class DateTime extends Constraint /** * @param non-empty-string|array|null $format The datetime format to match (defaults to 'Y-m-d H:i:s') * @param string[]|null $groups - * @param array $options + * @param array|null $options */ - public function __construct(string|array|null $format = null, ?string $message = null, ?array $groups = null, mixed $payload = null, array $options = []) + #[HasNamedArguments] + public function __construct(string|array|null $format = null, ?string $message = null, ?array $groups = null, mixed $payload = null, ?array $options = null) { if (\is_array($format)) { - $options = array_merge($format, $options); + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + + $options = array_merge($format, $options ?? []); } elseif (null !== $format) { + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } else { + $options = []; + } + $options['value'] = $format; } diff --git a/Constraints/DisableAutoMapping.php b/Constraints/DisableAutoMapping.php index 2b762059f..2ece16a04 100644 --- a/Constraints/DisableAutoMapping.php +++ b/Constraints/DisableAutoMapping.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; @@ -28,13 +29,18 @@ class DisableAutoMapping extends Constraint /** * @param array|null $options */ - public function __construct(?array $options = null) + #[HasNamedArguments] + public function __construct(?array $options = null, mixed $payload = null) { + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + if (\is_array($options) && \array_key_exists('groups', $options)) { throw new ConstraintDefinitionException(\sprintf('The option "groups" is not supported by the constraint "%s".', __CLASS__)); } - parent::__construct($options); + parent::__construct($options, null, $payload); } public function getTargets(): string|array diff --git a/Constraints/Email.php b/Constraints/Email.php index 7b9b9ba2b..05bd6ee1b 100644 --- a/Constraints/Email.php +++ b/Constraints/Email.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Constraints; use Egulias\EmailValidator\EmailValidator as StrictEmailValidator; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\InvalidArgumentException; use Symfony\Component\Validator\Exception\LogicException; @@ -50,6 +51,7 @@ class Email extends Constraint * @param self::VALIDATION_MODE_*|null $mode The pattern used to validate the email address; pass null to use the default mode configured for the EmailValidator * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $message = null, @@ -66,6 +68,10 @@ public function __construct( throw new InvalidArgumentException('The "mode" parameter value is not valid.'); } + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/EnableAutoMapping.php b/Constraints/EnableAutoMapping.php index a4808d08c..5de158a39 100644 --- a/Constraints/EnableAutoMapping.php +++ b/Constraints/EnableAutoMapping.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; @@ -28,13 +29,18 @@ class EnableAutoMapping extends Constraint /** * @param array|null $options */ - public function __construct(?array $options = null) + #[HasNamedArguments] + public function __construct(?array $options = null, mixed $payload = null) { + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + if (\is_array($options) && \array_key_exists('groups', $options)) { throw new ConstraintDefinitionException(\sprintf('The option "groups" is not supported by the constraint "%s".', __CLASS__)); } - parent::__construct($options); + parent::__construct($options, null, $payload); } public function getTargets(): string|array diff --git a/Constraints/Expression.php b/Constraints/Expression.php index a9423a08b..355ac2610 100644 --- a/Constraints/Expression.php +++ b/Constraints/Expression.php @@ -13,6 +13,7 @@ use Symfony\Component\ExpressionLanguage\Expression as ExpressionObject; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\LogicException; @@ -42,16 +43,17 @@ class Expression extends Constraint * @param string|ExpressionObject|array|null $expression The expression to evaluate * @param array|null $values The values of the custom variables used in the expression (defaults to an empty array) * @param string[]|null $groups - * @param array $options + * @param array|null $options * @param bool|null $negate Whether to fail if the expression evaluates to true (defaults to false) */ + #[HasNamedArguments] public function __construct( string|ExpressionObject|array|null $expression, ?string $message = null, ?array $values = null, ?array $groups = null, mixed $payload = null, - array $options = [], + ?array $options = null, ?bool $negate = null, ) { if (!class_exists(ExpressionLanguage::class)) { @@ -59,8 +61,16 @@ public function __construct( } if (\is_array($expression)) { - $options = array_merge($expression, $options); + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + + $options = array_merge($expression, $options ?? []); } else { + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } else { + $options = []; + } + $options['value'] = $expression; } diff --git a/Constraints/ExpressionSyntax.php b/Constraints/ExpressionSyntax.php index 8f4f59834..0dcf8a4e0 100644 --- a/Constraints/ExpressionSyntax.php +++ b/Constraints/ExpressionSyntax.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -37,8 +38,13 @@ class ExpressionSyntax extends Constraint * @param string[]|null $allowedVariables Restrict the available variables in the expression to these values (defaults to null that allows any variable) * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?string $service = null, ?array $allowedVariables = null, ?array $groups = null, mixed $payload = null) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/File.php b/Constraints/File.php index 8948b9ea6..6c77559ca 100644 --- a/Constraints/File.php +++ b/Constraints/File.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; @@ -89,6 +90,7 @@ class File extends Constraint * * @see https://www.iana.org/assignments/media-types/media-types.xhtml Existing media types */ + #[HasNamedArguments] public function __construct( ?array $options = null, int|string|null $maxSize = null, @@ -116,6 +118,10 @@ public function __construct( array|string|null $extensions = null, ?string $extensionsMessage = null, ) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->maxSize = $maxSize ?? $this->maxSize; diff --git a/Constraints/Hostname.php b/Constraints/Hostname.php index 3090f1ecc..1ea588ce5 100644 --- a/Constraints/Hostname.php +++ b/Constraints/Hostname.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -35,6 +36,7 @@ class Hostname extends Constraint * @param bool|null $requireTld Whether to require the hostname to include its top-level domain (defaults to true) * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $message = null, @@ -42,6 +44,10 @@ public function __construct( ?array $groups = null, mixed $payload = null, ) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/Iban.php b/Constraints/Iban.php index 71b6d18c7..be79d3dd3 100644 --- a/Constraints/Iban.php +++ b/Constraints/Iban.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -45,8 +46,13 @@ class Iban extends Constraint * @param array|null $options * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/Ip.php b/Constraints/Ip.php index 97743030d..4930b5f82 100644 --- a/Constraints/Ip.php +++ b/Constraints/Ip.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Exception\InvalidArgumentException; @@ -111,6 +112,7 @@ class Ip extends Constraint * @param self::V4*|self::V6*|self::ALL*|null $version The IP version to validate (defaults to {@see self::V4}) * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $version = null, @@ -119,6 +121,10 @@ public function __construct( ?array $groups = null, mixed $payload = null, ) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->version = $version ?? $this->version; diff --git a/Constraints/IsFalse.php b/Constraints/IsFalse.php index a46b071c9..42ef5aac2 100644 --- a/Constraints/IsFalse.php +++ b/Constraints/IsFalse.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -33,8 +34,13 @@ class IsFalse extends Constraint * @param array|null $options * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options ?? [], $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/IsNull.php b/Constraints/IsNull.php index 9f86e8560..b97a88660 100644 --- a/Constraints/IsNull.php +++ b/Constraints/IsNull.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -33,8 +34,13 @@ class IsNull extends Constraint * @param array|null $options * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options ?? [], $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/IsTrue.php b/Constraints/IsTrue.php index c8418a280..849ded086 100644 --- a/Constraints/IsTrue.php +++ b/Constraints/IsTrue.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -33,8 +34,13 @@ class IsTrue extends Constraint * @param array|null $options * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options ?? [], $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/Isbn.php b/Constraints/Isbn.php index c1bc83a34..36813bb7e 100644 --- a/Constraints/Isbn.php +++ b/Constraints/Isbn.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -52,8 +53,9 @@ class Isbn extends Constraint * @param self::ISBN_*|array|null $type The type of ISBN to validate (i.e. {@see Isbn::ISBN_10}, {@see Isbn::ISBN_13} or null to accept both, defaults to null) * @param string|null $message If defined, this message has priority over the others * @param string[]|null $groups - * @param array $options + * @param array|null $options */ + #[HasNamedArguments] public function __construct( string|array|null $type = null, ?string $message = null, @@ -62,11 +64,19 @@ public function __construct( ?string $bothIsbnMessage = null, ?array $groups = null, mixed $payload = null, - array $options = [], + ?array $options = null, ) { if (\is_array($type)) { - $options = array_merge($type, $options); + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + + $options = array_merge($type, $options ?? []); } elseif (null !== $type) { + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } else { + $options = []; + } + $options['value'] = $type; } diff --git a/Constraints/Isin.php b/Constraints/Isin.php index 3f722d21a..405175914 100644 --- a/Constraints/Isin.php +++ b/Constraints/Isin.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -42,8 +43,13 @@ class Isin extends Constraint * @param array|null $options * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/Issn.php b/Constraints/Issn.php index 7d0e5b515..d70b26b38 100644 --- a/Constraints/Issn.php +++ b/Constraints/Issn.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -50,6 +51,7 @@ class Issn extends Constraint * @param bool|null $requireHyphen Whether to require a hyphenated ISSN value (defaults to false) * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $message = null, @@ -58,6 +60,10 @@ public function __construct( ?array $groups = null, mixed $payload = null, ) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/Json.php b/Constraints/Json.php index 3b85a347c..954487fc9 100644 --- a/Constraints/Json.php +++ b/Constraints/Json.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -33,8 +34,13 @@ class Json extends Constraint * @param array|null $options * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/Language.php b/Constraints/Language.php index 67c228448..38fd164d0 100644 --- a/Constraints/Language.php +++ b/Constraints/Language.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Intl\Languages; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\LogicException; @@ -39,6 +40,7 @@ class Language extends Constraint * @param bool|null $alpha3 Pass true to validate the language with three-letter code (ISO 639-2 (2T)) or false with two-letter code (ISO 639-1) (defaults to false) * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $message = null, @@ -50,6 +52,10 @@ public function __construct( throw new LogicException('The Intl component is required to use the Language constraint. Try running "composer require symfony/intl".'); } + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/Length.php b/Constraints/Length.php index d1bc7b9dc..254487642 100644 --- a/Constraints/Length.php +++ b/Constraints/Length.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\InvalidArgumentException; use Symfony\Component\Validator\Exception\MissingOptionsException; @@ -65,8 +66,9 @@ class Length extends Constraint * @param callable|null $normalizer A callable to normalize value before it is validated * @param self::COUNT_*|null $countUnit The character count unit for the length check (defaults to {@see Length::COUNT_CODEPOINTS}) * @param string[]|null $groups - * @param array $options + * @param array|null $options */ + #[HasNamedArguments] public function __construct( int|array|null $exactly = null, ?int $min = null, @@ -80,11 +82,17 @@ public function __construct( ?string $charsetMessage = null, ?array $groups = null, mixed $payload = null, - array $options = [], + ?array $options = null, ) { if (\is_array($exactly)) { - $options = array_merge($exactly, $options); + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + + $options = array_merge($exactly, $options ?? []); $exactly = $options['value'] ?? null; + } elseif (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } else { + $options = []; } $min ??= $options['min'] ?? null; diff --git a/Constraints/Locale.php b/Constraints/Locale.php index fa31fbac4..739ce79ed 100644 --- a/Constraints/Locale.php +++ b/Constraints/Locale.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Intl\Locales; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\LogicException; @@ -39,6 +40,7 @@ class Locale extends Constraint * @param bool|null $canonicalize Whether to canonicalize the value before validation (defaults to true) (see {@see https://www.php.net/manual/en/locale.canonicalize.php}) * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $message = null, @@ -50,6 +52,10 @@ public function __construct( throw new LogicException('The Intl component is required to use the Locale constraint. Try running "composer require symfony/intl".'); } + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/Luhn.php b/Constraints/Luhn.php index df26b283e..2ecb5edc7 100644 --- a/Constraints/Luhn.php +++ b/Constraints/Luhn.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -39,12 +40,17 @@ class Luhn extends Constraint * @param array|null $options * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null, ) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/NoSuspiciousCharacters.php b/Constraints/NoSuspiciousCharacters.php index 2dd6fb8f5..ea9ef8b6f 100644 --- a/Constraints/NoSuspiciousCharacters.php +++ b/Constraints/NoSuspiciousCharacters.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\LogicException; @@ -89,6 +90,7 @@ class NoSuspiciousCharacters extends Constraint * @param string[]|null $locales Restrict the string's characters to those normally used with these locales. Pass null to use the default locales configured for the NoSuspiciousCharactersValidator. (defaults to null) * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $restrictionLevelMessage = null, @@ -105,6 +107,10 @@ public function __construct( throw new LogicException('The intl extension is required to use the NoSuspiciousCharacters constraint.'); } + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->restrictionLevelMessage = $restrictionLevelMessage ?? $this->restrictionLevelMessage; diff --git a/Constraints/NotBlank.php b/Constraints/NotBlank.php index db3602615..18c8e533b 100644 --- a/Constraints/NotBlank.php +++ b/Constraints/NotBlank.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\InvalidArgumentException; @@ -39,8 +40,13 @@ class NotBlank extends Constraint * @param bool|null $allowNull Whether to allow null values (defaults to false) * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?bool $allowNull = null, ?callable $normalizer = null, ?array $groups = null, mixed $payload = null) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options ?? [], $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/NotCompromisedPassword.php b/Constraints/NotCompromisedPassword.php index d11df3ba6..fd0d5e185 100644 --- a/Constraints/NotCompromisedPassword.php +++ b/Constraints/NotCompromisedPassword.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -37,6 +38,7 @@ class NotCompromisedPassword extends Constraint * @param bool|null $skipOnError Whether to ignore HTTP errors while requesting the API and thus consider the password valid (defaults to false) * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $message = null, @@ -45,6 +47,10 @@ public function __construct( ?array $groups = null, mixed $payload = null, ) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/NotNull.php b/Constraints/NotNull.php index 32a327a57..4eb57c6c9 100644 --- a/Constraints/NotNull.php +++ b/Constraints/NotNull.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -33,8 +34,13 @@ class NotNull extends Constraint * @param array|null $options * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options ?? [], $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/PasswordStrength.php b/Constraints/PasswordStrength.php index 42a93c530..7db3bb3a0 100644 --- a/Constraints/PasswordStrength.php +++ b/Constraints/PasswordStrength.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; @@ -43,8 +44,13 @@ final class PasswordStrength extends Constraint * @param self::STRENGTH_*|null $minScore The minimum required strength of the password (defaults to {@see PasswordStrength::STRENGTH_MEDIUM}) * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct(?array $options = null, ?int $minScore = null, ?array $groups = null, mixed $payload = null, ?string $message = null) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + $options['minScore'] ??= self::STRENGTH_MEDIUM; parent::__construct($options, $groups, $payload); diff --git a/Constraints/Range.php b/Constraints/Range.php index cf26d3573..038f3bb1e 100644 --- a/Constraints/Range.php +++ b/Constraints/Range.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\PropertyAccess\PropertyAccess; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Exception\LogicException; @@ -57,6 +58,7 @@ class Range extends Constraint * @param non-empty-string|null $maxPropertyPath Property path to the max value * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $notInRangeMessage = null, @@ -71,6 +73,10 @@ public function __construct( ?array $groups = null, mixed $payload = null, ) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->notInRangeMessage = $notInRangeMessage ?? $this->notInRangeMessage; diff --git a/Constraints/Regex.php b/Constraints/Regex.php index 4a2a90610..f3f1fb07e 100644 --- a/Constraints/Regex.php +++ b/Constraints/Regex.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\InvalidArgumentException; @@ -40,8 +41,9 @@ class Regex extends Constraint * @param string|null $htmlPattern The pattern to use in the HTML5 pattern attribute * @param bool|null $match Whether to validate the value matches the configured pattern or not (defaults to false) * @param string[]|null $groups - * @param array $options + * @param array|null $options */ + #[HasNamedArguments] public function __construct( string|array|null $pattern, ?string $message = null, @@ -50,11 +52,19 @@ public function __construct( ?callable $normalizer = null, ?array $groups = null, mixed $payload = null, - array $options = [], + ?array $options = null, ) { if (\is_array($pattern)) { - $options = array_merge($pattern, $options); + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + + $options = array_merge($pattern, $options ?? []); } elseif (null !== $pattern) { + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } else { + $options = []; + } + $options['value'] = $pattern; } diff --git a/Constraints/Sequentially.php b/Constraints/Sequentially.php index d2b45e4bb..93ae0fcdd 100644 --- a/Constraints/Sequentially.php +++ b/Constraints/Sequentially.php @@ -30,6 +30,10 @@ class Sequentially extends Composite */ public function __construct(mixed $constraints = null, ?array $groups = null, mixed $payload = null) { + if (is_array($constraints) && !array_is_list($constraints)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($constraints ?? [], $groups, $payload); } diff --git a/Constraints/Time.php b/Constraints/Time.php index dca9537cf..9973f681d 100644 --- a/Constraints/Time.php +++ b/Constraints/Time.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -37,6 +38,7 @@ class Time extends Constraint * @param string[]|null $groups * @param bool|null $withSeconds Whether to allow seconds in the given value (defaults to true) */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $message = null, @@ -44,6 +46,10 @@ public function __construct( mixed $payload = null, ?bool $withSeconds = null, ) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->withSeconds = $withSeconds ?? $this->withSeconds; diff --git a/Constraints/Timezone.php b/Constraints/Timezone.php index de10e2803..c92f412f8 100644 --- a/Constraints/Timezone.php +++ b/Constraints/Timezone.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; @@ -45,10 +46,11 @@ class Timezone extends Constraint * @param string|null $countryCode Restrict the valid timezones to this country if the zone option is {@see \DateTimeZone::PER_COUNTRY} * @param bool|null $intlCompatible Whether to restrict valid timezones to ones available in PHP's intl (defaults to false) * @param string[]|null $groups - * @param array $options + * @param array|null $options * * @see \DateTimeZone */ + #[HasNamedArguments] public function __construct( int|array|null $zone = null, ?string $message = null, @@ -56,11 +58,19 @@ public function __construct( ?bool $intlCompatible = null, ?array $groups = null, mixed $payload = null, - array $options = [], + ?array $options = null, ) { if (\is_array($zone)) { - $options = array_merge($zone, $options); + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + + $options = array_merge($zone, $options ?? []); } elseif (null !== $zone) { + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } else { + $options = []; + } + $options['value'] = $zone; } diff --git a/Constraints/Traverse.php b/Constraints/Traverse.php index 80c7b2d31..98671586d 100644 --- a/Constraints/Traverse.php +++ b/Constraints/Traverse.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; @@ -27,13 +28,18 @@ class Traverse extends Constraint /** * @param bool|array|null $traverse Whether to traverse the given object or not (defaults to true). Pass an associative array to configure the constraint's options (e.g. payload). */ - public function __construct(bool|array|null $traverse = null) + #[HasNamedArguments] + public function __construct(bool|array|null $traverse = null, mixed $payload = null) { if (\is_array($traverse) && \array_key_exists('groups', $traverse)) { throw new ConstraintDefinitionException(\sprintf('The option "groups" is not supported by the constraint "%s".', __CLASS__)); } - parent::__construct($traverse); + if (\is_array($traverse)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + + parent::__construct($traverse, null, $payload); } public function getDefaultOption(): ?string diff --git a/Constraints/Type.php b/Constraints/Type.php index 0482ff253..087c1a340 100644 --- a/Constraints/Type.php +++ b/Constraints/Type.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -33,14 +34,25 @@ class Type extends Constraint /** * @param string|string[]|array|null $type The type(s) to enforce on the value * @param string[]|null $groups - * @param array $options + * @param array|null $options */ - public function __construct(string|array|null $type, ?string $message = null, ?array $groups = null, mixed $payload = null, array $options = []) + #[HasNamedArguments] + public function __construct(string|array|null $type, ?string $message = null, ?array $groups = null, mixed $payload = null, ?array $options = null) { if (\is_array($type) && \is_string(key($type))) { - $options = array_merge($type, $options); + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + + $options = array_merge($type, $options ?? []); } elseif (null !== $type) { + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } else { + $options = []; + } + $options['value'] = $type; + } elseif (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Ulid.php b/Constraints/Ulid.php index b73757c13..28b5ef25e 100644 --- a/Constraints/Ulid.php +++ b/Constraints/Ulid.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; @@ -50,6 +51,7 @@ class Ulid extends Constraint * @param string[]|null $groups * @param self::FORMAT_*|null $format */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $message = null, @@ -57,6 +59,10 @@ public function __construct( mixed $payload = null, ?string $format = null, ) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/Unique.php b/Constraints/Unique.php index 6e68e2c3a..a407764ff 100644 --- a/Constraints/Unique.php +++ b/Constraints/Unique.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\InvalidArgumentException; @@ -40,6 +41,7 @@ class Unique extends Constraint * @param string[]|null $groups * @param string[]|string|null $fields Defines the key or keys in the collection that should be checked for uniqueness (defaults to null, which ensure uniqueness for all keys) */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $message = null, @@ -49,6 +51,10 @@ public function __construct( array|string|null $fields = null, ?string $errorPath = null, ) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/Url.php b/Constraints/Url.php index 7225a8be0..ed0733ae6 100644 --- a/Constraints/Url.php +++ b/Constraints/Url.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\InvalidArgumentException; @@ -45,6 +46,7 @@ class Url extends Constraint * @param string[]|null $groups * @param bool|null $requireTld Whether to require the URL to include a top-level domain (defaults to false) */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $message = null, @@ -56,6 +58,10 @@ public function __construct( ?bool $requireTld = null, ?string $tldMessage = null, ) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); if (null === ($options['requireTld'] ?? $requireTld)) { diff --git a/Constraints/Uuid.php b/Constraints/Uuid.php index 2e65d1a00..5a4de6a25 100644 --- a/Constraints/Uuid.php +++ b/Constraints/Uuid.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\InvalidArgumentException; @@ -100,6 +101,7 @@ class Uuid extends Constraint * @param bool|null $strict Whether to force the value to follow the RFC's input format rules; pass false to allow alternate formats (defaults to true) * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct( ?array $options = null, ?string $message = null, @@ -109,6 +111,10 @@ public function __construct( ?array $groups = null, mixed $payload = null, ) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/Constraints/Valid.php b/Constraints/Valid.php index f94d959a3..2a8eab1d4 100644 --- a/Constraints/Valid.php +++ b/Constraints/Valid.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -28,8 +29,13 @@ class Valid extends Constraint * @param string[]|null $groups * @param bool|null $traverse Whether to validate {@see \Traversable} objects (defaults to true) */ + #[HasNamedArguments] public function __construct(?array $options = null, ?array $groups = null, $payload = null, ?bool $traverse = null) { + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } + parent::__construct($options ?? [], $groups, $payload); $this->traverse = $traverse ?? $this->traverse; diff --git a/Constraints/When.php b/Constraints/When.php index 10b5aa3c7..1c3113e1b 100644 --- a/Constraints/When.php +++ b/Constraints/When.php @@ -13,6 +13,7 @@ use Symfony\Component\ExpressionLanguage\Expression; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\LogicException; @@ -33,17 +34,26 @@ class When extends Composite * @param Constraint[]|Constraint|null $constraints One or multiple constraints that are applied if the expression returns true * @param array|null $values The values of the custom variables used in the expression (defaults to []) * @param string[]|null $groups - * @param array $options + * @param array|null $options */ - public function __construct(string|Expression|array $expression, array|Constraint|null $constraints = null, ?array $values = null, ?array $groups = null, $payload = null, array $options = []) + #[HasNamedArguments] + public function __construct(string|Expression|array $expression, array|Constraint|null $constraints = null, ?array $values = null, ?array $groups = null, $payload = null, ?array $options = null) { if (!class_exists(ExpressionLanguage::class)) { throw new LogicException(\sprintf('The "symfony/expression-language" component is required to use the "%s" constraint. Try running "composer require symfony/expression-language".', __CLASS__)); } if (\is_array($expression)) { - $options = array_merge($expression, $options); + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + + $options = array_merge($expression, $options ?? []); } else { + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } else { + $options = []; + } + $options['expression'] = $expression; $options['constraints'] = $constraints; } diff --git a/Constraints/ZeroComparisonConstraintTrait.php b/Constraints/ZeroComparisonConstraintTrait.php index 78fab1f54..b369a9429 100644 --- a/Constraints/ZeroComparisonConstraintTrait.php +++ b/Constraints/ZeroComparisonConstraintTrait.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; /** @@ -21,15 +22,18 @@ */ trait ZeroComparisonConstraintTrait { + #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { - $options ??= []; + if (null !== $options) { + trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + } - if (isset($options['propertyPath'])) { + if (is_array($options) && isset($options['propertyPath'])) { throw new ConstraintDefinitionException(\sprintf('The "propertyPath" option of the "%s" constraint cannot be set.', static::class)); } - if (isset($options['value'])) { + if (is_array($options) && isset($options['value'])) { throw new ConstraintDefinitionException(\sprintf('The "value" option of the "%s" constraint cannot be set.', static::class)); } diff --git a/Context/ExecutionContextInterface.php b/Context/ExecutionContextInterface.php index bd7ec5f96..56e39bd6a 100644 --- a/Context/ExecutionContextInterface.php +++ b/Context/ExecutionContextInterface.php @@ -95,7 +95,7 @@ public function buildViolation(string $message, array $parameters = []): Constra * { * $validator = $this->context->getValidator(); * - * $violations = $validator->validate($value, new Length(['min' => 3])); + * $violations = $validator->validate($value, new Length(min: 3)); * * if (count($violations) > 0) { * // ... diff --git a/Mapping/Loader/AbstractLoader.php b/Mapping/Loader/AbstractLoader.php index a74b53348..184bca894 100644 --- a/Mapping/Loader/AbstractLoader.php +++ b/Mapping/Loader/AbstractLoader.php @@ -97,9 +97,19 @@ protected function newConstraint(string $name, mixed $options = null): Constrain return new $className($options['value']); } + if (array_is_list($options)) { + return new $className($options); + } + return new $className(...$options); } - return new $className($options); + if ($options) { + trigger_deprecation('symfony/validator', '7.2', 'Using constraints not supporting named arguments is deprecated. Try adding the HasNamedArguments attribute to %s.', $className); + + return new $className($options); + } + + return new $className(); } } diff --git a/Mapping/Loader/PropertyInfoLoader.php b/Mapping/Loader/PropertyInfoLoader.php index 444e864f2..57d65696e 100644 --- a/Mapping/Loader/PropertyInfoLoader.php +++ b/Mapping/Loader/PropertyInfoLoader.php @@ -134,7 +134,7 @@ public function loadClassMetadata(ClassMetadata $metadata): bool $metadata->addPropertyConstraint($property, $this->getTypeConstraintLegacy($builtinTypes[0], $types[0])); } elseif ($scalar) { - $metadata->addPropertyConstraint($property, new Type(['type' => 'scalar'])); + $metadata->addPropertyConstraint($property, new Type(type: 'scalar')); } } } else { @@ -203,10 +203,10 @@ private function getPropertyTypes(string $className, string $property): TypeInfo private function getTypeConstraintLegacy(string $builtinType, PropertyInfoType $type): Type { if (PropertyInfoType::BUILTIN_TYPE_OBJECT === $builtinType && null !== $className = $type->getClassName()) { - return new Type(['type' => $className]); + return new Type(type: $className); } - return new Type(['type' => $builtinType]); + return new Type(type: $builtinType); } private function getTypeConstraint(TypeInfoType $type): ?Type @@ -220,11 +220,11 @@ private function getTypeConstraint(TypeInfoType $type): ?Type $baseType = $type->getBaseType(); if ($baseType instanceof ObjectType) { - return new Type(['type' => $baseType->getClassName()]); + return new Type(type: $baseType->getClassName()); } if (TypeIdentifier::MIXED !== $baseType->getTypeIdentifier()) { - return new Type(['type' => $baseType->getTypeIdentifier()->value]); + return new Type(type: $baseType->getTypeIdentifier()->value); } return null; @@ -238,7 +238,7 @@ private function getTypeConstraint(TypeInfoType $type): ?Type TypeIdentifier::BOOL, TypeIdentifier::TRUE, TypeIdentifier::FALSE, - ) ? new Type(['type' => 'scalar']) : null; + ) ? new Type(type: 'scalar') : null; } while ($type instanceof WrappingTypeInterface) { @@ -246,11 +246,11 @@ private function getTypeConstraint(TypeInfoType $type): ?Type } if ($type instanceof ObjectType) { - return new Type(['type' => $type->getClassName()]); + return new Type(type: $type->getClassName()); } if ($type instanceof BuiltinType && TypeIdentifier::MIXED !== $type->getTypeIdentifier()) { - return new Type(['type' => $type->getTypeIdentifier()->value]); + return new Type(type: $type->getTypeIdentifier()->value); } return null; @@ -284,7 +284,7 @@ private function handleAllConstraint(string $property, ?All $allConstraint, Type } if (null === $allConstraint) { - $metadata->addPropertyConstraint($property, new All(['constraints' => $constraints])); + $metadata->addPropertyConstraint($property, new All(constraints: $constraints)); } else { $allConstraint->constraints = array_merge($allConstraint->constraints, $constraints); } @@ -318,7 +318,7 @@ private function handleAllConstraintLegacy(string $property, ?All $allConstraint } if (null === $allConstraint) { - $metadata->addPropertyConstraint($property, new All(['constraints' => $constraints])); + $metadata->addPropertyConstraint($property, new All(constraints: $constraints)); } else { $allConstraint->constraints = array_merge($allConstraint->constraints, $constraints); } diff --git a/Tests/Constraints/AllValidatorTest.php b/Tests/Constraints/AllValidatorTest.php index 65dae6275..ee6a29174 100644 --- a/Tests/Constraints/AllValidatorTest.php +++ b/Tests/Constraints/AllValidatorTest.php @@ -27,7 +27,7 @@ protected function createValidator(): AllValidator public function testNullIsValid() { - $this->validator->validate(null, new All(new Range(['min' => 4]))); + $this->validator->validate(null, new All(new Range(min: 4))); $this->assertNoViolation(); } @@ -35,7 +35,7 @@ public function testNullIsValid() public function testThrowsExceptionIfNotTraversable() { $this->expectException(UnexpectedValueException::class); - $this->validator->validate('foo.barbar', new All(new Range(['min' => 4]))); + $this->validator->validate('foo.barbar', new All(new Range(min: 4))); } /** @@ -43,7 +43,7 @@ public function testThrowsExceptionIfNotTraversable() */ public function testWalkSingleConstraint($array) { - $constraint = new Range(['min' => 4]); + $constraint = new Range(min: 4); $i = 0; @@ -61,7 +61,7 @@ public function testWalkSingleConstraint($array) */ public function testWalkMultipleConstraints($array) { - $constraint1 = new Range(['min' => 4]); + $constraint1 = new Range(min: 4); $constraint2 = new NotNull(); $constraints = [$constraint1, $constraint2]; diff --git a/Tests/Constraints/AtLeastOneOfValidatorTest.php b/Tests/Constraints/AtLeastOneOfValidatorTest.php index 8bda680b2..22b53dd13 100644 --- a/Tests/Constraints/AtLeastOneOfValidatorTest.php +++ b/Tests/Constraints/AtLeastOneOfValidatorTest.php @@ -66,31 +66,31 @@ public static function getValidCombinations() { return [ ['symfony', [ - new Length(['min' => 10]), - new EqualTo(['value' => 'symfony']), + new Length(min: 10), + new EqualTo(value: 'symfony'), ]], [150, [ - new Range(['min' => 10, 'max' => 20]), - new GreaterThanOrEqual(['value' => 100]), + new Range(min: 10, max: 20), + new GreaterThanOrEqual(value: 100), ]], [7, [ - new LessThan(['value' => 5]), - new IdenticalTo(['value' => 7]), + new LessThan(value: 5), + new IdenticalTo(value: 7), ]], [-3, [ - new DivisibleBy(['value' => 4]), + new DivisibleBy(value: 4), new Negative(), ]], ['FOO', [ - new Choice(['choices' => ['bar', 'BAR']]), - new Regex(['pattern' => '/foo/i']), + new Choice(choices: ['bar', 'BAR']), + new Regex(pattern: '/foo/i'), ]], ['fr', [ new Country(), new Language(), ]], [[1, 3, 5], [ - new Count(['min' => 5]), + new Count(min: 5), new Unique(), ]], ]; @@ -101,7 +101,7 @@ public static function getValidCombinations() */ public function testInvalidCombinationsWithDefaultMessage($value, $constraints) { - $atLeastOneOf = new AtLeastOneOf(['constraints' => $constraints]); + $atLeastOneOf = new AtLeastOneOf(constraints: $constraints); $validator = Validation::createValidator(); $message = [$atLeastOneOf->message]; @@ -123,7 +123,11 @@ public function testInvalidCombinationsWithDefaultMessage($value, $constraints) */ public function testInvalidCombinationsWithCustomMessage($value, $constraints) { - $atLeastOneOf = new AtLeastOneOf(['constraints' => $constraints, 'message' => 'foo', 'includeInternalMessages' => false]); + $atLeastOneOf = new AtLeastOneOf( + constraints: $constraints, + message: 'foo', + includeInternalMessages: false, + ); $violations = Validation::createValidator()->validate($value, $atLeastOneOf); @@ -135,31 +139,31 @@ public static function getInvalidCombinations() { return [ ['symphony', [ - new Length(['min' => 10]), - new EqualTo(['value' => 'symfony']), + new Length(min: 10), + new EqualTo(value: 'symfony'), ]], [70, [ - new Range(['min' => 10, 'max' => 20]), - new GreaterThanOrEqual(['value' => 100]), + new Range(min: 10, max: 20), + new GreaterThanOrEqual(value: 100), ]], [8, [ - new LessThan(['value' => 5]), - new IdenticalTo(['value' => 7]), + new LessThan(value: 5), + new IdenticalTo(value: 7), ]], [3, [ - new DivisibleBy(['value' => 4]), + new DivisibleBy(value: 4), new Negative(), ]], ['F_O_O', [ - new Choice(['choices' => ['bar', 'BAR']]), - new Regex(['pattern' => '/foo/i']), + new Choice(choices: ['bar', 'BAR']), + new Regex(pattern: '/foo/i'), ]], ['f_r', [ new Country(), new Language(), ]], [[1, 3, 3], [ - new Count(['min' => 5]), + new Count(min: 5), new Unique(), ]], ]; @@ -169,21 +173,21 @@ public function testGroupsArePropagatedToNestedConstraints() { $validator = Validation::createValidator(); - $violations = $validator->validate(50, new AtLeastOneOf([ - 'constraints' => [ - new Range([ - 'groups' => 'non_default_group', - 'min' => 10, - 'max' => 20, - ]), - new Range([ - 'groups' => 'non_default_group', - 'min' => 30, - 'max' => 40, - ]), + $violations = $validator->validate(50, new AtLeastOneOf( + constraints: [ + new Range( + groups: ['non_default_group'], + min: 10, + max: 20, + ), + new Range( + groups: ['non_default_group'], + min: 30, + max: 40, + ), ], - 'groups' => 'non_default_group', - ]), 'non_default_group'); + groups: ['non_default_group'], + ), ['non_default_group']); $this->assertCount(1, $violations); } @@ -221,9 +225,9 @@ public function testEmbeddedMessageTakenFromFailingConstraint() public function getMetadataFor($classOrObject): MetadataInterface { return (new ClassMetadata(Data::class)) - ->addPropertyConstraint('foo', new NotNull(['message' => 'custom message foo'])) + ->addPropertyConstraint('foo', new NotNull(message: 'custom message foo')) ->addPropertyConstraint('bar', new AtLeastOneOf([ - new NotNull(['message' => 'custom message bar']), + new NotNull(message: 'custom message bar'), ])) ; } @@ -247,20 +251,20 @@ public function testNestedConstraintsAreNotExecutedWhenGroupDoesNotMatch() { $validator = Validation::createValidator(); - $violations = $validator->validate(50, new AtLeastOneOf([ - 'constraints' => [ - new Range([ - 'groups' => 'adult', - 'min' => 18, - 'max' => 55, - ]), - new GreaterThan([ - 'groups' => 'senior', - 'value' => 55, - ]), + $violations = $validator->validate(50, new AtLeastOneOf( + constraints: [ + new Range( + groups: ['adult'], + min: 18, + max: 55, + ), + new GreaterThan( + groups: ['senior'], + value: 55, + ), ], - 'groups' => ['adult', 'senior'], - ]), 'senior'); + groups: ['adult', 'senior'], + ), 'senior'); $this->assertCount(1, $violations); } diff --git a/Tests/Constraints/BicValidatorTest.php b/Tests/Constraints/BicValidatorTest.php index 348613d00..315cb859e 100644 --- a/Tests/Constraints/BicValidatorTest.php +++ b/Tests/Constraints/BicValidatorTest.php @@ -44,7 +44,7 @@ public function testEmptyStringIsValid() public function testValidComparisonToPropertyPath() { - $constraint = new Bic(['ibanPropertyPath' => 'value']); + $constraint = new Bic(ibanPropertyPath: 'value'); $object = new BicComparisonTestClass('FR14 2004 1010 0505 0001 3M02 606'); @@ -57,7 +57,7 @@ public function testValidComparisonToPropertyPath() public function testInvalidComparisonToPropertyPath() { - $constraint = new Bic(['ibanPropertyPath' => 'value']); + $constraint = new Bic(ibanPropertyPath: 'value'); $constraint->ibanMessage = 'Constraint Message'; $object = new BicComparisonTestClass('FR14 2004 1010 0505 0001 3M02 606'); @@ -95,14 +95,14 @@ public function testPropertyPathReferencingUninitializedProperty() { $this->setObject(new BicTypedDummy()); - $this->validator->validate('UNCRIT2B912', new Bic(['ibanPropertyPath' => 'iban'])); + $this->validator->validate('UNCRIT2B912', new Bic(ibanPropertyPath: 'iban')); $this->assertNoViolation(); } public function testValidComparisonToValue() { - $constraint = new Bic(['iban' => 'FR14 2004 1010 0505 0001 3M02 606']); + $constraint = new Bic(iban: 'FR14 2004 1010 0505 0001 3M02 606'); $constraint->ibanMessage = 'Constraint Message'; $this->validator->validate('SOGEFRPP', $constraint); @@ -112,7 +112,7 @@ public function testValidComparisonToValue() public function testInvalidComparisonToValue() { - $constraint = new Bic(['iban' => 'FR14 2004 1010 0505 0001 3M02 606']); + $constraint = new Bic(iban: 'FR14 2004 1010 0505 0001 3M02 606'); $constraint->ibanMessage = 'Constraint Message'; $this->validator->validate('UNCRIT2B912', $constraint); @@ -142,7 +142,7 @@ public function testInvalidComparisonToValueFromAttribute() public function testNoViolationOnNullObjectWithPropertyPath() { - $constraint = new Bic(['ibanPropertyPath' => 'propertyPath']); + $constraint = new Bic(ibanPropertyPath: 'propertyPath'); $this->setObject(null); @@ -155,10 +155,10 @@ public function testThrowsConstraintExceptionIfBothValueAndPropertyPath() { $this->expectException(ConstraintDefinitionException::class); $this->expectExceptionMessage('The "iban" and "ibanPropertyPath" options of the Iban constraint cannot be used at the same time'); - new Bic([ - 'iban' => 'value', - 'ibanPropertyPath' => 'propertyPath', - ]); + new Bic( + iban: 'value', + ibanPropertyPath: 'propertyPath', + ); } public function testThrowsConstraintExceptionIfBothValueAndPropertyPathNamed() @@ -171,7 +171,7 @@ public function testThrowsConstraintExceptionIfBothValueAndPropertyPathNamed() public function testInvalidValuePath() { - $constraint = new Bic(['ibanPropertyPath' => 'foo']); + $constraint = new Bic(ibanPropertyPath: 'foo'); $this->expectException(ConstraintDefinitionException::class); $this->expectExceptionMessage(\sprintf('Invalid property path "foo" provided to "%s" constraint', $constraint::class)); @@ -217,9 +217,9 @@ public static function getValidBics() */ public function testInvalidBics($bic, $code) { - $constraint = new Bic([ - 'message' => 'myMessage', - ]); + $constraint = new Bic( + message: 'myMessage', + ); $this->validator->validate($bic, $constraint); @@ -277,7 +277,7 @@ public static function getInvalidBics() */ public function testValidBicSpecialCases(string $bic, string $iban) { - $constraint = new Bic(['iban' => $iban]); + $constraint = new Bic(iban: $iban); $this->validator->validate($bic, $constraint); $this->assertNoViolation(); diff --git a/Tests/Constraints/BlankValidatorTest.php b/Tests/Constraints/BlankValidatorTest.php index 9643c6793..21d3fc83e 100644 --- a/Tests/Constraints/BlankValidatorTest.php +++ b/Tests/Constraints/BlankValidatorTest.php @@ -41,9 +41,9 @@ public function testBlankIsValid() */ public function testInvalidValues($value, $valueAsString) { - $constraint = new Blank([ - 'message' => 'myMessage', - ]); + $constraint = new Blank( + message: 'myMessage', + ); $this->validator->validate($value, $constraint); diff --git a/Tests/Constraints/CallbackValidatorTest.php b/Tests/Constraints/CallbackValidatorTest.php index ef92d3072..7fbcd2714 100644 --- a/Tests/Constraints/CallbackValidatorTest.php +++ b/Tests/Constraints/CallbackValidatorTest.php @@ -74,7 +74,7 @@ public function testSingleMethod() public function testSingleMethodExplicitName() { $object = new CallbackValidatorTest_Object(); - $constraint = new Callback(['callback' => 'validate']); + $constraint = new Callback(callback: 'validate'); $this->validator->validate($object, $constraint); @@ -129,13 +129,11 @@ public function testClosureNullObject() public function testClosureExplicitName() { $object = new CallbackValidatorTest_Object(); - $constraint = new Callback([ - 'callback' => function ($object, ExecutionContextInterface $context) { - $context->addViolation('My message', ['{{ value }}' => 'foobar']); + $constraint = new Callback(callback: function ($object, ExecutionContextInterface $context) { + $context->addViolation('My message', ['{{ value }}' => 'foobar']); - return false; - }, - ]); + return false; + }); $this->validator->validate($object, $constraint); @@ -170,9 +168,7 @@ public function testArrayCallableNullObject() public function testArrayCallableExplicitName() { $object = new CallbackValidatorTest_Object(); - $constraint = new Callback([ - 'callback' => [__CLASS__.'_Class', 'validateCallback'], - ]); + $constraint = new Callback(callback: [__CLASS__.'_Class', 'validateCallback']); $this->validator->validate($object, $constraint); @@ -186,7 +182,7 @@ public function testExpectValidMethods() $this->expectException(ConstraintDefinitionException::class); $object = new CallbackValidatorTest_Object(); - $this->validator->validate($object, new Callback(['callback' => ['foobar']])); + $this->validator->validate($object, new Callback(callback: ['foobar'])); } public function testExpectValidCallbacks() @@ -194,12 +190,12 @@ public function testExpectValidCallbacks() $this->expectException(ConstraintDefinitionException::class); $object = new CallbackValidatorTest_Object(); - $this->validator->validate($object, new Callback(['callback' => ['foo', 'bar']])); + $this->validator->validate($object, new Callback(callback: ['foo', 'bar'])); } public function testConstraintGetTargets() { - $constraint = new Callback([]); + $constraint = new Callback(callback: []); $targets = [Constraint::CLASS_CONSTRAINT, Constraint::PROPERTY_CONSTRAINT]; $this->assertEquals($targets, $constraint->getTargets()); @@ -215,16 +211,16 @@ public function testNoConstructorArguments() public function testAttributeInvocationSingleValued() { - $constraint = new Callback(['value' => 'validateStatic']); + $constraint = new Callback(callback: 'validateStatic'); - $this->assertEquals(new Callback('validateStatic'), $constraint); + $this->assertEquals(new Callback(callback: 'validateStatic'), $constraint); } public function testAttributeInvocationMultiValued() { - $constraint = new Callback(['value' => [__CLASS__.'_Class', 'validateCallback']]); + $constraint = new Callback(callback: [__CLASS__.'_Class', 'validateCallback']); - $this->assertEquals(new Callback([__CLASS__.'_Class', 'validateCallback']), $constraint); + $this->assertEquals(new Callback(callback: [__CLASS__.'_Class', 'validateCallback']), $constraint); } public function testPayloadIsPassedToCallback() @@ -235,10 +231,10 @@ public function testPayloadIsPassedToCallback() $payloadCopy = $payload; }; - $constraint = new Callback([ - 'callback' => $callback, - 'payload' => 'Hello world!', - ]); + $constraint = new Callback( + callback: $callback, + payload: 'Hello world!', + ); $this->validator->validate($object, $constraint); $this->assertEquals('Hello world!', $payloadCopy); @@ -248,9 +244,7 @@ public function testPayloadIsPassedToCallback() $this->assertEquals('Hello world!', $payloadCopy); $payloadCopy = 'Replace me!'; - $constraint = new Callback([ - 'callback' => $callback, - ]); + $constraint = new Callback(callback: $callback); $this->validator->validate($object, $constraint); $this->assertNull($payloadCopy); } diff --git a/Tests/Constraints/CardSchemeValidatorTest.php b/Tests/Constraints/CardSchemeValidatorTest.php index 15f4fa634..87b1daebc 100644 --- a/Tests/Constraints/CardSchemeValidatorTest.php +++ b/Tests/Constraints/CardSchemeValidatorTest.php @@ -24,14 +24,14 @@ protected function createValidator(): CardSchemeValidator public function testNullIsValid() { - $this->validator->validate(null, new CardScheme(['schemes' => []])); + $this->validator->validate(null, new CardScheme(schemes: [])); $this->assertNoViolation(); } public function testEmptyStringIsValid() { - $this->validator->validate('', new CardScheme(['schemes' => []])); + $this->validator->validate('', new CardScheme(schemes:[])); $this->assertNoViolation(); } @@ -41,7 +41,7 @@ public function testEmptyStringIsValid() */ public function testValidNumbers($scheme, $number) { - $this->validator->validate($number, new CardScheme(['schemes' => $scheme])); + $this->validator->validate($number, new CardScheme(schemes: $scheme)); $this->assertNoViolation(); } @@ -51,7 +51,7 @@ public function testValidNumbers($scheme, $number) */ public function testValidNumbersWithNewLine($scheme, $number) { - $this->validator->validate($number."\n", new CardScheme(['schemes' => $scheme, 'message' => 'myMessage'])); + $this->validator->validate($number."\n", new CardScheme(schemes: $scheme, message: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ value }}', '"'.$number."\n\"") @@ -74,10 +74,10 @@ public function testValidNumberWithOrderedArguments() */ public function testInvalidNumbers($scheme, $number, $code) { - $constraint = new CardScheme([ - 'schemes' => $scheme, - 'message' => 'myMessage', - ]); + $constraint = new CardScheme( + schemes: $scheme, + message: 'myMessage', + ); $this->validator->validate($number, $constraint); diff --git a/Tests/Constraints/ChoiceValidatorTest.php b/Tests/Constraints/ChoiceValidatorTest.php index a78a2bfa5..a219e44d8 100644 --- a/Tests/Constraints/ChoiceValidatorTest.php +++ b/Tests/Constraints/ChoiceValidatorTest.php @@ -47,22 +47,17 @@ public static function staticCallbackInvalid() public function testExpectArrayIfMultipleIsTrue() { $this->expectException(UnexpectedValueException::class); - $constraint = new Choice([ - 'choices' => ['foo', 'bar'], - 'multiple' => true, - ]); + $constraint = new Choice( + choices: ['foo', 'bar'], + multiple: true, + ); $this->validator->validate('asdf', $constraint); } public function testNullIsValid() { - $this->validator->validate( - null, - new Choice([ - 'choices' => ['foo', 'bar'], - ]) - ); + $this->validator->validate(null, new Choice(choices: ['foo', 'bar'])); $this->assertNoViolation(); } @@ -76,7 +71,7 @@ public function testChoicesOrCallbackExpected() public function testValidCallbackExpected() { $this->expectException(ConstraintDefinitionException::class); - $this->validator->validate('foobar', new Choice(['callback' => 'abcd'])); + $this->validator->validate('foobar', new Choice(callback: 'abcd')); } /** @@ -91,12 +86,27 @@ public function testValidChoiceArray(Choice $constraint) public static function provideConstraintsWithChoicesArray(): iterable { - yield 'Doctrine style' => [new Choice(['choices' => ['foo', 'bar']])]; - yield 'Doctrine default option' => [new Choice(['value' => ['foo', 'bar']])]; yield 'first argument' => [new Choice(['foo', 'bar'])]; yield 'named arguments' => [new Choice(choices: ['foo', 'bar'])]; } + /** + * @group legacy + * @dataProvider provideLegacyConstraintsWithChoicesArrayDoctrineStyle + */ + public function testValidChoiceArrayDoctrineStyle(Choice $constraint) + { + $this->validator->validate('bar', $constraint); + + $this->assertNoViolation(); + } + + public static function provideLegacyConstraintsWithChoicesArrayDoctrineStyle(): iterable + { + yield 'Doctrine style' => [new Choice(['choices' => ['foo', 'bar']])]; + yield 'Doctrine default option' => [new Choice(['value' => ['foo', 'bar']])]; + } + /** * @dataProvider provideConstraintsWithCallbackFunction */ @@ -108,15 +118,30 @@ public function testValidChoiceCallbackFunction(Choice $constraint) } public static function provideConstraintsWithCallbackFunction(): iterable + { + yield 'named arguments, namespaced function' => [new Choice(callback: __NAMESPACE__.'\choice_callback')]; + yield 'named arguments, closure' => [new Choice(callback: fn () => ['foo', 'bar'])]; + yield 'named arguments, static method' => [new Choice(callback: [__CLASS__, 'staticCallback'])]; + } + + /** + * @group legacy + * @dataProvider provideLegacyConstraintsWithCallbackFunctionDoctrineStyle + */ + public function testValidChoiceCallbackFunctionDoctrineStyle(Choice $constraint) + { + $this->validator->validate('bar', $constraint); + + $this->assertNoViolation(); + } + + public static function provideLegacyConstraintsWithCallbackFunctionDoctrineStyle(): iterable { yield 'doctrine style, namespaced function' => [new Choice(['callback' => __NAMESPACE__.'\choice_callback'])]; yield 'doctrine style, closure' => [new Choice([ 'callback' => fn () => ['foo', 'bar'], ])]; yield 'doctrine style, static method' => [new Choice(['callback' => [__CLASS__, 'staticCallback']])]; - yield 'named arguments, namespaced function' => [new Choice(callback: __NAMESPACE__.'\choice_callback')]; - yield 'named arguments, closure' => [new Choice(callback: fn () => ['foo', 'bar'])]; - yield 'named arguments, static method' => [new Choice(callback: [__CLASS__, 'staticCallback'])]; } public function testValidChoiceCallbackContextMethod() @@ -124,7 +149,7 @@ public function testValidChoiceCallbackContextMethod() // search $this for "staticCallback" $this->setObject($this); - $constraint = new Choice(['callback' => 'staticCallback']); + $constraint = new Choice(callback: 'staticCallback'); $this->validator->validate('bar', $constraint); @@ -139,7 +164,7 @@ public function testInvalidChoiceCallbackContextMethod() // search $this for "staticCallbackInvalid" $this->setObject($this); - $constraint = new Choice(['callback' => 'staticCallbackInvalid']); + $constraint = new Choice(callback: 'staticCallbackInvalid'); $this->validator->validate('bar', $constraint); } @@ -149,41 +174,39 @@ public function testValidChoiceCallbackContextObjectMethod() // search $this for "objectMethodCallback" $this->setObject($this); - $constraint = new Choice(['callback' => 'objectMethodCallback']); + $constraint = new Choice(callback: 'objectMethodCallback'); $this->validator->validate('bar', $constraint); $this->assertNoViolation(); } - /** - * @dataProvider provideConstraintsWithMultipleTrue - */ - public function testMultipleChoices(Choice $constraint) + public function testMultipleChoices() { - $this->validator->validate(['baz', 'bar'], $constraint); + $this->validator->validate(['baz', 'bar'], new Choice( + choices: ['foo', 'bar', 'baz'], + multiple: true, + )); $this->assertNoViolation(); } - public static function provideConstraintsWithMultipleTrue(): iterable + /** + * @group legacy + */ + public function testMultipleChoicesDoctrineStyle() { - yield 'Doctrine style' => [new Choice([ + $this->validator->validate(['baz', 'bar'], new Choice([ 'choices' => ['foo', 'bar', 'baz'], 'multiple' => true, - ])]; - yield 'named arguments' => [new Choice( - choices: ['foo', 'bar', 'baz'], - multiple: true, - )]; + ])); + + $this->assertNoViolation(); } - /** - * @dataProvider provideConstraintsWithMessage - */ - public function testInvalidChoice(Choice $constraint) + public function testInvalidChoice() { - $this->validator->validate('baz', $constraint); + $this->validator->validate('baz', new Choice(choices: ['foo', 'bar'], message: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ value }}', '"baz"') @@ -192,20 +215,28 @@ public function testInvalidChoice(Choice $constraint) ->assertRaised(); } - public static function provideConstraintsWithMessage(): iterable + /** + * @group legacy + */ + public function testInvalidChoiceDoctrineStyle() { - yield 'Doctrine style' => [new Choice(['choices' => ['foo', 'bar'], 'message' => 'myMessage'])]; - yield 'named arguments' => [new Choice(choices: ['foo', 'bar'], message: 'myMessage')]; + $this->validator->validate('baz', new Choice(['choices' => ['foo', 'bar'], 'message' => 'myMessage'])); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"baz"') + ->setParameter('{{ choices }}', '"foo", "bar"') + ->setCode(Choice::NO_SUCH_CHOICE_ERROR) + ->assertRaised(); } public function testInvalidChoiceEmptyChoices() { - $constraint = new Choice([ + $constraint = new Choice( // May happen when the choices are provided dynamically, e.g. from // the DB or the model - 'choices' => [], - 'message' => 'myMessage', - ]); + choices: [], + message: 'myMessage', + ); $this->validator->validate('baz', $constraint); @@ -216,12 +247,13 @@ public function testInvalidChoiceEmptyChoices() ->assertRaised(); } - /** - * @dataProvider provideConstraintsWithMultipleMessage - */ - public function testInvalidChoiceMultiple(Choice $constraint) + public function testInvalidChoiceMultiple() { - $this->validator->validate(['foo', 'baz'], $constraint); + $this->validator->validate(['foo', 'baz'], new Choice( + choices: ['foo', 'bar'], + multipleMessage: 'myMessage', + multiple: true, + )); $this->buildViolation('myMessage') ->setParameter('{{ value }}', '"baz"') @@ -230,31 +262,37 @@ public function testInvalidChoiceMultiple(Choice $constraint) ->setCode(Choice::NO_SUCH_CHOICE_ERROR) ->assertRaised(); } - - public static function provideConstraintsWithMultipleMessage(): iterable + /** + * @group legacy + */ + public function testInvalidChoiceMultipleDoctrineStyle() { - yield 'Doctrine style' => [new Choice([ + $this->validator->validate(['foo', 'baz'], new Choice([ 'choices' => ['foo', 'bar'], 'multipleMessage' => 'myMessage', 'multiple' => true, - ])]; - yield 'named arguments' => [new Choice( - choices: ['foo', 'bar'], - multipleMessage: 'myMessage', - multiple: true, - )]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"baz"') + ->setParameter('{{ choices }}', '"foo", "bar"') + ->setInvalidValue('baz') + ->setCode(Choice::NO_SUCH_CHOICE_ERROR) + ->assertRaised(); } - /** - * @dataProvider provideConstraintsWithMin - */ - public function testTooFewChoices(Choice $constraint) + public function testTooFewChoices() { $value = ['foo']; $this->setValue($value); - $this->validator->validate($value, $constraint); + $this->validator->validate($value, new Choice( + choices: ['foo', 'bar', 'moo', 'maa'], + multiple: true, + min: 2, + minMessage: 'myMessage', + )); $this->buildViolation('myMessage') ->setParameter('{{ limit }}', 2) @@ -264,32 +302,42 @@ public function testTooFewChoices(Choice $constraint) ->assertRaised(); } - public static function provideConstraintsWithMin(): iterable + /** + * @group legacy + */ + public function testTooFewChoicesDoctrineStyle() { - yield 'Doctrine style' => [new Choice([ + $value = ['foo']; + + $this->setValue($value); + + $this->validator->validate($value, new Choice([ 'choices' => ['foo', 'bar', 'moo', 'maa'], 'multiple' => true, 'min' => 2, 'minMessage' => 'myMessage', - ])]; - yield 'named arguments' => [new Choice( - choices: ['foo', 'bar', 'moo', 'maa'], - multiple: true, - min: 2, - minMessage: 'myMessage', - )]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ limit }}', 2) + ->setInvalidValue($value) + ->setPlural(2) + ->setCode(Choice::TOO_FEW_ERROR) + ->assertRaised(); } - /** - * @dataProvider provideConstraintsWithMax - */ - public function testTooManyChoices(Choice $constraint) + public function testTooManyChoices() { $value = ['foo', 'bar', 'moo']; $this->setValue($value); - $this->validator->validate($value, $constraint); + $this->validator->validate($value, new Choice( + choices: ['foo', 'bar', 'moo', 'maa'], + multiple: true, + max: 2, + maxMessage: 'myMessage', + )); $this->buildViolation('myMessage') ->setParameter('{{ limit }}', 2) @@ -299,27 +347,33 @@ public function testTooManyChoices(Choice $constraint) ->assertRaised(); } - public static function provideConstraintsWithMax(): iterable + /** + * @group legacy + */ + public function testTooManyChoicesDoctrineStyle() { - yield 'Doctrine style' => [new Choice([ + $value = ['foo', 'bar', 'moo']; + + $this->setValue($value); + + $this->validator->validate($value, new Choice([ 'choices' => ['foo', 'bar', 'moo', 'maa'], 'multiple' => true, 'max' => 2, 'maxMessage' => 'myMessage', - ])]; - yield 'named arguments' => [new Choice( - choices: ['foo', 'bar', 'moo', 'maa'], - multiple: true, - max: 2, - maxMessage: 'myMessage', - )]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ limit }}', 2) + ->setInvalidValue($value) + ->setPlural(2) + ->setCode(Choice::TOO_MANY_ERROR) + ->assertRaised(); } public function testStrictAllowsExactValue() { - $constraint = new Choice([ - 'choices' => [1, 2], - ]); + $constraint = new Choice(choices: [1, 2]); $this->validator->validate(2, $constraint); @@ -328,10 +382,10 @@ public function testStrictAllowsExactValue() public function testStrictDisallowsDifferentType() { - $constraint = new Choice([ - 'choices' => [1, 2], - 'message' => 'myMessage', - ]); + $constraint = new Choice( + choices: [1, 2], + message: 'myMessage', + ); $this->validator->validate('2', $constraint); @@ -344,11 +398,11 @@ public function testStrictDisallowsDifferentType() public function testStrictWithMultipleChoices() { - $constraint = new Choice([ - 'choices' => [1, 2, 3], - 'multiple' => true, - 'multipleMessage' => 'myMessage', - ]); + $constraint = new Choice( + choices: [1, 2, 3], + multiple: true, + multipleMessage: 'myMessage', + ); $this->validator->validate([2, '3'], $constraint); @@ -362,10 +416,10 @@ public function testStrictWithMultipleChoices() public function testMatchFalse() { - $this->validator->validate('foo', new Choice([ - 'choices' => ['foo', 'bar'], - 'match' => false, - ])); + $this->validator->validate('foo', new Choice( + choices: ['foo', 'bar'], + match: false, + )); $this->buildViolation('The value you selected is not a valid choice.') ->setParameter('{{ value }}', '"foo"') @@ -376,11 +430,11 @@ public function testMatchFalse() public function testMatchFalseWithMultiple() { - $this->validator->validate(['ccc', 'bar', 'zzz'], new Choice([ - 'choices' => ['foo', 'bar'], - 'multiple' => true, - 'match' => false, - ])); + $this->validator->validate(['ccc', 'bar', 'zzz'], new Choice( + choices: ['foo', 'bar'], + multiple: true, + match: false, + )); $this->buildViolation('One or more of the given values is invalid.') ->setParameter('{{ value }}', '"bar"') diff --git a/Tests/Constraints/CidrTest.php b/Tests/Constraints/CidrTest.php index 142783ec0..25059104d 100644 --- a/Tests/Constraints/CidrTest.php +++ b/Tests/Constraints/CidrTest.php @@ -31,7 +31,7 @@ public function testForAll() public function testForV4() { - $cidrConstraint = new Cidr(['version' => Ip::V4]); + $cidrConstraint = new Cidr(version: Ip::V4); self::assertEquals(Ip::V4, $cidrConstraint->version); self::assertEquals(0, $cidrConstraint->netmaskMin); @@ -40,7 +40,7 @@ public function testForV4() public function testForV6() { - $cidrConstraint = new Cidr(['version' => Ip::V6]); + $cidrConstraint = new Cidr(version: Ip::V6); self::assertEquals(Ip::V6, $cidrConstraint->version); self::assertEquals(0, $cidrConstraint->netmaskMin); @@ -62,7 +62,7 @@ public function testWithInvalidVersion() self::expectException(ConstraintDefinitionException::class); self::expectExceptionMessage(\sprintf('The option "version" must be one of "%s".', implode('", "', $availableVersions))); - new Cidr(['version' => '8']); + new Cidr(version: '8'); } /** @@ -70,11 +70,11 @@ public function testWithInvalidVersion() */ public function testWithValidMinMaxValues(string $ipVersion, int $netmaskMin, int $netmaskMax) { - $cidrConstraint = new Cidr([ - 'version' => $ipVersion, - 'netmaskMin' => $netmaskMin, - 'netmaskMax' => $netmaskMax, - ]); + $cidrConstraint = new Cidr( + version: $ipVersion, + netmaskMin: $netmaskMin, + netmaskMax: $netmaskMax, + ); self::assertEquals($ipVersion, $cidrConstraint->version); self::assertEquals($netmaskMin, $cidrConstraint->netmaskMin); @@ -91,11 +91,11 @@ public function testWithInvalidMinMaxValues(string $ipVersion, int $netmaskMin, self::expectException(ConstraintDefinitionException::class); self::expectExceptionMessage(\sprintf('The netmask range must be between 0 and %d.', $expectedMax)); - new Cidr([ - 'version' => $ipVersion, - 'netmaskMin' => $netmaskMin, - 'netmaskMax' => $netmaskMax, - ]); + new Cidr( + version: $ipVersion, + netmaskMin: $netmaskMin, + netmaskMax: $netmaskMax, + ); } public static function getInvalidMinMaxValues(): array diff --git a/Tests/Constraints/CidrValidatorTest.php b/Tests/Constraints/CidrValidatorTest.php index 04d0b8999..6dfdc4931 100644 --- a/Tests/Constraints/CidrValidatorTest.php +++ b/Tests/Constraints/CidrValidatorTest.php @@ -86,7 +86,7 @@ public function testInvalidIpValue(string $cidr) */ public function testValidCidr(string|\Stringable $cidr, string $version) { - $this->validator->validate($cidr, new Cidr(['version' => $version])); + $this->validator->validate($cidr, new Cidr(version: $version)); $this->assertNoViolation(); } @@ -108,11 +108,11 @@ public function testInvalidIpAddressAndNetmask(string|\Stringable $cidr) */ public function testOutOfRangeNetmask(string $cidr, int $maxExpected, ?string $version = null, ?int $min = null, ?int $max = null) { - $cidrConstraint = new Cidr([ - 'version' => $version, - 'netmaskMin' => $min, - 'netmaskMax' => $max, - ]); + $cidrConstraint = new Cidr( + version: $version, + netmaskMin: $min, + netmaskMax: $max, + ); $this->validator->validate($cidr, $cidrConstraint); $this @@ -128,7 +128,7 @@ public function testOutOfRangeNetmask(string $cidr, int $maxExpected, ?string $v */ public function testWrongVersion(string $cidr, string $version) { - $this->validator->validate($cidr, new Cidr(['version' => $version])); + $this->validator->validate($cidr, new Cidr(version: $version)); $this ->buildViolation('This value is not a valid CIDR notation.') diff --git a/Tests/Constraints/CollectionTest.php b/Tests/Constraints/CollectionTest.php index a2c606154..4299edb26 100644 --- a/Tests/Constraints/CollectionTest.php +++ b/Tests/Constraints/CollectionTest.php @@ -25,6 +25,9 @@ */ class CollectionTest extends TestCase { + /** + * @group legacy + */ public function testRejectNonConstraints() { $this->expectException(InvalidOptionsException::class); @@ -59,18 +62,14 @@ public function testRejectValidConstraintWithinRequired() public function testAcceptOptionalConstraintAsOneElementArray() { - $collection1 = new Collection([ - 'fields' => [ - 'alternate_email' => [ - new Optional(new Email()), - ], + $collection1 = new Collection(fields: [ + 'alternate_email' => [ + new Optional(new Email()), ], ]); - $collection2 = new Collection([ - 'fields' => [ - 'alternate_email' => new Optional(new Email()), - ], + $collection2 = new Collection(fields: [ + 'alternate_email' => new Optional(new Email()), ]); $this->assertEquals($collection1, $collection2); @@ -78,18 +77,14 @@ public function testAcceptOptionalConstraintAsOneElementArray() public function testAcceptRequiredConstraintAsOneElementArray() { - $collection1 = new Collection([ - 'fields' => [ - 'alternate_email' => [ - new Required(new Email()), - ], + $collection1 = new Collection(fields: [ + 'alternate_email' => [ + new Required(new Email()), ], ]); - $collection2 = new Collection([ - 'fields' => [ - 'alternate_email' => new Required(new Email()), - ], + $collection2 = new Collection(fields: [ + 'alternate_email' => new Required(new Email()), ]); $this->assertEquals($collection1, $collection2); @@ -107,6 +102,9 @@ public function testConstraintHasDefaultGroupWithOptionalValues() $this->assertEquals(['Default'], $constraint->fields['bar']->groups); } + /** + * @group legacy + */ public function testOnlySomeKeysAreKnowOptions() { $constraint = new Collection([ @@ -125,15 +123,15 @@ public function testOnlySomeKeysAreKnowOptions() public function testAllKeysAreKnowOptions() { - $constraint = new Collection([ - 'fields' => [ + $constraint = new Collection( + fields: [ 'fields' => [new Required()], 'properties' => [new Required()], 'catalog' => [new Optional()], ], - 'allowExtraFields' => true, - 'extraFieldsMessage' => 'foo bar baz', - ]); + allowExtraFields: true, + extraFieldsMessage: 'foo bar baz', + ); $this->assertArrayHasKey('fields', $constraint->fields); $this->assertInstanceOf(Required::class, $constraint->fields['fields']); @@ -156,11 +154,11 @@ public function testEmptyFields() public function testEmptyFieldsInOptions() { - $constraint = new Collection([ - 'fields' => [], - 'allowExtraFields' => true, - 'extraFieldsMessage' => 'foo bar baz', - ]); + $constraint = new Collection( + fields: [], + allowExtraFields: true, + extraFieldsMessage: 'foo bar baz', + ); $this->assertSame([], $constraint->fields); $this->assertTrue($constraint->allowExtraFields); @@ -196,13 +194,13 @@ public function testEmptyConstraintListForField(?array $fieldConstraint) */ public function testEmptyConstraintListForFieldInOptions(?array $fieldConstraint) { - $constraint = new Collection([ - 'fields' => [ + $constraint = new Collection( + fields: [ 'foo' => $fieldConstraint, ], - 'allowExtraFields' => true, - 'extraFieldsMessage' => 'foo bar baz', - ]); + allowExtraFields: true, + extraFieldsMessage: 'foo bar baz', + ); $this->assertArrayHasKey('foo', $constraint->fields); $this->assertInstanceOf(Required::class, $constraint->fields['foo']); diff --git a/Tests/Constraints/CollectionValidatorTestCase.php b/Tests/Constraints/CollectionValidatorTestCase.php index 92260e966..8e03a9add 100644 --- a/Tests/Constraints/CollectionValidatorTestCase.php +++ b/Tests/Constraints/CollectionValidatorTestCase.php @@ -31,16 +31,16 @@ abstract protected function prepareTestData(array $contents); public function testNullIsValid() { - $this->validator->validate(null, new Collection(['fields' => [ - 'foo' => new Range(['min' => 4]), - ]])); + $this->validator->validate(null, new Collection(fields: [ + 'foo' => new Range(min: 4), + ])); $this->assertNoViolation(); } public function testFieldsAsDefaultOption() { - $constraint = new Range(['min' => 4]); + $constraint = new Range(min: 4); $data = $this->prepareTestData(['foo' => 'foobar']); @@ -56,14 +56,14 @@ public function testFieldsAsDefaultOption() public function testThrowsExceptionIfNotTraversable() { $this->expectException(UnexpectedValueException::class); - $this->validator->validate('foobar', new Collection(['fields' => [ - 'foo' => new Range(['min' => 4]), - ]])); + $this->validator->validate('foobar', new Collection(fields: [ + 'foo' => new Range(min: 4), + ])); } public function testWalkSingleConstraint() { - $constraint = new Range(['min' => 4]); + $constraint = new Range(min: 4); $array = [ 'foo' => 3, @@ -78,12 +78,12 @@ public function testWalkSingleConstraint() $data = $this->prepareTestData($array); - $this->validator->validate($data, new Collection([ - 'fields' => [ + $this->validator->validate($data, new Collection( + fields: [ 'foo' => $constraint, 'bar' => $constraint, ], - ])); + )); $this->assertNoViolation(); } @@ -91,7 +91,7 @@ public function testWalkSingleConstraint() public function testWalkMultipleConstraints() { $constraints = [ - new Range(['min' => 4]), + new Range(min: 4), new NotNull(), ]; @@ -108,19 +108,19 @@ public function testWalkMultipleConstraints() $data = $this->prepareTestData($array); - $this->validator->validate($data, new Collection([ - 'fields' => [ + $this->validator->validate($data, new Collection( + fields: [ 'foo' => $constraints, 'bar' => $constraints, ], - ])); + )); $this->assertNoViolation(); } public function testExtraFieldsDisallowed() { - $constraint = new Range(['min' => 4]); + $constraint = new Range(min: 4); $data = $this->prepareTestData([ 'foo' => 5, @@ -129,12 +129,12 @@ public function testExtraFieldsDisallowed() $this->expectValidateValueAt(0, '[foo]', $data['foo'], [$constraint]); - $this->validator->validate($data, new Collection([ - 'fields' => [ + $this->validator->validate($data, new Collection( + fields: [ 'foo' => $constraint, ], - 'extraFieldsMessage' => 'myMessage', - ])); + extraFieldsMessage: 'myMessage', + )); $this->buildViolation('myMessage') ->setParameter('{{ field }}', '"baz"') @@ -152,12 +152,12 @@ public function testExtraFieldsDisallowedWithOptionalValues() 'baz' => 6, ]); - $this->validator->validate($data, new Collection([ - 'fields' => [ + $this->validator->validate($data, new Collection( + fields: [ 'foo' => $constraint, ], - 'extraFieldsMessage' => 'myMessage', - ])); + extraFieldsMessage: 'myMessage', + )); $this->buildViolation('myMessage') ->setParameter('{{ field }}', '"baz"') @@ -174,15 +174,15 @@ public function testNullNotConsideredExtraField() 'foo' => null, ]); - $constraint = new Range(['min' => 4]); + $constraint = new Range(min: 4); $this->expectValidateValueAt(0, '[foo]', $data['foo'], [$constraint]); - $this->validator->validate($data, new Collection([ - 'fields' => [ + $this->validator->validate($data, new Collection( + fields: [ 'foo' => $constraint, ], - ])); + )); $this->assertNoViolation(); } @@ -194,16 +194,16 @@ public function testExtraFieldsAllowed() 'bar' => 6, ]); - $constraint = new Range(['min' => 4]); + $constraint = new Range(min: 4); $this->expectValidateValueAt(0, '[foo]', $data['foo'], [$constraint]); - $this->validator->validate($data, new Collection([ - 'fields' => [ + $this->validator->validate($data, new Collection( + fields: [ 'foo' => $constraint, ], - 'allowExtraFields' => true, - ])); + allowExtraFields: true, + )); $this->assertNoViolation(); } @@ -212,14 +212,14 @@ public function testMissingFieldsDisallowed() { $data = $this->prepareTestData([]); - $constraint = new Range(['min' => 4]); + $constraint = new Range(min: 4); - $this->validator->validate($data, new Collection([ - 'fields' => [ + $this->validator->validate($data, new Collection( + fields: [ 'foo' => $constraint, ], - 'missingFieldsMessage' => 'myMessage', - ])); + missingFieldsMessage: 'myMessage', + )); $this->buildViolation('myMessage') ->setParameter('{{ field }}', '"foo"') @@ -233,14 +233,14 @@ public function testMissingFieldsAllowed() { $data = $this->prepareTestData([]); - $constraint = new Range(['min' => 4]); + $constraint = new Range(min: 4); - $this->validator->validate($data, new Collection([ - 'fields' => [ + $this->validator->validate($data, new Collection( + fields: [ 'foo' => $constraint, ], - 'allowMissingFields' => true, - ])); + allowMissingFields: true, + )); $this->assertNoViolation(); } @@ -275,7 +275,7 @@ public function testOptionalFieldSingleConstraint() 'foo' => 5, ]; - $constraint = new Range(['min' => 4]); + $constraint = new Range(min: 4); $this->expectValidateValueAt(0, '[foo]', $array['foo'], [$constraint]); @@ -296,7 +296,7 @@ public function testOptionalFieldMultipleConstraints() $constraints = [ new NotNull(), - new Range(['min' => 4]), + new Range(min: 4), ]; $this->expectValidateValueAt(0, '[foo]', $array['foo'], $constraints); @@ -327,12 +327,12 @@ public function testRequiredFieldNotPresent() { $data = $this->prepareTestData([]); - $this->validator->validate($data, new Collection([ - 'fields' => [ + $this->validator->validate($data, new Collection( + fields: [ 'foo' => new Required(), ], - 'missingFieldsMessage' => 'myMessage', - ])); + missingFieldsMessage: 'myMessage', + )); $this->buildViolation('myMessage') ->setParameter('{{ field }}', '"foo"') @@ -348,7 +348,7 @@ public function testRequiredFieldSingleConstraint() 'foo' => 5, ]; - $constraint = new Range(['min' => 4]); + $constraint = new Range(min: 4); $this->expectValidateValueAt(0, '[foo]', $array['foo'], [$constraint]); @@ -369,7 +369,7 @@ public function testRequiredFieldMultipleConstraints() $constraints = [ new NotNull(), - new Range(['min' => 4]), + new Range(min: 4), ]; $this->expectValidateValueAt(0, '[foo]', $array['foo'], $constraints); @@ -389,15 +389,15 @@ public function testObjectShouldBeLeftUnchanged() 'foo' => 3, ]); - $constraint = new Range(['min' => 2]); + $constraint = new Range(min: 2); $this->expectValidateValueAt(0, '[foo]', $value['foo'], [$constraint]); - $this->validator->validate($value, new Collection([ - 'fields' => [ + $this->validator->validate($value, new Collection( + fields: [ 'foo' => $constraint, ], - ])); + )); $this->assertEquals([ 'foo' => 3, diff --git a/Tests/Constraints/CompositeTest.php b/Tests/Constraints/CompositeTest.php index 127ad21dd..a769a68e4 100644 --- a/Tests/Constraints/CompositeTest.php +++ b/Tests/Constraints/CompositeTest.php @@ -66,8 +66,8 @@ public function testNestedCompositeConstraintHasDefaultGroup() public function testMergeNestedGroupsIfNoExplicitParentGroup() { $constraint = new ConcreteComposite([ - new NotNull(['groups' => 'Default']), - new NotBlank(['groups' => ['Default', 'Strict']]), + new NotNull(groups: ['Default']), + new NotBlank(groups: ['Default', 'Strict']), ]); $this->assertEquals(['Default', 'Strict'], $constraint->groups); @@ -94,8 +94,8 @@ public function testExplicitNestedGroupsMustBeSubsetOfExplicitParentGroups() { $constraint = new ConcreteComposite([ 'constraints' => [ - new NotNull(['groups' => 'Default']), - new NotBlank(['groups' => 'Strict']), + new NotNull(groups: ['Default']), + new NotBlank(groups: ['Strict']), ], 'groups' => ['Default', 'Strict'], ]); @@ -110,7 +110,7 @@ public function testFailIfExplicitNestedGroupsNotSubsetOfExplicitParentGroups() $this->expectException(ConstraintDefinitionException::class); new ConcreteComposite([ 'constraints' => [ - new NotNull(['groups' => ['Default', 'Foobar']]), + new NotNull(groups: ['Default', 'Foobar']), ], 'groups' => ['Default', 'Strict'], ]); @@ -119,8 +119,8 @@ public function testFailIfExplicitNestedGroupsNotSubsetOfExplicitParentGroups() public function testImplicitGroupNamesAreForwarded() { $constraint = new ConcreteComposite([ - new NotNull(['groups' => 'Default']), - new NotBlank(['groups' => 'Strict']), + new NotNull(groups: ['Default']), + new NotBlank(groups: ['Strict']), ]); $constraint->addImplicitGroupName('ImplicitGroup'); @@ -142,7 +142,7 @@ public function testFailIfNoConstraint() { $this->expectException(ConstraintDefinitionException::class); new ConcreteComposite([ - new NotNull(['groups' => 'Default']), + new NotNull(groups: ['Default']), 'NotBlank', ]); } @@ -151,7 +151,7 @@ public function testFailIfNoConstraintObject() { $this->expectException(ConstraintDefinitionException::class); new ConcreteComposite([ - new NotNull(['groups' => 'Default']), + new NotNull(groups: ['Default']), new \ArrayObject(), ]); } diff --git a/Tests/Constraints/CompoundTest.php b/Tests/Constraints/CompoundTest.php index 26889a0cc..9b515a48c 100644 --- a/Tests/Constraints/CompoundTest.php +++ b/Tests/Constraints/CompoundTest.php @@ -19,6 +19,9 @@ class CompoundTest extends TestCase { + /** + * @group legacy + */ public function testItCannotRedefineConstraintsOption() { $this->expectException(ConstraintDefinitionException::class); @@ -72,7 +75,7 @@ public function getDefaultOption(): ?string protected function getConstraints(array $options): array { return [ - new Length(['min' => $options['min'] ?? null]), + new Length(min: $options['min'] ?? null), ]; } } diff --git a/Tests/Constraints/CountValidatorTestCase.php b/Tests/Constraints/CountValidatorTestCase.php index c52cd4e69..f60199027 100644 --- a/Tests/Constraints/CountValidatorTestCase.php +++ b/Tests/Constraints/CountValidatorTestCase.php @@ -70,6 +70,7 @@ public static function getFiveOrMoreElements() } /** + * @group legacy * @dataProvider getThreeOrLessElements */ public function testValidValuesMax($value) @@ -92,6 +93,7 @@ public function testValidValuesMaxNamed($value) } /** + * @group legacy * @dataProvider getFiveOrMoreElements */ public function testValidValuesMin($value) @@ -114,6 +116,7 @@ public function testValidValuesMinNamed($value) } /** + * @group legacy * @dataProvider getFourElements */ public function testValidValuesExact($value) @@ -136,6 +139,7 @@ public function testValidValuesExactNamed($value) } /** + * @group legacy * @dataProvider getFiveOrMoreElements */ public function testTooManyValues($value) @@ -175,6 +179,7 @@ public function testTooManyValuesNamed($value) } /** + * @group legacy * @dataProvider getThreeOrLessElements */ public function testTooFewValues($value) @@ -214,6 +219,7 @@ public function testTooFewValuesNamed($value) } /** + * @group legacy * @dataProvider getFiveOrMoreElements */ public function testTooManyValuesExact($value) @@ -258,11 +264,11 @@ public function testTooManyValuesExactNamed($value) */ public function testTooFewValuesExact($value) { - $constraint = new Count([ - 'min' => 4, - 'max' => 4, - 'exactMessage' => 'myMessage', - ]); + $constraint = new Count( + min: 4, + max: 4, + exactMessage: 'myMessage', + ); $this->validator->validate($value, $constraint); @@ -285,7 +291,7 @@ public function testDefaultOption() public function testConstraintAttributeDefaultOption() { - $constraint = new Count(['value' => 5, 'exactMessage' => 'message']); + $constraint = new Count(exactly: 5, exactMessage: 'message'); $this->assertEquals(5, $constraint->min); $this->assertEquals(5, $constraint->max); @@ -296,15 +302,15 @@ public function testConstraintAttributeDefaultOption() // is called with the right DivisibleBy constraint. public function testDivisibleBy() { - $constraint = new Count([ - 'divisibleBy' => 123, - 'divisibleByMessage' => 'foo {{ compared_value }}', - ]); - - $this->expectValidateValue(0, 3, [new DivisibleBy([ - 'value' => 123, - 'message' => 'foo {{ compared_value }}', - ])], $this->group); + $constraint = new Count( + divisibleBy: 123, + divisibleByMessage: 'foo {{ compared_value }}', + ); + + $this->expectValidateValue(0, 3, [new DivisibleBy( + value: 123, + message: 'foo {{ compared_value }}', + )], $this->group); $this->validator->validate(['foo', 'bar', 'ccc'], $constraint); diff --git a/Tests/Constraints/CountryValidatorTest.php b/Tests/Constraints/CountryValidatorTest.php index 524d0bc54..e535ce4f5 100644 --- a/Tests/Constraints/CountryValidatorTest.php +++ b/Tests/Constraints/CountryValidatorTest.php @@ -84,9 +84,7 @@ public static function getValidCountries() */ public function testInvalidCountries($country) { - $constraint = new Country([ - 'message' => 'myMessage', - ]); + $constraint = new Country(message: 'myMessage'); $this->validator->validate($country, $constraint); @@ -109,9 +107,7 @@ public static function getInvalidCountries() */ public function testValidAlpha3Countries($country) { - $this->validator->validate($country, new Country([ - 'alpha3' => true, - ])); + $this->validator->validate($country, new Country(alpha3: true)); $this->assertNoViolation(); } @@ -130,10 +126,10 @@ public static function getValidAlpha3Countries() */ public function testInvalidAlpha3Countries($country) { - $constraint = new Country([ - 'alpha3' => true, - 'message' => 'myMessage', - ]); + $constraint = new Country( + alpha3: true, + message: 'myMessage', + ); $this->validator->validate($country, $constraint); diff --git a/Tests/Constraints/CurrencyValidatorTest.php b/Tests/Constraints/CurrencyValidatorTest.php index a0e16ec14..51def4a2a 100644 --- a/Tests/Constraints/CurrencyValidatorTest.php +++ b/Tests/Constraints/CurrencyValidatorTest.php @@ -100,9 +100,7 @@ public static function getValidCurrencies() */ public function testInvalidCurrencies($currency) { - $constraint = new Currency([ - 'message' => 'myMessage', - ]); + $constraint = new Currency(message: 'myMessage'); $this->validator->validate($currency, $constraint); diff --git a/Tests/Constraints/DateTimeValidatorTest.php b/Tests/Constraints/DateTimeValidatorTest.php index 42519ffd4..383f06215 100644 --- a/Tests/Constraints/DateTimeValidatorTest.php +++ b/Tests/Constraints/DateTimeValidatorTest.php @@ -63,9 +63,7 @@ public function testDateTimeWithDefaultFormat() */ public function testValidDateTimes($format, $dateTime) { - $constraint = new DateTime([ - 'format' => $format, - ]); + $constraint = new DateTime(format: $format); $this->validator->validate($dateTime, $constraint); @@ -88,10 +86,10 @@ public static function getValidDateTimes() */ public function testInvalidDateTimes($format, $dateTime, $code) { - $constraint = new DateTime([ - 'message' => 'myMessage', - 'format' => $format, - ]); + $constraint = new DateTime( + message: 'myMessage', + format: $format, + ); $this->validator->validate($dateTime, $constraint); @@ -133,9 +131,7 @@ public function testInvalidDateTimeNamed() public function testDateTimeWithTrailingData() { - $this->validator->validate('1995-05-10 00:00:00', new DateTime([ - 'format' => 'Y-m-d+', - ])); + $this->validator->validate('1995-05-10 00:00:00', new DateTime(format: 'Y-m-d+')); $this->assertNoViolation(); } } diff --git a/Tests/Constraints/DateValidatorTest.php b/Tests/Constraints/DateValidatorTest.php index 93dab41f2..65909ef83 100644 --- a/Tests/Constraints/DateValidatorTest.php +++ b/Tests/Constraints/DateValidatorTest.php @@ -58,7 +58,7 @@ public function testValidDates($date) */ public function testValidDatesWithNewLine(string $date) { - $this->validator->validate($date."\n", new Date(['message' => 'myMessage'])); + $this->validator->validate($date."\n", new Date(message: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ value }}', '"'.$date."\n\"") @@ -80,9 +80,7 @@ public static function getValidDates() */ public function testInvalidDates($date, $code) { - $constraint = new Date([ - 'message' => 'myMessage', - ]); + $constraint = new Date(message: 'myMessage'); $this->validator->validate($date, $constraint); diff --git a/Tests/Constraints/DisableAutoMappingTest.php b/Tests/Constraints/DisableAutoMappingTest.php index 709334e36..e7b6a8db7 100644 --- a/Tests/Constraints/DisableAutoMappingTest.php +++ b/Tests/Constraints/DisableAutoMappingTest.php @@ -23,6 +23,9 @@ */ class DisableAutoMappingTest extends TestCase { + /** + * @group legacy + */ public function testGroups() { $this->expectException(ConstraintDefinitionException::class); diff --git a/Tests/Constraints/DivisibleByValidatorTest.php b/Tests/Constraints/DivisibleByValidatorTest.php index 22dc683fb..be96ad2b4 100644 --- a/Tests/Constraints/DivisibleByValidatorTest.php +++ b/Tests/Constraints/DivisibleByValidatorTest.php @@ -32,7 +32,11 @@ protected function createValidator(): DivisibleByValidator protected static function createConstraint(?array $options = null): Constraint { - return new DivisibleBy($options); + if (null !== $options) { + return new DivisibleBy(...$options); + } + + return new DivisibleBy(); } protected function getErrorCode(): ?string diff --git a/Tests/Constraints/EmailTest.php b/Tests/Constraints/EmailTest.php index 8489f9cfe..9436b4bd6 100644 --- a/Tests/Constraints/EmailTest.php +++ b/Tests/Constraints/EmailTest.php @@ -21,14 +21,14 @@ class EmailTest extends TestCase { public function testConstructorStrict() { - $subject = new Email(['mode' => Email::VALIDATION_MODE_STRICT]); + $subject = new Email(mode: Email::VALIDATION_MODE_STRICT); $this->assertEquals(Email::VALIDATION_MODE_STRICT, $subject->mode); } public function testConstructorHtml5AllowNoTld() { - $subject = new Email(['mode' => Email::VALIDATION_MODE_HTML5_ALLOW_NO_TLD]); + $subject = new Email(mode: Email::VALIDATION_MODE_HTML5_ALLOW_NO_TLD); $this->assertEquals(Email::VALIDATION_MODE_HTML5_ALLOW_NO_TLD, $subject->mode); } @@ -37,7 +37,7 @@ public function testUnknownModesTriggerException() { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('The "mode" parameter value is not valid.'); - new Email(['mode' => 'Unknown Mode']); + new Email(mode: 'Unknown Mode'); } public function testUnknownModeArgumentsTriggerException() @@ -49,11 +49,14 @@ public function testUnknownModeArgumentsTriggerException() public function testNormalizerCanBeSet() { - $email = new Email(['normalizer' => 'trim']); + $email = new Email(normalizer: 'trim'); $this->assertEquals('trim', $email->normalizer); } + /** + * @group legacy + */ public function testInvalidNormalizerThrowsException() { $this->expectException(InvalidArgumentException::class); @@ -61,6 +64,9 @@ public function testInvalidNormalizerThrowsException() new Email(['normalizer' => 'Unknown Callable']); } + /** + * @group legacy + */ public function testInvalidNormalizerObjectThrowsException() { $this->expectException(InvalidArgumentException::class); diff --git a/Tests/Constraints/EmailValidatorTest.php b/Tests/Constraints/EmailValidatorTest.php index 197490ce7..483b534e6 100644 --- a/Tests/Constraints/EmailValidatorTest.php +++ b/Tests/Constraints/EmailValidatorTest.php @@ -97,7 +97,7 @@ public static function getValidEmails() */ public function testValidNormalizedEmails($email) { - $this->validator->validate($email, new Email(['normalizer' => 'trim'])); + $this->validator->validate($email, new Email(normalizer: 'trim')); $this->assertNoViolation(); } @@ -115,7 +115,7 @@ public static function getValidEmailsWithWhitespaces() */ public function testValidEmailsHtml5($email) { - $this->validator->validate($email, new Email(['mode' => Email::VALIDATION_MODE_HTML5])); + $this->validator->validate($email, new Email(mode: Email::VALIDATION_MODE_HTML5)); $this->assertNoViolation(); } @@ -135,9 +135,7 @@ public static function getValidEmailsHtml5() */ public function testInvalidEmails($email) { - $constraint = new Email([ - 'message' => 'myMessage', - ]); + $constraint = new Email(message: 'myMessage'); $this->validator->validate($email, $constraint); @@ -162,10 +160,10 @@ public static function getInvalidEmails() */ public function testInvalidHtml5Emails($email) { - $constraint = new Email([ - 'message' => 'myMessage', - 'mode' => Email::VALIDATION_MODE_HTML5, - ]); + $constraint = new Email( + message: 'myMessage', + mode: Email::VALIDATION_MODE_HTML5, + ); $this->validator->validate($email, $constraint); @@ -202,10 +200,10 @@ public static function getInvalidHtml5Emails() */ public function testInvalidAllowNoTldEmails($email) { - $constraint = new Email([ - 'message' => 'myMessage', - 'mode' => Email::VALIDATION_MODE_HTML5_ALLOW_NO_TLD, - ]); + $constraint = new Email( + message: 'myMessage', + mode: Email::VALIDATION_MODE_HTML5_ALLOW_NO_TLD, + ); $this->validator->validate($email, $constraint); @@ -228,7 +226,7 @@ public static function getInvalidAllowNoTldEmails() public function testModeStrict() { - $constraint = new Email(['mode' => Email::VALIDATION_MODE_STRICT]); + $constraint = new Email(mode: Email::VALIDATION_MODE_STRICT); $this->validator->validate('example@mywebsite.tld', $constraint); @@ -237,7 +235,7 @@ public function testModeStrict() public function testModeHtml5() { - $constraint = new Email(['mode' => Email::VALIDATION_MODE_HTML5]); + $constraint = new Email(mode: Email::VALIDATION_MODE_HTML5); $this->validator->validate('example@example..com', $constraint); @@ -249,7 +247,7 @@ public function testModeHtml5() public function testModeHtml5AllowNoTld() { - $constraint = new Email(['mode' => Email::VALIDATION_MODE_HTML5_ALLOW_NO_TLD]); + $constraint = new Email(mode: Email::VALIDATION_MODE_HTML5_ALLOW_NO_TLD); $this->validator->validate('example@example', $constraint); @@ -272,10 +270,10 @@ public function testUnknownModesOnValidateTriggerException() */ public function testStrictWithInvalidEmails($email) { - $constraint = new Email([ - 'message' => 'myMessage', - 'mode' => Email::VALIDATION_MODE_STRICT, - ]); + $constraint = new Email( + message: 'myMessage', + mode: Email::VALIDATION_MODE_STRICT, + ); $this->validator->validate($email, $constraint); diff --git a/Tests/Constraints/EnableAutoMappingTest.php b/Tests/Constraints/EnableAutoMappingTest.php index 66ab42cdf..525a62ed5 100644 --- a/Tests/Constraints/EnableAutoMappingTest.php +++ b/Tests/Constraints/EnableAutoMappingTest.php @@ -23,6 +23,9 @@ */ class EnableAutoMappingTest extends TestCase { + /** + * @group legacy + */ public function testGroups() { $this->expectException(ConstraintDefinitionException::class); diff --git a/Tests/Constraints/EqualToValidatorTest.php b/Tests/Constraints/EqualToValidatorTest.php index b1af4ed18..c9a24ac4d 100644 --- a/Tests/Constraints/EqualToValidatorTest.php +++ b/Tests/Constraints/EqualToValidatorTest.php @@ -34,7 +34,11 @@ protected function createValidator(): EqualToValidator protected static function createConstraint(?array $options = null): Constraint { - return new EqualTo($options); + if (null !== $options) { + return new EqualTo(...$options); + } + + return new EqualTo(); } protected function getErrorCode(): ?string diff --git a/Tests/Constraints/ExpressionSyntaxTest.php b/Tests/Constraints/ExpressionSyntaxTest.php index 3f77cace2..8731a5d85 100644 --- a/Tests/Constraints/ExpressionSyntaxTest.php +++ b/Tests/Constraints/ExpressionSyntaxTest.php @@ -36,8 +36,6 @@ public function testValidatedByService(ExpressionSyntax $constraint) public static function provideServiceValidatedConstraints(): iterable { - yield 'Doctrine style' => [new ExpressionSyntax(['service' => 'my_service'])]; - yield 'named arguments' => [new ExpressionSyntax(service: 'my_service')]; $metadata = new ClassMetadata(ExpressionSyntaxDummy::class); @@ -46,6 +44,16 @@ public static function provideServiceValidatedConstraints(): iterable yield 'attribute' => [$metadata->properties['b']->constraints[0]]; } + /** + * @group legacy + */ + public function testValidatedByServiceDoctrineStyle() + { + $constraint = new ExpressionSyntax(['service' => 'my_service']); + + self::assertSame('my_service', $constraint->validatedBy()); + } + public function testAttributes() { $metadata = new ClassMetadata(ExpressionSyntaxDummy::class); diff --git a/Tests/Constraints/ExpressionSyntaxValidatorTest.php b/Tests/Constraints/ExpressionSyntaxValidatorTest.php index 65be7fb2a..3ca4e655b 100644 --- a/Tests/Constraints/ExpressionSyntaxValidatorTest.php +++ b/Tests/Constraints/ExpressionSyntaxValidatorTest.php @@ -40,49 +40,47 @@ public function testEmptyStringIsValid() public function testExpressionValid() { - $this->validator->validate('1 + 1', new ExpressionSyntax([ - 'message' => 'myMessage', - 'allowedVariables' => [], - ])); + $this->validator->validate('1 + 1', new ExpressionSyntax( + message: 'myMessage', + allowedVariables: [], + )); $this->assertNoViolation(); } public function testStringableExpressionValid() { - $this->validator->validate(new StringableValue('1 + 1'), new ExpressionSyntax([ - 'message' => 'myMessage', - 'allowedVariables' => [], - ])); + $this->validator->validate(new StringableValue('1 + 1'), new ExpressionSyntax( + message: 'myMessage', + allowedVariables: [], + )); $this->assertNoViolation(); } public function testExpressionWithoutNames() { - $this->validator->validate('1 + 1', new ExpressionSyntax([ - 'message' => 'myMessage', - ], null, null, [])); + $this->validator->validate('1 + 1', new ExpressionSyntax(null, 'myMessage', null, [])); $this->assertNoViolation(); } public function testExpressionWithAllowedVariableName() { - $this->validator->validate('a + 1', new ExpressionSyntax([ - 'message' => 'myMessage', - 'allowedVariables' => ['a'], - ])); + $this->validator->validate('a + 1', new ExpressionSyntax( + message: 'myMessage', + allowedVariables: ['a'], + )); $this->assertNoViolation(); } public function testExpressionIsNotValid() { - $this->validator->validate('a + 1', new ExpressionSyntax([ - 'message' => 'myMessage', - 'allowedVariables' => [], - ])); + $this->validator->validate('a + 1', new ExpressionSyntax( + message: 'myMessage', + allowedVariables: [], + )); $this->buildViolation('myMessage') ->setParameter('{{ syntax_error }}', '"Variable "a" is not valid around position 1 for expression `a + 1`."') @@ -93,10 +91,10 @@ public function testExpressionIsNotValid() public function testStringableExpressionIsNotValid() { - $this->validator->validate(new StringableValue('a + 1'), new ExpressionSyntax([ - 'message' => 'myMessage', - 'allowedVariables' => [], - ])); + $this->validator->validate(new StringableValue('a + 1'), new ExpressionSyntax( + message: 'myMessage', + allowedVariables: [], + )); $this->buildViolation('myMessage') ->setParameter('{{ syntax_error }}', '"Variable "a" is not valid around position 1 for expression `a + 1`."') diff --git a/Tests/Constraints/ExpressionValidatorTest.php b/Tests/Constraints/ExpressionValidatorTest.php index c237c793f..21c9eb630 100644 --- a/Tests/Constraints/ExpressionValidatorTest.php +++ b/Tests/Constraints/ExpressionValidatorTest.php @@ -31,10 +31,10 @@ protected function createValidator(): ExpressionValidator public function testExpressionIsEvaluatedWithNullValue() { - $constraint = new Expression([ - 'expression' => 'false', - 'message' => 'myMessage', - ]); + $constraint = new Expression( + expression: 'false', + message: 'myMessage', + ); $this->validator->validate(null, $constraint); @@ -46,10 +46,10 @@ public function testExpressionIsEvaluatedWithNullValue() public function testExpressionIsEvaluatedWithEmptyStringValue() { - $constraint = new Expression([ - 'expression' => 'false', - 'message' => 'myMessage', - ]); + $constraint = new Expression( + expression: 'false', + message: 'myMessage', + ); $this->validator->validate('', $constraint); @@ -75,10 +75,10 @@ public function testSucceedingExpressionAtObjectLevel() public function testFailingExpressionAtObjectLevel() { - $constraint = new Expression([ - 'expression' => 'this.data == 1', - 'message' => 'myMessage', - ]); + $constraint = new Expression( + expression: 'this.data == 1', + message: 'myMessage', + ); $object = new Entity(); $object->data = '2'; @@ -109,10 +109,10 @@ public function testSucceedingExpressionAtObjectLevelWithToString() public function testFailingExpressionAtObjectLevelWithToString() { - $constraint = new Expression([ - 'expression' => 'this.data == 1', - 'message' => 'myMessage', - ]); + $constraint = new Expression( + expression: 'this.data == 1', + message: 'myMessage', + ); $object = new ToString(); $object->data = '2'; @@ -145,10 +145,10 @@ public function testSucceedingExpressionAtPropertyLevel() public function testFailingExpressionAtPropertyLevel() { - $constraint = new Expression([ - 'expression' => 'value == this.data', - 'message' => 'myMessage', - ]); + $constraint = new Expression( + expression: 'value == this.data', + message: 'myMessage', + ); $object = new Entity(); $object->data = '1'; @@ -187,10 +187,10 @@ public function testSucceedingExpressionAtNestedPropertyLevel() public function testFailingExpressionAtNestedPropertyLevel() { - $constraint = new Expression([ - 'expression' => 'value == this.data', - 'message' => 'myMessage', - ]); + $constraint = new Expression( + expression: 'value == this.data', + message: 'myMessage', + ); $object = new Entity(); $object->data = '1'; @@ -234,10 +234,10 @@ public function testSucceedingExpressionAtPropertyLevelWithoutRoot() */ public function testFailingExpressionAtPropertyLevelWithoutRoot() { - $constraint = new Expression([ - 'expression' => 'value == "1"', - 'message' => 'myMessage', - ]); + $constraint = new Expression( + expression: 'value == "1"', + message: 'myMessage', + ); $this->setRoot('2'); $this->setPropertyPath(''); @@ -254,9 +254,7 @@ public function testFailingExpressionAtPropertyLevelWithoutRoot() public function testExpressionLanguageUsage() { - $constraint = new Expression([ - 'expression' => 'false', - ]); + $constraint = new Expression(expression: 'false'); $expressionLanguage = $this->createMock(ExpressionLanguage::class); @@ -278,12 +276,12 @@ public function testExpressionLanguageUsage() public function testPassingCustomValues() { - $constraint = new Expression([ - 'expression' => 'value + custom == 2', - 'values' => [ + $constraint = new Expression( + expression: 'value + custom == 2', + values: [ 'custom' => 1, ], - ]); + ); $this->validator->validate(1, $constraint); @@ -292,13 +290,13 @@ public function testPassingCustomValues() public function testViolationOnPass() { - $constraint = new Expression([ - 'expression' => 'value + custom != 2', - 'values' => [ + $constraint = new Expression( + expression: 'value + custom != 2', + values: [ 'custom' => 1, ], - 'negate' => false, - ]); + negate: false, + ); $this->validator->validate(2, $constraint); @@ -311,10 +309,11 @@ public function testViolationOnPass() public function testIsValidExpression() { - $constraints = [new NotNull(), new Range(['min' => 2])]; + $constraints = [new NotNull(), new Range(min: 2)]; $constraint = new Expression( - ['expression' => 'is_valid(this.data, a)', 'values' => ['a' => $constraints]] + expression: 'is_valid(this.data, a)', + values: ['a' => $constraints], ); $object = new Entity(); @@ -331,10 +330,11 @@ public function testIsValidExpression() public function testIsValidExpressionInvalid() { - $constraints = [new Range(['min' => 2, 'max' => 5])]; + $constraints = [new Range(min: 2, max: 5)]; $constraint = new Expression( - ['expression' => 'is_valid(this.data, a)', 'values' => ['a' => $constraints]] + expression: 'is_valid(this.data, a)', + values: ['a' => $constraints], ); $object = new Entity(); diff --git a/Tests/Constraints/FileTest.php b/Tests/Constraints/FileTest.php index e8c27b4b1..e4e30a581 100644 --- a/Tests/Constraints/FileTest.php +++ b/Tests/Constraints/FileTest.php @@ -24,7 +24,7 @@ class FileTest extends TestCase */ public function testMaxSize($maxSize, $bytes, $binaryFormat) { - $file = new File(['maxSize' => $maxSize]); + $file = new File(maxSize: $maxSize); $this->assertSame($bytes, $file->maxSize); $this->assertSame($binaryFormat, $file->binaryFormat); @@ -33,7 +33,7 @@ public function testMaxSize($maxSize, $bytes, $binaryFormat) public function testMagicIsset() { - $file = new File(['maxSize' => 1]); + $file = new File(maxSize: 1); $this->assertTrue($file->__isset('maxSize')); $this->assertTrue($file->__isset('groups')); @@ -57,7 +57,7 @@ public function testMaxSizeCanBeSetAfterInitialization($maxSize, $bytes, $binary */ public function testInvalidValueForMaxSizeThrowsExceptionAfterInitialization($maxSize) { - $file = new File(['maxSize' => 1000]); + $file = new File(maxSize: 1000); $this->expectException(ConstraintDefinitionException::class); @@ -69,7 +69,7 @@ public function testInvalidValueForMaxSizeThrowsExceptionAfterInitialization($ma */ public function testMaxSizeCannotBeSetToInvalidValueAfterInitialization($maxSize) { - $file = new File(['maxSize' => 1000]); + $file = new File(maxSize: 1000); try { $file->maxSize = $maxSize; @@ -85,7 +85,7 @@ public function testMaxSizeCannotBeSetToInvalidValueAfterInitialization($maxSize public function testInvalidMaxSize($maxSize) { $this->expectException(ConstraintDefinitionException::class); - new File(['maxSize' => $maxSize]); + new File(maxSize: $maxSize); } public static function provideValidSizes() @@ -125,7 +125,7 @@ public static function provideInvalidSizes() */ public function testBinaryFormat($maxSize, $guessedFormat, $binaryFormat) { - $file = new File(['maxSize' => $maxSize, 'binaryFormat' => $guessedFormat]); + $file = new File(maxSize: $maxSize, binaryFormat: $guessedFormat); $this->assertSame($binaryFormat, $file->binaryFormat); } diff --git a/Tests/Constraints/FileValidatorPathTest.php b/Tests/Constraints/FileValidatorPathTest.php index 9a8968801..37557aa1a 100644 --- a/Tests/Constraints/FileValidatorPathTest.php +++ b/Tests/Constraints/FileValidatorPathTest.php @@ -22,9 +22,9 @@ protected function getFile($filename) public function testFileNotFound() { - $constraint = new File([ - 'notFoundMessage' => 'myMessage', - ]); + $constraint = new File( + notFoundMessage: 'myMessage', + ); $this->validator->validate('foobar', $constraint); diff --git a/Tests/Constraints/FileValidatorTestCase.php b/Tests/Constraints/FileValidatorTestCase.php index b5d05801e..81e833b27 100644 --- a/Tests/Constraints/FileValidatorTestCase.php +++ b/Tests/Constraints/FileValidatorTestCase.php @@ -168,10 +168,10 @@ public function testMaxSizeExceeded($bytesWritten, $limit, $sizeAsString, $limit fwrite($this->file, '0'); fclose($this->file); - $constraint = new File([ - 'maxSize' => $limit, - 'maxSizeMessage' => 'myMessage', - ]); + $constraint = new File( + maxSize: $limit, + maxSizeMessage: 'myMessage', + ); $this->validator->validate($this->getFile($this->path), $constraint); @@ -220,10 +220,10 @@ public function testMaxSizeNotExceeded($bytesWritten, $limit) fwrite($this->file, '0'); fclose($this->file); - $constraint = new File([ - 'maxSize' => $limit, - 'maxSizeMessage' => 'myMessage', - ]); + $constraint = new File( + maxSize: $limit, + maxSizeMessage: 'myMessage', + ); $this->validator->validate($this->getFile($this->path), $constraint); @@ -233,9 +233,7 @@ public function testMaxSizeNotExceeded($bytesWritten, $limit) public function testInvalidMaxSize() { $this->expectException(ConstraintDefinitionException::class); - new File([ - 'maxSize' => '1abc', - ]); + new File(maxSize: '1abc'); } public static function provideBinaryFormatTests() @@ -269,11 +267,11 @@ public function testBinaryFormat($bytesWritten, $limit, $binaryFormat, $sizeAsSt fwrite($this->file, '0'); fclose($this->file); - $constraint = new File([ - 'maxSize' => $limit, - 'binaryFormat' => $binaryFormat, - 'maxSizeMessage' => 'myMessage', - ]); + $constraint = new File( + maxSize: $limit, + binaryFormat: $binaryFormat, + maxSizeMessage: 'myMessage', + ); $this->validator->validate($this->getFile($this->path), $constraint); @@ -322,9 +320,7 @@ public function testValidMimeType() ->method('getMimeType') ->willReturn('image/jpg'); - $constraint = new File([ - 'mimeTypes' => ['image/png', 'image/jpg'], - ]); + $constraint = new File(mimeTypes: ['image/png', 'image/jpg']); $this->validator->validate($file, $constraint); @@ -346,19 +342,14 @@ public function testValidWildcardMimeType() ->method('getMimeType') ->willReturn('image/jpg'); - $constraint = new File([ - 'mimeTypes' => ['image/*'], - ]); + $constraint = new File(mimeTypes: ['image/*']); $this->validator->validate($file, $constraint); $this->assertNoViolation(); } - /** - * @dataProvider provideMimeTypeConstraints - */ - public function testInvalidMimeType(File $constraint) + public function testInvalidMimeType() { $file = $this ->getMockBuilder(\Symfony\Component\HttpFoundation\File\File::class) @@ -373,7 +364,7 @@ public function testInvalidMimeType(File $constraint) ->method('getMimeType') ->willReturn('application/pdf'); - $this->validator->validate($file, $constraint); + $this->validator->validate($file, new File(mimeTypes: ['image/png', 'image/jpg'], mimeTypesMessage: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ type }}', '"application/pdf"') @@ -384,15 +375,36 @@ public function testInvalidMimeType(File $constraint) ->assertRaised(); } - public static function provideMimeTypeConstraints(): iterable + /** + * @group legacy + */ + public function testInvalidMimeTypeDoctrineStyle() { - yield 'Doctrine style' => [new File([ + $file = $this + ->getMockBuilder(\Symfony\Component\HttpFoundation\File\File::class) + ->setConstructorArgs([__DIR__.'/Fixtures/foo']) + ->getMock(); + $file + ->expects($this->once()) + ->method('getPathname') + ->willReturn($this->path); + $file + ->expects($this->once()) + ->method('getMimeType') + ->willReturn('application/pdf'); + + $this->validator->validate($file, new File([ 'mimeTypes' => ['image/png', 'image/jpg'], 'mimeTypesMessage' => 'myMessage', - ])]; - yield 'named arguments' => [ - new File(mimeTypes: ['image/png', 'image/jpg'], mimeTypesMessage: 'myMessage'), - ]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ type }}', '"application/pdf"') + ->setParameter('{{ types }}', '"image/png", "image/jpg"') + ->setParameter('{{ file }}', '"'.$this->path.'"') + ->setParameter('{{ name }}', '"'.basename($this->path).'"') + ->setCode(File::INVALID_MIME_TYPE_ERROR) + ->assertRaised(); } public function testInvalidWildcardMimeType() @@ -410,10 +422,10 @@ public function testInvalidWildcardMimeType() ->method('getMimeType') ->willReturn('application/pdf'); - $constraint = new File([ - 'mimeTypes' => ['image/*', 'image/jpg'], - 'mimeTypesMessage' => 'myMessage', - ]); + $constraint = new File( + mimeTypes: ['image/*', 'image/jpg'], + mimeTypesMessage: 'myMessage', + ); $this->validator->validate($file, $constraint); @@ -426,14 +438,11 @@ public function testInvalidWildcardMimeType() ->assertRaised(); } - /** - * @dataProvider provideDisallowEmptyConstraints - */ - public function testDisallowEmpty(File $constraint) + public function testDisallowEmpty() { ftruncate($this->file, 0); - $this->validator->validate($this->getFile($this->path), $constraint); + $this->validator->validate($this->getFile($this->path), new File(disallowEmptyMessage: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ file }}', '"'.$this->path.'"') @@ -442,14 +451,22 @@ public function testDisallowEmpty(File $constraint) ->assertRaised(); } - public static function provideDisallowEmptyConstraints(): iterable + /** + * @group legacy + */ + public function testDisallowEmptyDoctrineStyle() { - yield 'Doctrine style' => [new File([ + ftruncate($this->file, 0); + + $this->validator->validate($this->getFile($this->path), new File([ 'disallowEmptyMessage' => 'myMessage', - ])]; - yield 'named arguments' => [ - new File(disallowEmptyMessage: 'myMessage'), - ]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ file }}', '"'.$this->path.'"') + ->setParameter('{{ name }}', '"'.basename($this->path).'"') + ->setCode(File::EMPTY_ERROR) + ->assertRaised(); } /** @@ -459,7 +476,7 @@ public function testUploadedFileError($error, $message, array $params = [], $max { $file = new UploadedFile(tempnam(sys_get_temp_dir(), 'file-validator-test-'), 'originalName', 'mime', $error); - $constraint = new File([ + $constraint = new File(...[ $message => 'myMessage', 'maxSize' => $maxSize, ]); diff --git a/Tests/Constraints/GreaterThanOrEqualValidatorTest.php b/Tests/Constraints/GreaterThanOrEqualValidatorTest.php index 1bd4b6538..ae9f2034c 100644 --- a/Tests/Constraints/GreaterThanOrEqualValidatorTest.php +++ b/Tests/Constraints/GreaterThanOrEqualValidatorTest.php @@ -34,7 +34,11 @@ protected function createValidator(): GreaterThanOrEqualValidator protected static function createConstraint(?array $options = null): Constraint { - return new GreaterThanOrEqual($options); + if (null !== $options) { + return new GreaterThanOrEqual(...$options); + } + + return new GreaterThanOrEqual(); } protected function getErrorCode(): ?string diff --git a/Tests/Constraints/GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest.php b/Tests/Constraints/GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest.php index b05ba53a5..47f190851 100644 --- a/Tests/Constraints/GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest.php +++ b/Tests/Constraints/GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest.php @@ -61,6 +61,9 @@ public static function provideInvalidComparisons(): array ]; } + /** + * @group legacy + */ public function testThrowsConstraintExceptionIfPropertyPath() { $this->expectException(ConstraintDefinitionException::class); @@ -69,6 +72,9 @@ public function testThrowsConstraintExceptionIfPropertyPath() return new PositiveOrZero(['propertyPath' => 'field']); } + /** + * @group legacy + */ public function testThrowsConstraintExceptionIfValue() { $this->expectException(ConstraintDefinitionException::class); diff --git a/Tests/Constraints/GreaterThanValidatorTest.php b/Tests/Constraints/GreaterThanValidatorTest.php index 4cc64396d..0e74da15f 100644 --- a/Tests/Constraints/GreaterThanValidatorTest.php +++ b/Tests/Constraints/GreaterThanValidatorTest.php @@ -34,7 +34,11 @@ protected function createValidator(): GreaterThanValidator protected static function createConstraint(?array $options = null): Constraint { - return new GreaterThan($options); + if (null !== $options) { + return new GreaterThan(...$options); + } + + return new GreaterThan(); } protected function getErrorCode(): ?string diff --git a/Tests/Constraints/GreaterThanValidatorWithPositiveConstraintTest.php b/Tests/Constraints/GreaterThanValidatorWithPositiveConstraintTest.php index 0aa8aee93..6b58bff85 100644 --- a/Tests/Constraints/GreaterThanValidatorWithPositiveConstraintTest.php +++ b/Tests/Constraints/GreaterThanValidatorWithPositiveConstraintTest.php @@ -58,6 +58,9 @@ public static function provideInvalidComparisons(): array ]; } + /** + * @group legacy + */ public function testThrowsConstraintExceptionIfPropertyPath() { $this->expectException(ConstraintDefinitionException::class); @@ -66,6 +69,9 @@ public function testThrowsConstraintExceptionIfPropertyPath() return new Positive(['propertyPath' => 'field']); } + /** + * @group legacy + */ public function testThrowsConstraintExceptionIfValue() { $this->expectException(ConstraintDefinitionException::class); diff --git a/Tests/Constraints/HostnameValidatorTest.php b/Tests/Constraints/HostnameValidatorTest.php index f0b03e019..2471fe0b5 100644 --- a/Tests/Constraints/HostnameValidatorTest.php +++ b/Tests/Constraints/HostnameValidatorTest.php @@ -57,7 +57,7 @@ public function testValidTldDomainsPassValidationIfTldRequired($domain) */ public function testValidTldDomainsPassValidationIfTldNotRequired($domain) { - $this->validator->validate($domain, new Hostname(['requireTld' => false])); + $this->validator->validate($domain, new Hostname(requireTld: false)); $this->assertNoViolation(); } @@ -81,9 +81,7 @@ public static function getValidMultilevelDomains() */ public function testInvalidDomainsRaiseViolationIfTldRequired($domain) { - $this->validator->validate($domain, new Hostname([ - 'message' => 'myMessage', - ])); + $this->validator->validate($domain, new Hostname(message: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ value }}', '"'.$domain.'"') @@ -96,10 +94,10 @@ public function testInvalidDomainsRaiseViolationIfTldRequired($domain) */ public function testInvalidDomainsRaiseViolationIfTldNotRequired($domain) { - $this->validator->validate($domain, new Hostname([ - 'message' => 'myMessage', - 'requireTld' => false, - ])); + $this->validator->validate($domain, new Hostname( + message: 'myMessage', + requireTld: false, + )); $this->buildViolation('myMessage') ->setParameter('{{ value }}', '"'.$domain.'"') @@ -123,7 +121,7 @@ public static function getInvalidDomains() */ public function testReservedDomainsPassValidationIfTldNotRequired($domain) { - $this->validator->validate($domain, new Hostname(['requireTld' => false])); + $this->validator->validate($domain, new Hostname(requireTld: false)); $this->assertNoViolation(); } @@ -133,10 +131,10 @@ public function testReservedDomainsPassValidationIfTldNotRequired($domain) */ public function testReservedDomainsRaiseViolationIfTldRequired($domain) { - $this->validator->validate($domain, new Hostname([ - 'message' => 'myMessage', - 'requireTld' => true, - ])); + $this->validator->validate($domain, new Hostname( + message: 'myMessage', + requireTld: true, + )); $this->buildViolation('myMessage') ->setParameter('{{ value }}', '"'.$domain.'"') @@ -176,7 +174,7 @@ public function testReservedDomainsRaiseViolationIfTldRequiredNamed() */ public function testTopLevelDomainsPassValidationIfTldNotRequired($domain) { - $this->validator->validate($domain, new Hostname(['requireTld' => false])); + $this->validator->validate($domain, new Hostname(requireTld: false)); $this->assertNoViolation(); } @@ -186,10 +184,10 @@ public function testTopLevelDomainsPassValidationIfTldNotRequired($domain) */ public function testTopLevelDomainsRaiseViolationIfTldRequired($domain) { - $this->validator->validate($domain, new Hostname([ - 'message' => 'myMessage', - 'requireTld' => true, - ])); + $this->validator->validate($domain, new Hostname( + message: 'myMessage', + requireTld: true, + )); $this->buildViolation('myMessage') ->setParameter('{{ value }}', '"'.$domain.'"') diff --git a/Tests/Constraints/IbanValidatorTest.php b/Tests/Constraints/IbanValidatorTest.php index 2a8156914..184924d5e 100644 --- a/Tests/Constraints/IbanValidatorTest.php +++ b/Tests/Constraints/IbanValidatorTest.php @@ -488,9 +488,7 @@ public static function getIbansWithInvalidCountryCode() private function assertViolationRaised($iban, $code) { - $constraint = new Iban([ - 'message' => 'myMessage', - ]); + $constraint = new Iban(message: 'myMessage'); $this->validator->validate($iban, $constraint); diff --git a/Tests/Constraints/IdenticalToValidatorTest.php b/Tests/Constraints/IdenticalToValidatorTest.php index 66390a6de..97164b74c 100644 --- a/Tests/Constraints/IdenticalToValidatorTest.php +++ b/Tests/Constraints/IdenticalToValidatorTest.php @@ -34,7 +34,11 @@ protected function createValidator(): IdenticalToValidator protected static function createConstraint(?array $options = null): Constraint { - return new IdenticalTo($options); + if (null !== $options) { + return new IdenticalTo(...$options); + } + + return new IdenticalTo(); } protected function getErrorCode(): ?string diff --git a/Tests/Constraints/ImageValidatorTest.php b/Tests/Constraints/ImageValidatorTest.php index d18d81eea..8811c5774 100644 --- a/Tests/Constraints/ImageValidatorTest.php +++ b/Tests/Constraints/ImageValidatorTest.php @@ -72,12 +72,10 @@ public function testValidImage() /** * Checks that the logic from FileValidator still works. - * - * @dataProvider provideConstraintsWithNotFoundMessage */ - public function testFileNotFound(Image $constraint) + public function testFileNotFound() { - $this->validator->validate('foobar', $constraint); + $this->validator->validate('foobar', new Image(notFoundMessage: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ file }}', '"foobar"') @@ -85,36 +83,40 @@ public function testFileNotFound(Image $constraint) ->assertRaised(); } - public static function provideConstraintsWithNotFoundMessage(): iterable + /** + * Checks that the logic from FileValidator still works. + * + * @group legacy + */ + public function testFileNotFoundDoctrineStyle() { - yield 'Doctrine style' => [new Image([ + $this->validator->validate('foobar', new Image([ 'notFoundMessage' => 'myMessage', - ])]; - yield 'Named arguments' => [ - new Image(notFoundMessage: 'myMessage'), - ]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ file }}', '"foobar"') + ->setCode(Image::NOT_FOUND_ERROR) + ->assertRaised(); } public function testValidSize() { - $constraint = new Image([ - 'minWidth' => 1, - 'maxWidth' => 2, - 'minHeight' => 1, - 'maxHeight' => 2, - ]); + $constraint = new Image( + minWidth: 1, + maxWidth: 2, + minHeight: 1, + maxHeight: 2, + ); $this->validator->validate($this->image, $constraint); $this->assertNoViolation(); } - /** - * @dataProvider provideMinWidthConstraints - */ - public function testWidthTooSmall(Image $constraint) + public function testWidthTooSmall() { - $this->validator->validate($this->image, $constraint); + $this->validator->validate($this->image, new Image(minWidth: 3, minWidthMessage: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ width }}', '2') @@ -123,23 +125,26 @@ public function testWidthTooSmall(Image $constraint) ->assertRaised(); } - public static function provideMinWidthConstraints(): iterable + /** + * @group legacy + */ + public function testWidthTooSmallDoctrineStyle() { - yield 'Doctrine style' => [new Image([ + $this->validator->validate($this->image, new Image([ 'minWidth' => 3, 'minWidthMessage' => 'myMessage', - ])]; - yield 'Named arguments' => [ - new Image(minWidth: 3, minWidthMessage: 'myMessage'), - ]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ width }}', '2') + ->setParameter('{{ min_width }}', '3') + ->setCode(Image::TOO_NARROW_ERROR) + ->assertRaised(); } - /** - * @dataProvider provideMaxWidthConstraints - */ - public function testWidthTooBig(Image $constraint) + public function testWidthTooBig() { - $this->validator->validate($this->image, $constraint); + $this->validator->validate($this->image, new Image(maxWidth: 1, maxWidthMessage: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ width }}', '2') @@ -148,23 +153,26 @@ public function testWidthTooBig(Image $constraint) ->assertRaised(); } - public static function provideMaxWidthConstraints(): iterable + /** + * @group legacy + */ + public function testWidthTooBigDoctrineStyle() { - yield 'Doctrine style' => [new Image([ + $this->validator->validate($this->image, new Image([ 'maxWidth' => 1, 'maxWidthMessage' => 'myMessage', - ])]; - yield 'Named arguments' => [ - new Image(maxWidth: 1, maxWidthMessage: 'myMessage'), - ]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ width }}', '2') + ->setParameter('{{ max_width }}', '1') + ->setCode(Image::TOO_WIDE_ERROR) + ->assertRaised(); } - /** - * @dataProvider provideMinHeightConstraints - */ - public function testHeightTooSmall(Image $constraint) + public function testHeightTooSmall() { - $this->validator->validate($this->image, $constraint); + $this->validator->validate($this->image, new Image(minHeight: 3, minHeightMessage: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ height }}', '2') @@ -173,23 +181,26 @@ public function testHeightTooSmall(Image $constraint) ->assertRaised(); } - public static function provideMinHeightConstraints(): iterable + /** + * @group legacy + */ + public function testHeightTooSmallDoctrineStyle() { - yield 'Doctrine style' => [new Image([ + $this->validator->validate($this->image, new Image([ 'minHeight' => 3, 'minHeightMessage' => 'myMessage', - ])]; - yield 'Named arguments' => [ - new Image(minHeight: 3, minHeightMessage: 'myMessage'), - ]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ height }}', '2') + ->setParameter('{{ min_height }}', '3') + ->setCode(Image::TOO_LOW_ERROR) + ->assertRaised(); } - /** - * @dataProvider provideMaxHeightConstraints - */ - public function testHeightTooBig(Image $constraint) + public function testHeightTooBig() { - $this->validator->validate($this->image, $constraint); + $this->validator->validate($this->image, new Image(maxHeight: 1, maxHeightMessage: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ height }}', '2') @@ -198,23 +209,26 @@ public function testHeightTooBig(Image $constraint) ->assertRaised(); } - public static function provideMaxHeightConstraints(): iterable + /** + * @group legacy + */ + public function testHeightTooBigDoctrineStyle() { - yield 'Doctrine style' => [new Image([ + $this->validator->validate($this->image, new Image([ 'maxHeight' => 1, 'maxHeightMessage' => 'myMessage', - ])]; - yield 'Named arguments' => [ - new Image(maxHeight: 1, maxHeightMessage: 'myMessage'), - ]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ height }}', '2') + ->setParameter('{{ max_height }}', '1') + ->setCode(Image::TOO_HIGH_ERROR) + ->assertRaised(); } - /** - * @dataProvider provideMinPixelsConstraints - */ - public function testPixelsTooFew(Image $constraint) + public function testPixelsTooFew() { - $this->validator->validate($this->image, $constraint); + $this->validator->validate($this->image, new Image(minPixels: 5, minPixelsMessage: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ pixels }}', '4') @@ -225,23 +239,28 @@ public function testPixelsTooFew(Image $constraint) ->assertRaised(); } - public static function provideMinPixelsConstraints(): iterable + /** + * @group legacy + */ + public function testPixelsTooFewDoctrineStyle() { - yield 'Doctrine style' => [new Image([ + $this->validator->validate($this->image, new Image([ 'minPixels' => 5, 'minPixelsMessage' => 'myMessage', - ])]; - yield 'Named arguments' => [ - new Image(minPixels: 5, minPixelsMessage: 'myMessage'), - ]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ pixels }}', '4') + ->setParameter('{{ min_pixels }}', '5') + ->setParameter('{{ height }}', '2') + ->setParameter('{{ width }}', '2') + ->setCode(Image::TOO_FEW_PIXEL_ERROR) + ->assertRaised(); } - /** - * @dataProvider provideMaxPixelsConstraints - */ - public function testPixelsTooMany(Image $constraint) + public function testPixelsTooMany() { - $this->validator->validate($this->image, $constraint); + $this->validator->validate($this->image, new Image(maxPixels: 3, maxPixelsMessage: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ pixels }}', '4') @@ -252,23 +271,28 @@ public function testPixelsTooMany(Image $constraint) ->assertRaised(); } - public static function provideMaxPixelsConstraints(): iterable + /** + * @group legacy + */ + public function testPixelsTooManyDoctrineStyle() { - yield 'Doctrine style' => [new Image([ + $this->validator->validate($this->image, new Image([ 'maxPixels' => 3, 'maxPixelsMessage' => 'myMessage', - ])]; - yield 'Named arguments' => [ - new Image(maxPixels: 3, maxPixelsMessage: 'myMessage'), - ]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ pixels }}', '4') + ->setParameter('{{ max_pixels }}', '3') + ->setParameter('{{ height }}', '2') + ->setParameter('{{ width }}', '2') + ->setCode(Image::TOO_MANY_PIXEL_ERROR) + ->assertRaised(); } - /** - * @dataProvider provideMinRatioConstraints - */ - public function testRatioTooSmall(Image $constraint) + public function testRatioTooSmall() { - $this->validator->validate($this->image, $constraint); + $this->validator->validate($this->image, new Image(minRatio: 2, minRatioMessage: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ ratio }}', 1) @@ -277,23 +301,26 @@ public function testRatioTooSmall(Image $constraint) ->assertRaised(); } - public static function provideMinRatioConstraints(): iterable + /** + * @group legacy + */ + public function testRatioTooSmallDoctrineStyle() { - yield 'Doctrine style' => [new Image([ + $this->validator->validate($this->image, new Image([ 'minRatio' => 2, 'minRatioMessage' => 'myMessage', - ])]; - yield 'Named arguments' => [ - new Image(minRatio: 2, minRatioMessage: 'myMessage'), - ]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ ratio }}', 1) + ->setParameter('{{ min_ratio }}', 2) + ->setCode(Image::RATIO_TOO_SMALL_ERROR) + ->assertRaised(); } - /** - * @dataProvider provideMaxRatioConstraints - */ - public function testRatioTooBig(Image $constraint) + public function testRatioTooBig() { - $this->validator->validate($this->image, $constraint); + $this->validator->validate($this->image, new Image(maxRatio: 0.5, maxRatioMessage: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ ratio }}', 1) @@ -302,22 +329,26 @@ public function testRatioTooBig(Image $constraint) ->assertRaised(); } - public static function provideMaxRatioConstraints(): iterable + /** + * @group legacy + */ + public function testRatioTooBigDoctrineStyle() { - yield 'Doctrine style' => [new Image([ + $this->validator->validate($this->image, new Image([ 'maxRatio' => 0.5, 'maxRatioMessage' => 'myMessage', - ])]; - yield 'Named arguments' => [ - new Image(maxRatio: 0.5, maxRatioMessage: 'myMessage'), - ]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ ratio }}', 1) + ->setParameter('{{ max_ratio }}', 0.5) + ->setCode(Image::RATIO_TOO_BIG_ERROR) + ->assertRaised(); } public function testMaxRatioUsesTwoDecimalsOnly() { - $constraint = new Image([ - 'maxRatio' => 1.33, - ]); + $constraint = new Image(maxRatio: 1.33); $this->validator->validate($this->image4By3, $constraint); @@ -326,9 +357,7 @@ public function testMaxRatioUsesTwoDecimalsOnly() public function testMinRatioUsesInputMoreDecimals() { - $constraint = new Image([ - 'minRatio' => 4 / 3, - ]); + $constraint = new Image(minRatio: 4 / 3); $this->validator->validate($this->image4By3, $constraint); @@ -337,21 +366,16 @@ public function testMinRatioUsesInputMoreDecimals() public function testMaxRatioUsesInputMoreDecimals() { - $constraint = new Image([ - 'maxRatio' => 16 / 9, - ]); + $constraint = new Image(maxRatio: 16 / 9); $this->validator->validate($this->image16By9, $constraint); $this->assertNoViolation(); } - /** - * @dataProvider provideAllowSquareConstraints - */ - public function testSquareNotAllowed(Image $constraint) + public function testSquareNotAllowed() { - $this->validator->validate($this->image, $constraint); + $this->validator->validate($this->image, new Image(allowSquare: false, allowSquareMessage: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ width }}', 2) @@ -360,23 +384,26 @@ public function testSquareNotAllowed(Image $constraint) ->assertRaised(); } - public static function provideAllowSquareConstraints(): iterable + /** + * @group legacy + */ + public function testSquareNotAllowedDoctrineStyle() { - yield 'Doctrine style' => [new Image([ + $this->validator->validate($this->image, new Image([ 'allowSquare' => false, 'allowSquareMessage' => 'myMessage', - ])]; - yield 'Named arguments' => [ - new Image(allowSquare: false, allowSquareMessage: 'myMessage'), - ]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ width }}', 2) + ->setParameter('{{ height }}', 2) + ->setCode(Image::SQUARE_NOT_ALLOWED_ERROR) + ->assertRaised(); } - /** - * @dataProvider provideAllowLandscapeConstraints - */ - public function testLandscapeNotAllowed(Image $constraint) + public function testLandscapeNotAllowed() { - $this->validator->validate($this->imageLandscape, $constraint); + $this->validator->validate($this->imageLandscape, new Image(allowLandscape: false, allowLandscapeMessage: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ width }}', 2) @@ -385,23 +412,26 @@ public function testLandscapeNotAllowed(Image $constraint) ->assertRaised(); } - public static function provideAllowLandscapeConstraints(): iterable + /** + * @group legacy + */ + public function testLandscapeNotAllowedDoctrineStyle() { - yield 'Doctrine style' => [new Image([ + $this->validator->validate($this->imageLandscape, new Image([ 'allowLandscape' => false, 'allowLandscapeMessage' => 'myMessage', - ])]; - yield 'Named arguments' => [ - new Image(allowLandscape: false, allowLandscapeMessage: 'myMessage'), - ]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ width }}', 2) + ->setParameter('{{ height }}', 1) + ->setCode(Image::LANDSCAPE_NOT_ALLOWED_ERROR) + ->assertRaised(); } - /** - * @dataProvider provideAllowPortraitConstraints - */ - public function testPortraitNotAllowed(Image $constraint) + public function testPortraitNotAllowed() { - $this->validator->validate($this->imagePortrait, $constraint); + $this->validator->validate($this->imagePortrait, new Image(allowPortrait: false, allowPortraitMessage: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ width }}', 1) @@ -410,26 +440,56 @@ public function testPortraitNotAllowed(Image $constraint) ->assertRaised(); } - public static function provideAllowPortraitConstraints(): iterable + /** + * @group legacy + */ + public function testPortraitNotAllowedDoctrineStyle() { - yield 'Doctrine style' => [new Image([ + $this->validator->validate($this->imagePortrait, new Image([ 'allowPortrait' => false, 'allowPortraitMessage' => 'myMessage', - ])]; - yield 'Named arguments' => [ - new Image(allowPortrait: false, allowPortraitMessage: 'myMessage'), - ]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ width }}', 1) + ->setParameter('{{ height }}', 2) + ->setCode(Image::PORTRAIT_NOT_ALLOWED_ERROR) + ->assertRaised(); + } + + public function testCorrupted() + { + if (!\function_exists('imagecreatefromstring')) { + $this->markTestSkipped('This test require GD extension'); + } + + $constraint = new Image(detectCorrupted: true, corruptedMessage: 'myMessage'); + + $this->validator->validate($this->image, $constraint); + + $this->assertNoViolation(); + + $this->validator->validate($this->imageCorrupted, $constraint); + + $this->buildViolation('myMessage') + ->setCode(Image::CORRUPTED_IMAGE_ERROR) + ->assertRaised(); } /** - * @dataProvider provideDetectCorruptedConstraints + * @group legacy */ - public function testCorrupted(Image $constraint) + public function testCorruptedDoctrineStyle() { if (!\function_exists('imagecreatefromstring')) { $this->markTestSkipped('This test require GD extension'); } + $constraint = new Image([ + 'detectCorrupted' => true, + 'corruptedMessage' => 'myMessage', + ]); + $this->validator->validate($this->image, $constraint); $this->assertNoViolation(); @@ -456,23 +516,12 @@ public function testInvalidMimeType() ->assertRaised(); } - public static function provideDetectCorruptedConstraints(): iterable + public function testInvalidMimeTypeWithNarrowedSet() { - yield 'Doctrine style' => [new Image([ - 'detectCorrupted' => true, - 'corruptedMessage' => 'myMessage', - ])]; - yield 'Named arguments' => [ - new Image(detectCorrupted: true, corruptedMessage: 'myMessage'), - ]; - } - - /** - * @dataProvider provideInvalidMimeTypeWithNarrowedSet - */ - public function testInvalidMimeTypeWithNarrowedSet(Image $constraint) - { - $this->validator->validate($this->image, $constraint); + $this->validator->validate($this->image, new Image(mimeTypes: [ + 'image/jpeg', + 'image/png', + ])); $this->buildViolation('The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.') ->setParameter('{{ file }}', \sprintf('"%s"', $this->image)) @@ -483,20 +532,25 @@ public function testInvalidMimeTypeWithNarrowedSet(Image $constraint) ->assertRaised(); } - public static function provideInvalidMimeTypeWithNarrowedSet() + /** + * @group legacy + */ + public function testInvalidMimeTypeWithNarrowedSetDoctrineStyle() { - yield 'Doctrine style' => [new Image([ + $this->validator->validate($this->image, new Image([ 'mimeTypes' => [ 'image/jpeg', 'image/png', ], - ])]; - yield 'Named arguments' => [ - new Image(mimeTypes: [ - 'image/jpeg', - 'image/png', - ]), - ]; + ])); + + $this->buildViolation('The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.') + ->setParameter('{{ file }}', sprintf('"%s"', $this->image)) + ->setParameter('{{ type }}', '"image/gif"') + ->setParameter('{{ types }}', '"image/jpeg", "image/png"') + ->setParameter('{{ name }}', '"test.gif"') + ->setCode(Image::INVALID_MIME_TYPE_ERROR) + ->assertRaised(); } /** @dataProvider provideSvgWithViolation */ diff --git a/Tests/Constraints/IpTest.php b/Tests/Constraints/IpTest.php index 7f391153f..2d740ae88 100644 --- a/Tests/Constraints/IpTest.php +++ b/Tests/Constraints/IpTest.php @@ -24,11 +24,14 @@ class IpTest extends TestCase { public function testNormalizerCanBeSet() { - $ip = new Ip(['normalizer' => 'trim']); + $ip = new Ip(normalizer: 'trim'); $this->assertEquals('trim', $ip->normalizer); } + /** + * @group legacy + */ public function testInvalidNormalizerThrowsException() { $this->expectException(InvalidArgumentException::class); @@ -36,6 +39,9 @@ public function testInvalidNormalizerThrowsException() new Ip(['normalizer' => 'Unknown Callable']); } + /** + * @group legacy + */ public function testInvalidNormalizerObjectThrowsException() { $this->expectException(InvalidArgumentException::class); diff --git a/Tests/Constraints/IpValidatorTest.php b/Tests/Constraints/IpValidatorTest.php index a2277a3d8..e37d61bb6 100644 --- a/Tests/Constraints/IpValidatorTest.php +++ b/Tests/Constraints/IpValidatorTest.php @@ -47,9 +47,7 @@ public function testExpectsStringCompatibleType() public function testInvalidValidatorVersion() { $this->expectException(ConstraintDefinitionException::class); - new Ip([ - 'version' => 666, - ]); + new Ip(version: 666); } /** @@ -57,9 +55,7 @@ public function testInvalidValidatorVersion() */ public function testValidIpsV4($ip) { - $this->validator->validate($ip, new Ip([ - 'version' => Ip::V4, - ])); + $this->validator->validate($ip, new Ip(version: Ip::V4)); $this->assertNoViolation(); } @@ -83,10 +79,10 @@ public static function getValidIpsV4() */ public function testValidIpsV4WithWhitespaces($ip) { - $this->validator->validate($ip, new Ip([ - 'version' => Ip::V4, - 'normalizer' => 'trim', - ])); + $this->validator->validate($ip, new Ip( + version: Ip::V4, + normalizer: 'trim', + )); $this->assertNoViolation(); } @@ -118,9 +114,7 @@ public static function getValidIpsV4WithWhitespaces() */ public function testValidIpsV6($ip) { - $this->validator->validate($ip, new Ip([ - 'version' => Ip::V6, - ])); + $this->validator->validate($ip, new Ip(version: Ip::V6)); $this->assertNoViolation(); } @@ -155,9 +149,7 @@ public static function getValidIpsV6() */ public function testValidIpsAll($ip) { - $this->validator->validate($ip, new Ip([ - 'version' => Ip::ALL, - ])); + $this->validator->validate($ip, new Ip(version: Ip::ALL)); $this->assertNoViolation(); } @@ -172,10 +164,10 @@ public static function getValidIpsAll() */ public function testInvalidIpsV4($ip) { - $constraint = new Ip([ - 'version' => Ip::V4, - 'message' => 'myMessage', - ]); + $constraint = new Ip( + version: Ip::V4, + message: 'myMessage', + ); $this->validator->validate($ip, $constraint); @@ -190,10 +182,10 @@ public function testInvalidIpsV4($ip) */ public function testInvalidNoPublicIpsV4($ip) { - $constraint = new Ip([ - 'version' => Ip::V4_NO_PUBLIC, - 'message' => 'myMessage', - ]); + $constraint = new Ip( + version: Ip::V4_NO_PUBLIC, + message: 'myMessage', + ); $this->validator->validate($ip, $constraint); @@ -232,9 +224,7 @@ public static function getInvalidIpsV4() */ public function testValidPrivateIpsV4($ip) { - $this->validator->validate($ip, new Ip([ - 'version' => Ip::V4_ONLY_PRIVATE, - ])); + $this->validator->validate($ip, new Ip(version: Ip::V4_ONLY_PRIVATE)); $this->assertNoViolation(); } @@ -244,10 +234,10 @@ public function testValidPrivateIpsV4($ip) */ public function testInvalidPrivateIpsV4($ip) { - $constraint = new Ip([ - 'version' => Ip::V4_NO_PRIVATE, - 'message' => 'myMessage', - ]); + $constraint = new Ip( + version: Ip::V4_NO_PRIVATE, + message: 'myMessage', + ); $this->validator->validate($ip, $constraint); @@ -262,10 +252,10 @@ public function testInvalidPrivateIpsV4($ip) */ public function testInvalidOnlyPrivateIpsV4($ip) { - $constraint = new Ip([ - 'version' => Ip::V4_ONLY_PRIVATE, - 'message' => 'myMessage', - ]); + $constraint = new Ip( + version: Ip::V4_ONLY_PRIVATE, + message: 'myMessage', + ); $this->validator->validate($ip, $constraint); @@ -294,9 +284,7 @@ public static function getInvalidPrivateIpsV4() */ public function testValidReservedIpsV4($ip) { - $this->validator->validate($ip, new Ip([ - 'version' => Ip::V4_ONLY_RESERVED, - ])); + $this->validator->validate($ip, new Ip(version: Ip::V4_ONLY_RESERVED)); $this->assertNoViolation(); } @@ -306,10 +294,10 @@ public function testValidReservedIpsV4($ip) */ public function testInvalidReservedIpsV4($ip) { - $constraint = new Ip([ - 'version' => Ip::V4_NO_RESERVED, - 'message' => 'myMessage', - ]); + $constraint = new Ip( + version: Ip::V4_NO_RESERVED, + message: 'myMessage', + ); $this->validator->validate($ip, $constraint); @@ -324,10 +312,10 @@ public function testInvalidReservedIpsV4($ip) */ public function testInvalidOnlyReservedIpsV4($ip) { - $constraint = new Ip([ - 'version' => Ip::V4_ONLY_RESERVED, - 'message' => 'myMessage', - ]); + $constraint = new Ip( + version: Ip::V4_ONLY_RESERVED, + message: 'myMessage', + ); $this->validator->validate($ip, $constraint); @@ -356,10 +344,10 @@ public static function getInvalidReservedIpsV4() */ public function testInvalidPublicIpsV4($ip) { - $constraint = new Ip([ - 'version' => Ip::V4_ONLY_PUBLIC, - 'message' => 'myMessage', - ]); + $constraint = new Ip( + version: Ip::V4_ONLY_PUBLIC, + message: 'myMessage', + ); $this->validator->validate($ip, $constraint); @@ -379,10 +367,10 @@ public static function getInvalidPublicIpsV4() */ public function testInvalidIpsV6($ip) { - $constraint = new Ip([ - 'version' => Ip::V6, - 'message' => 'myMessage', - ]); + $constraint = new Ip( + version: Ip::V6, + message: 'myMessage', + ); $this->validator->validate($ip, $constraint); @@ -416,10 +404,10 @@ public static function getInvalidIpsV6() */ public function testInvalidPrivateIpsV6($ip) { - $constraint = new Ip([ - 'version' => Ip::V6_NO_PRIVATE, - 'message' => 'myMessage', - ]); + $constraint = new Ip( + version: Ip::V6_NO_PRIVATE, + message: 'myMessage', + ); $this->validator->validate($ip, $constraint); @@ -443,10 +431,10 @@ public static function getInvalidPrivateIpsV6() */ public function testInvalidReservedIpsV6($ip) { - $constraint = new Ip([ - 'version' => Ip::V6_NO_RESERVED, - 'message' => 'myMessage', - ]); + $constraint = new Ip( + version: Ip::V6_NO_RESERVED, + message: 'myMessage', + ); $this->validator->validate($ip, $constraint); @@ -469,10 +457,10 @@ public static function getInvalidReservedIpsV6() */ public function testInvalidPublicIpsV6($ip) { - $constraint = new Ip([ - 'version' => Ip::V6_ONLY_PUBLIC, - 'message' => 'myMessage', - ]); + $constraint = new Ip( + version: Ip::V6_ONLY_PUBLIC, + message: 'myMessage', + ); $this->validator->validate($ip, $constraint); @@ -492,10 +480,10 @@ public static function getInvalidPublicIpsV6() */ public function testInvalidIpsAll($ip) { - $constraint = new Ip([ - 'version' => Ip::ALL, - 'message' => 'myMessage', - ]); + $constraint = new Ip( + version: Ip::ALL, + message: 'myMessage', + ); $this->validator->validate($ip, $constraint); @@ -515,10 +503,10 @@ public static function getInvalidIpsAll() */ public function testInvalidPrivateIpsAll($ip) { - $constraint = new Ip([ - 'version' => Ip::ALL_NO_PRIVATE, - 'message' => 'myMessage', - ]); + $constraint = new Ip( + version: Ip::ALL_NO_PRIVATE, + message: 'myMessage', + ); $this->validator->validate($ip, $constraint); @@ -538,10 +526,10 @@ public static function getInvalidPrivateIpsAll() */ public function testInvalidReservedIpsAll($ip) { - $constraint = new Ip([ - 'version' => Ip::ALL_NO_RESERVED, - 'message' => 'myMessage', - ]); + $constraint = new Ip( + version: Ip::ALL_NO_RESERVED, + message: 'myMessage', + ); $this->validator->validate($ip, $constraint); @@ -561,10 +549,10 @@ public static function getInvalidReservedIpsAll() */ public function testInvalidPublicIpsAll($ip) { - $constraint = new Ip([ - 'version' => Ip::ALL_ONLY_PUBLIC, - 'message' => 'myMessage', - ]); + $constraint = new Ip( + version: Ip::ALL_ONLY_PUBLIC, + message: 'myMessage', + ); $this->validator->validate($ip, $constraint); diff --git a/Tests/Constraints/IsFalseValidatorTest.php b/Tests/Constraints/IsFalseValidatorTest.php index e59764764..c6e2ccef6 100644 --- a/Tests/Constraints/IsFalseValidatorTest.php +++ b/Tests/Constraints/IsFalseValidatorTest.php @@ -36,12 +36,9 @@ public function testFalseIsValid() $this->assertNoViolation(); } - /** - * @dataProvider provideInvalidConstraints - */ - public function testTrueIsInvalid(IsFalse $constraint) + public function testTrueIsInvalid() { - $this->validator->validate(true, $constraint); + $this->validator->validate(true, new IsFalse(message: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ value }}', 'true') @@ -49,11 +46,20 @@ public function testTrueIsInvalid(IsFalse $constraint) ->assertRaised(); } - public static function provideInvalidConstraints(): iterable + /** + * @group legacy + */ + public function testTrueIsInvalidDoctrineStyle() { - yield 'Doctrine style' => [new IsFalse([ + $constraint = new IsFalse([ 'message' => 'myMessage', - ])]; - yield 'named parameters' => [new IsFalse(message: 'myMessage')]; + ]); + + $this->validator->validate(true, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', 'true') + ->setCode(IsFalse::NOT_FALSE_ERROR) + ->assertRaised(); } } diff --git a/Tests/Constraints/IsNullValidatorTest.php b/Tests/Constraints/IsNullValidatorTest.php index f0ff58f34..ed6beffc4 100644 --- a/Tests/Constraints/IsNullValidatorTest.php +++ b/Tests/Constraints/IsNullValidatorTest.php @@ -34,9 +34,7 @@ public function testNullIsValid() */ public function testInvalidValues($value, $valueAsString) { - $constraint = new IsNull([ - 'message' => 'myMessage', - ]); + $constraint = new IsNull(message: 'myMessage'); $this->validator->validate($value, $constraint); diff --git a/Tests/Constraints/IsTrueValidatorTest.php b/Tests/Constraints/IsTrueValidatorTest.php index 1dc47f4b0..4a9eb7702 100644 --- a/Tests/Constraints/IsTrueValidatorTest.php +++ b/Tests/Constraints/IsTrueValidatorTest.php @@ -36,12 +36,9 @@ public function testTrueIsValid() $this->assertNoViolation(); } - /** - * @dataProvider provideInvalidConstraints - */ - public function testFalseIsInvalid(IsTrue $constraint) + public function testFalseIsInvalid() { - $this->validator->validate(false, $constraint); + $this->validator->validate(false, new IsTrue(message: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ value }}', 'false') @@ -49,11 +46,18 @@ public function testFalseIsInvalid(IsTrue $constraint) ->assertRaised(); } - public static function provideInvalidConstraints(): iterable + /** + * @group legacy + */ + public function testFalseIsInvalidDoctrineStyle() { - yield 'Doctrine style' => [new IsTrue([ + $this->validator->validate(false, new IsTrue([ 'message' => 'myMessage', - ])]; - yield 'named parameters' => [new IsTrue(message: 'myMessage')]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', 'false') + ->setCode(IsTrue::NOT_TRUE_ERROR) + ->assertRaised(); } } diff --git a/Tests/Constraints/IsbnValidatorTest.php b/Tests/Constraints/IsbnValidatorTest.php index df985137c..9d2336f7f 100644 --- a/Tests/Constraints/IsbnValidatorTest.php +++ b/Tests/Constraints/IsbnValidatorTest.php @@ -150,9 +150,7 @@ public function testExpectsStringCompatibleType() */ public function testValidIsbn10($isbn) { - $constraint = new Isbn([ - 'type' => 'isbn10', - ]); + $constraint = new Isbn(type: 'isbn10'); $this->validator->validate($isbn, $constraint); @@ -160,6 +158,7 @@ public function testValidIsbn10($isbn) } /** + * @group legacy * @dataProvider getInvalidIsbn10 */ public function testInvalidIsbn10($isbn, $code) @@ -195,7 +194,7 @@ public function testInvalidIsbn10Named() */ public function testValidIsbn13($isbn) { - $constraint = new Isbn(['type' => 'isbn13']); + $constraint = new Isbn(type: 'isbn13'); $this->validator->validate($isbn, $constraint); @@ -203,6 +202,7 @@ public function testValidIsbn13($isbn) } /** + * @group legacy * @dataProvider getInvalidIsbn13 */ public function testInvalidIsbn13($isbn, $code) @@ -220,16 +220,21 @@ public function testInvalidIsbn13($isbn, $code) ->assertRaised(); } - public function testInvalidIsbn13Named() + /** + * @dataProvider getInvalidIsbn13 + */ + public function testInvalidIsbn13Named($isbn, $code) { - $this->validator->validate( - '2723442284', - new Isbn(type: Isbn::ISBN_13, isbn13Message: 'myMessage') + $constraint = new Isbn( + type: Isbn::ISBN_13, + isbn13Message: 'myMessage', ); + $this->validator->validate($isbn, $constraint); + $this->buildViolation('myMessage') - ->setParameter('{{ value }}', '"2723442284"') - ->setCode(Isbn::TOO_SHORT_ERROR) + ->setParameter('{{ value }}', '"'.$isbn.'"') + ->setCode($code) ->assertRaised(); } @@ -250,9 +255,7 @@ public function testValidIsbnAny($isbn) */ public function testInvalidIsbnAnyIsbn10($isbn, $code) { - $constraint = new Isbn([ - 'bothIsbnMessage' => 'myMessage', - ]); + $constraint = new Isbn(bothIsbnMessage: 'myMessage'); $this->validator->validate($isbn, $constraint); @@ -272,9 +275,7 @@ public function testInvalidIsbnAnyIsbn10($isbn, $code) */ public function testInvalidIsbnAnyIsbn13($isbn, $code) { - $constraint = new Isbn([ - 'bothIsbnMessage' => 'myMessage', - ]); + $constraint = new Isbn(bothIsbnMessage: 'myMessage'); $this->validator->validate($isbn, $constraint); diff --git a/Tests/Constraints/IsinValidatorTest.php b/Tests/Constraints/IsinValidatorTest.php index dca4a423f..b1ac3be20 100644 --- a/Tests/Constraints/IsinValidatorTest.php +++ b/Tests/Constraints/IsinValidatorTest.php @@ -130,9 +130,7 @@ public static function getIsinWithValidFormatButIncorrectChecksum() private function assertViolationRaised($isin, $code) { - $constraint = new Isin([ - 'message' => 'myMessage', - ]); + $constraint = new Isin(message: 'myMessage'); $this->validator->validate($isin, $constraint); diff --git a/Tests/Constraints/IssnValidatorTest.php b/Tests/Constraints/IssnValidatorTest.php index 9eece3eb9..6351ab620 100644 --- a/Tests/Constraints/IssnValidatorTest.php +++ b/Tests/Constraints/IssnValidatorTest.php @@ -119,10 +119,10 @@ public function testExpectsStringCompatibleType() */ public function testCaseSensitiveIssns($issn) { - $constraint = new Issn([ - 'caseSensitive' => true, - 'message' => 'myMessage', - ]); + $constraint = new Issn( + caseSensitive: true, + message: 'myMessage', + ); $this->validator->validate($issn, $constraint); @@ -137,10 +137,10 @@ public function testCaseSensitiveIssns($issn) */ public function testRequireHyphenIssns($issn) { - $constraint = new Issn([ - 'requireHyphen' => true, - 'message' => 'myMessage', - ]); + $constraint = new Issn( + requireHyphen: true, + message: 'myMessage', + ); $this->validator->validate($issn, $constraint); @@ -167,9 +167,7 @@ public function testValidIssn($issn) */ public function testInvalidIssn($issn, $code) { - $constraint = new Issn([ - 'message' => 'myMessage', - ]); + $constraint = new Issn(message: 'myMessage'); $this->validator->validate($issn, $constraint); diff --git a/Tests/Constraints/JsonValidatorTest.php b/Tests/Constraints/JsonValidatorTest.php index 92d8a20a7..123cb95fe 100644 --- a/Tests/Constraints/JsonValidatorTest.php +++ b/Tests/Constraints/JsonValidatorTest.php @@ -37,9 +37,7 @@ public function testJsonIsValid($value) */ public function testInvalidValues($value) { - $constraint = new Json([ - 'message' => 'myMessageTest', - ]); + $constraint = new Json(message: 'myMessageTest'); $this->validator->validate($value, $constraint); diff --git a/Tests/Constraints/LanguageValidatorTest.php b/Tests/Constraints/LanguageValidatorTest.php index 9abb9cfc4..d7c01a478 100644 --- a/Tests/Constraints/LanguageValidatorTest.php +++ b/Tests/Constraints/LanguageValidatorTest.php @@ -83,9 +83,7 @@ public static function getValidLanguages() */ public function testInvalidLanguages($language) { - $constraint = new Language([ - 'message' => 'myMessage', - ]); + $constraint = new Language(message: 'myMessage'); $this->validator->validate($language, $constraint); @@ -108,9 +106,7 @@ public static function getInvalidLanguages() */ public function testValidAlpha3Languages($language) { - $this->validator->validate($language, new Language([ - 'alpha3' => true, - ])); + $this->validator->validate($language, new Language(alpha3: true)); $this->assertNoViolation(); } @@ -129,10 +125,10 @@ public static function getValidAlpha3Languages() */ public function testInvalidAlpha3Languages($language) { - $constraint = new Language([ - 'alpha3' => true, - 'message' => 'myMessage', - ]); + $constraint = new Language( + alpha3: true, + message: 'myMessage', + ); $this->validator->validate($language, $constraint); @@ -172,9 +168,7 @@ public function testValidateUsingCountrySpecificLocale() \Locale::setDefault('fr_FR'); $existingLanguage = 'en'; - $this->validator->validate($existingLanguage, new Language([ - 'message' => 'aMessage', - ])); + $this->validator->validate($existingLanguage, new Language(message: 'aMessage')); $this->assertNoViolation(); } diff --git a/Tests/Constraints/LengthTest.php b/Tests/Constraints/LengthTest.php index 6af8a7bc1..6e292cb35 100644 --- a/Tests/Constraints/LengthTest.php +++ b/Tests/Constraints/LengthTest.php @@ -24,11 +24,18 @@ class LengthTest extends TestCase { public function testNormalizerCanBeSet() { - $length = new Length(['min' => 0, 'max' => 10, 'normalizer' => 'trim']); + $length = new Length( + min: 0, + max: 10, + normalizer: 'trim', + ); $this->assertEquals('trim', $length->normalizer); } + /** + * @group legacy + */ public function testInvalidNormalizerThrowsException() { $this->expectException(InvalidArgumentException::class); @@ -36,6 +43,9 @@ public function testInvalidNormalizerThrowsException() new Length(['min' => 0, 'max' => 10, 'normalizer' => 'Unknown Callable']); } + /** + * @group legacy + */ public function testInvalidNormalizerObjectThrowsException() { $this->expectException(InvalidArgumentException::class); @@ -45,13 +55,13 @@ public function testInvalidNormalizerObjectThrowsException() public function testDefaultCountUnitIsUsed() { - $length = new Length(['min' => 0, 'max' => 10]); + $length = new Length(min: 0, max: 10); $this->assertSame(Length::COUNT_CODEPOINTS, $length->countUnit); } public function testNonDefaultCountUnitCanBeSet() { - $length = new Length(['min' => 0, 'max' => 10, 'countUnit' => Length::COUNT_GRAPHEMES]); + $length = new Length(min: 0, max: 10, countUnit: Length::COUNT_GRAPHEMES); $this->assertSame(Length::COUNT_GRAPHEMES, $length->countUnit); } @@ -59,7 +69,7 @@ public function testInvalidCountUnitThrowsException() { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage(\sprintf('The "countUnit" option must be one of the "%s"::COUNT_* constants ("%s" given).', Length::class, 'nonExistentCountUnit')); - new Length(['min' => 0, 'max' => 10, 'countUnit' => 'nonExistentCountUnit']); + new Length(min: 0, max: 10, countUnit: 'nonExistentCountUnit'); } public function testConstraintDefaultOption() @@ -72,7 +82,7 @@ public function testConstraintDefaultOption() public function testConstraintAttributeDefaultOption() { - $constraint = new Length(['value' => 5, 'exactMessage' => 'message']); + $constraint = new Length(exactly: 5, exactMessage: 'message'); self::assertEquals(5, $constraint->min); self::assertEquals(5, $constraint->max); diff --git a/Tests/Constraints/LengthValidatorTest.php b/Tests/Constraints/LengthValidatorTest.php index 0afc9e6e1..0c228f25d 100644 --- a/Tests/Constraints/LengthValidatorTest.php +++ b/Tests/Constraints/LengthValidatorTest.php @@ -25,17 +25,17 @@ protected function createValidator(): LengthValidator public function testNullIsValid() { - $this->validator->validate(null, new Length(['value' => 6])); + $this->validator->validate(null, new Length(exactly: 6)); $this->assertNoViolation(); } public function testEmptyStringIsInvalid() { - $this->validator->validate('', new Length([ - 'value' => $limit = 6, - 'exactMessage' => 'myMessage', - ])); + $this->validator->validate('', new Length( + exactly: $limit = 6, + exactMessage: 'myMessage', + )); $this->buildViolation('myMessage') ->setParameter('{{ value }}', '""') @@ -50,7 +50,7 @@ public function testEmptyStringIsInvalid() public function testExpectsStringCompatibleType() { $this->expectException(UnexpectedValueException::class); - $this->validator->validate(new \stdClass(), new Length(['value' => 5])); + $this->validator->validate(new \stdClass(), new Length(exactly: 5)); } public static function getThreeOrLessCharacters() @@ -118,7 +118,7 @@ public static function getThreeCharactersWithWhitespaces() */ public function testValidValuesMin(int|string $value) { - $constraint = new Length(['min' => 5]); + $constraint = new Length(min: 5); $this->validator->validate($value, $constraint); $this->assertNoViolation(); @@ -129,7 +129,7 @@ public function testValidValuesMin(int|string $value) */ public function testValidValuesMax(int|string $value) { - $constraint = new Length(['max' => 3]); + $constraint = new Length(max: 3); $this->validator->validate($value, $constraint); $this->assertNoViolation(); @@ -151,7 +151,7 @@ public function testValidValuesExact(int|string $value) */ public function testValidNormalizedValues($value) { - $constraint = new Length(['min' => 3, 'max' => 3, 'normalizer' => 'trim']); + $constraint = new Length(min: 3, max: 3, normalizer: 'trim'); $this->validator->validate($value, $constraint); $this->assertNoViolation(); @@ -186,10 +186,10 @@ public function testValidBytesValues() */ public function testInvalidValuesMin(int|string $value, int $valueLength) { - $constraint = new Length([ - 'min' => 4, - 'minMessage' => 'myMessage', - ]); + $constraint = new Length( + min: 4, + minMessage: 'myMessage', + ); $this->validator->validate($value, $constraint); @@ -227,10 +227,10 @@ public function testInvalidValuesMinNamed(int|string $value, int $valueLength) */ public function testInvalidValuesMax(int|string $value, int $valueLength) { - $constraint = new Length([ - 'max' => 4, - 'maxMessage' => 'myMessage', - ]); + $constraint = new Length( + max: 4, + maxMessage: 'myMessage', + ); $this->validator->validate($value, $constraint); @@ -268,11 +268,11 @@ public function testInvalidValuesMaxNamed(int|string $value, int $valueLength) */ public function testInvalidValuesExactLessThanFour(int|string $value, int $valueLength) { - $constraint = new Length([ - 'min' => 4, - 'max' => 4, - 'exactMessage' => 'myMessage', - ]); + $constraint = new Length( + min: 4, + max: 4, + exactMessage: 'myMessage', + ); $this->validator->validate($value, $constraint); @@ -310,11 +310,11 @@ public function testInvalidValuesExactLessThanFourNamed(int|string $value, int $ */ public function testInvalidValuesExactMoreThanFour(int|string $value, int $valueLength) { - $constraint = new Length([ - 'min' => 4, - 'max' => 4, - 'exactMessage' => 'myMessage', - ]); + $constraint = new Length( + min: 4, + max: 4, + exactMessage: 'myMessage', + ); $this->validator->validate($value, $constraint); @@ -333,12 +333,12 @@ public function testInvalidValuesExactMoreThanFour(int|string $value, int $value */ public function testOneCharset($value, $charset, $isValid) { - $constraint = new Length([ - 'min' => 1, - 'max' => 1, - 'charset' => $charset, - 'charsetMessage' => 'myMessage', - ]); + $constraint = new Length( + min: 1, + max: 1, + charset: $charset, + charsetMessage: 'myMessage', + ); $this->validator->validate($value, $constraint); diff --git a/Tests/Constraints/LessThanOrEqualValidatorTest.php b/Tests/Constraints/LessThanOrEqualValidatorTest.php index 4c0aa5349..9a84043ca 100644 --- a/Tests/Constraints/LessThanOrEqualValidatorTest.php +++ b/Tests/Constraints/LessThanOrEqualValidatorTest.php @@ -34,7 +34,11 @@ protected function createValidator(): LessThanOrEqualValidator protected static function createConstraint(?array $options = null): Constraint { - return new LessThanOrEqual($options); + if (null !== $options) { + return new LessThanOrEqual(...$options); + } + + return new LessThanOrEqual(); } protected function getErrorCode(): ?string diff --git a/Tests/Constraints/LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest.php b/Tests/Constraints/LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest.php index 43bca5121..685bb58a6 100644 --- a/Tests/Constraints/LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest.php +++ b/Tests/Constraints/LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest.php @@ -59,6 +59,9 @@ public static function provideInvalidComparisons(): array ]; } + /** + * @group legacy + */ public function testThrowsConstraintExceptionIfPropertyPath() { $this->expectException(ConstraintDefinitionException::class); @@ -67,6 +70,9 @@ public function testThrowsConstraintExceptionIfPropertyPath() return new NegativeOrZero(['propertyPath' => 'field']); } + /** + * @group legacy + */ public function testThrowsConstraintExceptionIfValue() { $this->expectException(ConstraintDefinitionException::class); diff --git a/Tests/Constraints/LessThanValidatorTest.php b/Tests/Constraints/LessThanValidatorTest.php index c6918942d..da7f929cd 100644 --- a/Tests/Constraints/LessThanValidatorTest.php +++ b/Tests/Constraints/LessThanValidatorTest.php @@ -34,7 +34,11 @@ protected function createValidator(): LessThanValidator protected static function createConstraint(?array $options = null): Constraint { - return new LessThan($options); + if (null !== $options) { + return new LessThan(...$options); + } + + return new LessThan(); } protected function getErrorCode(): ?string diff --git a/Tests/Constraints/LessThanValidatorWithNegativeConstraintTest.php b/Tests/Constraints/LessThanValidatorWithNegativeConstraintTest.php index fa820c19b..5174a951d 100644 --- a/Tests/Constraints/LessThanValidatorWithNegativeConstraintTest.php +++ b/Tests/Constraints/LessThanValidatorWithNegativeConstraintTest.php @@ -58,6 +58,9 @@ public static function provideInvalidComparisons(): array ]; } + /** + * @group legacy + */ public function testThrowsConstraintExceptionIfPropertyPath() { $this->expectException(ConstraintDefinitionException::class); @@ -66,6 +69,9 @@ public function testThrowsConstraintExceptionIfPropertyPath() return new Negative(['propertyPath' => 'field']); } + /** + * @group legacy + */ public function testThrowsConstraintExceptionIfValue() { $this->expectException(ConstraintDefinitionException::class); diff --git a/Tests/Constraints/LocaleValidatorTest.php b/Tests/Constraints/LocaleValidatorTest.php index 1626eecef..a9429f188 100644 --- a/Tests/Constraints/LocaleValidatorTest.php +++ b/Tests/Constraints/LocaleValidatorTest.php @@ -71,9 +71,7 @@ public static function getValidLocales() */ public function testInvalidLocales($locale) { - $constraint = new Locale([ - 'message' => 'myMessage', - ]); + $constraint = new Locale(message: 'myMessage'); $this->validator->validate($locale, $constraint); @@ -96,9 +94,7 @@ public static function getInvalidLocales() */ public function testValidLocalesWithCanonicalization(string $locale) { - $constraint = new Locale([ - 'message' => 'myMessage', - ]); + $constraint = new Locale(message: 'myMessage'); $this->validator->validate($locale, $constraint); @@ -110,10 +106,10 @@ public function testValidLocalesWithCanonicalization(string $locale) */ public function testValidLocalesWithoutCanonicalization(string $locale) { - $constraint = new Locale([ - 'message' => 'myMessage', - 'canonicalize' => false, - ]); + $constraint = new Locale( + message: 'myMessage', + canonicalize: false, + ); $this->validator->validate($locale, $constraint); @@ -125,10 +121,10 @@ public function testValidLocalesWithoutCanonicalization(string $locale) */ public function testInvalidLocalesWithoutCanonicalization(string $locale) { - $constraint = new Locale([ - 'message' => 'myMessage', - 'canonicalize' => false, - ]); + $constraint = new Locale( + message: 'myMessage', + canonicalize: false, + ); $this->validator->validate($locale, $constraint); diff --git a/Tests/Constraints/LuhnValidatorTest.php b/Tests/Constraints/LuhnValidatorTest.php index b0571ebd0..9eb33bde6 100644 --- a/Tests/Constraints/LuhnValidatorTest.php +++ b/Tests/Constraints/LuhnValidatorTest.php @@ -76,9 +76,7 @@ public static function getValidNumbers() */ public function testInvalidNumbers($number, $code) { - $constraint = new Luhn([ - 'message' => 'myMessage', - ]); + $constraint = new Luhn(message: 'myMessage'); $this->validator->validate($number, $constraint); diff --git a/Tests/Constraints/NoSuspiciousCharactersValidatorTest.php b/Tests/Constraints/NoSuspiciousCharactersValidatorTest.php index d15e41660..c38a431f5 100644 --- a/Tests/Constraints/NoSuspiciousCharactersValidatorTest.php +++ b/Tests/Constraints/NoSuspiciousCharactersValidatorTest.php @@ -32,7 +32,7 @@ protected function createValidator(): NoSuspiciousCharactersValidator */ public function testNonSuspiciousStrings(string $string, array $options = []) { - $this->validator->validate($string, new NoSuspiciousCharacters($options)); + $this->validator->validate($string, new NoSuspiciousCharacters(...$options)); $this->assertNoViolation(); } @@ -58,7 +58,7 @@ public static function provideNonSuspiciousStrings(): iterable */ public function testSuspiciousStrings(string $string, array $options, array $errors) { - $this->validator->validate($string, new NoSuspiciousCharacters($options)); + $this->validator->validate($string, new NoSuspiciousCharacters(...$options)); $violations = null; diff --git a/Tests/Constraints/NotBlankTest.php b/Tests/Constraints/NotBlankTest.php index 77435a37a..d04a65f1c 100644 --- a/Tests/Constraints/NotBlankTest.php +++ b/Tests/Constraints/NotBlankTest.php @@ -24,7 +24,7 @@ class NotBlankTest extends TestCase { public function testNormalizerCanBeSet() { - $notBlank = new NotBlank(['normalizer' => 'trim']); + $notBlank = new NotBlank(normalizer: 'trim'); $this->assertEquals('trim', $notBlank->normalizer); } @@ -45,6 +45,9 @@ public function testAttributes() self::assertSame('myMessage', $bConstraint->message); } + /** + * @group legacy + */ public function testInvalidNormalizerThrowsException() { $this->expectException(InvalidArgumentException::class); @@ -52,6 +55,9 @@ public function testInvalidNormalizerThrowsException() new NotBlank(['normalizer' => 'Unknown Callable']); } + /** + * @group legacy + */ public function testInvalidNormalizerObjectThrowsException() { $this->expectException(InvalidArgumentException::class); diff --git a/Tests/Constraints/NotBlankValidatorTest.php b/Tests/Constraints/NotBlankValidatorTest.php index 8d1ba3d0f..42d5f3a60 100644 --- a/Tests/Constraints/NotBlankValidatorTest.php +++ b/Tests/Constraints/NotBlankValidatorTest.php @@ -45,9 +45,7 @@ public static function getValidValues() public function testNullIsInvalid() { - $constraint = new NotBlank([ - 'message' => 'myMessage', - ]); + $constraint = new NotBlank(message: 'myMessage'); $this->validator->validate(null, $constraint); @@ -59,9 +57,7 @@ public function testNullIsInvalid() public function testBlankIsInvalid() { - $constraint = new NotBlank([ - 'message' => 'myMessage', - ]); + $constraint = new NotBlank(message: 'myMessage'); $this->validator->validate('', $constraint); @@ -73,9 +69,7 @@ public function testBlankIsInvalid() public function testFalseIsInvalid() { - $constraint = new NotBlank([ - 'message' => 'myMessage', - ]); + $constraint = new NotBlank(message: 'myMessage'); $this->validator->validate(false, $constraint); @@ -87,9 +81,7 @@ public function testFalseIsInvalid() public function testEmptyArrayIsInvalid() { - $constraint = new NotBlank([ - 'message' => 'myMessage', - ]); + $constraint = new NotBlank(message: 'myMessage'); $this->validator->validate([], $constraint); @@ -101,10 +93,10 @@ public function testEmptyArrayIsInvalid() public function testAllowNullTrue() { - $constraint = new NotBlank([ - 'message' => 'myMessage', - 'allowNull' => true, - ]); + $constraint = new NotBlank( + message: 'myMessage', + allowNull: true, + ); $this->validator->validate(null, $constraint); $this->assertNoViolation(); @@ -112,10 +104,10 @@ public function testAllowNullTrue() public function testAllowNullFalse() { - $constraint = new NotBlank([ - 'message' => 'myMessage', - 'allowNull' => false, - ]); + $constraint = new NotBlank( + message: 'myMessage', + allowNull: false, + ); $this->validator->validate(null, $constraint); @@ -130,10 +122,10 @@ public function testAllowNullFalse() */ public function testNormalizedStringIsInvalid($value) { - $constraint = new NotBlank([ - 'message' => 'myMessage', - 'normalizer' => 'trim', - ]); + $constraint = new NotBlank( + message: 'myMessage', + normalizer: 'trim', + ); $this->validator->validate($value, $constraint); diff --git a/Tests/Constraints/NotCompromisedPasswordValidatorTest.php b/Tests/Constraints/NotCompromisedPasswordValidatorTest.php index 3ff24eb94..11c325d53 100644 --- a/Tests/Constraints/NotCompromisedPasswordValidatorTest.php +++ b/Tests/Constraints/NotCompromisedPasswordValidatorTest.php @@ -87,7 +87,7 @@ public function testInvalidPassword() public function testThresholdReached() { - $constraint = new NotCompromisedPassword(['threshold' => 3]); + $constraint = new NotCompromisedPassword(threshold: 3); $this->validator->validate(self::PASSWORD_LEAKED, $constraint); $this->buildViolation($constraint->message) @@ -95,20 +95,21 @@ public function testThresholdReached() ->assertRaised(); } - /** - * @dataProvider provideConstraintsWithThreshold - */ - public function testThresholdNotReached(NotCompromisedPassword $constraint) + public function testThresholdNotReached() { - $this->validator->validate(self::PASSWORD_LEAKED, $constraint); + $this->validator->validate(self::PASSWORD_LEAKED, new NotCompromisedPassword(threshold: 10)); $this->assertNoViolation(); } - public static function provideConstraintsWithThreshold(): iterable + /** + * @group legacy + */ + public function testThresholdNotReachedDoctrineStyle() { - yield 'Doctrine style' => [new NotCompromisedPassword(['threshold' => 10])]; - yield 'named arguments' => [new NotCompromisedPassword(threshold: 10)]; + $this->validator->validate(self::PASSWORD_LEAKED, new NotCompromisedPassword(['threshold' => 10])); + + $this->assertNoViolation(); } public function testValidPassword() @@ -208,20 +209,21 @@ public function testApiError() $this->validator->validate(self::PASSWORD_TRIGGERING_AN_ERROR, new NotCompromisedPassword()); } - /** - * @dataProvider provideErrorSkippingConstraints - */ - public function testApiErrorSkipped(NotCompromisedPassword $constraint) + public function testApiErrorSkipped() { $this->expectNotToPerformAssertions(); - $this->validator->validate(self::PASSWORD_TRIGGERING_AN_ERROR, $constraint); + $this->validator->validate(self::PASSWORD_TRIGGERING_AN_ERROR, new NotCompromisedPassword(skipOnError: true)); } - public static function provideErrorSkippingConstraints(): iterable + /** + * @group legacy + */ + public function testApiErrorSkippedDoctrineStyle() { - yield 'Doctrine style' => [new NotCompromisedPassword(['skipOnError' => true])]; - yield 'named arguments' => [new NotCompromisedPassword(skipOnError: true)]; + $this->expectNotToPerformAssertions(); + + $this->validator->validate(self::PASSWORD_TRIGGERING_AN_ERROR, new NotCompromisedPassword(['skipOnError' => true])); } private function createHttpClientStub(?string $returnValue = null): HttpClientInterface diff --git a/Tests/Constraints/NotEqualToValidatorTest.php b/Tests/Constraints/NotEqualToValidatorTest.php index 52e25a8db..2f6948db9 100644 --- a/Tests/Constraints/NotEqualToValidatorTest.php +++ b/Tests/Constraints/NotEqualToValidatorTest.php @@ -34,7 +34,11 @@ protected function createValidator(): NotEqualToValidator protected static function createConstraint(?array $options = null): Constraint { - return new NotEqualTo($options); + if (null !== $options) { + return new NotEqualTo(...$options); + } + + return new NotEqualTo(); } protected function getErrorCode(): ?string diff --git a/Tests/Constraints/NotIdenticalToValidatorTest.php b/Tests/Constraints/NotIdenticalToValidatorTest.php index 825a5ff9f..9831d26cb 100644 --- a/Tests/Constraints/NotIdenticalToValidatorTest.php +++ b/Tests/Constraints/NotIdenticalToValidatorTest.php @@ -34,7 +34,11 @@ protected function createValidator(): NotIdenticalToValidator protected static function createConstraint(?array $options = null): Constraint { - return new NotIdenticalTo($options); + if (null !== $options) { + return new NotIdenticalTo(...$options); + } + + return new NotIdenticalTo(); } protected function getErrorCode(): ?string diff --git a/Tests/Constraints/NotNullValidatorTest.php b/Tests/Constraints/NotNullValidatorTest.php index 82156e326..fec2ec12a 100644 --- a/Tests/Constraints/NotNullValidatorTest.php +++ b/Tests/Constraints/NotNullValidatorTest.php @@ -42,12 +42,9 @@ public static function getValidValues() ]; } - /** - * @dataProvider provideInvalidConstraints - */ - public function testNullIsInvalid(NotNull $constraint) + public function testNullIsInvalid() { - $this->validator->validate(null, $constraint); + $this->validator->validate(null, new NotNull(message: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ value }}', 'null') @@ -55,11 +52,18 @@ public function testNullIsInvalid(NotNull $constraint) ->assertRaised(); } - public static function provideInvalidConstraints(): iterable + /** + * @group legacy + */ + public function testNullIsInvalidDoctrineStyle() { - yield 'Doctrine style' => [new NotNull([ + $this->validator->validate(null, new NotNull([ 'message' => 'myMessage', - ])]; - yield 'named parameters' => [new NotNull(message: 'myMessage')]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', 'null') + ->setCode(NotNull::IS_NULL_ERROR) + ->assertRaised(); } } diff --git a/Tests/Constraints/RangeTest.php b/Tests/Constraints/RangeTest.php index a306b104a..ae7e07077 100644 --- a/Tests/Constraints/RangeTest.php +++ b/Tests/Constraints/RangeTest.php @@ -18,6 +18,9 @@ class RangeTest extends TestCase { + /** + * @group legacy + */ public function testThrowsConstraintExceptionIfBothMinLimitAndPropertyPath() { $this->expectException(ConstraintDefinitionException::class); @@ -35,6 +38,9 @@ public function testThrowsConstraintExceptionIfBothMinLimitAndPropertyPathNamed( new Range(min: 'min', minPropertyPath: 'minPropertyPath'); } + /** + * @group legacy + */ public function testThrowsConstraintExceptionIfBothMaxLimitAndPropertyPath() { $this->expectException(ConstraintDefinitionException::class); @@ -86,6 +92,9 @@ public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMaxMess new Range(min: 'min', max: 'max', maxMessage: 'maxMessage'); } + /** + * @group legacy + */ public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMinMessageAndMaxMessageOptions() { $this->expectException(ConstraintDefinitionException::class); @@ -98,6 +107,9 @@ public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMinMess ]); } + /** + * @group legacy + */ public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMinMessageOptions() { $this->expectException(ConstraintDefinitionException::class); @@ -109,6 +121,9 @@ public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMinMess ]); } + /** + * @group legacy + */ public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMaxMessageOptions() { $this->expectException(ConstraintDefinitionException::class); diff --git a/Tests/Constraints/RangeValidatorTest.php b/Tests/Constraints/RangeValidatorTest.php index e0fff6f85..f8765af18 100644 --- a/Tests/Constraints/RangeValidatorTest.php +++ b/Tests/Constraints/RangeValidatorTest.php @@ -30,7 +30,7 @@ protected function createValidator(): RangeValidator public function testNullIsValid() { - $this->validator->validate(null, new Range(['min' => 10, 'max' => 20])); + $this->validator->validate(null, new Range(min: 10, max: 20)); $this->assertNoViolation(); } @@ -70,6 +70,7 @@ public static function getMoreThanTwenty(): array } /** + * @group legacy * @dataProvider getTenToTwenty */ public function testValidValuesMin($value) @@ -92,6 +93,7 @@ public function testValidValuesMinNamed($value) } /** + * @group legacy * @dataProvider getTenToTwenty */ public function testValidValuesMax($value) @@ -114,6 +116,7 @@ public function testValidValuesMaxNamed($value) } /** + * @group legacy * @dataProvider getTenToTwenty */ public function testValidValuesMinMax($value) @@ -136,6 +139,7 @@ public function testValidValuesMinMaxNamed($value) } /** + * @group legacy * @dataProvider getLessThanTen */ public function testInvalidValuesMin($value, $formattedValue) @@ -171,6 +175,7 @@ public function testInvalidValuesMinNamed($value, $formattedValue) } /** + * @group legacy * @dataProvider getMoreThanTwenty */ public function testInvalidValuesMax($value, $formattedValue) @@ -206,6 +211,7 @@ public function testInvalidValuesMaxNamed($value, $formattedValue) } /** + * @group legacy * @dataProvider getMoreThanTwenty */ public function testInvalidValuesCombinedMax($value, $formattedValue) @@ -244,6 +250,7 @@ public function testInvalidValuesCombinedMaxNamed($value, $formattedValue) } /** + * @group legacy * @dataProvider getLessThanTen */ public function testInvalidValuesCombinedMin($value, $formattedValue) @@ -345,7 +352,7 @@ public static function getLaterThanTwentiethMarch2014(): array */ public function testValidDatesMin($value) { - $constraint = new Range(['min' => 'March 10, 2014']); + $constraint = new Range(min: 'March 10, 2014'); $this->validator->validate($value, $constraint); $this->assertNoViolation(); @@ -356,7 +363,7 @@ public function testValidDatesMin($value) */ public function testValidDatesMax($value) { - $constraint = new Range(['max' => 'March 20, 2014']); + $constraint = new Range(max: 'March 20, 2014'); $this->validator->validate($value, $constraint); $this->assertNoViolation(); @@ -367,7 +374,7 @@ public function testValidDatesMax($value) */ public function testValidDatesMinMax($value) { - $constraint = new Range(['min' => 'March 10, 2014', 'max' => 'March 20, 2014']); + $constraint = new Range(min: 'March 10, 2014', max: 'March 20, 2014'); $this->validator->validate($value, $constraint); $this->assertNoViolation(); @@ -382,10 +389,10 @@ public function testInvalidDatesMin(\DateTimeInterface $value, string $dateTimeA // Make sure we have the correct version loaded IntlTestHelper::requireIntl($this, '57.1'); - $constraint = new Range([ - 'min' => 'March 10, 2014', - 'minMessage' => 'myMessage', - ]); + $constraint = new Range( + min: 'March 10, 2014', + minMessage: 'myMessage', + ); $this->validator->validate($value, $constraint); @@ -405,10 +412,10 @@ public function testInvalidDatesMax(\DateTimeInterface $value, string $dateTimeA // Make sure we have the correct version loaded IntlTestHelper::requireIntl($this, '57.1'); - $constraint = new Range([ - 'max' => 'March 20, 2014', - 'maxMessage' => 'myMessage', - ]); + $constraint = new Range( + max: 'March 20, 2014', + maxMessage: 'myMessage', + ); $this->validator->validate($value, $constraint); @@ -428,11 +435,11 @@ public function testInvalidDatesCombinedMax(\DateTimeInterface $value, string $d // Make sure we have the correct version loaded IntlTestHelper::requireIntl($this, '57.1'); - $constraint = new Range([ - 'min' => 'March 10, 2014', - 'max' => 'March 20, 2014', - 'notInRangeMessage' => 'myNotInRangeMessage', - ]); + $constraint = new Range( + min: 'March 10, 2014', + max: 'March 20, 2014', + notInRangeMessage: 'myNotInRangeMessage', + ); $this->validator->validate($value, $constraint); @@ -453,11 +460,11 @@ public function testInvalidDatesCombinedMin($value, $dateTimeAsString) // Make sure we have the correct version loaded IntlTestHelper::requireIntl($this, '57.1'); - $constraint = new Range([ - 'min' => 'March 10, 2014', - 'max' => 'March 20, 2014', - 'notInRangeMessage' => 'myNotInRangeMessage', - ]); + $constraint = new Range( + min: 'March 10, 2014', + max: 'March 20, 2014', + notInRangeMessage: 'myNotInRangeMessage', + ); $this->validator->validate($value, $constraint); @@ -482,10 +489,10 @@ public function getInvalidValues(): array public function testNonNumeric() { - $constraint = new Range([ - 'min' => 10, - 'max' => 20, - ]); + $constraint = new Range( + min: 10, + max: 20, + ); $this->validator->validate('abcd', $constraint); @@ -497,9 +504,9 @@ public function testNonNumeric() public function testNonNumericWithParsableDatetimeMinAndMaxNull() { - $constraint = new Range([ - 'min' => 'March 10, 2014', - ]); + $constraint = new Range( + min: 'March 10, 2014', + ); $this->validator->validate('abcd', $constraint); @@ -511,9 +518,9 @@ public function testNonNumericWithParsableDatetimeMinAndMaxNull() public function testNonNumericWithParsableDatetimeMaxAndMinNull() { - $constraint = new Range([ - 'max' => 'March 20, 2014', - ]); + $constraint = new Range( + max: 'March 20, 2014', + ); $this->validator->validate('abcd', $constraint); @@ -525,10 +532,10 @@ public function testNonNumericWithParsableDatetimeMaxAndMinNull() public function testNonNumericWithParsableDatetimeMinAndMax() { - $constraint = new Range([ - 'min' => 'March 10, 2014', - 'max' => 'March 20, 2014', - ]); + $constraint = new Range( + min: 'March 10, 2014', + max: 'March 20, 2014', + ); $this->validator->validate('abcd', $constraint); @@ -540,10 +547,10 @@ public function testNonNumericWithParsableDatetimeMinAndMax() public function testNonNumericWithNonParsableDatetimeMin() { - $constraint = new Range([ - 'min' => 'March 40, 2014', - 'max' => 'March 20, 2014', - ]); + $constraint = new Range( + min: 'March 40, 2014', + max: 'March 20, 2014', + ); $this->validator->validate('abcd', $constraint); @@ -555,10 +562,10 @@ public function testNonNumericWithNonParsableDatetimeMin() public function testNonNumericWithNonParsableDatetimeMax() { - $constraint = new Range([ - 'min' => 'March 10, 2014', - 'max' => 'March 50, 2014', - ]); + $constraint = new Range( + min: 'March 10, 2014', + max: 'March 50, 2014', + ); $this->validator->validate('abcd', $constraint); @@ -570,10 +577,10 @@ public function testNonNumericWithNonParsableDatetimeMax() public function testNonNumericWithNonParsableDatetimeMinAndMax() { - $constraint = new Range([ - 'min' => 'March 40, 2014', - 'max' => 'March 50, 2014', - ]); + $constraint = new Range( + min: 'March 40, 2014', + max: 'March 50, 2014', + ); $this->validator->validate('abcd', $constraint); @@ -591,10 +598,10 @@ public function testThrowsOnInvalidStringDates($expectedMessage, $value, $min, $ $this->expectException(ConstraintDefinitionException::class); $this->expectExceptionMessage($expectedMessage); - $this->validator->validate($value, new Range([ - 'min' => $min, - 'max' => $max, - ])); + $this->validator->validate($value, new Range( + min: $min, + max: $max, + )); } public static function throwsOnInvalidStringDatesProvider(): array @@ -612,15 +619,16 @@ public function testNoViolationOnNullObjectWithPropertyPaths() { $this->setObject(null); - $this->validator->validate(1, new Range([ - 'minPropertyPath' => 'minPropertyPath', - 'maxPropertyPath' => 'maxPropertyPath', - ])); + $this->validator->validate(1, new Range( + minPropertyPath: 'minPropertyPath', + maxPropertyPath: 'maxPropertyPath', + )); $this->assertNoViolation(); } /** + * @group legacy * @dataProvider getTenToTwenty */ public function testValidValuesMinPropertyPath($value) @@ -653,9 +661,9 @@ public function testValidValuesMaxPropertyPath($value) { $this->setObject(new Limit(20)); - $this->validator->validate($value, new Range([ - 'maxPropertyPath' => 'value', - ])); + $this->validator->validate($value, new Range( + maxPropertyPath: 'value', + )); $this->assertNoViolation(); } @@ -679,10 +687,10 @@ public function testValidValuesMinMaxPropertyPath($value) { $this->setObject(new MinMax(10, 20)); - $this->validator->validate($value, new Range([ - 'minPropertyPath' => 'min', - 'maxPropertyPath' => 'max', - ])); + $this->validator->validate($value, new Range( + minPropertyPath: 'min', + maxPropertyPath: 'max', + )); $this->assertNoViolation(); } @@ -694,10 +702,10 @@ public function testInvalidValuesMinPropertyPath($value, $formattedValue) { $this->setObject(new Limit(10)); - $constraint = new Range([ - 'minPropertyPath' => 'value', - 'minMessage' => 'myMessage', - ]); + $constraint = new Range( + minPropertyPath: 'value', + minMessage: 'myMessage', + ); $this->validator->validate($value, $constraint); @@ -716,10 +724,10 @@ public function testInvalidValuesMaxPropertyPath($value, $formattedValue) { $this->setObject(new Limit(20)); - $constraint = new Range([ - 'maxPropertyPath' => 'value', - 'maxMessage' => 'myMessage', - ]); + $constraint = new Range( + maxPropertyPath: 'value', + maxMessage: 'myMessage', + ); $this->validator->validate($value, $constraint); @@ -732,6 +740,7 @@ public function testInvalidValuesMaxPropertyPath($value, $formattedValue) } /** + * @group legacy * @dataProvider getMoreThanTwenty */ public function testInvalidValuesCombinedMaxPropertyPath($value, $formattedValue) @@ -782,6 +791,7 @@ public function testInvalidValuesCombinedMaxPropertyPathNamed($value, $formatted } /** + * @group legacy * @dataProvider getLessThanTen */ public function testInvalidValuesCombinedMinPropertyPath($value, $formattedValue) @@ -838,11 +848,11 @@ public function testViolationOnNullObjectWithDefinedMin($value, $formattedValue) { $this->setObject(null); - $this->validator->validate($value, new Range([ - 'min' => 10, - 'maxPropertyPath' => 'max', - 'minMessage' => 'myMessage', - ])); + $this->validator->validate($value, new Range( + min: 10, + maxPropertyPath: 'max', + minMessage: 'myMessage', + )); $this->buildViolation('myMessage') ->setParameter('{{ value }}', $formattedValue) @@ -859,11 +869,11 @@ public function testViolationOnNullObjectWithDefinedMax($value, $formattedValue) { $this->setObject(null); - $this->validator->validate($value, new Range([ - 'minPropertyPath' => 'min', - 'max' => 20, - 'maxMessage' => 'myMessage', - ])); + $this->validator->validate($value, new Range( + minPropertyPath: 'min', + max: 20, + maxMessage: 'myMessage', + )); $this->buildViolation('myMessage') ->setParameter('{{ value }}', $formattedValue) @@ -880,7 +890,7 @@ public function testValidDatesMinPropertyPath($value) { $this->setObject(new Limit('March 10, 2014')); - $this->validator->validate($value, new Range(['minPropertyPath' => 'value'])); + $this->validator->validate($value, new Range(minPropertyPath: 'value')); $this->assertNoViolation(); } @@ -892,7 +902,7 @@ public function testValidDatesMaxPropertyPath($value) { $this->setObject(new Limit('March 20, 2014')); - $constraint = new Range(['maxPropertyPath' => 'value']); + $constraint = new Range(maxPropertyPath: 'value'); $this->validator->validate($value, $constraint); $this->assertNoViolation(); @@ -905,7 +915,7 @@ public function testValidDatesMinMaxPropertyPath($value) { $this->setObject(new MinMax('March 10, 2014', 'March 20, 2014')); - $constraint = new Range(['minPropertyPath' => 'min', 'maxPropertyPath' => 'max']); + $constraint = new Range(minPropertyPath: 'min', maxPropertyPath: 'max'); $this->validator->validate($value, $constraint); $this->assertNoViolation(); @@ -922,10 +932,10 @@ public function testInvalidDatesMinPropertyPath($value, $dateTimeAsString) $this->setObject(new Limit('March 10, 2014')); - $constraint = new Range([ - 'minPropertyPath' => 'value', - 'minMessage' => 'myMessage', - ]); + $constraint = new Range( + minPropertyPath: 'value', + minMessage: 'myMessage', + ); $this->validator->validate($value, $constraint); @@ -948,10 +958,10 @@ public function testInvalidDatesMaxPropertyPath($value, $dateTimeAsString) $this->setObject(new Limit('March 20, 2014')); - $constraint = new Range([ - 'maxPropertyPath' => 'value', - 'maxMessage' => 'myMessage', - ]); + $constraint = new Range( + maxPropertyPath: 'value', + maxMessage: 'myMessage', + ); $this->validator->validate($value, $constraint); @@ -974,11 +984,11 @@ public function testInvalidDatesCombinedMaxPropertyPath($value, $dateTimeAsStrin $this->setObject(new MinMax('March 10, 2014', 'March 20, 2014')); - $constraint = new Range([ - 'minPropertyPath' => 'min', - 'maxPropertyPath' => 'max', - 'notInRangeMessage' => 'myNotInRangeMessage', - ]); + $constraint = new Range( + minPropertyPath: 'min', + maxPropertyPath: 'max', + notInRangeMessage: 'myNotInRangeMessage', + ); $this->validator->validate($value, $constraint); @@ -1003,11 +1013,11 @@ public function testInvalidDatesCombinedMinPropertyPath($value, $dateTimeAsStrin $this->setObject(new MinMax('March 10, 2014', 'March 20, 2014')); - $constraint = new Range([ - 'minPropertyPath' => 'min', - 'maxPropertyPath' => 'max', - 'notInRangeMessage' => 'myNotInRangeMessage', - ]); + $constraint = new Range( + minPropertyPath: 'min', + maxPropertyPath: 'max', + notInRangeMessage: 'myNotInRangeMessage', + ); $this->validator->validate($value, $constraint); @@ -1027,7 +1037,7 @@ public function testMinPropertyPathReferencingUninitializedProperty() $object->max = 5; $this->setObject($object); - $this->validator->validate(5, new Range(['minPropertyPath' => 'min', 'maxPropertyPath' => 'max'])); + $this->validator->validate(5, new Range(minPropertyPath: 'min', maxPropertyPath: 'max')); $this->assertNoViolation(); } @@ -1038,14 +1048,14 @@ public function testMaxPropertyPathReferencingUninitializedProperty() $object->min = 5; $this->setObject($object); - $this->validator->validate(5, new Range(['minPropertyPath' => 'min', 'maxPropertyPath' => 'max'])); + $this->validator->validate(5, new Range(minPropertyPath: 'min', maxPropertyPath: 'max')); $this->assertNoViolation(); } public static function provideMessageIfMinAndMaxSet(): array { - $notInRangeMessage = (new Range(['min' => '']))->notInRangeMessage; + $notInRangeMessage = (new Range(min: ''))->notInRangeMessage; return [ [ @@ -1068,7 +1078,7 @@ public static function provideMessageIfMinAndMaxSet(): array */ public function testMessageIfMinAndMaxSet(array $constraintExtraOptions, int $value, string $expectedMessage, string $expectedCode) { - $constraint = new Range(array_merge(['min' => 1, 'max' => 10], $constraintExtraOptions)); + $constraint = new Range(...array_merge(['min' => 1, 'max' => 10], $constraintExtraOptions)); $this->validator->validate($value, $constraint); $this diff --git a/Tests/Constraints/RegexTest.php b/Tests/Constraints/RegexTest.php index ba24fb0cb..96b5d5fc4 100644 --- a/Tests/Constraints/RegexTest.php +++ b/Tests/Constraints/RegexTest.php @@ -69,10 +69,10 @@ public static function provideHtmlPatterns() */ public function testGetHtmlPattern($pattern, $htmlPattern, $match = true) { - $constraint = new Regex([ - 'pattern' => $pattern, - 'match' => $match, - ]); + $constraint = new Regex( + pattern: $pattern, + match: $match, + ); $this->assertSame($pattern, $constraint->pattern); $this->assertSame($htmlPattern, $constraint->getHtmlPattern()); @@ -80,10 +80,10 @@ public function testGetHtmlPattern($pattern, $htmlPattern, $match = true) public function testGetCustomHtmlPattern() { - $constraint = new Regex([ - 'pattern' => '((?![0-9]$|[a-z]+).)*', - 'htmlPattern' => 'foobar', - ]); + $constraint = new Regex( + pattern: '((?![0-9]$|[a-z]+).)*', + htmlPattern: 'foobar', + ); $this->assertSame('((?![0-9]$|[a-z]+).)*', $constraint->pattern); $this->assertSame('foobar', $constraint->getHtmlPattern()); @@ -91,11 +91,14 @@ public function testGetCustomHtmlPattern() public function testNormalizerCanBeSet() { - $regex = new Regex(['pattern' => '/^[0-9]+$/', 'normalizer' => 'trim']); + $regex = new Regex(pattern: '/^[0-9]+$/', normalizer: 'trim'); $this->assertEquals('trim', $regex->normalizer); } + /** + * @group legacy + */ public function testInvalidNormalizerThrowsException() { $this->expectException(InvalidArgumentException::class); @@ -103,6 +106,9 @@ public function testInvalidNormalizerThrowsException() new Regex(['pattern' => '/^[0-9]+$/', 'normalizer' => 'Unknown Callable']); } + /** + * @group legacy + */ public function testInvalidNormalizerObjectThrowsException() { $this->expectException(InvalidArgumentException::class); diff --git a/Tests/Constraints/RegexValidatorTest.php b/Tests/Constraints/RegexValidatorTest.php index 82739f0e3..576df3748 100644 --- a/Tests/Constraints/RegexValidatorTest.php +++ b/Tests/Constraints/RegexValidatorTest.php @@ -25,14 +25,14 @@ protected function createValidator(): RegexValidator public function testNullIsValid() { - $this->validator->validate(null, new Regex(['pattern' => '/^[0-9]+$/'])); + $this->validator->validate(null, new Regex(pattern: '/^[0-9]+$/')); $this->assertNoViolation(); } public function testEmptyStringIsValid() { - $this->validator->validate('', new Regex(['pattern' => '/^[0-9]+$/'])); + $this->validator->validate('', new Regex(pattern: '/^[0-9]+$/')); $this->assertNoViolation(); } @@ -40,7 +40,7 @@ public function testEmptyStringIsValid() public function testExpectsStringCompatibleType() { $this->expectException(UnexpectedValueException::class); - $this->validator->validate(new \stdClass(), new Regex(['pattern' => '/^[0-9]+$/'])); + $this->validator->validate(new \stdClass(), new Regex(pattern: '/^[0-9]+$/')); } /** @@ -48,13 +48,14 @@ public function testExpectsStringCompatibleType() */ public function testValidValues($value) { - $constraint = new Regex(['pattern' => '/^[0-9]+$/']); + $constraint = new Regex(pattern: '/^[0-9]+$/'); $this->validator->validate($value, $constraint); $this->assertNoViolation(); } /** + * @group legacy * @dataProvider getValidValuesWithWhitespaces */ public function testValidValuesWithWhitespaces($value) @@ -105,6 +106,7 @@ public static function getValidValuesWithWhitespaces() } /** + * @group legacy * @dataProvider getInvalidValues */ public function testInvalidValues($value) diff --git a/Tests/Constraints/SequentiallyValidatorTest.php b/Tests/Constraints/SequentiallyValidatorTest.php index 657ff2637..4c8a48e10 100644 --- a/Tests/Constraints/SequentiallyValidatorTest.php +++ b/Tests/Constraints/SequentiallyValidatorTest.php @@ -33,7 +33,7 @@ public function testWalkThroughConstraints() { $constraints = [ new Type('number'), - new Range(['min' => 4]), + new Range(min: 4), ]; $value = 6; @@ -50,7 +50,7 @@ public function testStopsAtFirstConstraintWithViolations() { $constraints = [ new Type('string'), - new Regex(['pattern' => '[a-z]']), + new Regex(pattern: '[a-z]'), new NotEqualTo('Foo'), ]; @@ -68,20 +68,20 @@ public function testNestedConstraintsAreNotExecutedWhenGroupDoesNotMatch() { $validator = Validation::createValidator(); - $violations = $validator->validate(50, new Sequentially([ - 'constraints' => [ - new GreaterThan([ - 'groups' => 'senior', - 'value' => 55, - ]), - new Range([ - 'groups' => 'adult', - 'min' => 18, - 'max' => 55, - ]), + $violations = $validator->validate(50, new Sequentially( + constraints: [ + new GreaterThan( + groups: ['senior'], + value: 55, + ), + new Range( + groups: ['adult'], + min: 18, + max: 55, + ), ], - 'groups' => ['adult', 'senior'], - ]), 'adult'); + groups: ['adult', 'senior'], + ), 'adult'); $this->assertCount(0, $violations); } diff --git a/Tests/Constraints/TimeValidatorTest.php b/Tests/Constraints/TimeValidatorTest.php index 5d9027a17..7c1a9feb9 100644 --- a/Tests/Constraints/TimeValidatorTest.php +++ b/Tests/Constraints/TimeValidatorTest.php @@ -87,9 +87,7 @@ public static function getValidTimes() */ public function testValidTimesWithoutSeconds(string $time) { - $this->validator->validate($time, new Time([ - 'withSeconds' => false, - ])); + $this->validator->validate($time, new Time(withSeconds: false)); $this->assertNoViolation(); } @@ -143,9 +141,7 @@ public static function getInvalidTimesWithoutSeconds() */ public function testInvalidTimes($time, $code) { - $constraint = new Time([ - 'message' => 'myMessage', - ]); + $constraint = new Time(message: 'myMessage'); $this->validator->validate($time, $constraint); diff --git a/Tests/Constraints/TimezoneTest.php b/Tests/Constraints/TimezoneTest.php index 42a38a711..41fed2386 100644 --- a/Tests/Constraints/TimezoneTest.php +++ b/Tests/Constraints/TimezoneTest.php @@ -25,12 +25,12 @@ class TimezoneTest extends TestCase public function testValidTimezoneConstraints() { new Timezone(); - new Timezone(['zone' => \DateTimeZone::ALL]); + new Timezone(zone: \DateTimeZone::ALL); new Timezone(\DateTimeZone::ALL_WITH_BC); - new Timezone([ - 'zone' => \DateTimeZone::PER_COUNTRY, - 'countryCode' => 'AR', - ]); + new Timezone( + zone: \DateTimeZone::PER_COUNTRY, + countryCode: 'AR', + ); $this->addToAssertionCount(1); } @@ -38,16 +38,16 @@ public function testValidTimezoneConstraints() public function testExceptionForGroupedTimezonesByCountryWithWrongZone() { $this->expectException(ConstraintDefinitionException::class); - new Timezone([ - 'zone' => \DateTimeZone::ALL, - 'countryCode' => 'AR', - ]); + new Timezone( + zone: \DateTimeZone::ALL, + countryCode: 'AR', + ); } public function testExceptionForGroupedTimezonesByCountryWithoutZone() { $this->expectException(ConstraintDefinitionException::class); - new Timezone(['countryCode' => 'AR']); + new Timezone(countryCode: 'AR'); } /** @@ -56,7 +56,7 @@ public function testExceptionForGroupedTimezonesByCountryWithoutZone() public function testExceptionForInvalidGroupedTimezones(int $zone) { $this->expectException(ConstraintDefinitionException::class); - new Timezone(['zone' => $zone]); + new Timezone(zone: $zone); } public static function provideInvalidZones(): iterable diff --git a/Tests/Constraints/TimezoneValidatorTest.php b/Tests/Constraints/TimezoneValidatorTest.php index 25451c5d2..5595f872c 100644 --- a/Tests/Constraints/TimezoneValidatorTest.php +++ b/Tests/Constraints/TimezoneValidatorTest.php @@ -92,9 +92,7 @@ public static function getValidTimezones(): iterable */ public function testValidGroupedTimezones(string $timezone, int $zone) { - $constraint = new Timezone([ - 'zone' => $zone, - ]); + $constraint = new Timezone(zone: $zone); $this->validator->validate($timezone, $constraint); @@ -125,9 +123,7 @@ public static function getValidGroupedTimezones(): iterable */ public function testInvalidTimezoneWithoutZone(string $timezone) { - $constraint = new Timezone([ - 'message' => 'myMessage', - ]); + $constraint = new Timezone(message: 'myMessage'); $this->validator->validate($timezone, $constraint); @@ -150,10 +146,10 @@ public static function getInvalidTimezones(): iterable */ public function testInvalidGroupedTimezones(string $timezone, int $zone) { - $constraint = new Timezone([ - 'zone' => $zone, - 'message' => 'myMessage', - ]); + $constraint = new Timezone( + zone: $zone, + message: 'myMessage', + ); $this->validator->validate($timezone, $constraint); @@ -193,10 +189,10 @@ public function testInvalidGroupedTimezoneNamed() */ public function testValidGroupedTimezonesByCountry(string $timezone, string $country) { - $constraint = new Timezone([ - 'zone' => \DateTimeZone::PER_COUNTRY, - 'countryCode' => $country, - ]); + $constraint = new Timezone( + zone: \DateTimeZone::PER_COUNTRY, + countryCode: $country, + ); $this->validator->validate($timezone, $constraint); @@ -230,11 +226,11 @@ public static function getValidGroupedTimezonesByCountry(): iterable */ public function testInvalidGroupedTimezonesByCountry(string $timezone, string $countryCode) { - $constraint = new Timezone([ - 'message' => 'myMessage', - 'zone' => \DateTimeZone::PER_COUNTRY, - 'countryCode' => $countryCode, - ]); + $constraint = new Timezone( + message: 'myMessage', + zone: \DateTimeZone::PER_COUNTRY, + countryCode: $countryCode, + ); $this->validator->validate($timezone, $constraint); @@ -255,11 +251,11 @@ public static function getInvalidGroupedTimezonesByCountry(): iterable public function testGroupedTimezonesWithInvalidCountry() { - $constraint = new Timezone([ - 'message' => 'myMessage', - 'zone' => \DateTimeZone::PER_COUNTRY, - 'countryCode' => 'foobar', - ]); + $constraint = new Timezone( + message: 'myMessage', + zone: \DateTimeZone::PER_COUNTRY, + countryCode: 'foobar', + ); $this->validator->validate('Europe/Amsterdam', $constraint); @@ -286,9 +282,7 @@ public function testDeprecatedTimezonesAreValidWithBC(string $timezone) */ public function testDeprecatedTimezonesAreInvalidWithoutBC(string $timezone) { - $constraint = new Timezone([ - 'message' => 'myMessage', - ]); + $constraint = new Timezone(message: 'myMessage'); $this->validator->validate($timezone, $constraint); @@ -332,10 +326,10 @@ public function testIntlCompatibility() $this->markTestSkipped('"Europe/Saratov" is expired until 2017, current version is '.$tzDbVersion); } - $constraint = new Timezone([ - 'message' => 'myMessage', - 'intlCompatible' => true, - ]); + $constraint = new Timezone( + message: 'myMessage', + intlCompatible: true, + ); $this->validator->validate('Europe/Saratov', $constraint); diff --git a/Tests/Constraints/TypeValidatorTest.php b/Tests/Constraints/TypeValidatorTest.php index 99714407f..8e9e1aa3b 100644 --- a/Tests/Constraints/TypeValidatorTest.php +++ b/Tests/Constraints/TypeValidatorTest.php @@ -26,7 +26,7 @@ protected function createValidator(): TypeValidator public function testNullIsValid() { - $constraint = new Type(['type' => 'integer']); + $constraint = new Type(type: 'integer'); $this->validator->validate(null, $constraint); @@ -35,7 +35,7 @@ public function testNullIsValid() public function testEmptyIsValidIfString() { - $constraint = new Type(['type' => 'string']); + $constraint = new Type(type: 'string'); $this->validator->validate('', $constraint); @@ -44,10 +44,10 @@ public function testEmptyIsValidIfString() public function testEmptyIsInvalidIfNoString() { - $constraint = new Type([ - 'type' => 'integer', - 'message' => 'myMessage', - ]); + $constraint = new Type( + type: 'integer', + message: 'myMessage', + ); $this->validator->validate('', $constraint); @@ -63,7 +63,7 @@ public function testEmptyIsInvalidIfNoString() */ public function testValidValues($value, $type) { - $constraint = new Type(['type' => $type]); + $constraint = new Type(type: $type); $this->validator->validate($value, $constraint); @@ -123,10 +123,10 @@ public static function getValidValues() */ public function testInvalidValues($value, $type, $valueAsString) { - $constraint = new Type([ - 'type' => $type, - 'message' => 'myMessage', - ]); + $constraint = new Type( + type: $type, + message: 'myMessage', + ); $this->validator->validate($value, $constraint); @@ -195,7 +195,7 @@ public static function getInvalidValues() */ public function testValidValuesMultipleTypes($value, array $types) { - $constraint = new Type(['type' => $types]); + $constraint = new Type(type: $types); $this->validator->validate($value, $constraint); @@ -210,12 +210,9 @@ public static function getValidValuesMultipleTypes() ]; } - /** - * @dataProvider provideConstraintsWithMultipleTypes - */ - public function testInvalidValuesMultipleTypes(Type $constraint) + public function testInvalidValuesMultipleTypes() { - $this->validator->validate('12345', $constraint); + $this->validator->validate('12345', new Type(type: ['boolean', 'array'], message: 'myMessage')); $this->buildViolation('myMessage') ->setParameter('{{ value }}', '"12345"') @@ -224,13 +221,21 @@ public function testInvalidValuesMultipleTypes(Type $constraint) ->assertRaised(); } - public static function provideConstraintsWithMultipleTypes() + /** + * @group legacy + */ + public function testInvalidValuesMultipleTypesDoctrineStyle() { - yield 'Doctrine style' => [new Type([ + $this->validator->validate('12345', new Type([ 'type' => ['boolean', 'array'], 'message' => 'myMessage', - ])]; - yield 'named arguments' => [new Type(type: ['boolean', 'array'], message: 'myMessage')]; + ])); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"12345"') + ->setParameter('{{ type }}', implode('|', ['boolean', 'array'])) + ->setCode(Type::INVALID_TYPE_ERROR) + ->assertRaised(); } protected static function createFile() diff --git a/Tests/Constraints/UlidValidatorTest.php b/Tests/Constraints/UlidValidatorTest.php index abacdfdc5..172ace189 100644 --- a/Tests/Constraints/UlidValidatorTest.php +++ b/Tests/Constraints/UlidValidatorTest.php @@ -72,9 +72,7 @@ public function testValidUlidAsRfc4122() */ public function testInvalidUlid(string $ulid, string $code) { - $constraint = new Ulid([ - 'message' => 'testMessage', - ]); + $constraint = new Ulid(message: 'testMessage'); $this->validator->validate($ulid, $constraint); diff --git a/Tests/Constraints/UniqueTest.php b/Tests/Constraints/UniqueTest.php index 7d882a9c3..9fe2599fd 100644 --- a/Tests/Constraints/UniqueTest.php +++ b/Tests/Constraints/UniqueTest.php @@ -37,6 +37,9 @@ public function testAttributes() self::assertSame('intval', $dConstraint->normalizer); } + /** + * @group legacy + */ public function testInvalidNormalizerThrowsException() { $this->expectException(InvalidArgumentException::class); @@ -44,6 +47,9 @@ public function testInvalidNormalizerThrowsException() new Unique(['normalizer' => 'Unknown Callable']); } + /** + * @group legacy + */ public function testInvalidNormalizerObjectThrowsException() { $this->expectException(InvalidArgumentException::class); diff --git a/Tests/Constraints/UniqueValidatorTest.php b/Tests/Constraints/UniqueValidatorTest.php index f81621d65..ac43ed2b8 100644 --- a/Tests/Constraints/UniqueValidatorTest.php +++ b/Tests/Constraints/UniqueValidatorTest.php @@ -63,9 +63,7 @@ public static function getValidValues() */ public function testInvalidValues($value, $expectedMessageParam) { - $constraint = new Unique([ - 'message' => 'myMessage', - ]); + $constraint = new Unique(message: 'myMessage'); $this->validator->validate($value, $constraint); $this->buildViolation('myMessage') @@ -118,9 +116,7 @@ public function testExpectsUniqueObjects($callback) $value = [$object1, $object2, $object3]; - $this->validator->validate($value, new Unique([ - 'normalizer' => $callback, - ])); + $this->validator->validate($value, new Unique(normalizer: $callback)); $this->assertNoViolation(); } @@ -144,10 +140,10 @@ public function testExpectsNonUniqueObjects($callback) $value = [$object1, $object2, $object3]; - $this->validator->validate($value, new Unique([ - 'message' => 'myMessage', - 'normalizer' => $callback, - ])); + $this->validator->validate($value, new Unique( + message: 'myMessage', + normalizer: $callback, + )); $this->buildViolation('myMessage') ->setParameter('{{ value }}', 'array') @@ -168,10 +164,10 @@ public static function getCallback(): array public function testExpectsInvalidNonStrictComparison() { - $this->validator->validate([1, '1', 1.0, '1.0'], new Unique([ - 'message' => 'myMessage', - 'normalizer' => 'intval', - ])); + $this->validator->validate([1, '1', 1.0, '1.0'], new Unique( + message: 'myMessage', + normalizer: 'intval', + )); $this->buildViolation('myMessage') ->setParameter('{{ value }}', '1') @@ -183,9 +179,7 @@ public function testExpectsValidNonStrictComparison() { $callback = static fn ($item) => (int) $item; - $this->validator->validate([1, '2', 3, '4.0'], new Unique([ - 'normalizer' => $callback, - ])); + $this->validator->validate([1, '2', 3, '4.0'], new Unique(normalizer: $callback)); $this->assertNoViolation(); } @@ -194,10 +188,10 @@ public function testExpectsInvalidCaseInsensitiveComparison() { $callback = static fn ($item) => mb_strtolower($item); - $this->validator->validate(['Hello', 'hello', 'HELLO', 'hellO'], new Unique([ - 'message' => 'myMessage', - 'normalizer' => $callback, - ])); + $this->validator->validate(['Hello', 'hello', 'HELLO', 'hellO'], new Unique( + message: 'myMessage', + normalizer: $callback, + )); $this->buildViolation('myMessage') ->setParameter('{{ value }}', '"hello"') @@ -209,9 +203,7 @@ public function testExpectsValidCaseInsensitiveComparison() { $callback = static fn ($item) => mb_strtolower($item); - $this->validator->validate(['Hello', 'World'], new Unique([ - 'normalizer' => $callback, - ])); + $this->validator->validate(['Hello', 'World'], new Unique(normalizer: $callback)); $this->assertNoViolation(); } @@ -248,9 +240,10 @@ public static function getInvalidFieldNames(): array */ public function testInvalidCollectionValues(array $value, array $fields, string $expectedMessageParam) { - $this->validator->validate($value, new Unique([ - 'message' => 'myMessage', - ], fields: $fields)); + $this->validator->validate($value, new Unique( + message: 'myMessage', + fields: $fields, + )); $this->buildViolation('myMessage') ->setParameter('{{ value }}', $expectedMessageParam) diff --git a/Tests/Constraints/UrlTest.php b/Tests/Constraints/UrlTest.php index 1d641aa92..8dd593d2e 100644 --- a/Tests/Constraints/UrlTest.php +++ b/Tests/Constraints/UrlTest.php @@ -24,11 +24,14 @@ class UrlTest extends TestCase { public function testNormalizerCanBeSet() { - $url = new Url(['normalizer' => 'trim', 'requireTld' => true]); + $url = new Url(normalizer: 'trim', requireTld: true); $this->assertEquals('trim', $url->normalizer); } + /** + * @group legacy + */ public function testInvalidNormalizerThrowsException() { $this->expectException(InvalidArgumentException::class); @@ -36,6 +39,9 @@ public function testInvalidNormalizerThrowsException() new Url(['normalizer' => 'Unknown Callable', 'requireTld' => true]); } + /** + * @group legacy + */ public function testInvalidNormalizerObjectThrowsException() { $this->expectException(InvalidArgumentException::class); diff --git a/Tests/Constraints/UrlValidatorTest.php b/Tests/Constraints/UrlValidatorTest.php index 5fdbb28b6..b1322eac7 100644 --- a/Tests/Constraints/UrlValidatorTest.php +++ b/Tests/Constraints/UrlValidatorTest.php @@ -78,10 +78,10 @@ public function testValidUrlsWithNewLine($url) */ public function testValidUrlsWithWhitespaces($url) { - $this->validator->validate($url, new Url([ - 'normalizer' => 'trim', - 'requireTld' => true, - ])); + $this->validator->validate($url, new Url( + normalizer: 'trim', + requireTld: true, + )); $this->assertNoViolation(); } @@ -92,10 +92,10 @@ public function testValidUrlsWithWhitespaces($url) */ public function testValidRelativeUrl($url) { - $constraint = new Url([ - 'relativeProtocol' => true, - 'requireTld' => false, - ]); + $constraint = new Url( + relativeProtocol: true, + requireTld: false, + ); $this->validator->validate($url, $constraint); @@ -229,10 +229,10 @@ public static function getValidUrlsWithWhitespaces() */ public function testInvalidUrls($url) { - $constraint = new Url([ - 'message' => 'myMessage', - 'requireTld' => false, - ]); + $constraint = new Url( + message: 'myMessage', + requireTld: false, + ); $this->validator->validate($url, $constraint); @@ -248,11 +248,11 @@ public function testInvalidUrls($url) */ public function testInvalidRelativeUrl($url) { - $constraint = new Url([ - 'message' => 'myMessage', - 'relativeProtocol' => true, - 'requireTld' => false, - ]); + $constraint = new Url( + message: 'myMessage', + relativeProtocol: true, + requireTld: false, + ); $this->validator->validate($url, $constraint); @@ -331,10 +331,10 @@ public static function getInvalidUrls() */ public function testCustomProtocolIsValid($url, $requireTld) { - $constraint = new Url([ - 'protocols' => ['ftp', 'file', 'git'], - 'requireTld' => $requireTld, - ]); + $constraint = new Url( + protocols: ['ftp', 'file', 'git'], + requireTld: $requireTld, + ); $this->validator->validate($url, $constraint); @@ -355,9 +355,7 @@ public static function getValidCustomUrls() */ public function testRequiredTld(string $url, bool $requireTld, bool $isValid) { - $constraint = new Url([ - 'requireTld' => $requireTld, - ]); + $constraint = new Url(requireTld: $requireTld); $this->validator->validate($url, $constraint); diff --git a/Tests/Constraints/UuidTest.php b/Tests/Constraints/UuidTest.php index 3da8b8133..22901a9db 100644 --- a/Tests/Constraints/UuidTest.php +++ b/Tests/Constraints/UuidTest.php @@ -24,11 +24,14 @@ class UuidTest extends TestCase { public function testNormalizerCanBeSet() { - $uuid = new Uuid(['normalizer' => 'trim']); + $uuid = new Uuid(normalizer: 'trim'); $this->assertEquals('trim', $uuid->normalizer); } + /** + * @group legacy + */ public function testInvalidNormalizerThrowsException() { $this->expectException(InvalidArgumentException::class); @@ -36,6 +39,9 @@ public function testInvalidNormalizerThrowsException() new Uuid(['normalizer' => 'Unknown Callable']); } + /** + * @group legacy + */ public function testInvalidNormalizerObjectThrowsException() { $this->expectException(InvalidArgumentException::class); diff --git a/Tests/Constraints/UuidValidatorTest.php b/Tests/Constraints/UuidValidatorTest.php index 23bfe8383..84edc6612 100644 --- a/Tests/Constraints/UuidValidatorTest.php +++ b/Tests/Constraints/UuidValidatorTest.php @@ -93,7 +93,7 @@ public static function getValidStrictUuids() */ public function testValidStrictUuidsWithWhitespaces($uuid, $versions = null) { - $constraint = new Uuid(['normalizer' => 'trim']); + $constraint = new Uuid(normalizer: 'trim'); if (null !== $versions) { $constraint->versions = $versions; @@ -131,9 +131,7 @@ public function testValidStrictUuidWithWhitespacesNamed() */ public function testInvalidStrictUuids($uuid, $code, $versions = null) { - $constraint = new Uuid([ - 'message' => 'testMessage', - ]); + $constraint = new Uuid(message: 'testMessage'); if (null !== $versions) { $constraint->versions = $versions; @@ -195,9 +193,7 @@ public static function getInvalidStrictUuids() */ public function testValidNonStrictUuids($uuid) { - $constraint = new Uuid([ - 'strict' => false, - ]); + $constraint = new Uuid(strict: false); $this->validator->validate($uuid, $constraint); @@ -226,10 +222,10 @@ public static function getValidNonStrictUuids() */ public function testInvalidNonStrictUuids($uuid, $code) { - $constraint = new Uuid([ - 'strict' => false, - 'message' => 'myMessage', - ]); + $constraint = new Uuid( + strict: false, + message: 'myMessage', + ); $this->validator->validate($uuid, $constraint); @@ -270,9 +266,7 @@ public function testInvalidNonStrictUuidNamed() */ public function testTimeBasedUuid(string $uid, bool $expectedTimeBased) { - $constraint = new Uuid([ - 'versions' => Uuid::TIME_BASED_VERSIONS, - ]); + $constraint = new Uuid(versions: Uuid::TIME_BASED_VERSIONS); $this->validator->validate($uid, $constraint); diff --git a/Tests/Constraints/ValidTest.php b/Tests/Constraints/ValidTest.php index c56cdedd5..a862171f1 100644 --- a/Tests/Constraints/ValidTest.php +++ b/Tests/Constraints/ValidTest.php @@ -23,7 +23,7 @@ class ValidTest extends TestCase { public function testGroupsCanBeSet() { - $constraint = new Valid(['groups' => 'foo']); + $constraint = new Valid(groups: ['foo']); $this->assertSame(['foo'], $constraint->groups); } diff --git a/Tests/Constraints/WhenTest.php b/Tests/Constraints/WhenTest.php index 7cfe13f2f..fa71de02e 100644 --- a/Tests/Constraints/WhenTest.php +++ b/Tests/Constraints/WhenTest.php @@ -24,6 +24,9 @@ final class WhenTest extends TestCase { + /** + * @group legacy + */ public function testMissingOptionsExceptionIsThrown() { $this->expectException(MissingOptionsException::class); @@ -51,10 +54,10 @@ public function testAttributes() self::assertInstanceOf(When::class, $classConstraint); self::assertSame('true', $classConstraint->expression); self::assertEquals([ - new Callback([ - 'callback' => 'callback', - 'groups' => ['Default', 'WhenTestWithAttributes'], - ]), + new Callback( + callback: 'callback', + groups: ['Default', 'WhenTestWithAttributes'], + ), ], $classConstraint->constraints); [$fooConstraint] = $metadata->properties['foo']->getConstraints(); @@ -62,12 +65,8 @@ public function testAttributes() self::assertInstanceOf(When::class, $fooConstraint); self::assertSame('true', $fooConstraint->expression); self::assertEquals([ - new NotNull([ - 'groups' => ['Default', 'WhenTestWithAttributes'], - ]), - new NotBlank([ - 'groups' => ['Default', 'WhenTestWithAttributes'], - ]), + new NotNull(groups: ['Default', 'WhenTestWithAttributes']), + new NotBlank(groups: ['Default', 'WhenTestWithAttributes']), ], $fooConstraint->constraints); self::assertSame(['Default', 'WhenTestWithAttributes'], $fooConstraint->groups); @@ -76,12 +75,8 @@ public function testAttributes() self::assertInstanceOf(When::class, $fooConstraint); self::assertSame('false', $barConstraint->expression); self::assertEquals([ - new NotNull([ - 'groups' => ['foo'], - ]), - new NotBlank([ - 'groups' => ['foo'], - ]), + new NotNull(groups: ['foo']), + new NotBlank(groups: ['foo']), ], $barConstraint->constraints); self::assertSame(['foo'], $barConstraint->groups); @@ -89,11 +84,7 @@ public function testAttributes() self::assertInstanceOf(When::class, $quxConstraint); self::assertSame('true', $quxConstraint->expression); - self::assertEquals([ - new NotNull([ - 'groups' => ['foo'], - ]), - ], $quxConstraint->constraints); + self::assertEquals([new NotNull(groups: ['foo'])], $quxConstraint->constraints); self::assertSame(['foo'], $quxConstraint->groups); [$bazConstraint] = $metadata->getters['baz']->getConstraints(); @@ -101,12 +92,8 @@ public function testAttributes() self::assertInstanceOf(When::class, $bazConstraint); self::assertSame('true', $bazConstraint->expression); self::assertEquals([ - new NotNull([ - 'groups' => ['Default', 'WhenTestWithAttributes'], - ]), - new NotBlank([ - 'groups' => ['Default', 'WhenTestWithAttributes'], - ]), + new NotNull(groups: ['Default', 'WhenTestWithAttributes']), + new NotBlank(groups: ['Default', 'WhenTestWithAttributes']), ], $bazConstraint->constraints); self::assertSame(['Default', 'WhenTestWithAttributes'], $bazConstraint->groups); } diff --git a/Tests/Constraints/WhenValidatorTest.php b/Tests/Constraints/WhenValidatorTest.php index f79d53031..019ec828f 100644 --- a/Tests/Constraints/WhenValidatorTest.php +++ b/Tests/Constraints/WhenValidatorTest.php @@ -33,10 +33,10 @@ public function testConstraintsAreExecuted() $this->expectValidateValue(0, 'Foo', $constraints); - $this->validator->validate('Foo', new When([ - 'expression' => 'true', - 'constraints' => $constraints, - ])); + $this->validator->validate('Foo', new When( + expression: 'true', + constraints: $constraints, + )); } public function testConstraintIsExecuted() @@ -44,10 +44,10 @@ public function testConstraintIsExecuted() $constraint = new NotNull(); $this->expectValidateValue(0, 'Foo', [$constraint]); - $this->validator->validate('Foo', new When([ - 'expression' => 'true', - 'constraints' => $constraint, - ])); + $this->validator->validate('Foo', new When( + expression: 'true', + constraints: $constraint, + )); } public function testConstraintsAreExecutedWithNull() @@ -58,10 +58,10 @@ public function testConstraintsAreExecutedWithNull() $this->expectValidateValue(0, null, $constraints); - $this->validator->validate(null, new When([ - 'expression' => 'true', - 'constraints' => $constraints, - ])); + $this->validator->validate(null, new When( + expression: 'true', + constraints: $constraints, + )); } public function testConstraintsAreExecutedWithObject() @@ -79,10 +79,10 @@ public function testConstraintsAreExecutedWithObject() $this->expectValidateValue(0, $number->value, $constraints); - $this->validator->validate($number->value, new When([ - 'expression' => 'this.type === "positive"', - 'constraints' => $constraints, - ])); + $this->validator->validate($number->value, new When( + expression: 'this.type === "positive"', + constraints: $constraints, + )); } public function testConstraintsAreExecutedWithNestedObject() @@ -104,10 +104,10 @@ public function testConstraintsAreExecutedWithNestedObject() $this->expectValidateValue(0, $number->value, $constraints); - $this->validator->validate($number->value, new When([ - 'expression' => 'context.getRoot().ok === true', - 'constraints' => $constraints, - ])); + $this->validator->validate($number->value, new When( + expression: 'context.getRoot().ok === true', + constraints: $constraints, + )); } public function testConstraintsAreExecutedWithValue() @@ -118,10 +118,10 @@ public function testConstraintsAreExecutedWithValue() $this->expectValidateValue(0, 'foo', $constraints); - $this->validator->validate('foo', new When([ - 'expression' => 'value === "foo"', - 'constraints' => $constraints, - ])); + $this->validator->validate('foo', new When( + expression: 'value === "foo"', + constraints: $constraints, + )); } public function testConstraintsAreExecutedWithExpressionValues() @@ -132,14 +132,14 @@ public function testConstraintsAreExecutedWithExpressionValues() $this->expectValidateValue(0, 'foo', $constraints); - $this->validator->validate('foo', new When([ - 'expression' => 'activated && value === compared_value', - 'constraints' => $constraints, - 'values' => [ + $this->validator->validate('foo', new When( + expression: 'activated && value === compared_value', + constraints: $constraints, + values: [ 'activated' => true, 'compared_value' => 'foo', ], - ])); + )); } public function testConstraintsNotExecuted() @@ -151,10 +151,10 @@ public function testConstraintsNotExecuted() $this->expectNoValidate(); - $this->validator->validate('', new When([ - 'expression' => 'false', - 'constraints' => $constraints, - ])); + $this->validator->validate('', new When( + expression: 'false', + constraints: $constraints, + )); $this->assertNoViolation(); } @@ -174,10 +174,10 @@ public function testConstraintsNotExecutedWithObject() $this->expectNoValidate(); - $this->validator->validate($number->value, new When([ - 'expression' => 'this.type !== "positive"', - 'constraints' => $constraints, - ])); + $this->validator->validate($number->value, new When( + expression: 'this.type !== "positive"', + constraints: $constraints, + )); $this->assertNoViolation(); } @@ -190,10 +190,10 @@ public function testConstraintsNotExecutedWithValue() $this->expectNoValidate(); - $this->validator->validate('foo', new When([ - 'expression' => 'value === null', - 'constraints' => $constraints, - ])); + $this->validator->validate('foo', new When( + expression: 'value === null', + constraints: $constraints, + )); $this->assertNoViolation(); } @@ -206,14 +206,14 @@ public function testConstraintsNotExecutedWithExpressionValues() $this->expectNoValidate(); - $this->validator->validate('foo', new When([ - 'expression' => 'activated && value === compared_value', - 'constraints' => $constraints, - 'values' => [ + $this->validator->validate('foo', new When( + expression: 'activated && value === compared_value', + constraints: $constraints, + values: [ 'activated' => true, 'compared_value' => 'bar', ], - ])); + )); $this->assertNoViolation(); } @@ -221,9 +221,7 @@ public function testConstraintsNotExecutedWithExpressionValues() public function testConstraintViolations() { $constraints = [ - new Blank([ - 'message' => 'my_message', - ]), + new Blank(message: 'my_message'), ]; $this->expectFailingValueValidation( 0, diff --git a/Tests/Fixtures/DummyCompoundConstraint.php b/Tests/Fixtures/DummyCompoundConstraint.php index 87253f25d..e4f7bafaa 100644 --- a/Tests/Fixtures/DummyCompoundConstraint.php +++ b/Tests/Fixtures/DummyCompoundConstraint.php @@ -22,7 +22,7 @@ protected function getConstraints(array $options): array { return [ new NotBlank(), - new Length(['max' => 3]), + new Length(max: 3), new Regex('/[a-z]+/'), new Regex('/[0-9]+/'), ]; diff --git a/Tests/Fixtures/DummyEntityConstraintWithoutNamedArguments.php b/Tests/Fixtures/DummyEntityConstraintWithoutNamedArguments.php new file mode 100644 index 000000000..880f73cae --- /dev/null +++ b/Tests/Fixtures/DummyEntityConstraintWithoutNamedArguments.php @@ -0,0 +1,16 @@ + + * + * 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 DummyEntityConstraintWithoutNamedArguments +{ +} diff --git a/Tests/Fixtures/EntityStaticCar.php b/Tests/Fixtures/EntityStaticCar.php index af90ddc74..3afaaf843 100644 --- a/Tests/Fixtures/EntityStaticCar.php +++ b/Tests/Fixtures/EntityStaticCar.php @@ -18,6 +18,6 @@ class EntityStaticCar extends EntityStaticVehicle { public static function loadValidatorMetadata(ClassMetadata $metadata) { - $metadata->addPropertyConstraint('wheels', new Length(['max' => 99])); + $metadata->addPropertyConstraint('wheels', new Length(max: 99)); } } diff --git a/Tests/Fixtures/EntityStaticCarTurbo.php b/Tests/Fixtures/EntityStaticCarTurbo.php index d559074db..cb0efe281 100644 --- a/Tests/Fixtures/EntityStaticCarTurbo.php +++ b/Tests/Fixtures/EntityStaticCarTurbo.php @@ -18,6 +18,6 @@ class EntityStaticCarTurbo extends EntityStaticCar { public static function loadValidatorMetadata(ClassMetadata $metadata) { - $metadata->addPropertyConstraint('wheels', new Length(['max' => 99])); + $metadata->addPropertyConstraint('wheels', new Length(max: 99)); } } diff --git a/Tests/Fixtures/EntityStaticVehicle.php b/Tests/Fixtures/EntityStaticVehicle.php index 1190318fa..429bffdeb 100644 --- a/Tests/Fixtures/EntityStaticVehicle.php +++ b/Tests/Fixtures/EntityStaticVehicle.php @@ -20,6 +20,6 @@ class EntityStaticVehicle public static function loadValidatorMetadata(ClassMetadata $metadata) { - $metadata->addPropertyConstraint('wheels', new Length(['max' => 99])); + $metadata->addPropertyConstraint('wheels', new Length(max: 99)); } } diff --git a/Tests/Mapping/Factory/LazyLoadingMetadataFactoryTest.php b/Tests/Mapping/Factory/LazyLoadingMetadataFactoryTest.php index d2250114f..68f279ecf 100644 --- a/Tests/Mapping/Factory/LazyLoadingMetadataFactoryTest.php +++ b/Tests/Mapping/Factory/LazyLoadingMetadataFactoryTest.php @@ -38,8 +38,8 @@ public function testLoadClassMetadataWithInterface() $metadata = $factory->getMetadataFor(self::PARENT_CLASS); $constraints = [ - new ConstraintA(['groups' => ['Default', 'EntityParent']]), - new ConstraintA(['groups' => ['Default', 'EntityInterfaceA', 'EntityParent']]), + new ConstraintA(groups: ['Default', 'EntityParent']), + new ConstraintA(groups: ['Default', 'EntityInterfaceA', 'EntityParent']), ]; $this->assertEquals($constraints, $metadata->getConstraints()); @@ -51,31 +51,31 @@ public function testMergeParentConstraints() $metadata = $factory->getMetadataFor(self::CLASS_NAME); $constraints = [ - new ConstraintA(['groups' => [ + new ConstraintA(groups: [ 'Default', 'Entity', - ]]), - new ConstraintA(['groups' => [ + ]), + new ConstraintA(groups: [ 'Default', 'EntityParent', 'Entity', - ]]), - new ConstraintA(['groups' => [ + ]), + new ConstraintA(groups: [ 'Default', 'EntityInterfaceA', 'EntityParent', 'Entity', - ]]), - new ConstraintA(['groups' => [ + ]), + new ConstraintA(groups: [ 'Default', 'EntityInterfaceB', 'Entity', - ]]), - new ConstraintA(['groups' => [ + ]), + new ConstraintA(groups: [ 'Default', 'EntityParentInterface', 'Entity', - ]]), + ]), ]; $this->assertEquals($constraints, $metadata->getConstraints()); @@ -87,8 +87,8 @@ public function testCachedMetadata() $factory = new LazyLoadingMetadataFactory(new TestLoader(), $cache); $expectedConstraints = [ - new ConstraintA(['groups' => ['Default', 'EntityParent']]), - new ConstraintA(['groups' => ['Default', 'EntityInterfaceA', 'EntityParent']]), + new ConstraintA(groups: ['Default', 'EntityParent']), + new ConstraintA(groups: ['Default', 'EntityInterfaceA', 'EntityParent']), ]; $metadata = $factory->getMetadataFor(self::PARENT_CLASS); diff --git a/Tests/Mapping/Loader/AttributeLoaderTest.php b/Tests/Mapping/Loader/AttributeLoaderTest.php index ca025431c..9285117f9 100644 --- a/Tests/Mapping/Loader/AttributeLoaderTest.php +++ b/Tests/Mapping/Loader/AttributeLoaderTest.php @@ -66,29 +66,29 @@ public function testLoadClassMetadata() $expected->addConstraint(new Sequentially([ new Expression('this.getFirstName() != null'), ])); - $expected->addConstraint(new Callback(['callback' => 'validateMe', 'payload' => 'foo'])); + $expected->addConstraint(new Callback(callback: 'validateMe', payload: 'foo')); $expected->addConstraint(new Callback('validateMeStatic')); $expected->addPropertyConstraint('firstName', new NotNull()); - $expected->addPropertyConstraint('firstName', new Range(['min' => 3])); - $expected->addPropertyConstraint('firstName', new All([new NotNull(), new Range(['min' => 3])])); - $expected->addPropertyConstraint('firstName', new All(['constraints' => [new NotNull(), new Range(['min' => 3])]])); - $expected->addPropertyConstraint('firstName', new Collection([ - 'foo' => [new NotNull(), new Range(['min' => 3])], - 'bar' => new Range(['min' => 5]), + $expected->addPropertyConstraint('firstName', new Range(min: 3)); + $expected->addPropertyConstraint('firstName', new All(constraints: [new NotNull(), new Range(min: 3)])); + $expected->addPropertyConstraint('firstName', new All(constraints: [new NotNull(), new Range(min: 3)])); + $expected->addPropertyConstraint('firstName', new Collection(fields: [ + 'foo' => [new NotNull(), new Range(min: 3)], + 'bar' => new Range(min: 5), 'baz' => new Required([new Email()]), 'qux' => new Optional([new NotBlank()]), - ], null, null, true)); - $expected->addPropertyConstraint('firstName', new Choice([ - 'message' => 'Must be one of %choices%', - 'choices' => ['A', 'B'], - ])); + ], allowExtraFields: true)); + $expected->addPropertyConstraint('firstName', new Choice( + message: 'Must be one of %choices%', + choices: ['A', 'B'], + )); $expected->addPropertyConstraint('firstName', new AtLeastOneOf([ new NotNull(), - new Range(['min' => 3]), + new Range(min: 3), ], null, null, 'foo', null, false)); $expected->addPropertyConstraint('firstName', new Sequentially([ new NotBlank(), - new Range(['min' => 5]), + new Range(min: 5), ])); $expected->addPropertyConstraint('childA', new Valid()); $expected->addPropertyConstraint('childB', new Valid()); @@ -152,29 +152,29 @@ public function testLoadClassMetadataAndMerge() $expected->addConstraint(new Sequentially([ new Expression('this.getFirstName() != null'), ])); - $expected->addConstraint(new Callback(['callback' => 'validateMe', 'payload' => 'foo'])); + $expected->addConstraint(new Callback(callback: 'validateMe', payload: 'foo')); $expected->addConstraint(new Callback('validateMeStatic')); $expected->addPropertyConstraint('firstName', new NotNull()); - $expected->addPropertyConstraint('firstName', new Range(['min' => 3])); - $expected->addPropertyConstraint('firstName', new All([new NotNull(), new Range(['min' => 3])])); - $expected->addPropertyConstraint('firstName', new All(['constraints' => [new NotNull(), new Range(['min' => 3])]])); - $expected->addPropertyConstraint('firstName', new Collection([ - 'foo' => [new NotNull(), new Range(['min' => 3])], - 'bar' => new Range(['min' => 5]), + $expected->addPropertyConstraint('firstName', new Range(min: 3)); + $expected->addPropertyConstraint('firstName', new All(constraints: [new NotNull(), new Range(min: 3)])); + $expected->addPropertyConstraint('firstName', new All(constraints: [new NotNull(), new Range(min: 3)])); + $expected->addPropertyConstraint('firstName', new Collection(fields: [ + 'foo' => [new NotNull(), new Range(min: 3)], + 'bar' => new Range(min: 5), 'baz' => new Required([new Email()]), 'qux' => new Optional([new NotBlank()]), - ], null, null, true)); - $expected->addPropertyConstraint('firstName', new Choice([ - 'message' => 'Must be one of %choices%', - 'choices' => ['A', 'B'], - ])); + ], allowExtraFields: true)); + $expected->addPropertyConstraint('firstName', new Choice( + message: 'Must be one of %choices%', + choices: ['A', 'B'], + )); $expected->addPropertyConstraint('firstName', new AtLeastOneOf([ new NotNull(), - new Range(['min' => 3]), + new Range(min: 3), ], null, null, 'foo', null, false)); $expected->addPropertyConstraint('firstName', new Sequentially([ new NotBlank(), - new Range(['min' => 5]), + new Range(min: 5), ])); $expected->addPropertyConstraint('childA', new Valid()); $expected->addPropertyConstraint('childB', new Valid()); diff --git a/Tests/Mapping/Loader/Fixtures/ConstraintWithoutNamedArguments.php b/Tests/Mapping/Loader/Fixtures/ConstraintWithoutNamedArguments.php new file mode 100644 index 000000000..035a1a837 --- /dev/null +++ b/Tests/Mapping/Loader/Fixtures/ConstraintWithoutNamedArguments.php @@ -0,0 +1,22 @@ + + * + * 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\Constraint; + +class ConstraintWithoutNamedArguments extends Constraint +{ + public function getTargets(): string + { + return self::CLASS_CONSTRAINT; + } +} diff --git a/Tests/Mapping/Loader/XmlFileLoaderTest.php b/Tests/Mapping/Loader/XmlFileLoaderTest.php index 2385dc888..bc8e4e72e 100644 --- a/Tests/Mapping/Loader/XmlFileLoaderTest.php +++ b/Tests/Mapping/Loader/XmlFileLoaderTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Tests\Mapping\Loader; use PHPUnit\Framework\TestCase; +use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait; use Symfony\Component\Validator\Constraints\All; use Symfony\Component\Validator\Constraints\Callback; use Symfony\Component\Validator\Constraints\Choice; @@ -29,6 +30,7 @@ use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; use Symfony\Component\Validator\Tests\Fixtures\ConstraintB; use Symfony\Component\Validator\Tests\Fixtures\ConstraintWithRequiredArgument; +use Symfony\Component\Validator\Tests\Fixtures\DummyEntityConstraintWithoutNamedArguments; use Symfony\Component\Validator\Tests\Fixtures\Entity_81; use Symfony\Component\Validator\Tests\Fixtures\NestedAttribute\Entity; use Symfony\Component\Validator\Tests\Fixtures\NestedAttribute\GroupSequenceProviderEntity; @@ -37,6 +39,8 @@ class XmlFileLoaderTest extends TestCase { + use ExpectUserDeprecationMessageTrait; + public function testLoadClassMetadataReturnsTrueIfSuccessful() { $loader = new XmlFileLoader(__DIR__.'/constraint-mapping.xml'); @@ -72,18 +76,18 @@ public function testLoadClassMetadata() $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 Range(min: 3)); $expected->addPropertyConstraint('firstName', new Choice(['A', 'B'])); - $expected->addPropertyConstraint('firstName', new All([new NotNull(), new Range(['min' => 3])])); - $expected->addPropertyConstraint('firstName', new All(['constraints' => [new NotNull(), new Range(['min' => 3])]])); - $expected->addPropertyConstraint('firstName', new Collection(['fields' => [ - 'foo' => [new NotNull(), new Range(['min' => 3])], - 'bar' => [new Range(['min' => 5])], - ]])); - $expected->addPropertyConstraint('firstName', new Choice([ - 'message' => 'Must be one of %choices%', - 'choices' => ['A', 'B'], + $expected->addPropertyConstraint('firstName', new All(constraints: [new NotNull(), new Range(min: 3)])); + $expected->addPropertyConstraint('firstName', new All(constraints: [new NotNull(), new Range(min: 3)])); + $expected->addPropertyConstraint('firstName', new Collection(fields: [ + 'foo' => [new NotNull(), new Range(min: 3)], + 'bar' => [new Range(min: 5)], ])); + $expected->addPropertyConstraint('firstName', new Choice( + message: 'Must be one of %choices%', + choices: ['A', 'B'], + )); $expected->addGetterConstraint('lastName', new NotNull()); $expected->addGetterConstraint('valid', new IsTrue()); $expected->addGetterConstraint('permissions', new IsTrue()); @@ -99,7 +103,7 @@ public function testLoadClassMetadataWithNonStrings() $loader->loadClassMetadata($metadata); $expected = new ClassMetadata(Entity::class); - $expected->addPropertyConstraint('firstName', new Regex(['pattern' => '/^1/', 'match' => false])); + $expected->addPropertyConstraint('firstName', new Regex(pattern: '/^1/', match: false)); $properties = $metadata->getPropertyMetadata('firstName'); $constraints = $properties[0]->getConstraints(); @@ -171,4 +175,17 @@ public function testDoNotModifyStateIfExceptionIsThrown() $loader->loadClassMetadata($metadata); } } + + /** + * @group legacy + */ + public function testLoadConstraintWithoutNamedArgumentsSupport() + { + $loader = new XmlFileLoader(__DIR__.'/constraint-without-named-arguments-support.xml'); + $metadata = new ClassMetadata(DummyEntityConstraintWithoutNamedArguments::class); + + $this->expectUserDeprecationMessage('Since symfony/validator 7.2: Using constraints not supporting named arguments is deprecated. Try adding the HasNamedArguments attribute to Symfony\Component\Validator\Tests\Mapping\Loader\Fixtures\ConstraintWithoutNamedArguments.'); + + $loader->loadClassMetadata($metadata); + } } diff --git a/Tests/Mapping/Loader/YamlFileLoaderTest.php b/Tests/Mapping/Loader/YamlFileLoaderTest.php index 75955c09f..b496663f1 100644 --- a/Tests/Mapping/Loader/YamlFileLoaderTest.php +++ b/Tests/Mapping/Loader/YamlFileLoaderTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Tests\Mapping\Loader; use PHPUnit\Framework\TestCase; +use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait; use Symfony\Component\Validator\Constraints\All; use Symfony\Component\Validator\Constraints\Callback; use Symfony\Component\Validator\Constraints\Choice; @@ -26,6 +27,7 @@ use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; use Symfony\Component\Validator\Tests\Fixtures\ConstraintB; use Symfony\Component\Validator\Tests\Fixtures\ConstraintWithRequiredArgument; +use Symfony\Component\Validator\Tests\Fixtures\DummyEntityConstraintWithoutNamedArguments; use Symfony\Component\Validator\Tests\Fixtures\Entity_81; use Symfony\Component\Validator\Tests\Fixtures\NestedAttribute\Entity; use Symfony\Component\Validator\Tests\Fixtures\NestedAttribute\GroupSequenceProviderEntity; @@ -34,6 +36,8 @@ class YamlFileLoaderTest extends TestCase { + use ExpectUserDeprecationMessageTrait; + public function testLoadClassMetadataReturnsFalseIfEmpty() { $loader = new YamlFileLoader(__DIR__.'/empty-mapping.yml'); @@ -116,18 +120,18 @@ public function testLoadClassMetadata() $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 Range(min: 3)); $expected->addPropertyConstraint('firstName', new Choice(['A', 'B'])); - $expected->addPropertyConstraint('firstName', new All([new NotNull(), new Range(['min' => 3])])); - $expected->addPropertyConstraint('firstName', new All(['constraints' => [new NotNull(), new Range(['min' => 3])]])); - $expected->addPropertyConstraint('firstName', new Collection(['fields' => [ - 'foo' => [new NotNull(), new Range(['min' => 3])], - 'bar' => [new Range(['min' => 5])], - ]])); - $expected->addPropertyConstraint('firstName', new Choice([ - 'message' => 'Must be one of %choices%', - 'choices' => ['A', 'B'], + $expected->addPropertyConstraint('firstName', new All(constraints: [new NotNull(), new Range(min: 3)])); + $expected->addPropertyConstraint('firstName', new All(constraints: [new NotNull(), new Range(min: 3)])); + $expected->addPropertyConstraint('firstName', new Collection(fields: [ + 'foo' => [new NotNull(), new Range(min: 3)], + 'bar' => [new Range(min: 5)], ])); + $expected->addPropertyConstraint('firstName', new Choice( + message: 'Must be one of %choices%', + choices: ['A', 'B'], + )); $expected->addGetterConstraint('lastName', new NotNull()); $expected->addGetterConstraint('valid', new IsTrue()); $expected->addGetterConstraint('permissions', new IsTrue()); @@ -143,7 +147,7 @@ public function testLoadClassMetadataWithConstants() $loader->loadClassMetadata($metadata); $expected = new ClassMetadata(Entity::class); - $expected->addPropertyConstraint('firstName', new Range(['max' => \PHP_INT_MAX])); + $expected->addPropertyConstraint('firstName', new Range(max: \PHP_INT_MAX)); $this->assertEquals($expected, $metadata); } @@ -187,4 +191,17 @@ public function testLoadGroupProvider() $this->assertEquals($expected, $metadata); } + + /** + * @group legacy + */ + public function testLoadConstraintWithoutNamedArgumentsSupport() + { + $loader = new YamlFileLoader(__DIR__.'/constraint-without-named-arguments-support.yml'); + $metadata = new ClassMetadata(DummyEntityConstraintWithoutNamedArguments::class); + + $this->expectUserDeprecationMessage('Since symfony/validator 7.2: Using constraints not supporting named arguments is deprecated. Try adding the HasNamedArguments attribute to Symfony\Component\Validator\Tests\Mapping\Loader\Fixtures\ConstraintWithoutNamedArguments.'); + + $loader->loadClassMetadata($metadata); + } } diff --git a/Tests/Mapping/Loader/constraint-without-named-arguments-support.xml b/Tests/Mapping/Loader/constraint-without-named-arguments-support.xml new file mode 100644 index 000000000..48321b174 --- /dev/null +++ b/Tests/Mapping/Loader/constraint-without-named-arguments-support.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/Tests/Mapping/Loader/constraint-without-named-arguments-support.yml b/Tests/Mapping/Loader/constraint-without-named-arguments-support.yml new file mode 100644 index 000000000..3e25b78e4 --- /dev/null +++ b/Tests/Mapping/Loader/constraint-without-named-arguments-support.yml @@ -0,0 +1,4 @@ +Symfony\Component\Validator\Tests\Fixtures\DummyEntityConstraintWithoutNamedArguments: + constraints: + - Symfony\Component\Validator\Tests\Mapping\Loader\Fixtures\ConstraintWithoutNamedArguments: + groups: foo diff --git a/Tests/Mapping/MemberMetadataTest.php b/Tests/Mapping/MemberMetadataTest.php index cd429e676..84d047f10 100644 --- a/Tests/Mapping/MemberMetadataTest.php +++ b/Tests/Mapping/MemberMetadataTest.php @@ -84,7 +84,7 @@ public function testSerialize() public function testSerializeCollectionCascaded() { - $this->metadata->addConstraint(new Valid(['traverse' => true])); + $this->metadata->addConstraint(new Valid(traverse: true)); $metadata = unserialize(serialize($this->metadata)); @@ -93,7 +93,7 @@ public function testSerializeCollectionCascaded() public function testSerializeCollectionNotCascaded() { - $this->metadata->addConstraint(new Valid(['traverse' => false])); + $this->metadata->addConstraint(new Valid(traverse: false)); $metadata = unserialize(serialize($this->metadata)); diff --git a/Tests/Validator/RecursiveValidatorTest.php b/Tests/Validator/RecursiveValidatorTest.php index ee183a1bf..91449f72e 100644 --- a/Tests/Validator/RecursiveValidatorTest.php +++ b/Tests/Validator/RecursiveValidatorTest.php @@ -113,10 +113,10 @@ public function testValidate() $context->addViolation('Message %param%', ['%param%' => 'value']); }; - $constraint = new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ]); + $constraint = new Callback( + callback: $callback, + groups: ['Group'], + ); $violations = $this->validate('Bernhard', $constraint, 'Group'); @@ -149,10 +149,10 @@ public function testClassConstraint() $context->addViolation('Message %param%', ['%param%' => 'value']); }; - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->metadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($entity, null, 'Group'); @@ -188,10 +188,10 @@ public function testPropertyConstraint() $context->addViolation('Message %param%', ['%param%' => 'value']); }; - $this->metadata->addPropertyConstraint('firstName', new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->metadata->addPropertyConstraint('firstName', new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($entity, null, 'Group'); @@ -227,10 +227,10 @@ public function testGetterConstraint() $context->addViolation('Message %param%', ['%param%' => 'value']); }; - $this->metadata->addGetterConstraint('lastName', new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->metadata->addGetterConstraint('lastName', new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($entity, null, 'Group'); @@ -264,10 +264,10 @@ public function testArray() $context->addViolation('Message %param%', ['%param%' => 'value']); }; - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->metadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($array, null, 'Group'); @@ -301,10 +301,10 @@ public function testRecursiveArray() $context->addViolation('Message %param%', ['%param%' => 'value']); }; - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->metadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($array, null, 'Group'); @@ -338,10 +338,10 @@ public function testTraversable() $context->addViolation('Message %param%', ['%param%' => 'value']); }; - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->metadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($traversable, null, 'Group'); @@ -377,10 +377,10 @@ public function testRecursiveTraversable() $context->addViolation('Message %param%', ['%param%' => 'value']); }; - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->metadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($traversable, null, 'Group'); @@ -415,10 +415,10 @@ public function testReferenceClassConstraint() }; $this->metadata->addPropertyConstraint('reference', new Valid()); - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($entity, null, 'Group'); @@ -456,10 +456,10 @@ public function testReferencePropertyConstraint() }; $this->metadata->addPropertyConstraint('reference', new Valid()); - $this->referenceMetadata->addPropertyConstraint('value', new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->referenceMetadata->addPropertyConstraint('value', new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($entity, null, 'Group'); @@ -497,10 +497,10 @@ public function testReferenceGetterConstraint() }; $this->metadata->addPropertyConstraint('reference', new Valid()); - $this->referenceMetadata->addPropertyConstraint('privateValue', new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->referenceMetadata->addPropertyConstraint('privateValue', new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($entity, null, 'Group'); @@ -563,10 +563,10 @@ public function testArrayReference($constraintMethod) }; $this->metadata->$constraintMethod('reference', new Valid()); - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($entity, null, 'Group'); @@ -604,10 +604,10 @@ public function testRecursiveArrayReference($constraintMethod) }; $this->metadata->$constraintMethod('reference', new Valid()); - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($entity, null, 'Group'); @@ -632,14 +632,14 @@ public function testOnlyCascadedArraysAreTraversed() $context->addViolation('Message %param%', ['%param%' => 'value']); }; - $this->metadata->addPropertyConstraint('reference', new Callback([ - 'callback' => function () {}, - 'groups' => 'Group', - ])); - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->metadata->addPropertyConstraint('reference', new Callback( + callback: function () {}, + groups: ['Group'], + )); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($entity, null, 'Group'); @@ -659,9 +659,9 @@ public function testArrayTraversalCannotBeDisabled($constraintMethod) $context->addViolation('Message %param%', ['%param%' => 'value']); }; - $this->metadata->$constraintMethod('reference', new Valid([ - 'traverse' => false, - ])); + $this->metadata->$constraintMethod('reference', new Valid( + traverse: false, + )); $this->referenceMetadata->addConstraint(new Callback($callback)); $violations = $this->validate($entity); @@ -682,9 +682,9 @@ public function testRecursiveArrayTraversalCannotBeDisabled($constraintMethod) $context->addViolation('Message %param%', ['%param%' => 'value']); }; - $this->metadata->$constraintMethod('reference', new Valid([ - 'traverse' => false, - ])); + $this->metadata->$constraintMethod('reference', new Valid( + traverse: false, + )); $this->referenceMetadata->addConstraint(new Callback($callback)); @@ -745,10 +745,10 @@ public function testTraversableReference() }; $this->metadata->addPropertyConstraint('reference', new Valid()); - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($entity, null, 'Group'); @@ -774,9 +774,9 @@ public function testDisableTraversableTraversal() }; $this->metadataFactory->addMetadata(new ClassMetadata('ArrayIterator')); - $this->metadata->addPropertyConstraint('reference', new Valid([ - 'traverse' => false, - ])); + $this->metadata->addPropertyConstraint('reference', new Valid( + traverse: false, + )); $this->referenceMetadata->addConstraint(new Callback($callback)); $violations = $this->validate($entity); @@ -790,9 +790,9 @@ public function testMetadataMustExistIfTraversalIsDisabled() $entity = new Entity(); $entity->reference = new \ArrayIterator(); - $this->metadata->addPropertyConstraint('reference', new Valid([ - 'traverse' => false, - ])); + $this->metadata->addPropertyConstraint('reference', new Valid( + traverse: false, + )); $this->expectException(NoSuchMetadataException::class); @@ -819,13 +819,13 @@ public function testEnableRecursiveTraversableTraversal() $context->addViolation('Message %param%', ['%param%' => 'value']); }; - $this->metadata->addPropertyConstraint('reference', new Valid([ - 'traverse' => true, - ])); - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->metadata->addPropertyConstraint('reference', new Valid( + traverse: true, + )); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($entity, null, 'Group'); @@ -866,14 +866,14 @@ public function testValidateProperty() $context->addViolation('Other violation'); }; - $this->metadata->addPropertyConstraint('firstName', new Callback([ - 'callback' => $callback1, - 'groups' => 'Group', - ])); - $this->metadata->addPropertyConstraint('lastName', new Callback([ - 'callback' => $callback2, - 'groups' => 'Group', - ])); + $this->metadata->addPropertyConstraint('firstName', new Callback( + callback: $callback1, + groups: ['Group'], + )); + $this->metadata->addPropertyConstraint('lastName', new Callback( + callback: $callback2, + groups: ['Group'], + )); $violations = $this->validateProperty($entity, 'firstName', 'Group'); @@ -924,14 +924,14 @@ public function testValidatePropertyValue() $context->addViolation('Other violation'); }; - $this->metadata->addPropertyConstraint('firstName', new Callback([ - 'callback' => $callback1, - 'groups' => 'Group', - ])); - $this->metadata->addPropertyConstraint('lastName', new Callback([ - 'callback' => $callback2, - 'groups' => 'Group', - ])); + $this->metadata->addPropertyConstraint('firstName', new Callback( + callback: $callback1, + groups: ['Group'], + )); + $this->metadata->addPropertyConstraint('lastName', new Callback( + callback: $callback2, + groups: ['Group'], + )); $violations = $this->validatePropertyValue( $entity, @@ -973,14 +973,14 @@ public function testValidatePropertyValueWithClassName() $context->addViolation('Other violation'); }; - $this->metadata->addPropertyConstraint('firstName', new Callback([ - 'callback' => $callback1, - 'groups' => 'Group', - ])); - $this->metadata->addPropertyConstraint('lastName', new Callback([ - 'callback' => $callback2, - 'groups' => 'Group', - ])); + $this->metadata->addPropertyConstraint('firstName', new Callback( + callback: $callback1, + groups: ['Group'], + )); + $this->metadata->addPropertyConstraint('lastName', new Callback( + callback: $callback2, + groups: ['Group'], + )); $violations = $this->validatePropertyValue( self::ENTITY_CLASS, @@ -1060,14 +1060,14 @@ public function testValidateSingleGroup() $context->addViolation('Message'); }; - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group 1', - ])); - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group 2', - ])); + $this->metadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group 1'], + )); + $this->metadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group 2'], + )); $violations = $this->validate($entity, null, 'Group 2'); @@ -1083,14 +1083,14 @@ public function testValidateMultipleGroups() $context->addViolation('Message'); }; - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group 1', - ])); - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group 2', - ])); + $this->metadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group 1'], + )); + $this->metadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group 2'], + )); $violations = $this->validate($entity, null, ['Group 1', 'Group 2']); @@ -1109,18 +1109,18 @@ public function testReplaceDefaultGroupByGroupSequenceObject() $context->addViolation('Violation in Group 3'); }; - $this->metadata->addConstraint(new Callback([ - 'callback' => function () {}, - 'groups' => 'Group 1', - ])); - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback1, - 'groups' => 'Group 2', - ])); - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback2, - 'groups' => 'Group 3', - ])); + $this->metadata->addConstraint(new Callback( + callback: function () {}, + groups: ['Group 1'], + )); + $this->metadata->addConstraint(new Callback( + callback: $callback1, + groups: ['Group 2'], + )); + $this->metadata->addConstraint(new Callback( + callback: $callback2, + groups: ['Group 3'], + )); $sequence = new GroupSequence(['Group 1', 'Group 2', 'Group 3', 'Entity']); $this->metadata->setGroupSequence($sequence); @@ -1143,18 +1143,18 @@ public function testReplaceDefaultGroupByGroupSequenceArray() $context->addViolation('Violation in Group 3'); }; - $this->metadata->addConstraint(new Callback([ - 'callback' => function () {}, - 'groups' => 'Group 1', - ])); - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback1, - 'groups' => 'Group 2', - ])); - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback2, - 'groups' => 'Group 3', - ])); + $this->metadata->addConstraint(new Callback( + callback: function () {}, + groups: ['Group 1'], + )); + $this->metadata->addConstraint(new Callback( + callback: $callback1, + groups: ['Group 2'], + )); + $this->metadata->addConstraint(new Callback( + callback: $callback2, + groups: ['Group 3'], + )); $sequence = ['Group 1', 'Group 2', 'Group 3', 'Entity']; $this->metadata->setGroupSequence($sequence); @@ -1179,14 +1179,14 @@ public function testPropagateDefaultGroupToReferenceWhenReplacingDefaultGroup() }; $this->metadata->addPropertyConstraint('reference', new Valid()); - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback1, - 'groups' => 'Default', - ])); - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback2, - 'groups' => 'Group 1', - ])); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback1, + groups: ['Default'], + )); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback2, + groups: ['Group 1'], + )); $sequence = new GroupSequence(['Group 1', 'Entity']); $this->metadata->setGroupSequence($sequence); @@ -1209,14 +1209,14 @@ public function testValidateCustomGroupWhenDefaultGroupWasReplaced() $context->addViolation('Violation in group sequence'); }; - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback1, - 'groups' => 'Other Group', - ])); - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback2, - 'groups' => 'Group 1', - ])); + $this->metadata->addConstraint(new Callback( + callback: $callback1, + groups: ['Other Group'], + )); + $this->metadata->addConstraint(new Callback( + callback: $callback2, + groups: ['Group 1'], + )); $sequence = new GroupSequence(['Group 1', 'Entity']); $this->metadata->setGroupSequence($sequence); @@ -1243,18 +1243,18 @@ public function testReplaceDefaultGroup($sequence, array $assertViolations) }; $metadata = new ClassMetadata($entity::class); - $metadata->addConstraint(new Callback([ - 'callback' => function () {}, - 'groups' => 'Group 1', - ])); - $metadata->addConstraint(new Callback([ - 'callback' => $callback1, - 'groups' => 'Group 2', - ])); - $metadata->addConstraint(new Callback([ - 'callback' => $callback2, - 'groups' => 'Group 3', - ])); + $metadata->addConstraint(new Callback( + callback: function () {}, + groups: ['Group 1'], + )); + $metadata->addConstraint(new Callback( + callback: $callback1, + groups: ['Group 2'], + )); + $metadata->addConstraint(new Callback( + callback: $callback2, + groups: ['Group 3'], + )); $metadata->setGroupSequenceProvider(true); $this->metadataFactory->addMetadata($metadata); @@ -1348,18 +1348,18 @@ public function testGroupSequenceAbortsAfterFailedGroup() $context->addViolation('Message 2'); }; - $this->metadata->addConstraint(new Callback([ - 'callback' => function () {}, - 'groups' => 'Group 1', - ])); - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback1, - 'groups' => 'Group 2', - ])); - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback2, - 'groups' => 'Group 3', - ])); + $this->metadata->addConstraint(new Callback( + callback: function () {}, + groups: ['Group 1'], + )); + $this->metadata->addConstraint(new Callback( + callback: $callback1, + groups: ['Group 2'], + )); + $this->metadata->addConstraint(new Callback( + callback: $callback2, + groups: ['Group 3'], + )); $sequence = new GroupSequence(['Group 1', 'Group 2', 'Group 3']); $violations = $this->validator->validate($entity, new Valid(), $sequence); @@ -1382,14 +1382,14 @@ public function testGroupSequenceIncludesReferences() }; $this->metadata->addPropertyConstraint('reference', new Valid()); - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback1, - 'groups' => 'Group 1', - ])); - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback2, - 'groups' => 'Group 2', - ])); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback1, + groups: ['Group 1'], + )); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback2, + groups: ['Group 2'], + )); $sequence = new GroupSequence(['Group 1', 'Entity']); $violations = $this->validator->validate($entity, new Valid(), $sequence); @@ -1442,14 +1442,14 @@ public function testValidateInSeparateContext() $context->addViolation('Message %param%', ['%param%' => 'value']); }; - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback1, - 'groups' => 'Group', - ])); - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback2, - 'groups' => 'Group', - ])); + $this->metadata->addConstraint(new Callback( + callback: $callback1, + groups: ['Group'], + )); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback2, + groups: ['Group'], + )); $violations = $this->validator->validate($entity, new Valid(), 'Group'); @@ -1498,14 +1498,14 @@ public function testValidateInContext() $context->addViolation('Message %param%', ['%param%' => 'value']); }; - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback1, - 'groups' => 'Group', - ])); - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback2, - 'groups' => 'Group', - ])); + $this->metadata->addConstraint(new Callback( + callback: $callback1, + groups: ['Group'], + )); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback2, + groups: ['Group'], + )); $violations = $this->validator->validate($entity, new Valid(), 'Group'); @@ -1561,14 +1561,14 @@ public function testValidateArrayInContext() $context->addViolation('Message %param%', ['%param%' => 'value']); }; - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback1, - 'groups' => 'Group', - ])); - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback2, - 'groups' => 'Group', - ])); + $this->metadata->addConstraint(new Callback( + callback: $callback1, + groups: ['Group'], + )); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback2, + groups: ['Group'], + )); $violations = $this->validator->validate($entity, new Valid(), 'Group'); @@ -1603,10 +1603,10 @@ public function testTraverseTraversableByDefault() }; $this->metadataFactory->addMetadata(new ClassMetadata('ArrayIterator')); - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->metadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($traversable, new Valid(), 'Group'); @@ -1635,10 +1635,10 @@ public function testTraversalEnabledOnClass() $traversableMetadata->addConstraint(new Traverse(true)); $this->metadataFactory->addMetadata($traversableMetadata); - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->metadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($traversable, new Valid(), 'Group'); @@ -1659,10 +1659,10 @@ public function testTraversalDisabledOnClass() $traversableMetadata->addConstraint(new Traverse(false)); $this->metadataFactory->addMetadata($traversableMetadata); - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->metadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($traversable, new Valid(), 'Group'); @@ -1692,10 +1692,10 @@ public function testReferenceTraversalDisabledOnClass() $traversableMetadata->addConstraint(new Traverse(false)); $this->metadataFactory->addMetadata($traversableMetadata); - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $this->metadata->addPropertyConstraint('reference', new Valid()); $violations = $this->validate($entity, new Valid(), 'Group'); @@ -1717,13 +1717,13 @@ public function testReferenceTraversalEnabledOnReferenceDisabledOnClass() $traversableMetadata->addConstraint(new Traverse(false)); $this->metadataFactory->addMetadata($traversableMetadata); - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); - $this->metadata->addPropertyConstraint('reference', new Valid([ - 'traverse' => true, - ])); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); + $this->metadata->addPropertyConstraint('reference', new Valid( + traverse: true, + )); $violations = $this->validate($entity, new Valid(), 'Group'); @@ -1744,13 +1744,13 @@ public function testReferenceTraversalDisabledOnReferenceEnabledOnClass() $traversableMetadata->addConstraint(new Traverse(true)); $this->metadataFactory->addMetadata($traversableMetadata); - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); - $this->metadata->addPropertyConstraint('reference', new Valid([ - 'traverse' => false, - ])); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); + $this->metadata->addPropertyConstraint('reference', new Valid( + traverse: false, + )); $violations = $this->validate($entity, new Valid(), 'Group'); @@ -1767,10 +1767,10 @@ public function testReferenceCascadeDisabledByDefault() $this->fail('Should not be called'); }; - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($entity, new Valid(), 'Group'); @@ -1789,10 +1789,10 @@ public function testReferenceCascadeEnabledIgnoresUntyped() $this->fail('Should not be called'); }; - $this->referenceMetadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $this->referenceMetadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $violations = $this->validate($entity, new Valid(), 'Group'); @@ -1816,10 +1816,10 @@ public function testTypedReferenceCascadeEnabled() $cascadingMetadata->addConstraint(new Cascade()); $cascadedMetadata = new ClassMetadata(CascadedChild::class); - $cascadedMetadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => 'Group', - ])); + $cascadedMetadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group'], + )); $this->metadataFactory->addMetadata($cascadingMetadata); $this->metadataFactory->addMetadata($cascadedMetadata); @@ -1868,10 +1868,10 @@ public function testNoDuplicateValidationIfClassConstraintInMultipleGroups() $context->addViolation('Message'); }; - $this->metadata->addConstraint(new Callback([ - 'callback' => $callback, - 'groups' => ['Group 1', 'Group 2'], - ])); + $this->metadata->addConstraint(new Callback( + callback: $callback, + groups: ['Group 1', 'Group 2'], + )); $violations = $this->validator->validate($entity, new Valid(), ['Group 1', 'Group 2']); @@ -1887,10 +1887,10 @@ public function testNoDuplicateValidationIfPropertyConstraintInMultipleGroups() $context->addViolation('Message'); }; - $this->metadata->addPropertyConstraint('firstName', new Callback([ - 'callback' => $callback, - 'groups' => ['Group 1', 'Group 2'], - ])); + $this->metadata->addPropertyConstraint('firstName', new Callback( + callback: $callback, + groups: ['Group 1', 'Group 2'], + )); $violations = $this->validator->validate($entity, new Valid(), ['Group 1', 'Group 2']); @@ -2007,8 +2007,8 @@ public function testNestedObjectIsNotValidatedIfGroupInValidConstraintIsNotValid $reference->value = ''; $entity->childA = $reference; - $this->metadata->addPropertyConstraint('firstName', new NotBlank(['groups' => 'group1'])); - $this->metadata->addPropertyConstraint('childA', new Valid(['groups' => 'group1'])); + $this->metadata->addPropertyConstraint('firstName', new NotBlank(groups: ['group1'])); + $this->metadata->addPropertyConstraint('childA', new Valid(groups: ['group1'])); $this->referenceMetadata->addPropertyConstraint('value', new NotBlank()); $violations = $this->validator->validate($entity, null, []); @@ -2024,9 +2024,9 @@ public function testNestedObjectIsValidatedIfGroupInValidConstraintIsValidated() $reference->value = ''; $entity->childA = $reference; - $this->metadata->addPropertyConstraint('firstName', new NotBlank(['groups' => 'group1'])); - $this->metadata->addPropertyConstraint('childA', new Valid(['groups' => 'group1'])); - $this->referenceMetadata->addPropertyConstraint('value', new NotBlank(['groups' => 'group1'])); + $this->metadata->addPropertyConstraint('firstName', new NotBlank(groups: ['group1'])); + $this->metadata->addPropertyConstraint('childA', new Valid(groups: ['group1'])); + $this->referenceMetadata->addPropertyConstraint('value', new NotBlank(groups: ['group1'])); $violations = $this->validator->validate($entity, null, ['Default', 'group1']); @@ -2044,10 +2044,10 @@ public function testNestedObjectIsValidatedInMultipleGroupsIfGroupInValidConstra $entity->childA = $reference; $this->metadata->addPropertyConstraint('firstName', new NotBlank()); - $this->metadata->addPropertyConstraint('childA', new Valid(['groups' => ['group1', 'group2']])); + $this->metadata->addPropertyConstraint('childA', new Valid(groups: ['group1', 'group2'])); - $this->referenceMetadata->addPropertyConstraint('value', new NotBlank(['groups' => 'group1'])); - $this->referenceMetadata->addPropertyConstraint('value', new NotNull(['groups' => 'group2'])); + $this->referenceMetadata->addPropertyConstraint('value', new NotBlank(groups: ['group1'])); + $this->referenceMetadata->addPropertyConstraint('value', new NotNull(groups: ['group2'])); $violations = $this->validator->validate($entity, null, ['Default', 'group1', 'group2']); @@ -2136,10 +2136,10 @@ public function testRelationBetweenChildAAndChildB() public function testCollectionConstraintValidateAllGroupsForNestedConstraints() { - $this->metadata->addPropertyConstraint('data', new Collection(['fields' => [ - 'one' => [new NotBlank(['groups' => 'one']), new Length(['min' => 2, 'groups' => 'two'])], - 'two' => [new NotBlank(['groups' => 'two'])], - ]])); + $this->metadata->addPropertyConstraint('data', new Collection(fields: [ + 'one' => [new NotBlank(groups: ['one']), new Length(min: 2, groups: ['two'])], + 'two' => [new NotBlank(groups: ['two'])], + ])); $entity = new Entity(); $entity->data = ['one' => 't', 'two' => '']; @@ -2154,9 +2154,9 @@ public function testCollectionConstraintValidateAllGroupsForNestedConstraints() public function testGroupedMethodConstraintValidateInSequence() { $metadata = new ClassMetadata(EntityWithGroupedConstraintOnMethods::class); - $metadata->addPropertyConstraint('bar', new NotNull(['groups' => 'Foo'])); - $metadata->addGetterMethodConstraint('validInFoo', 'isValidInFoo', new IsTrue(['groups' => 'Foo'])); - $metadata->addGetterMethodConstraint('bar', 'getBar', new NotNull(['groups' => 'Bar'])); + $metadata->addPropertyConstraint('bar', new NotNull(groups: ['Foo'])); + $metadata->addGetterMethodConstraint('validInFoo', 'isValidInFoo', new IsTrue(groups: ['Foo'])); + $metadata->addGetterMethodConstraint('bar', 'getBar', new NotNull(groups: ['Bar'])); $this->metadataFactory->addMetadata($metadata); @@ -2197,10 +2197,13 @@ public function testNotNullConstraintOnGetterReturningNull() public function testAllConstraintValidateAllGroupsForNestedConstraints() { - $this->metadata->addPropertyConstraint('data', new All(['constraints' => [ - new NotBlank(['groups' => 'one']), - new Length(['min' => 2, 'groups' => 'two']), - ]])); + $this->metadata->addPropertyConstraint('data', new All(constraints: [ + new NotBlank(groups: ['one']), + new Length( + min: 2, + groups: ['two'], + ), + ])); $entity = new Entity(); $entity->data = ['one' => 't', 'two' => '']; @@ -2330,8 +2333,8 @@ public function testValidateWithExplicitCascade() public function testValidatedConstraintsHashesDoNotCollide() { $metadata = new ClassMetadata(Entity::class); - $metadata->addPropertyConstraint('initialized', new NotNull(['groups' => 'should_pass'])); - $metadata->addPropertyConstraint('initialized', new IsNull(['groups' => 'should_fail'])); + $metadata->addPropertyConstraint('initialized', new NotNull(groups: ['should_pass'])); + $metadata->addPropertyConstraint('initialized', new IsNull(groups: ['should_fail'])); $this->metadataFactory->addMetadata($metadata); From 388a47591870990a26b6f9c6d93be64f19242d73 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 20 Jan 2025 15:01:44 +0100 Subject: [PATCH 08/74] [Validator] Fix constraints deprecations --- Constraints/AbstractComparison.php | 4 ++-- Constraints/All.php | 2 +- Constraints/AtLeastOneOf.php | 2 +- Constraints/Bic.php | 4 ++-- Constraints/Blank.php | 4 ++-- Constraints/Callback.php | 6 +++--- Constraints/CardScheme.php | 4 ++-- Constraints/Cascade.php | 4 ++-- Constraints/Choice.php | 2 +- Constraints/Cidr.php | 4 ++-- Constraints/Collection.php | 2 +- Constraints/Count.php | 4 ++-- Constraints/Country.php | 4 ++-- Constraints/CssColor.php | 2 +- Constraints/Currency.php | 4 ++-- Constraints/Date.php | 4 ++-- Constraints/DateTime.php | 4 ++-- Constraints/DisableAutoMapping.php | 2 +- Constraints/Email.php | 4 ++-- Constraints/EnableAutoMapping.php | 2 +- Constraints/Expression.php | 4 ++-- Constraints/ExpressionSyntax.php | 4 ++-- Constraints/File.php | 4 ++-- Constraints/Hostname.php | 4 ++-- Constraints/Iban.php | 4 ++-- Constraints/Ip.php | 4 ++-- Constraints/IsFalse.php | 4 ++-- Constraints/IsNull.php | 4 ++-- Constraints/IsTrue.php | 4 ++-- Constraints/Isbn.php | 4 ++-- Constraints/Isin.php | 4 ++-- Constraints/Issn.php | 4 ++-- Constraints/Json.php | 4 ++-- Constraints/Language.php | 4 ++-- Constraints/Length.php | 4 ++-- Constraints/Locale.php | 4 ++-- Constraints/Luhn.php | 4 ++-- Constraints/NoSuspiciousCharacters.php | 4 ++-- Constraints/NotBlank.php | 4 ++-- Constraints/NotCompromisedPassword.php | 4 ++-- Constraints/NotNull.php | 4 ++-- Constraints/PasswordStrength.php | 4 ++-- Constraints/Range.php | 4 ++-- Constraints/Regex.php | 4 ++-- Constraints/Sequentially.php | 2 +- Constraints/Time.php | 4 ++-- Constraints/Timezone.php | 4 ++-- Constraints/Traverse.php | 2 +- Constraints/Type.php | 6 +++--- Constraints/Ulid.php | 4 ++-- Constraints/Unique.php | 4 ++-- Constraints/Url.php | 4 ++-- Constraints/Uuid.php | 4 ++-- Constraints/Valid.php | 4 ++-- Constraints/When.php | 4 ++-- Constraints/ZeroComparisonConstraintTrait.php | 2 +- Tests/Constraints/RangeTest.php | 2 +- 57 files changed, 105 insertions(+), 105 deletions(-) diff --git a/Constraints/AbstractComparison.php b/Constraints/AbstractComparison.php index 1b4629c43..3830da789 100644 --- a/Constraints/AbstractComparison.php +++ b/Constraints/AbstractComparison.php @@ -33,12 +33,12 @@ abstract class AbstractComparison extends Constraint public function __construct(mixed $value = null, ?string $propertyPath = null, ?string $message = null, ?array $groups = null, mixed $payload = null, ?array $options = null) { if (\is_array($value)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); $options = array_merge($value, $options ?? []); } elseif (null !== $value) { if (\is_array($options)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } else { $options = []; } diff --git a/Constraints/All.php b/Constraints/All.php index bbaa9a9a5..9bb60ba5d 100644 --- a/Constraints/All.php +++ b/Constraints/All.php @@ -33,7 +33,7 @@ class All extends Composite public function __construct(mixed $constraints = null, ?array $groups = null, mixed $payload = null) { if (\is_array($constraints) && !array_is_list($constraints)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($constraints ?? [], $groups, $payload); diff --git a/Constraints/AtLeastOneOf.php b/Constraints/AtLeastOneOf.php index a03ca7f7a..b20ea0df0 100644 --- a/Constraints/AtLeastOneOf.php +++ b/Constraints/AtLeastOneOf.php @@ -42,7 +42,7 @@ class AtLeastOneOf extends Composite public function __construct(mixed $constraints = null, ?array $groups = null, mixed $payload = null, ?string $message = null, ?string $messageCollection = null, ?bool $includeInternalMessages = null) { if (\is_array($constraints) && !array_is_list($constraints)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($constraints ?? [], $groups, $payload); diff --git a/Constraints/Bic.php b/Constraints/Bic.php index 34121af75..5390d5556 100644 --- a/Constraints/Bic.php +++ b/Constraints/Bic.php @@ -92,8 +92,8 @@ public function __construct( throw new InvalidArgumentException('The "mode" parameter value is not valid.'); } - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Blank.php b/Constraints/Blank.php index 09c5a5fac..72fbae57a 100644 --- a/Constraints/Blank.php +++ b/Constraints/Blank.php @@ -37,8 +37,8 @@ class Blank extends Constraint #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options ?? [], $groups, $payload); diff --git a/Constraints/Callback.php b/Constraints/Callback.php index ff02183bd..44b51ac2a 100644 --- a/Constraints/Callback.php +++ b/Constraints/Callback.php @@ -36,21 +36,21 @@ public function __construct(array|string|callable|null $callback = null, ?array { // Invocation through attributes with an array parameter only if (\is_array($callback) && 1 === \count($callback) && isset($callback['value'])) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); $callback = $callback['value']; } if (!\is_array($callback) || (!isset($callback['callback']) && !isset($callback['groups']) && !isset($callback['payload']))) { if (\is_array($options)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } else { $options = []; } $options['callback'] = $callback; } else { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); $options = array_merge($callback, $options ?? []); } diff --git a/Constraints/CardScheme.php b/Constraints/CardScheme.php index 0944761d8..a75e9f7ab 100644 --- a/Constraints/CardScheme.php +++ b/Constraints/CardScheme.php @@ -56,12 +56,12 @@ class CardScheme extends Constraint public function __construct(array|string|null $schemes, ?string $message = null, ?array $groups = null, mixed $payload = null, ?array $options = null) { if (\is_array($schemes) && \is_string(key($schemes))) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); $options = array_merge($schemes, $options ?? []); } else { if (\is_array($options)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } else { $options = []; } diff --git a/Constraints/Cascade.php b/Constraints/Cascade.php index 016b7e7ef..a3ea71dbf 100644 --- a/Constraints/Cascade.php +++ b/Constraints/Cascade.php @@ -33,12 +33,12 @@ class Cascade extends Constraint public function __construct(array|string|null $exclude = null, ?array $options = null) { if (\is_array($exclude) && !array_is_list($exclude)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); $options = array_merge($exclude, $options ?? []); } else { if (\is_array($options)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } $this->exclude = array_flip((array) $exclude); diff --git a/Constraints/Choice.php b/Constraints/Choice.php index d17e5f654..1435a762b 100644 --- a/Constraints/Choice.php +++ b/Constraints/Choice.php @@ -81,7 +81,7 @@ public function __construct( $choices ??= $options; $options = []; } elseif (\is_array($options) && [] !== $options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } if (null !== $choices) { diff --git a/Constraints/Cidr.php b/Constraints/Cidr.php index 82d52317a..a6e470177 100644 --- a/Constraints/Cidr.php +++ b/Constraints/Cidr.php @@ -86,8 +86,8 @@ public function __construct( $payload = null, ?callable $normalizer = null, ) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } $this->version = $version ?? $options['version'] ?? $this->version; diff --git a/Constraints/Collection.php b/Constraints/Collection.php index 4253697ef..eca5a4eee 100644 --- a/Constraints/Collection.php +++ b/Constraints/Collection.php @@ -48,7 +48,7 @@ public function __construct(mixed $fields = null, ?array $groups = null, mixed $ if (self::isFieldsOption($fields)) { $fields = ['fields' => $fields]; } else { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($fields, $groups, $payload); diff --git a/Constraints/Count.php b/Constraints/Count.php index 31479b578..108872904 100644 --- a/Constraints/Count.php +++ b/Constraints/Count.php @@ -66,12 +66,12 @@ public function __construct( ?array $options = null, ) { if (\is_array($exactly)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); $options = array_merge($exactly, $options ?? []); $exactly = $options['value'] ?? null; } elseif (\is_array($options)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } else { $options = []; } diff --git a/Constraints/Country.php b/Constraints/Country.php index dcbdd01a1..135f996dd 100644 --- a/Constraints/Country.php +++ b/Constraints/Country.php @@ -54,8 +54,8 @@ public function __construct( throw new LogicException('The Intl component is required to use the Country constraint. Try running "composer require symfony/intl".'); } - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/CssColor.php b/Constraints/CssColor.php index 302e779eb..793a4a576 100644 --- a/Constraints/CssColor.php +++ b/Constraints/CssColor.php @@ -75,7 +75,7 @@ public function __construct(array|string $formats = [], ?string $message = null, if (!$formats) { $options['value'] = self::$validationModes; } elseif (\is_array($formats) && \is_string(key($formats))) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); $options = array_merge($formats, $options ?? []); } elseif (\is_array($formats)) { diff --git a/Constraints/Currency.php b/Constraints/Currency.php index c9b034d6d..c8f6417b3 100644 --- a/Constraints/Currency.php +++ b/Constraints/Currency.php @@ -46,8 +46,8 @@ public function __construct(?array $options = null, ?string $message = null, ?ar throw new LogicException('The Intl component is required to use the Currency constraint. Try running "composer require symfony/intl".'); } - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Date.php b/Constraints/Date.php index 98d42ad72..adb48474f 100644 --- a/Constraints/Date.php +++ b/Constraints/Date.php @@ -41,8 +41,8 @@ class Date extends Constraint #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/DateTime.php b/Constraints/DateTime.php index 863b5d119..6b287be75 100644 --- a/Constraints/DateTime.php +++ b/Constraints/DateTime.php @@ -46,12 +46,12 @@ class DateTime extends Constraint public function __construct(string|array|null $format = null, ?string $message = null, ?array $groups = null, mixed $payload = null, ?array $options = null) { if (\is_array($format)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); $options = array_merge($format, $options ?? []); } elseif (null !== $format) { if (\is_array($options)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } else { $options = []; } diff --git a/Constraints/DisableAutoMapping.php b/Constraints/DisableAutoMapping.php index 2ece16a04..7cbea8b38 100644 --- a/Constraints/DisableAutoMapping.php +++ b/Constraints/DisableAutoMapping.php @@ -33,7 +33,7 @@ class DisableAutoMapping extends Constraint public function __construct(?array $options = null, mixed $payload = null) { if (\is_array($options)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } if (\is_array($options) && \array_key_exists('groups', $options)) { diff --git a/Constraints/Email.php b/Constraints/Email.php index 05bd6ee1b..4a66986b2 100644 --- a/Constraints/Email.php +++ b/Constraints/Email.php @@ -68,8 +68,8 @@ public function __construct( throw new InvalidArgumentException('The "mode" parameter value is not valid.'); } - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/EnableAutoMapping.php b/Constraints/EnableAutoMapping.php index 5de158a39..873430677 100644 --- a/Constraints/EnableAutoMapping.php +++ b/Constraints/EnableAutoMapping.php @@ -33,7 +33,7 @@ class EnableAutoMapping extends Constraint public function __construct(?array $options = null, mixed $payload = null) { if (\is_array($options)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } if (\is_array($options) && \array_key_exists('groups', $options)) { diff --git a/Constraints/Expression.php b/Constraints/Expression.php index 355ac2610..a739acbb8 100644 --- a/Constraints/Expression.php +++ b/Constraints/Expression.php @@ -61,12 +61,12 @@ public function __construct( } if (\is_array($expression)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); $options = array_merge($expression, $options ?? []); } else { if (\is_array($options)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } else { $options = []; } diff --git a/Constraints/ExpressionSyntax.php b/Constraints/ExpressionSyntax.php index 0dcf8a4e0..5a0a09de1 100644 --- a/Constraints/ExpressionSyntax.php +++ b/Constraints/ExpressionSyntax.php @@ -41,8 +41,8 @@ class ExpressionSyntax extends Constraint #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?string $service = null, ?array $allowedVariables = null, ?array $groups = null, mixed $payload = null) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/File.php b/Constraints/File.php index 6c77559ca..8117339ba 100644 --- a/Constraints/File.php +++ b/Constraints/File.php @@ -118,8 +118,8 @@ public function __construct( array|string|null $extensions = null, ?string $extensionsMessage = null, ) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Hostname.php b/Constraints/Hostname.php index 1ea588ce5..ca9bc3a32 100644 --- a/Constraints/Hostname.php +++ b/Constraints/Hostname.php @@ -44,8 +44,8 @@ public function __construct( ?array $groups = null, mixed $payload = null, ) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Iban.php b/Constraints/Iban.php index be79d3dd3..459fb5fb0 100644 --- a/Constraints/Iban.php +++ b/Constraints/Iban.php @@ -49,8 +49,8 @@ class Iban extends Constraint #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Ip.php b/Constraints/Ip.php index 4930b5f82..4db552a76 100644 --- a/Constraints/Ip.php +++ b/Constraints/Ip.php @@ -121,8 +121,8 @@ public function __construct( ?array $groups = null, mixed $payload = null, ) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/IsFalse.php b/Constraints/IsFalse.php index 42ef5aac2..bcdadeaf9 100644 --- a/Constraints/IsFalse.php +++ b/Constraints/IsFalse.php @@ -37,8 +37,8 @@ class IsFalse extends Constraint #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options ?? [], $groups, $payload); diff --git a/Constraints/IsNull.php b/Constraints/IsNull.php index b97a88660..fa04703ea 100644 --- a/Constraints/IsNull.php +++ b/Constraints/IsNull.php @@ -37,8 +37,8 @@ class IsNull extends Constraint #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options ?? [], $groups, $payload); diff --git a/Constraints/IsTrue.php b/Constraints/IsTrue.php index 849ded086..3c0345e77 100644 --- a/Constraints/IsTrue.php +++ b/Constraints/IsTrue.php @@ -37,8 +37,8 @@ class IsTrue extends Constraint #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options ?? [], $groups, $payload); diff --git a/Constraints/Isbn.php b/Constraints/Isbn.php index 36813bb7e..45ca4e4b8 100644 --- a/Constraints/Isbn.php +++ b/Constraints/Isbn.php @@ -67,12 +67,12 @@ public function __construct( ?array $options = null, ) { if (\is_array($type)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); $options = array_merge($type, $options ?? []); } elseif (null !== $type) { if (\is_array($options)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } else { $options = []; } diff --git a/Constraints/Isin.php b/Constraints/Isin.php index 405175914..7bd9abe2d 100644 --- a/Constraints/Isin.php +++ b/Constraints/Isin.php @@ -46,8 +46,8 @@ class Isin extends Constraint #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Issn.php b/Constraints/Issn.php index d70b26b38..048c18f5e 100644 --- a/Constraints/Issn.php +++ b/Constraints/Issn.php @@ -60,8 +60,8 @@ public function __construct( ?array $groups = null, mixed $payload = null, ) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Json.php b/Constraints/Json.php index 954487fc9..18078a2fe 100644 --- a/Constraints/Json.php +++ b/Constraints/Json.php @@ -37,8 +37,8 @@ class Json extends Constraint #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Language.php b/Constraints/Language.php index 38fd164d0..61ac4644b 100644 --- a/Constraints/Language.php +++ b/Constraints/Language.php @@ -52,8 +52,8 @@ public function __construct( throw new LogicException('The Intl component is required to use the Language constraint. Try running "composer require symfony/intl".'); } - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Length.php b/Constraints/Length.php index 254487642..ce1460c6e 100644 --- a/Constraints/Length.php +++ b/Constraints/Length.php @@ -85,12 +85,12 @@ public function __construct( ?array $options = null, ) { if (\is_array($exactly)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); $options = array_merge($exactly, $options ?? []); $exactly = $options['value'] ?? null; } elseif (\is_array($options)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } else { $options = []; } diff --git a/Constraints/Locale.php b/Constraints/Locale.php index 739ce79ed..0ffe4b0e8 100644 --- a/Constraints/Locale.php +++ b/Constraints/Locale.php @@ -52,8 +52,8 @@ public function __construct( throw new LogicException('The Intl component is required to use the Locale constraint. Try running "composer require symfony/intl".'); } - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Luhn.php b/Constraints/Luhn.php index 2ecb5edc7..9421fc3c7 100644 --- a/Constraints/Luhn.php +++ b/Constraints/Luhn.php @@ -47,8 +47,8 @@ public function __construct( ?array $groups = null, mixed $payload = null, ) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/NoSuspiciousCharacters.php b/Constraints/NoSuspiciousCharacters.php index ea9ef8b6f..f0d28dba2 100644 --- a/Constraints/NoSuspiciousCharacters.php +++ b/Constraints/NoSuspiciousCharacters.php @@ -107,8 +107,8 @@ public function __construct( throw new LogicException('The intl extension is required to use the NoSuspiciousCharacters constraint.'); } - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/NotBlank.php b/Constraints/NotBlank.php index 18c8e533b..725e7eede 100644 --- a/Constraints/NotBlank.php +++ b/Constraints/NotBlank.php @@ -43,8 +43,8 @@ class NotBlank extends Constraint #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?bool $allowNull = null, ?callable $normalizer = null, ?array $groups = null, mixed $payload = null) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options ?? [], $groups, $payload); diff --git a/Constraints/NotCompromisedPassword.php b/Constraints/NotCompromisedPassword.php index fd0d5e185..ef1e03da9 100644 --- a/Constraints/NotCompromisedPassword.php +++ b/Constraints/NotCompromisedPassword.php @@ -47,8 +47,8 @@ public function __construct( ?array $groups = null, mixed $payload = null, ) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/NotNull.php b/Constraints/NotNull.php index 4eb57c6c9..28596925e 100644 --- a/Constraints/NotNull.php +++ b/Constraints/NotNull.php @@ -37,8 +37,8 @@ class NotNull extends Constraint #[HasNamedArguments] public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options ?? [], $groups, $payload); diff --git a/Constraints/PasswordStrength.php b/Constraints/PasswordStrength.php index 7db3bb3a0..3867cfbda 100644 --- a/Constraints/PasswordStrength.php +++ b/Constraints/PasswordStrength.php @@ -47,8 +47,8 @@ final class PasswordStrength extends Constraint #[HasNamedArguments] public function __construct(?array $options = null, ?int $minScore = null, ?array $groups = null, mixed $payload = null, ?string $message = null) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } $options['minScore'] ??= self::STRENGTH_MEDIUM; diff --git a/Constraints/Range.php b/Constraints/Range.php index 038f3bb1e..e27dc3501 100644 --- a/Constraints/Range.php +++ b/Constraints/Range.php @@ -73,8 +73,8 @@ public function __construct( ?array $groups = null, mixed $payload = null, ) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Regex.php b/Constraints/Regex.php index f3f1fb07e..f81c731da 100644 --- a/Constraints/Regex.php +++ b/Constraints/Regex.php @@ -55,12 +55,12 @@ public function __construct( ?array $options = null, ) { if (\is_array($pattern)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); $options = array_merge($pattern, $options ?? []); } elseif (null !== $pattern) { if (\is_array($options)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } else { $options = []; } diff --git a/Constraints/Sequentially.php b/Constraints/Sequentially.php index 93ae0fcdd..bdedb2a5e 100644 --- a/Constraints/Sequentially.php +++ b/Constraints/Sequentially.php @@ -31,7 +31,7 @@ class Sequentially extends Composite public function __construct(mixed $constraints = null, ?array $groups = null, mixed $payload = null) { if (is_array($constraints) && !array_is_list($constraints)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($constraints ?? [], $groups, $payload); diff --git a/Constraints/Time.php b/Constraints/Time.php index 9973f681d..a99702cb2 100644 --- a/Constraints/Time.php +++ b/Constraints/Time.php @@ -46,8 +46,8 @@ public function __construct( mixed $payload = null, ?bool $withSeconds = null, ) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Timezone.php b/Constraints/Timezone.php index c92f412f8..93b0692ef 100644 --- a/Constraints/Timezone.php +++ b/Constraints/Timezone.php @@ -61,12 +61,12 @@ public function __construct( ?array $options = null, ) { if (\is_array($zone)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); $options = array_merge($zone, $options ?? []); } elseif (null !== $zone) { if (\is_array($options)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } else { $options = []; } diff --git a/Constraints/Traverse.php b/Constraints/Traverse.php index 98671586d..d8546e323 100644 --- a/Constraints/Traverse.php +++ b/Constraints/Traverse.php @@ -36,7 +36,7 @@ public function __construct(bool|array|null $traverse = null, mixed $payload = n } if (\is_array($traverse)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($traverse, null, $payload); diff --git a/Constraints/Type.php b/Constraints/Type.php index 087c1a340..747c6add4 100644 --- a/Constraints/Type.php +++ b/Constraints/Type.php @@ -40,19 +40,19 @@ class Type extends Constraint public function __construct(string|array|null $type, ?string $message = null, ?array $groups = null, mixed $payload = null, ?array $options = null) { if (\is_array($type) && \is_string(key($type))) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); $options = array_merge($type, $options ?? []); } elseif (null !== $type) { if (\is_array($options)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } else { $options = []; } $options['value'] = $type; } elseif (\is_array($options)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Ulid.php b/Constraints/Ulid.php index 28b5ef25e..91d395fd2 100644 --- a/Constraints/Ulid.php +++ b/Constraints/Ulid.php @@ -59,8 +59,8 @@ public function __construct( mixed $payload = null, ?string $format = null, ) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Unique.php b/Constraints/Unique.php index a407764ff..857672daf 100644 --- a/Constraints/Unique.php +++ b/Constraints/Unique.php @@ -51,8 +51,8 @@ public function __construct( array|string|null $fields = null, ?string $errorPath = null, ) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Url.php b/Constraints/Url.php index ed0733ae6..b3e7256a0 100644 --- a/Constraints/Url.php +++ b/Constraints/Url.php @@ -58,8 +58,8 @@ public function __construct( ?bool $requireTld = null, ?string $tldMessage = null, ) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Uuid.php b/Constraints/Uuid.php index 5a4de6a25..9c6526457 100644 --- a/Constraints/Uuid.php +++ b/Constraints/Uuid.php @@ -111,8 +111,8 @@ public function __construct( ?array $groups = null, mixed $payload = null, ) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options, $groups, $payload); diff --git a/Constraints/Valid.php b/Constraints/Valid.php index 2a8eab1d4..48deae8ac 100644 --- a/Constraints/Valid.php +++ b/Constraints/Valid.php @@ -32,8 +32,8 @@ class Valid extends Constraint #[HasNamedArguments] public function __construct(?array $options = null, ?array $groups = null, $payload = null, ?bool $traverse = null) { - if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + if (\is_array($options)) { + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } parent::__construct($options ?? [], $groups, $payload); diff --git a/Constraints/When.php b/Constraints/When.php index 1c3113e1b..12d5e7cc3 100644 --- a/Constraints/When.php +++ b/Constraints/When.php @@ -44,12 +44,12 @@ public function __construct(string|Expression|array $expression, array|Constrain } if (\is_array($expression)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); $options = array_merge($expression, $options ?? []); } else { if (\is_array($options)) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } else { $options = []; } diff --git a/Constraints/ZeroComparisonConstraintTrait.php b/Constraints/ZeroComparisonConstraintTrait.php index b369a9429..d8479c20f 100644 --- a/Constraints/ZeroComparisonConstraintTrait.php +++ b/Constraints/ZeroComparisonConstraintTrait.php @@ -26,7 +26,7 @@ trait ZeroComparisonConstraintTrait public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) { if (null !== $options) { - trigger_deprecation('symfony/validator', '7.2', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); + trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } if (is_array($options) && isset($options['propertyPath'])) { diff --git a/Tests/Constraints/RangeTest.php b/Tests/Constraints/RangeTest.php index ae7e07077..01481e8bc 100644 --- a/Tests/Constraints/RangeTest.php +++ b/Tests/Constraints/RangeTest.php @@ -62,7 +62,7 @@ public function testThrowsConstraintExceptionIfNoLimitNorPropertyPath() { $this->expectException(MissingOptionsException::class); $this->expectExceptionMessage('Either option "min", "minPropertyPath", "max" or "maxPropertyPath" must be given'); - new Range([]); + new Range(); } public function testThrowsNoDefaultOptionConfiguredException() From 6bb3d01513c59f5f93524be736b1eca798f8fb3a Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 24 Jan 2025 13:51:14 +0100 Subject: [PATCH 09/74] add missing changelog/upgrade entries --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70468d4d3..5f4872a7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,25 @@ CHANGELOG 7.3 --- + * Deprecate passing an array of options to the constructors of the constraint classes, pass each option as a dedicated argument instead + + Before: + + ```php + new NotNull([ + 'groups' => ['foo', 'bar'], + 'message' => 'a custom constraint violation message', + ]) + ``` + + After: + + ```php + new NotNull( + groups: ['foo', 'bar'], + message: 'a custom constraint violation message', + ) + ``` * Add support for ratio checks for SVG files to the `Image` constraint * Add the `Slug` constraint From bc4d9ebae0bf4ef4f5ae168e5f1725016c32e73c Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 24 Jan 2025 13:57:06 +0100 Subject: [PATCH 10/74] fix the version constaints not supporting named arguments are deprecated in --- CHANGELOG.md | 31 +++++++++++++++++++++ Mapping/Loader/AbstractLoader.php | 2 +- Tests/Mapping/Loader/XmlFileLoaderTest.php | 2 +- Tests/Mapping/Loader/YamlFileLoaderTest.php | 2 +- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f4872a7b..c10797cab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,37 @@ CHANGELOG 7.3 --- + * Deprecate defining custom constraints not supporting named arguments + + Before: + + ```php + use Symfony\Component\Validator\Constraint; + + class CustomConstraint extends Constraint + { + public function __construct(array $options) + { + // ... + } + } + ``` + + After: + + ```php + use Symfony\Component\Validator\Attribute\HasNamedArguments; + use Symfony\Component\Validator\Constraint; + + class CustomConstraint extends Constraint + { + #[HasNamedArguments] + public function __construct($option1, $option2, $groups, $payload) + { + // ... + } + } + ``` * Deprecate passing an array of options to the constructors of the constraint classes, pass each option as a dedicated argument instead Before: diff --git a/Mapping/Loader/AbstractLoader.php b/Mapping/Loader/AbstractLoader.php index 184bca894..67b7b2010 100644 --- a/Mapping/Loader/AbstractLoader.php +++ b/Mapping/Loader/AbstractLoader.php @@ -105,7 +105,7 @@ protected function newConstraint(string $name, mixed $options = null): Constrain } if ($options) { - trigger_deprecation('symfony/validator', '7.2', 'Using constraints not supporting named arguments is deprecated. Try adding the HasNamedArguments attribute to %s.', $className); + trigger_deprecation('symfony/validator', '7.3', 'Using constraints not supporting named arguments is deprecated. Try adding the HasNamedArguments attribute to %s.', $className); return new $className($options); } diff --git a/Tests/Mapping/Loader/XmlFileLoaderTest.php b/Tests/Mapping/Loader/XmlFileLoaderTest.php index bc8e4e72e..08a4bb862 100644 --- a/Tests/Mapping/Loader/XmlFileLoaderTest.php +++ b/Tests/Mapping/Loader/XmlFileLoaderTest.php @@ -184,7 +184,7 @@ public function testLoadConstraintWithoutNamedArgumentsSupport() $loader = new XmlFileLoader(__DIR__.'/constraint-without-named-arguments-support.xml'); $metadata = new ClassMetadata(DummyEntityConstraintWithoutNamedArguments::class); - $this->expectUserDeprecationMessage('Since symfony/validator 7.2: Using constraints not supporting named arguments is deprecated. Try adding the HasNamedArguments attribute to Symfony\Component\Validator\Tests\Mapping\Loader\Fixtures\ConstraintWithoutNamedArguments.'); + $this->expectUserDeprecationMessage('Since symfony/validator 7.3: Using constraints not supporting named arguments is deprecated. Try adding the HasNamedArguments attribute to Symfony\Component\Validator\Tests\Mapping\Loader\Fixtures\ConstraintWithoutNamedArguments.'); $loader->loadClassMetadata($metadata); } diff --git a/Tests/Mapping/Loader/YamlFileLoaderTest.php b/Tests/Mapping/Loader/YamlFileLoaderTest.php index b496663f1..c3bbcb18e 100644 --- a/Tests/Mapping/Loader/YamlFileLoaderTest.php +++ b/Tests/Mapping/Loader/YamlFileLoaderTest.php @@ -200,7 +200,7 @@ public function testLoadConstraintWithoutNamedArgumentsSupport() $loader = new YamlFileLoader(__DIR__.'/constraint-without-named-arguments-support.yml'); $metadata = new ClassMetadata(DummyEntityConstraintWithoutNamedArguments::class); - $this->expectUserDeprecationMessage('Since symfony/validator 7.2: Using constraints not supporting named arguments is deprecated. Try adding the HasNamedArguments attribute to Symfony\Component\Validator\Tests\Mapping\Loader\Fixtures\ConstraintWithoutNamedArguments.'); + $this->expectUserDeprecationMessage('Since symfony/validator 7.3: Using constraints not supporting named arguments is deprecated. Try adding the HasNamedArguments attribute to Symfony\Component\Validator\Tests\Mapping\Loader\Fixtures\ConstraintWithoutNamedArguments.'); $loader->loadClassMetadata($metadata); } From 8ddcb6e95cb8d6f4e98ee5435f806090badb2642 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Tue, 28 Jan 2025 12:27:23 +0100 Subject: [PATCH 11/74] [Validator] Add support for the `otherwise` option in the `When` constraint --- CHANGELOG.md | 2 + Constraints/Composite.php | 95 ++++++++++--------- Constraints/When.php | 15 ++- Constraints/WhenValidator.php | 7 +- Tests/Constraints/CompositeTest.php | 69 +++++++++++++- .../Fixtures/WhenTestWithAttributes.php | 4 + Tests/Constraints/WhenTest.php | 14 +++ Tests/Constraints/WhenValidatorTest.php | 30 ++++++ 8 files changed, 184 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c10797cab..960195c95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,8 @@ CHANGELOG ``` * Add support for ratio checks for SVG files to the `Image` constraint * Add the `Slug` constraint + * Add support for the `otherwise` option in the `When` constraint + * Add support for multiple fields containing nested constraints in `Composite` constraints 7.2 --- diff --git a/Constraints/Composite.php b/Constraints/Composite.php index 8cd0edde7..deac22cc5 100644 --- a/Constraints/Composite.php +++ b/Constraints/Composite.php @@ -55,57 +55,58 @@ public function __construct(mixed $options = null, ?array $groups = null, mixed $this->initializeNestedConstraints(); - /* @var Constraint[] $nestedConstraints */ - $compositeOption = $this->getCompositeOption(); - $nestedConstraints = $this->$compositeOption; + foreach ((array) $this->getCompositeOption() as $option) { + /* @var Constraint[] $nestedConstraints */ + $nestedConstraints = $this->$option; - if (!\is_array($nestedConstraints)) { - $nestedConstraints = [$nestedConstraints]; - } - - foreach ($nestedConstraints as $constraint) { - if (!$constraint instanceof Constraint) { - if (\is_object($constraint)) { - $constraint = $constraint::class; - } - - throw new ConstraintDefinitionException(\sprintf('The value "%s" is not an instance of Constraint in constraint "%s".', $constraint, static::class)); + if (!\is_array($nestedConstraints)) { + $nestedConstraints = [$nestedConstraints]; } - if ($constraint instanceof Valid) { - throw new ConstraintDefinitionException(\sprintf('The constraint Valid cannot be nested inside constraint "%s". You can only declare the Valid constraint directly on a field or method.', static::class)); - } - } + foreach ($nestedConstraints as $constraint) { + if (!$constraint instanceof Constraint) { + if (\is_object($constraint)) { + $constraint = get_debug_type($constraint); + } - if (!isset(((array) $this)['groups'])) { - $mergedGroups = []; + throw new ConstraintDefinitionException(\sprintf('The value "%s" is not an instance of Constraint in constraint "%s".', $constraint, get_debug_type($this))); + } - foreach ($nestedConstraints as $constraint) { - foreach ($constraint->groups as $group) { - $mergedGroups[$group] = true; + if ($constraint instanceof Valid) { + throw new ConstraintDefinitionException(\sprintf('The constraint Valid cannot be nested inside constraint "%s". You can only declare the Valid constraint directly on a field or method.', get_debug_type($this))); } } - // prevent empty composite constraint to have empty groups - $this->groups = array_keys($mergedGroups) ?: [self::DEFAULT_GROUP]; - $this->$compositeOption = $nestedConstraints; + if (!isset(((array) $this)['groups'])) { + $mergedGroups = []; - return; - } + foreach ($nestedConstraints as $constraint) { + foreach ($constraint->groups as $group) { + $mergedGroups[$group] = true; + } + } + + // prevent empty composite constraint to have empty groups + $this->groups = array_keys($mergedGroups) ?: [self::DEFAULT_GROUP]; + $this->$option = $nestedConstraints; - foreach ($nestedConstraints as $constraint) { - if (isset(((array) $constraint)['groups'])) { - $excessGroups = array_diff($constraint->groups, $this->groups); + continue; + } - if (\count($excessGroups) > 0) { - throw new ConstraintDefinitionException(\sprintf('The group(s) "%s" passed to the constraint "%s" should also be passed to its containing constraint "%s".', implode('", "', $excessGroups), get_debug_type($constraint), static::class)); + foreach ($nestedConstraints as $constraint) { + if (isset(((array) $constraint)['groups'])) { + $excessGroups = array_diff($constraint->groups, $this->groups); + + if (\count($excessGroups) > 0) { + throw new ConstraintDefinitionException(\sprintf('The group(s) "%s" passed to the constraint "%s" should also be passed to its containing constraint "%s".', implode('", "', $excessGroups), get_debug_type($constraint), get_debug_type($this))); + } + } else { + $constraint->groups = $this->groups; } - } else { - $constraint->groups = $this->groups; } - } - $this->$compositeOption = $nestedConstraints; + $this->$option = $nestedConstraints; + } } /** @@ -115,18 +116,20 @@ public function addImplicitGroupName(string $group): void { parent::addImplicitGroupName($group); - /** @var Constraint[] $nestedConstraints */ - $nestedConstraints = $this->{$this->getCompositeOption()}; + foreach ((array) $this->getCompositeOption() as $option) { + /* @var Constraint[] $nestedConstraints */ + $nestedConstraints = (array) $this->$option; - foreach ($nestedConstraints as $constraint) { - $constraint->addImplicitGroupName($group); + foreach ($nestedConstraints as $constraint) { + $constraint->addImplicitGroupName($group); + } } } /** * Returns the name of the property that contains the nested constraints. */ - abstract protected function getCompositeOption(): string; + abstract protected function getCompositeOption(): array|string; /** * @internal Used by metadata @@ -135,8 +138,12 @@ abstract protected function getCompositeOption(): string; */ public function getNestedConstraints(): array { - /* @var Constraint[] $nestedConstraints */ - return $this->{$this->getCompositeOption()}; + $constraints = []; + foreach ((array) $this->getCompositeOption() as $option) { + $constraints = array_merge($constraints, (array) $this->$option); + } + + return $constraints; } /** diff --git a/Constraints/When.php b/Constraints/When.php index 12d5e7cc3..5fe83ab53 100644 --- a/Constraints/When.php +++ b/Constraints/When.php @@ -28,6 +28,7 @@ class When extends Composite public string|Expression $expression; public array|Constraint $constraints = []; public array $values = []; + public array|Constraint $otherwise = []; /** * @param string|Expression|array $expression The condition to evaluate, written with the ExpressionLanguage syntax @@ -35,9 +36,10 @@ class When extends Composite * @param array|null $values The values of the custom variables used in the expression (defaults to []) * @param string[]|null $groups * @param array|null $options + * @param Constraint[]|Constraint $otherwise One or multiple constraints that are applied if the expression returns false */ #[HasNamedArguments] - public function __construct(string|Expression|array $expression, array|Constraint|null $constraints = null, ?array $values = null, ?array $groups = null, $payload = null, ?array $options = null) + public function __construct(string|Expression|array $expression, array|Constraint|null $constraints = null, ?array $values = null, ?array $groups = null, $payload = null, ?array $options = null, array|Constraint $otherwise = []) { if (!class_exists(ExpressionLanguage::class)) { throw new LogicException(\sprintf('The "symfony/expression-language" component is required to use the "%s" constraint. Try running "composer require symfony/expression-language".', __CLASS__)); @@ -56,12 +58,17 @@ public function __construct(string|Expression|array $expression, array|Constrain $options['expression'] = $expression; $options['constraints'] = $constraints; + $options['otherwise'] = $otherwise; } - if (isset($options['constraints']) && !\is_array($options['constraints'])) { + if (!\is_array($options['constraints'] ?? [])) { $options['constraints'] = [$options['constraints']]; } + if (!\is_array($options['otherwise'] ?? [])) { + $options['otherwise'] = [$options['otherwise']]; + } + if (null !== $groups) { $options['groups'] = $groups; } @@ -85,8 +92,8 @@ public function getTargets(): string|array return [self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT]; } - protected function getCompositeOption(): string + protected function getCompositeOption(): array|string { - return 'constraints'; + return ['constraints', 'otherwise']; } } diff --git a/Constraints/WhenValidator.php b/Constraints/WhenValidator.php index b41ba83ff..272bd86e9 100644 --- a/Constraints/WhenValidator.php +++ b/Constraints/WhenValidator.php @@ -35,9 +35,14 @@ public function validate(mixed $value, Constraint $constraint): void $variables['this'] = $context->getObject(); $variables['context'] = $context; - if ($this->getExpressionLanguage()->evaluate($constraint->expression, $variables)) { + $result = $this->getExpressionLanguage()->evaluate($constraint->expression, $variables); + + if ($result) { $context->getValidator()->inContext($context) ->validate($value, $constraint->constraints); + } elseif ($constraint->otherwise) { + $context->getValidator()->inContext($context) + ->validate($value, $constraint->otherwise); } } diff --git a/Tests/Constraints/CompositeTest.php b/Tests/Constraints/CompositeTest.php index a769a68e4..9329ef1a2 100644 --- a/Tests/Constraints/CompositeTest.php +++ b/Tests/Constraints/CompositeTest.php @@ -14,6 +14,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Constraints\Composite; +use Symfony\Component\Validator\Constraints\Length; use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotNull; use Symfony\Component\Validator\Constraints\Valid; @@ -23,9 +24,14 @@ class ConcreteComposite extends Composite { public array|Constraint $constraints = []; - protected function getCompositeOption(): string + public function __construct(mixed $options = null, public array|Constraint $otherNested = []) { - return 'constraints'; + parent::__construct($options); + } + + protected function getCompositeOption(): array + { + return ['constraints', 'otherNested']; } public function getDefaultOption(): ?string @@ -44,11 +50,14 @@ public function testConstraintHasDefaultGroup() $constraint = new ConcreteComposite([ new NotNull(), new NotBlank(), + ], [ + new Length(exactly: 10), ]); $this->assertEquals(['Default'], $constraint->groups); $this->assertEquals(['Default'], $constraint->constraints[0]->groups); $this->assertEquals(['Default'], $constraint->constraints[1]->groups); + $this->assertEquals(['Default'], $constraint->otherNested[0]->groups); } public function testNestedCompositeConstraintHasDefaultGroup() @@ -68,11 +77,14 @@ public function testMergeNestedGroupsIfNoExplicitParentGroup() $constraint = new ConcreteComposite([ new NotNull(groups: ['Default']), new NotBlank(groups: ['Default', 'Strict']), + ], [ + new Length(exactly: 10, groups: ['Default', 'Strict']), ]); $this->assertEquals(['Default', 'Strict'], $constraint->groups); $this->assertEquals(['Default'], $constraint->constraints[0]->groups); $this->assertEquals(['Default', 'Strict'], $constraint->constraints[1]->groups); + $this->assertEquals(['Default', 'Strict'], $constraint->otherNested[0]->groups); } public function testSetImplicitNestedGroupsIfExplicitParentGroup() @@ -82,12 +94,16 @@ public function testSetImplicitNestedGroupsIfExplicitParentGroup() new NotNull(), new NotBlank(), ], + 'otherNested' => [ + new Length(exactly: 10), + ], 'groups' => ['Default', 'Strict'], ]); $this->assertEquals(['Default', 'Strict'], $constraint->groups); $this->assertEquals(['Default', 'Strict'], $constraint->constraints[0]->groups); $this->assertEquals(['Default', 'Strict'], $constraint->constraints[1]->groups); + $this->assertEquals(['Default', 'Strict'], $constraint->otherNested[0]->groups); } public function testExplicitNestedGroupsMustBeSubsetOfExplicitParentGroups() @@ -97,12 +113,16 @@ public function testExplicitNestedGroupsMustBeSubsetOfExplicitParentGroups() new NotNull(groups: ['Default']), new NotBlank(groups: ['Strict']), ], + 'otherNested' => [ + new Length(exactly: 10, groups: ['Strict']), + ], 'groups' => ['Default', 'Strict'], ]); $this->assertEquals(['Default', 'Strict'], $constraint->groups); $this->assertEquals(['Default'], $constraint->constraints[0]->groups); $this->assertEquals(['Strict'], $constraint->constraints[1]->groups); + $this->assertEquals(['Strict'], $constraint->otherNested[0]->groups); } public function testFailIfExplicitNestedGroupsNotSubsetOfExplicitParentGroups() @@ -116,11 +136,27 @@ public function testFailIfExplicitNestedGroupsNotSubsetOfExplicitParentGroups() ]); } + public function testFailIfExplicitNestedGroupsNotSubsetOfExplicitParentGroupsInOtherNested() + { + $this->expectException(ConstraintDefinitionException::class); + new ConcreteComposite([ + 'constraints' => [ + new NotNull(groups: ['Default']), + ], + 'otherNested' => [ + new NotNull(groups: ['Default', 'Foobar']), + ], + 'groups' => ['Default', 'Strict'], + ]); + } + public function testImplicitGroupNamesAreForwarded() { $constraint = new ConcreteComposite([ new NotNull(groups: ['Default']), new NotBlank(groups: ['Strict']), + ], [ + new Length(exactly: 10, groups: ['Default']), ]); $constraint->addImplicitGroupName('ImplicitGroup'); @@ -128,14 +164,17 @@ public function testImplicitGroupNamesAreForwarded() $this->assertEquals(['Default', 'Strict', 'ImplicitGroup'], $constraint->groups); $this->assertEquals(['Default', 'ImplicitGroup'], $constraint->constraints[0]->groups); $this->assertEquals(['Strict'], $constraint->constraints[1]->groups); + $this->assertEquals(['Default', 'ImplicitGroup'], $constraint->otherNested[0]->groups); } public function testSingleConstraintsAccepted() { $nestedConstraint = new NotNull(); - $constraint = new ConcreteComposite($nestedConstraint); + $otherNestedConstraint = new Length(exactly: 10); + $constraint = new ConcreteComposite($nestedConstraint, $otherNestedConstraint); $this->assertEquals([$nestedConstraint], $constraint->constraints); + $this->assertEquals([$otherNestedConstraint], $constraint->otherNested); } public function testFailIfNoConstraint() @@ -147,6 +186,15 @@ public function testFailIfNoConstraint() ]); } + public function testFailIfNoConstraintInAnotherNested() + { + $this->expectException(ConstraintDefinitionException::class); + new ConcreteComposite([new NotNull()], [ + new NotNull(groups: ['Default']), + 'NotBlank', + ]); + } + public function testFailIfNoConstraintObject() { $this->expectException(ConstraintDefinitionException::class); @@ -156,6 +204,15 @@ public function testFailIfNoConstraintObject() ]); } + public function testFailIfNoConstraintObjectInAnotherNested() + { + $this->expectException(ConstraintDefinitionException::class); + new ConcreteComposite([new NotNull()], [ + new NotNull(groups: ['Default']), + new \ArrayObject(), + ]); + } + public function testValidCantBeNested() { $this->expectException(ConstraintDefinitionException::class); @@ -163,4 +220,10 @@ public function testValidCantBeNested() new Valid(), ]); } + + public function testValidCantBeNestedInAnotherNested() + { + $this->expectException(ConstraintDefinitionException::class); + new ConcreteComposite([new NotNull()], [new Valid()]); + } } diff --git a/Tests/Constraints/Fixtures/WhenTestWithAttributes.php b/Tests/Constraints/Fixtures/WhenTestWithAttributes.php index a683eb3c6..31258dc0d 100644 --- a/Tests/Constraints/Fixtures/WhenTestWithAttributes.php +++ b/Tests/Constraints/Fixtures/WhenTestWithAttributes.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Tests\Constraints\Fixtures; use Symfony\Component\Validator\Constraints\Callback; +use Symfony\Component\Validator\Constraints\Length; use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotNull; use Symfony\Component\Validator\Constraints\When; @@ -36,6 +37,9 @@ class WhenTestWithAttributes #[When(expression: 'true', constraints: new NotNull(), groups: ['foo'])] private $qux; + #[When(expression: 'true', constraints: new NotNull(), otherwise: new Length(exactly: 10), groups: ['foo'])] + private $quux; + #[When(expression: 'true', constraints: [ new NotNull(), new NotBlank(), diff --git a/Tests/Constraints/WhenTest.php b/Tests/Constraints/WhenTest.php index fa71de02e..6516a1014 100644 --- a/Tests/Constraints/WhenTest.php +++ b/Tests/Constraints/WhenTest.php @@ -13,6 +13,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\Constraints\Callback; +use Symfony\Component\Validator\Constraints\Length; use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotNull; use Symfony\Component\Validator\Constraints\When; @@ -59,6 +60,7 @@ public function testAttributes() groups: ['Default', 'WhenTestWithAttributes'], ), ], $classConstraint->constraints); + self::assertEmpty($classConstraint->otherwise); [$fooConstraint] = $metadata->properties['foo']->getConstraints(); @@ -68,6 +70,7 @@ public function testAttributes() new NotNull(groups: ['Default', 'WhenTestWithAttributes']), new NotBlank(groups: ['Default', 'WhenTestWithAttributes']), ], $fooConstraint->constraints); + self::assertEmpty($fooConstraint->otherwise); self::assertSame(['Default', 'WhenTestWithAttributes'], $fooConstraint->groups); [$barConstraint] = $metadata->properties['bar']->getConstraints(); @@ -78,6 +81,7 @@ public function testAttributes() new NotNull(groups: ['foo']), new NotBlank(groups: ['foo']), ], $barConstraint->constraints); + self::assertEmpty($barConstraint->otherwise); self::assertSame(['foo'], $barConstraint->groups); [$quxConstraint] = $metadata->properties['qux']->getConstraints(); @@ -85,6 +89,7 @@ public function testAttributes() self::assertInstanceOf(When::class, $quxConstraint); self::assertSame('true', $quxConstraint->expression); self::assertEquals([new NotNull(groups: ['foo'])], $quxConstraint->constraints); + self::assertEmpty($quxConstraint->otherwise); self::assertSame(['foo'], $quxConstraint->groups); [$bazConstraint] = $metadata->getters['baz']->getConstraints(); @@ -95,6 +100,15 @@ public function testAttributes() new NotNull(groups: ['Default', 'WhenTestWithAttributes']), new NotBlank(groups: ['Default', 'WhenTestWithAttributes']), ], $bazConstraint->constraints); + self::assertEmpty($bazConstraint->otherwise); self::assertSame(['Default', 'WhenTestWithAttributes'], $bazConstraint->groups); + + [$quuxConstraint] = $metadata->properties['quux']->getConstraints(); + + self::assertInstanceOf(When::class, $quuxConstraint); + self::assertSame('true', $quuxConstraint->expression); + self::assertEquals([new NotNull(groups: ['foo'])], $quuxConstraint->constraints); + self::assertEquals([new Length(exactly: 10, groups: ['foo'])], $quuxConstraint->otherwise); + self::assertSame(['foo'], $quuxConstraint->groups); } } diff --git a/Tests/Constraints/WhenValidatorTest.php b/Tests/Constraints/WhenValidatorTest.php index 019ec828f..501398d2a 100644 --- a/Tests/Constraints/WhenValidatorTest.php +++ b/Tests/Constraints/WhenValidatorTest.php @@ -13,6 +13,7 @@ use Symfony\Component\Validator\Constraints\Blank; use Symfony\Component\Validator\Constraints\Callback; +use Symfony\Component\Validator\Constraints\Length; use Symfony\Component\Validator\Constraints\NegativeOrZero; use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotNull; @@ -50,6 +51,20 @@ public function testConstraintIsExecuted() )); } + public function testOtherwiseIsExecutedWhenFalse() + { + $constraint = new NotNull(); + $otherwise = new Length(exactly: 10); + + $this->expectValidateValue(0, 'Foo', [$otherwise]); + + $this->validator->validate('Foo', new When( + expression: 'false', + constraints: $constraint, + otherwise: $otherwise, + )); + } + public function testConstraintsAreExecutedWithNull() { $constraints = [ @@ -159,6 +174,21 @@ public function testConstraintsNotExecuted() $this->assertNoViolation(); } + public function testOtherwiseIsExecutedWhenTrue() + { + $constraints = [new NotNull()]; + + $this->expectValidateValue(0, '', $constraints); + + $this->validator->validate('', new When( + expression: 'true', + constraints: $constraints, + otherwise: new Length(exactly: 10), + )); + + $this->assertNoViolation(); + } + public function testConstraintsNotExecutedWithObject() { $number = new \stdClass(); From 0304b1f12e711cc3009eb35f7f1f60ff4fb9f144 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Tue, 27 Jun 2023 16:01:55 +0200 Subject: [PATCH 12/74] [FrameworkBundle][Validator] Add `framework.validation.disable_translation` config --- Context/ExecutionContext.php | 6 ++++-- Context/ExecutionContextFactory.php | 2 +- Tests/ValidatorBuilderTest.php | 5 +++++ ValidatorBuilder.php | 12 +++++++++++- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Context/ExecutionContext.php b/Context/ExecutionContext.php index 0378c3e6f..1fd373309 100644 --- a/Context/ExecutionContext.php +++ b/Context/ExecutionContext.php @@ -107,7 +107,7 @@ public function __construct( private ValidatorInterface $validator, private mixed $root, private TranslatorInterface $translator, - private ?string $translationDomain = null, + private string|false|null $translationDomain = null, ) { $this->violations = new ConstraintViolationList(); $this->cachedObjectsRefs = new \SplObjectStorage(); @@ -134,7 +134,9 @@ public function setConstraint(Constraint $constraint): void public function addViolation(string|\Stringable $message, array $parameters = []): void { $this->violations->add(new ConstraintViolation( - $this->translator->trans($message, $parameters, $this->translationDomain), + false === $this->translationDomain ? + strtr($message, $parameters) : + $this->translator->trans($message, $parameters, $this->translationDomain), $message, $parameters, $this->root, diff --git a/Context/ExecutionContextFactory.php b/Context/ExecutionContextFactory.php index a6a2844ad..39c2add35 100644 --- a/Context/ExecutionContextFactory.php +++ b/Context/ExecutionContextFactory.php @@ -25,7 +25,7 @@ class ExecutionContextFactory implements ExecutionContextFactoryInterface { public function __construct( private TranslatorInterface $translator, - private ?string $translationDomain = null, + private string|false|null $translationDomain = null, ) { } diff --git a/Tests/ValidatorBuilderTest.php b/Tests/ValidatorBuilderTest.php index c57a507e2..ec464b748 100644 --- a/Tests/ValidatorBuilderTest.php +++ b/Tests/ValidatorBuilderTest.php @@ -99,6 +99,11 @@ public function testSetTranslationDomain() $this->assertSame($this->builder, $this->builder->setTranslationDomain('TRANS_DOMAIN')); } + public function testDisableTranslation() + { + $this->assertSame($this->builder, $this->builder->disableTranslation()); + } + public function testGetValidator() { $this->assertInstanceOf(RecursiveValidator::class, $this->builder->getValidator()); diff --git a/ValidatorBuilder.php b/ValidatorBuilder.php index 83e543b8f..917f1c57a 100644 --- a/ValidatorBuilder.php +++ b/ValidatorBuilder.php @@ -50,7 +50,7 @@ class ValidatorBuilder private ?ContainerInterface $groupProviderLocator = null; private ?CacheItemPoolInterface $mappingCache = null; private ?TranslatorInterface $translator = null; - private ?string $translationDomain = null; + private string|false|null $translationDomain = null; /** * Adds an object initializer to the validator. @@ -292,6 +292,16 @@ public function setTranslationDomain(?string $translationDomain): static return $this; } + /** + * @return $this + */ + public function disableTranslation(): static + { + $this->translationDomain = false; + + return $this; + } + /** * @return $this */ From c8b6f7fc91cd60bc5f9f022abd806e9fd2ee45c3 Mon Sep 17 00:00:00 2001 From: "hubert.lenoir" Date: Fri, 20 Dec 2024 15:56:14 +0100 Subject: [PATCH 13/74] [Validator] Allow Unique constraint validation on all elements --- CHANGELOG.md | 49 +--------------- Constraints/Unique.php | 3 + Constraints/UniqueValidator.php | 22 ++++--- Tests/Constraints/UniqueValidatorTest.php | 71 +++++++++++++++++++++++ 4 files changed, 88 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 960195c95..e421f748e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,59 +5,12 @@ CHANGELOG --- * Deprecate defining custom constraints not supporting named arguments - - Before: - - ```php - use Symfony\Component\Validator\Constraint; - - class CustomConstraint extends Constraint - { - public function __construct(array $options) - { - // ... - } - } - ``` - - After: - - ```php - use Symfony\Component\Validator\Attribute\HasNamedArguments; - use Symfony\Component\Validator\Constraint; - - class CustomConstraint extends Constraint - { - #[HasNamedArguments] - public function __construct($option1, $option2, $groups, $payload) - { - // ... - } - } - ``` * Deprecate passing an array of options to the constructors of the constraint classes, pass each option as a dedicated argument instead - - Before: - - ```php - new NotNull([ - 'groups' => ['foo', 'bar'], - 'message' => 'a custom constraint violation message', - ]) - ``` - - After: - - ```php - new NotNull( - groups: ['foo', 'bar'], - message: 'a custom constraint violation message', - ) - ``` * Add support for ratio checks for SVG files to the `Image` constraint * Add the `Slug` constraint * Add support for the `otherwise` option in the `When` constraint * Add support for multiple fields containing nested constraints in `Composite` constraints + * Add the `stopOnFirstError` option to the `Unique` constraint to validate all elements 7.2 --- diff --git a/Constraints/Unique.php b/Constraints/Unique.php index 857672daf..1e6503785 100644 --- a/Constraints/Unique.php +++ b/Constraints/Unique.php @@ -27,6 +27,7 @@ class Unique extends Constraint public array|string $fields = []; public ?string $errorPath = null; + public bool $stopOnFirstError = true; protected const ERROR_NAMES = [ self::IS_NOT_UNIQUE => 'IS_NOT_UNIQUE', @@ -50,6 +51,7 @@ public function __construct( mixed $payload = null, array|string|null $fields = null, ?string $errorPath = null, + ?bool $stopOnFirstError = null, ) { if (\is_array($options)) { trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); @@ -61,6 +63,7 @@ public function __construct( $this->normalizer = $normalizer ?? $this->normalizer; $this->fields = $fields ?? $this->fields; $this->errorPath = $errorPath ?? $this->errorPath; + $this->stopOnFirstError = $stopOnFirstError ?? $this->stopOnFirstError; if (null !== $this->normalizer && !\is_callable($this->normalizer)) { throw new InvalidArgumentException(\sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); diff --git a/Constraints/UniqueValidator.php b/Constraints/UniqueValidator.php index 8977fd221..bd78cac72 100644 --- a/Constraints/UniqueValidator.php +++ b/Constraints/UniqueValidator.php @@ -46,20 +46,24 @@ public function validate(mixed $value, Constraint $constraint): void continue; } - if (\in_array($element, $collectionElements, true)) { - $violationBuilder = $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($element)) - ->setCode(Unique::IS_NOT_UNIQUE); + if (!\in_array($element, $collectionElements, true)) { + $collectionElements[] = $element; + continue; + } - if (null !== $constraint->errorPath) { - $violationBuilder->atPath("[$index].{$constraint->errorPath}"); - } + $violationBuilder = $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($element)) + ->setCode(Unique::IS_NOT_UNIQUE); + + if (!$constraint->stopOnFirstError || null !== $constraint->errorPath) { + $violationBuilder->atPath("[$index]".(null !== $constraint->errorPath ? ".{$constraint->errorPath}" : '')); + } - $violationBuilder->addViolation(); + $violationBuilder->addViolation(); + if ($constraint->stopOnFirstError) { return; } - $collectionElements[] = $element; } } diff --git a/Tests/Constraints/UniqueValidatorTest.php b/Tests/Constraints/UniqueValidatorTest.php index ac43ed2b8..12efb7698 100644 --- a/Tests/Constraints/UniqueValidatorTest.php +++ b/Tests/Constraints/UniqueValidatorTest.php @@ -387,6 +387,77 @@ public function testErrorPathWithNonList() ->assertRaised(); } + public function testWithoutStopOnFirstError() + { + $this->validator->validate( + ['a1', 'a2', 'a1', 'a1', 'a2'], + new Unique(stopOnFirstError: false), + ); + + $this + ->buildViolation('This collection should contain only unique elements.') + ->setParameter('{{ value }}', '"a1"') + ->setCode(Unique::IS_NOT_UNIQUE) + ->atPath('property.path[2]') + + ->buildNextViolation('This collection should contain only unique elements.') + ->setParameter('{{ value }}', '"a1"') + ->setCode(Unique::IS_NOT_UNIQUE) + ->atPath('property.path[3]') + + ->buildNextViolation('This collection should contain only unique elements.') + ->setParameter('{{ value }}', '"a2"') + ->setCode(Unique::IS_NOT_UNIQUE) + ->atPath('property.path[4]') + + ->assertRaised(); + } + + public function testWithoutStopOnFirstErrorWithErrorPath() + { + $array = [ + new DummyClassOne(), + new DummyClassOne(), + new DummyClassOne(), + new DummyClassOne(), + new DummyClassOne(), + ]; + + $array[0]->code = 'a1'; + $array[1]->code = 'a2'; + $array[2]->code = 'a1'; + $array[3]->code = 'a1'; + $array[4]->code = 'a2'; + + $this->validator->validate( + $array, + new Unique( + normalizer: [self::class, 'normalizeDummyClassOne'], + fields: 'code', + errorPath: 'code', + stopOnFirstError: false, + ) + ); + + $this + ->buildViolation('This collection should contain only unique elements.') + ->setParameter('{{ value }}', 'array') + ->setCode(Unique::IS_NOT_UNIQUE) + ->atPath('property.path[2].code') + + ->buildNextViolation('This collection should contain only unique elements.') + ->setParameter('{{ value }}', 'array') + ->setCode(Unique::IS_NOT_UNIQUE) + ->atPath('property.path[3].code') + + ->buildNextViolation('This collection should contain only unique elements.') + ->setParameter('{{ value }}', 'array') + ->setCode(Unique::IS_NOT_UNIQUE) + ->atPath('property.path[4].code') + + ->assertRaised(); + } + public static function normalizeDummyClassOne(DummyClassOne $obj): array { return [ From 4a3587a519d372f2396da8e0bf713d38f93ac56d Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Tue, 18 Feb 2025 13:35:11 +0100 Subject: [PATCH 14/74] [Validator] Add support for closures in `When` --- CHANGELOG.md | 1 + Constraints/When.php | 6 +-- Constraints/WhenValidator.php | 6 ++- .../Fixtures/WhenTestWithClosure.php | 31 ++++++++++++++ Tests/Constraints/WhenTest.php | 35 ++++++++++++++++ Tests/Constraints/WhenValidatorTest.php | 42 +++++++++++++++++++ 6 files changed, 117 insertions(+), 4 deletions(-) create mode 100644 Tests/Constraints/Fixtures/WhenTestWithClosure.php diff --git a/CHANGELOG.md b/CHANGELOG.md index e421f748e..0d2c87f17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ CHANGELOG * Add support for the `otherwise` option in the `When` constraint * Add support for multiple fields containing nested constraints in `Composite` constraints * Add the `stopOnFirstError` option to the `Unique` constraint to validate all elements + * Add support for closures in the `When` constraint 7.2 --- diff --git a/Constraints/When.php b/Constraints/When.php index 5fe83ab53..f32b81a37 100644 --- a/Constraints/When.php +++ b/Constraints/When.php @@ -25,13 +25,13 @@ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class When extends Composite { - public string|Expression $expression; + public string|Expression|\Closure $expression; public array|Constraint $constraints = []; public array $values = []; public array|Constraint $otherwise = []; /** - * @param string|Expression|array $expression The condition to evaluate, written with the ExpressionLanguage syntax + * @param string|Expression|array|\Closure(object): bool $expression The condition to evaluate, either as a closure or using the ExpressionLanguage syntax * @param Constraint[]|Constraint|null $constraints One or multiple constraints that are applied if the expression returns true * @param array|null $values The values of the custom variables used in the expression (defaults to []) * @param string[]|null $groups @@ -39,7 +39,7 @@ class When extends Composite * @param Constraint[]|Constraint $otherwise One or multiple constraints that are applied if the expression returns false */ #[HasNamedArguments] - public function __construct(string|Expression|array $expression, array|Constraint|null $constraints = null, ?array $values = null, ?array $groups = null, $payload = null, ?array $options = null, array|Constraint $otherwise = []) + public function __construct(string|Expression|array|\Closure $expression, array|Constraint|null $constraints = null, ?array $values = null, ?array $groups = null, $payload = null, ?array $options = null, array|Constraint $otherwise = []) { if (!class_exists(ExpressionLanguage::class)) { throw new LogicException(\sprintf('The "symfony/expression-language" component is required to use the "%s" constraint. Try running "composer require symfony/expression-language".', __CLASS__)); diff --git a/Constraints/WhenValidator.php b/Constraints/WhenValidator.php index 272bd86e9..1ef14469f 100644 --- a/Constraints/WhenValidator.php +++ b/Constraints/WhenValidator.php @@ -35,7 +35,11 @@ public function validate(mixed $value, Constraint $constraint): void $variables['this'] = $context->getObject(); $variables['context'] = $context; - $result = $this->getExpressionLanguage()->evaluate($constraint->expression, $variables); + if ($constraint->expression instanceof \Closure) { + $result = ($constraint->expression)($context->getObject()); + } else { + $result = $this->getExpressionLanguage()->evaluate($constraint->expression, $variables); + } if ($result) { $context->getValidator()->inContext($context) diff --git a/Tests/Constraints/Fixtures/WhenTestWithClosure.php b/Tests/Constraints/Fixtures/WhenTestWithClosure.php new file mode 100644 index 000000000..56777ac7a --- /dev/null +++ b/Tests/Constraints/Fixtures/WhenTestWithClosure.php @@ -0,0 +1,31 @@ + + * + * 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; + +use Symfony\Component\Validator\Constraints\NotBlank; +use Symfony\Component\Validator\Constraints\NotNull; +use Symfony\Component\Validator\Constraints\When; + +#[When(expression: static function () { + return true; + }, constraints: new NotNull() +)] +class WhenTestWithClosure +{ + #[When(expression: static function () { + return true; + }, constraints: [ + new NotNull(), + new NotBlank(), + ])] + private $foo; +} diff --git a/Tests/Constraints/WhenTest.php b/Tests/Constraints/WhenTest.php index 6516a1014..630bed281 100644 --- a/Tests/Constraints/WhenTest.php +++ b/Tests/Constraints/WhenTest.php @@ -22,6 +22,7 @@ use Symfony\Component\Validator\Mapping\ClassMetadata; use Symfony\Component\Validator\Mapping\Loader\AttributeLoader; use Symfony\Component\Validator\Tests\Constraints\Fixtures\WhenTestWithAttributes; +use Symfony\Component\Validator\Tests\Constraints\Fixtures\WhenTestWithClosure; final class WhenTest extends TestCase { @@ -111,4 +112,38 @@ public function testAttributes() self::assertEquals([new Length(exactly: 10, groups: ['foo'])], $quuxConstraint->otherwise); self::assertSame(['foo'], $quuxConstraint->groups); } + + /** + * @requires PHP 8.5 + */ + public function testAttributesWithClosure() + { + $loader = new AttributeLoader(); + $metadata = new ClassMetadata(WhenTestWithClosure::class); + + self::assertTrue($loader->loadClassMetadata($metadata)); + + [$classConstraint] = $metadata->getConstraints(); + + self::assertInstanceOf(When::class, $classConstraint); + self::assertInstanceOf(\Closure::class, $classConstraint->expression); + self::assertEquals([ + new Callback( + callback: 'callback', + groups: ['Default', 'WhenTestWithClosure'], + ), + ], $classConstraint->constraints); + self::assertEmpty($classConstraint->otherwise); + + [$fooConstraint] = $metadata->properties['foo']->getConstraints(); + + self::assertInstanceOf(When::class, $fooConstraint); + self::assertInstanceOf(\Closure::class, $fooConstraint->expression); + self::assertEquals([ + new NotNull(groups: ['Default', 'WhenTestWithClosure']), + new NotBlank(groups: ['Default', 'WhenTestWithClosure']), + ], $fooConstraint->constraints); + self::assertEmpty($fooConstraint->otherwise); + self::assertSame(['Default', 'WhenTestWithClosure'], $fooConstraint->groups); + } } diff --git a/Tests/Constraints/WhenValidatorTest.php b/Tests/Constraints/WhenValidatorTest.php index 501398d2a..35d8b8ce9 100644 --- a/Tests/Constraints/WhenValidatorTest.php +++ b/Tests/Constraints/WhenValidatorTest.php @@ -40,6 +40,34 @@ public function testConstraintsAreExecuted() )); } + public function testConstraintsAreExecutedWhenClosureIsTrue() + { + $constraints = [ + new NotNull(), + new NotBlank(), + ]; + + $this->expectValidateValue(0, 'Foo', $constraints); + + $this->validator->validate('Foo', new When( + expression: static fn () => true, + constraints: $constraints, + )); + } + + public function testClosureTakesSubject() + { + $subject = new \stdClass(); + $this->setObject($subject); + + $this->validator->validate($subject, new When( + expression: static function ($closureSubject) use ($subject) { + self::assertSame($subject, $closureSubject); + }, + constraints: new NotNull(), + )); + } + public function testConstraintIsExecuted() { $constraint = new NotNull(); @@ -65,6 +93,20 @@ public function testOtherwiseIsExecutedWhenFalse() )); } + public function testOtherwiseIsExecutedWhenClosureReturnsFalse() + { + $constraint = new NotNull(); + $otherwise = new Length(exactly: 10); + + $this->expectValidateValue(0, 'Foo', [$otherwise]); + + $this->validator->validate('Foo', new When( + expression: static fn () => false, + constraints: $constraint, + otherwise: $otherwise, + )); + } + public function testConstraintsAreExecutedWithNull() { $constraints = [ From 15b904cb4ec4be0b83084f0f8c33898875d95c88 Mon Sep 17 00:00:00 2001 From: iraouf Date: Mon, 7 Oct 2024 23:41:27 +0200 Subject: [PATCH 15/74] [Validator] Add `filenameCharset` and `filenameCountUnit` options to `File` constraint --- CHANGELOG.md | 1 + Constraints/File.php | 31 ++++++++- Constraints/FileValidator.php | 32 ++++++++- Constraints/Image.php | 8 ++- Tests/Constraints/FileTest.php | 31 ++++++++- Tests/Constraints/FileValidatorTestCase.php | 75 ++++++++++++++++++--- 6 files changed, 163 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e421f748e..1884db589 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ CHANGELOG 7.3 --- + * Add the `filenameCharset` and `filenameCountUnit` options to the `File` constraint * Deprecate defining custom constraints not supporting named arguments * Deprecate passing an array of options to the constructors of the constraint classes, pass each option as a dedicated argument instead * Add support for ratio checks for SVG files to the `Image` constraint diff --git a/Constraints/File.php b/Constraints/File.php index 8117339ba..7d93a2084 100644 --- a/Constraints/File.php +++ b/Constraints/File.php @@ -14,6 +14,7 @@ use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Exception\InvalidArgumentException; /** * Validates that a value is a valid "file". @@ -38,6 +39,17 @@ class File extends Constraint public const INVALID_MIME_TYPE_ERROR = '744f00bc-4389-4c74-92de-9a43cde55534'; public const INVALID_EXTENSION_ERROR = 'c8c7315c-6186-4719-8b71-5659e16bdcb7'; public const FILENAME_TOO_LONG = 'e5706483-91a8-49d8-9a59-5e81a3c634a8'; + public const FILENAME_INVALID_CHARACTERS = '04ee58e1-42b4-45c7-8423-8a4a145fedd9'; + + public const FILENAME_COUNT_BYTES = 'bytes'; + public const FILENAME_COUNT_CODEPOINTS = 'codepoints'; + public const FILENAME_COUNT_GRAPHEMES = 'graphemes'; + + private const FILENAME_VALID_COUNT_UNITS = [ + self::FILENAME_COUNT_BYTES, + self::FILENAME_COUNT_CODEPOINTS, + self::FILENAME_COUNT_GRAPHEMES, + ]; protected const ERROR_NAMES = [ self::NOT_FOUND_ERROR => 'NOT_FOUND_ERROR', @@ -47,12 +59,17 @@ class File extends Constraint self::INVALID_MIME_TYPE_ERROR => 'INVALID_MIME_TYPE_ERROR', self::INVALID_EXTENSION_ERROR => 'INVALID_EXTENSION_ERROR', self::FILENAME_TOO_LONG => 'FILENAME_TOO_LONG', + self::FILENAME_INVALID_CHARACTERS => 'FILENAME_INVALID_CHARACTERS', ]; public ?bool $binaryFormat = null; public array|string $mimeTypes = []; public ?int $filenameMaxLength = null; public array|string $extensions = []; + public ?string $filenameCharset = null; + /** @var self::FILENAME_COUNT_* */ + public string $filenameCountUnit = self::FILENAME_COUNT_BYTES; + public string $notFoundMessage = 'The file could not be found.'; public string $notReadableMessage = 'The file is not readable.'; public string $maxSizeMessage = 'The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.'; @@ -60,6 +77,7 @@ class File extends Constraint public string $extensionsMessage = 'The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}.'; public string $disallowEmptyMessage = 'An empty file is not allowed.'; public string $filenameTooLongMessage = '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.'; + public string $filenameCharsetMessage = 'This filename does not match the expected charset.'; public string $uploadIniSizeErrorMessage = 'The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.'; public string $uploadFormSizeErrorMessage = 'The file is too large.'; @@ -87,6 +105,8 @@ class File extends Constraint * @param string|null $uploadErrorMessage Message if an unknown error occurred on upload * @param string[]|null $groups * @param array|string|null $extensions A list of valid extensions to check. Related media types are also enforced ({@see https://symfony.com/doc/current/reference/constraints/File.html#extensions}) + * @param string|null $filenameCharset The charset to be used when computing filename length (defaults to null) + * @param self::FILENAME_COUNT_*|null $filenameCountUnit The character count unit used for checking the filename length (defaults to {@see File::FILENAME_COUNT_BYTES}) * * @see https://www.iana.org/assignments/media-types/media-types.xhtml Existing media types */ @@ -114,9 +134,11 @@ public function __construct( ?string $uploadErrorMessage = null, ?array $groups = null, mixed $payload = null, - array|string|null $extensions = null, ?string $extensionsMessage = null, + ?string $filenameCharset = null, + ?string $filenameCountUnit = null, + ?string $filenameCharsetMessage = null, ) { if (\is_array($options)) { trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); @@ -128,6 +150,8 @@ public function __construct( $this->binaryFormat = $binaryFormat ?? $this->binaryFormat; $this->mimeTypes = $mimeTypes ?? $this->mimeTypes; $this->filenameMaxLength = $filenameMaxLength ?? $this->filenameMaxLength; + $this->filenameCharset = $filenameCharset ?? $this->filenameCharset; + $this->filenameCountUnit = $filenameCountUnit ?? $this->filenameCountUnit; $this->extensions = $extensions ?? $this->extensions; $this->notFoundMessage = $notFoundMessage ?? $this->notFoundMessage; $this->notReadableMessage = $notReadableMessage ?? $this->notReadableMessage; @@ -136,6 +160,7 @@ public function __construct( $this->extensionsMessage = $extensionsMessage ?? $this->extensionsMessage; $this->disallowEmptyMessage = $disallowEmptyMessage ?? $this->disallowEmptyMessage; $this->filenameTooLongMessage = $filenameTooLongMessage ?? $this->filenameTooLongMessage; + $this->filenameCharsetMessage = $filenameCharsetMessage ?? $this->filenameCharsetMessage; $this->uploadIniSizeErrorMessage = $uploadIniSizeErrorMessage ?? $this->uploadIniSizeErrorMessage; $this->uploadFormSizeErrorMessage = $uploadFormSizeErrorMessage ?? $this->uploadFormSizeErrorMessage; $this->uploadPartialErrorMessage = $uploadPartialErrorMessage ?? $this->uploadPartialErrorMessage; @@ -148,6 +173,10 @@ public function __construct( if (null !== $this->maxSize) { $this->normalizeBinaryFormat($this->maxSize); } + + if (!\in_array($this->filenameCountUnit, self::FILENAME_VALID_COUNT_UNITS, true)) { + throw new InvalidArgumentException(\sprintf('The "filenameCountUnit" option must be one of the "%s::FILENAME_COUNT_*" constants ("%s" given).', __CLASS__, $this->filenameCountUnit)); + } } public function __set(string $option, mixed $value): void diff --git a/Constraints/FileValidator.php b/Constraints/FileValidator.php index 03c12b91e..2b8e33494 100644 --- a/Constraints/FileValidator.php +++ b/Constraints/FileValidator.php @@ -137,10 +137,36 @@ public function validate(mixed $value, Constraint $constraint): void return; } - $sizeInBytes = filesize($path); $basename = $value instanceof UploadedFile ? $value->getClientOriginalName() : basename($path); + $filenameCharset = $constraint->filenameCharset ?? (File::FILENAME_COUNT_BYTES !== $constraint->filenameCountUnit ? 'UTF-8' : null); + + if ($invalidFilenameCharset = null !== $filenameCharset) { + try { + $invalidFilenameCharset = !@mb_check_encoding($basename, $constraint->filenameCharset); + } catch (\ValueError $e) { + if (!str_starts_with($e->getMessage(), 'mb_check_encoding(): Argument #2 ($encoding) must be a valid encoding')) { + throw $e; + } + } + } + + $filenameLength = $invalidFilenameCharset ? 0 : match ($constraint->filenameCountUnit) { + File::FILENAME_COUNT_BYTES => \strlen($basename), + File::FILENAME_COUNT_CODEPOINTS => mb_strlen($basename, $filenameCharset), + File::FILENAME_COUNT_GRAPHEMES => grapheme_strlen($basename), + }; + + if ($invalidFilenameCharset || false === ($filenameLength ?? false)) { + $this->context->buildViolation($constraint->filenameCharsetMessage) + ->setParameter('{{ name }}', $this->formatValue($basename)) + ->setParameter('{{ charset }}', $filenameCharset) + ->setCode(File::FILENAME_INVALID_CHARACTERS) + ->addViolation(); + + return; + } - if ($constraint->filenameMaxLength && $constraint->filenameMaxLength < $filenameLength = \strlen($basename)) { + if ($constraint->filenameMaxLength && $constraint->filenameMaxLength < $filenameLength) { $this->context->buildViolation($constraint->filenameTooLongMessage) ->setParameter('{{ filename_max_length }}', $this->formatValue($constraint->filenameMaxLength)) ->setCode(File::FILENAME_TOO_LONG) @@ -150,7 +176,7 @@ public function validate(mixed $value, Constraint $constraint): void return; } - if (0 === $sizeInBytes) { + if (!$sizeInBytes = filesize($path)) { $this->context->buildViolation($constraint->disallowEmptyMessage) ->setParameter('{{ file }}', $this->formatValue($path)) ->setParameter('{{ name }}', $this->formatValue($basename)) diff --git a/Constraints/Image.php b/Constraints/Image.php index 0f045d9f9..59cd6ba88 100644 --- a/Constraints/Image.php +++ b/Constraints/Image.php @@ -165,6 +165,9 @@ public function __construct( ?string $corruptedMessage = null, ?array $groups = null, mixed $payload = null, + ?string $filenameCharset = null, + ?string $filenameCountUnit = null, + ?string $filenameCharsetMessage = null, ) { parent::__construct( $options, @@ -187,7 +190,10 @@ public function __construct( $uploadExtensionErrorMessage, $uploadErrorMessage, $groups, - $payload + $payload, + $filenameCharset, + $filenameCountUnit, + $filenameCharsetMessage, ); $this->minWidth = $minWidth ?? $this->minWidth; diff --git a/Tests/Constraints/FileTest.php b/Tests/Constraints/FileTest.php index e4e30a581..3e03f7881 100644 --- a/Tests/Constraints/FileTest.php +++ b/Tests/Constraints/FileTest.php @@ -14,6 +14,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\Constraints\File; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Exception\InvalidArgumentException; use Symfony\Component\Validator\Mapping\ClassMetadata; use Symfony\Component\Validator\Mapping\Loader\AttributeLoader; @@ -79,6 +80,31 @@ public function testMaxSizeCannotBeSetToInvalidValueAfterInitialization($maxSize $this->assertSame(1000, $file->maxSize); } + public function testFilenameMaxLength() + { + $file = new File(filenameMaxLength: 30); + $this->assertSame(30, $file->filenameMaxLength); + } + + public function testDefaultFilenameCountUnitIsUsed() + { + $file = new File(); + self::assertSame(File::FILENAME_COUNT_BYTES, $file->filenameCountUnit); + } + + public function testFilenameCharsetDefaultsToNull() + { + $file = new File(); + self::assertNull($file->filenameCharset); + } + + public function testInvalidFilenameCountUnitThrowsException() + { + self::expectException(InvalidArgumentException::class); + self::expectExceptionMessage(\sprintf('The "filenameCountUnit" option must be one of the "%s::FILENAME_COUNT_*" constants ("%s" given).', File::class, 'nonExistentCountUnit')); + $file = new File(filenameCountUnit: 'nonExistentCountUnit'); + } + /** * @dataProvider provideInValidSizes */ @@ -162,6 +188,9 @@ public function testAttributes() self::assertSame(100000, $cConstraint->maxSize); self::assertSame(['my_group'], $cConstraint->groups); self::assertSame('some attached data', $cConstraint->payload); + self::assertSame(30, $cConstraint->filenameMaxLength); + self::assertSame('ISO-8859-15', $cConstraint->filenameCharset); + self::assertSame(File::FILENAME_COUNT_CODEPOINTS, $cConstraint->filenameCountUnit); } } @@ -173,6 +202,6 @@ class FileDummy #[File(maxSize: 100, notFoundMessage: 'myMessage')] private $b; - #[File(maxSize: '100K', groups: ['my_group'], payload: 'some attached data')] + #[File(maxSize: '100K', filenameMaxLength: 30, filenameCharset: 'ISO-8859-15', filenameCountUnit: File::FILENAME_COUNT_CODEPOINTS, groups: ['my_group'], payload: 'some attached data')] private $c; } diff --git a/Tests/Constraints/FileValidatorTestCase.php b/Tests/Constraints/FileValidatorTestCase.php index 81e833b27..b1ebf530e 100644 --- a/Tests/Constraints/FileValidatorTestCase.php +++ b/Tests/Constraints/FileValidatorTestCase.php @@ -675,11 +675,11 @@ public function testUploadedFileExtensions() /** * @dataProvider provideFilenameMaxLengthIsTooLong */ - public function testFilenameMaxLengthIsTooLong(File $constraintFile, string $messageViolation) + public function testFilenameMaxLengthIsTooLong(File $constraintFile, string $filename, string $messageViolation) { file_put_contents($this->path, '1'); - $file = new UploadedFile($this->path, 'myFileWithATooLongOriginalFileName', null, null, true); + $file = new UploadedFile($this->path, $filename, null, null, true); $this->validator->validate($file, $constraintFile); $this->buildViolation($messageViolation) @@ -693,26 +693,83 @@ public function testFilenameMaxLengthIsTooLong(File $constraintFile, string $mes public static function provideFilenameMaxLengthIsTooLong(): \Generator { - yield 'Simple case with only the parameter "filenameMaxLength" ' => [ + yield 'Codepoints and UTF-8 : default' => [ new File(filenameMaxLength: 30), + 'myFileWithATooLongOriginalFileName', '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.', ]; - yield 'Case with the parameter "filenameMaxLength" and a custom error message' => [ - new File(filenameMaxLength: 20, filenameTooLongMessage: 'Your filename is too long. Please use at maximum {{ filename_max_length }} characters'), - 'Your filename is too long. Please use at maximum {{ filename_max_length }} characters', + yield 'Codepoints and UTF-8: custom error message' => [ + new File(filenameMaxLength: 20, filenameTooLongMessage: 'myMessage'), + 'myFileWithATooLongOriginalFileName', + 'myMessage', + ]; + + yield 'Graphemes' => [ + new File(filenameMaxLength: 1, filenameCountUnit: File::FILENAME_COUNT_GRAPHEMES, filenameTooLongMessage: 'myMessage'), + "A\u{0300}A\u{0300}", + 'myMessage', + ]; + + yield 'Bytes' => [ + new File(filenameMaxLength: 5, filenameCountUnit: File::FILENAME_COUNT_BYTES, filenameTooLongMessage: 'myMessage'), + "A\u{0300}A\u{0300}", + 'myMessage', ]; } - public function testFilenameMaxLength() + /** + * @dataProvider provideFilenameCountUnit + */ + public function testValidCountUnitFilenameMaxLength(int $maxLength, string $countUnit) { file_put_contents($this->path, '1'); - $file = new UploadedFile($this->path, 'tinyOriginalFileName', null, null, true); - $this->validator->validate($file, new File(filenameMaxLength: 20)); + $file = new UploadedFile($this->path, "A\u{0300}", null, null, true); + $this->validator->validate($file, new File(filenameMaxLength: $maxLength, filenameCountUnit: $countUnit)); $this->assertNoViolation(); } + /** + * @dataProvider provideFilenameCharset + */ + public function testFilenameCharset(string $filename, string $charset, bool $isValid) + { + file_put_contents($this->path, '1'); + + $file = new UploadedFile($this->path, $filename, null, null, true); + $this->validator->validate($file, new File(filenameCharset: $charset, filenameCharsetMessage: 'myMessage')); + + if ($isValid) { + $this->assertNoViolation(); + } else { + $this->buildViolation('myMessage') + ->setParameter('{{ name }}', '"'.$filename.'"') + ->setParameter('{{ charset }}', $charset) + ->setCode(File::FILENAME_INVALID_CHARACTERS) + ->assertRaised(); + } + } + + public static function provideFilenameCountUnit(): array + { + return [ + 'graphemes' => [1, File::FILENAME_COUNT_GRAPHEMES], + 'codepoints' => [2, File::FILENAME_COUNT_CODEPOINTS], + 'bytes' => [3, File::FILENAME_COUNT_BYTES], + ]; + } + + public static function provideFilenameCharset(): array + { + return [ + ['é', 'utf8', true], + ["\xE9", 'CP1252', true], + ["\xE9", 'XXX', false], + ["\xE9", 'utf8', false], + ]; + } + abstract protected function getFile($filename); } From 9bf984601dffebb3e808f6ce4291e9b167a7ee61 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sun, 2 Mar 2025 15:41:56 +0100 Subject: [PATCH 16/74] fix test setup and skip test until bug is fixed in PHP --- Tests/Constraints/Fixtures/WhenTestWithClosure.php | 3 ++- Tests/Constraints/WhenTest.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Tests/Constraints/Fixtures/WhenTestWithClosure.php b/Tests/Constraints/Fixtures/WhenTestWithClosure.php index 56777ac7a..de0f07daa 100644 --- a/Tests/Constraints/Fixtures/WhenTestWithClosure.php +++ b/Tests/Constraints/Fixtures/WhenTestWithClosure.php @@ -11,13 +11,14 @@ namespace Symfony\Component\Validator\Tests\Constraints\Fixtures; +use Symfony\Component\Validator\Constraints\Callback; use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotNull; use Symfony\Component\Validator\Constraints\When; #[When(expression: static function () { return true; - }, constraints: new NotNull() + }, constraints: new Callback('isValid') )] class WhenTestWithClosure { diff --git a/Tests/Constraints/WhenTest.php b/Tests/Constraints/WhenTest.php index a7dea114d..4435dd88e 100644 --- a/Tests/Constraints/WhenTest.php +++ b/Tests/Constraints/WhenTest.php @@ -118,6 +118,8 @@ public function testAttributes() */ public function testAttributesWithClosure() { + $this->markTestSkipped('Requires https://github.com/php/php-src/issues/17851 to be fixed'); + $loader = new AttributeLoader(); $metadata = new ClassMetadata(WhenTestWithClosure::class); @@ -129,7 +131,7 @@ public function testAttributesWithClosure() self::assertInstanceOf(\Closure::class, $classConstraint->expression); self::assertEquals([ new Callback( - callback: 'callback', + callback: 'isValid', groups: ['Default', 'WhenTestWithClosure'], ), ], $classConstraint->constraints); From bc1f8c8be24ccc4c7a0d2a7840a1ccfe963409af Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sun, 2 Mar 2025 16:03:52 +0100 Subject: [PATCH 17/74] replace assertEmpty() with stricter assertions --- Test/CompoundConstraintTestCase.php | 3 ++- Tests/Constraints/WhenTest.php | 14 +++++++------- Tests/Mapping/Loader/PropertyInfoLoaderTest.php | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Test/CompoundConstraintTestCase.php b/Test/CompoundConstraintTestCase.php index db7021729..1a0544c82 100644 --- a/Test/CompoundConstraintTestCase.php +++ b/Test/CompoundConstraintTestCase.php @@ -102,7 +102,8 @@ protected function getConstraints(array $options): array next($expectedViolations); } - $this->assertEmpty( + $this->assertSame( + [], $failedToAssertViolations, \sprintf('Expected violation(s) for constraint(s) %s to be raised by compound.', implode(', ', array_map(fn ($violation) => ($violation->getConstraint())::class, $failedToAssertViolations)) diff --git a/Tests/Constraints/WhenTest.php b/Tests/Constraints/WhenTest.php index 4435dd88e..a1b4bd501 100644 --- a/Tests/Constraints/WhenTest.php +++ b/Tests/Constraints/WhenTest.php @@ -61,7 +61,7 @@ public function testAttributes() groups: ['Default', 'WhenTestWithAttributes'], ), ], $classConstraint->constraints); - self::assertEmpty($classConstraint->otherwise); + self::assertSame([], $classConstraint->otherwise); [$fooConstraint] = $metadata->properties['foo']->getConstraints(); @@ -71,7 +71,7 @@ public function testAttributes() new NotNull(groups: ['Default', 'WhenTestWithAttributes']), new NotBlank(groups: ['Default', 'WhenTestWithAttributes']), ], $fooConstraint->constraints); - self::assertEmpty($fooConstraint->otherwise); + self::assertSame([], $fooConstraint->otherwise); self::assertSame(['Default', 'WhenTestWithAttributes'], $fooConstraint->groups); [$barConstraint] = $metadata->properties['bar']->getConstraints(); @@ -82,7 +82,7 @@ public function testAttributes() new NotNull(groups: ['foo']), new NotBlank(groups: ['foo']), ], $barConstraint->constraints); - self::assertEmpty($barConstraint->otherwise); + self::assertSame([], $barConstraint->otherwise); self::assertSame(['foo'], $barConstraint->groups); [$quxConstraint] = $metadata->properties['qux']->getConstraints(); @@ -90,7 +90,7 @@ public function testAttributes() self::assertInstanceOf(When::class, $quxConstraint); self::assertSame('true', $quxConstraint->expression); self::assertEquals([new NotNull(groups: ['foo'])], $quxConstraint->constraints); - self::assertEmpty($quxConstraint->otherwise); + self::assertSame([], $quxConstraint->otherwise); self::assertSame(['foo'], $quxConstraint->groups); [$bazConstraint] = $metadata->getters['baz']->getConstraints(); @@ -101,7 +101,7 @@ public function testAttributes() new NotNull(groups: ['Default', 'WhenTestWithAttributes']), new NotBlank(groups: ['Default', 'WhenTestWithAttributes']), ], $bazConstraint->constraints); - self::assertEmpty($bazConstraint->otherwise); + self::assertSame([], $bazConstraint->otherwise); self::assertSame(['Default', 'WhenTestWithAttributes'], $bazConstraint->groups); [$quuxConstraint] = $metadata->properties['quux']->getConstraints(); @@ -135,7 +135,7 @@ public function testAttributesWithClosure() groups: ['Default', 'WhenTestWithClosure'], ), ], $classConstraint->constraints); - self::assertEmpty($classConstraint->otherwise); + self::assertSame([], $classConstraint->otherwise); [$fooConstraint] = $metadata->properties['foo']->getConstraints(); @@ -145,7 +145,7 @@ public function testAttributesWithClosure() new NotNull(groups: ['Default', 'WhenTestWithClosure']), new NotBlank(groups: ['Default', 'WhenTestWithClosure']), ], $fooConstraint->constraints); - self::assertEmpty($fooConstraint->otherwise); + self::assertSame([], $fooConstraint->otherwise); self::assertSame(['Default', 'WhenTestWithClosure'], $fooConstraint->groups); } } diff --git a/Tests/Mapping/Loader/PropertyInfoLoaderTest.php b/Tests/Mapping/Loader/PropertyInfoLoaderTest.php index 6c49f0d25..ae5253a3f 100644 --- a/Tests/Mapping/Loader/PropertyInfoLoaderTest.php +++ b/Tests/Mapping/Loader/PropertyInfoLoaderTest.php @@ -214,7 +214,7 @@ public function getTypes(string $class, string $property, array $context = []): $this->assertInstanceOf(Iban::class, $alreadyPartiallyMappedCollectionConstraints[0]->constraints[1]); $readOnlyMetadata = $classMetadata->getPropertyMetadata('readOnly'); - $this->assertEmpty($readOnlyMetadata); + $this->assertSame([], $readOnlyMetadata); /** @var PropertyMetadata[] $noAutoMappingMetadata */ $noAutoMappingMetadata = $classMetadata->getPropertyMetadata('noAutoMapping'); @@ -298,7 +298,7 @@ public function getTypes(string $class, string $property, array $context = []): /** @var ClassMetadata $classMetadata */ $classMetadata = $validator->getMetadataFor(new PropertyInfoLoaderNoAutoMappingEntity()); - $this->assertEmpty($classMetadata->getPropertyMetadata('string')); + $this->assertSame([], $classMetadata->getPropertyMetadata('string')); $this->assertCount(2, $classMetadata->getPropertyMetadata('autoMappingExplicitlyEnabled')[0]->constraints); $this->assertSame(AutoMappingStrategy::ENABLED, $classMetadata->getPropertyMetadata('autoMappingExplicitlyEnabled')[0]->getAutoMappingStrategy()); } From f8d1c698576d7771e62506464ee8dc377c405393 Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Sat, 8 Mar 2025 00:16:33 +0100 Subject: [PATCH 18/74] chore: PHP CS Fixer fixes --- Constraints/Sequentially.php | 2 +- Constraints/ZeroComparisonConstraintTrait.php | 4 ++-- Tests/Constraints/CardSchemeValidatorTest.php | 2 +- Tests/Constraints/ChoiceValidatorTest.php | 3 +++ Tests/Constraints/CountValidatorTestCase.php | 6 ++++++ Tests/Constraints/ImageValidatorTest.php | 2 +- Tests/Constraints/IsbnValidatorTest.php | 2 ++ Tests/Constraints/LengthValidatorTest.php | 2 +- Tests/Constraints/RangeValidatorTest.php | 10 ++++++++++ Tests/Constraints/RegexValidatorTest.php | 2 ++ Tests/Mapping/Loader/FilesLoaderTest.php | 6 ++++-- 11 files changed, 33 insertions(+), 8 deletions(-) diff --git a/Constraints/Sequentially.php b/Constraints/Sequentially.php index bdedb2a5e..1096a994d 100644 --- a/Constraints/Sequentially.php +++ b/Constraints/Sequentially.php @@ -30,7 +30,7 @@ class Sequentially extends Composite */ public function __construct(mixed $constraints = null, ?array $groups = null, mixed $payload = null) { - if (is_array($constraints) && !array_is_list($constraints)) { + if (\is_array($constraints) && !array_is_list($constraints)) { trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } diff --git a/Constraints/ZeroComparisonConstraintTrait.php b/Constraints/ZeroComparisonConstraintTrait.php index d8479c20f..d0841adea 100644 --- a/Constraints/ZeroComparisonConstraintTrait.php +++ b/Constraints/ZeroComparisonConstraintTrait.php @@ -29,11 +29,11 @@ public function __construct(?array $options = null, ?string $message = null, ?ar trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } - if (is_array($options) && isset($options['propertyPath'])) { + if (\is_array($options) && isset($options['propertyPath'])) { throw new ConstraintDefinitionException(\sprintf('The "propertyPath" option of the "%s" constraint cannot be set.', static::class)); } - if (is_array($options) && isset($options['value'])) { + if (\is_array($options) && isset($options['value'])) { throw new ConstraintDefinitionException(\sprintf('The "value" option of the "%s" constraint cannot be set.', static::class)); } diff --git a/Tests/Constraints/CardSchemeValidatorTest.php b/Tests/Constraints/CardSchemeValidatorTest.php index 87b1daebc..d70457833 100644 --- a/Tests/Constraints/CardSchemeValidatorTest.php +++ b/Tests/Constraints/CardSchemeValidatorTest.php @@ -31,7 +31,7 @@ public function testNullIsValid() public function testEmptyStringIsValid() { - $this->validator->validate('', new CardScheme(schemes:[])); + $this->validator->validate('', new CardScheme(schemes: [])); $this->assertNoViolation(); } diff --git a/Tests/Constraints/ChoiceValidatorTest.php b/Tests/Constraints/ChoiceValidatorTest.php index a219e44d8..39affe442 100644 --- a/Tests/Constraints/ChoiceValidatorTest.php +++ b/Tests/Constraints/ChoiceValidatorTest.php @@ -92,6 +92,7 @@ public static function provideConstraintsWithChoicesArray(): iterable /** * @group legacy + * * @dataProvider provideLegacyConstraintsWithChoicesArrayDoctrineStyle */ public function testValidChoiceArrayDoctrineStyle(Choice $constraint) @@ -126,6 +127,7 @@ public static function provideConstraintsWithCallbackFunction(): iterable /** * @group legacy + * * @dataProvider provideLegacyConstraintsWithCallbackFunctionDoctrineStyle */ public function testValidChoiceCallbackFunctionDoctrineStyle(Choice $constraint) @@ -262,6 +264,7 @@ public function testInvalidChoiceMultiple() ->setCode(Choice::NO_SUCH_CHOICE_ERROR) ->assertRaised(); } + /** * @group legacy */ diff --git a/Tests/Constraints/CountValidatorTestCase.php b/Tests/Constraints/CountValidatorTestCase.php index f60199027..da319cd8b 100644 --- a/Tests/Constraints/CountValidatorTestCase.php +++ b/Tests/Constraints/CountValidatorTestCase.php @@ -71,6 +71,7 @@ public static function getFiveOrMoreElements() /** * @group legacy + * * @dataProvider getThreeOrLessElements */ public function testValidValuesMax($value) @@ -94,6 +95,7 @@ public function testValidValuesMaxNamed($value) /** * @group legacy + * * @dataProvider getFiveOrMoreElements */ public function testValidValuesMin($value) @@ -117,6 +119,7 @@ public function testValidValuesMinNamed($value) /** * @group legacy + * * @dataProvider getFourElements */ public function testValidValuesExact($value) @@ -140,6 +143,7 @@ public function testValidValuesExactNamed($value) /** * @group legacy + * * @dataProvider getFiveOrMoreElements */ public function testTooManyValues($value) @@ -180,6 +184,7 @@ public function testTooManyValuesNamed($value) /** * @group legacy + * * @dataProvider getThreeOrLessElements */ public function testTooFewValues($value) @@ -220,6 +225,7 @@ public function testTooFewValuesNamed($value) /** * @group legacy + * * @dataProvider getFiveOrMoreElements */ public function testTooManyValuesExact($value) diff --git a/Tests/Constraints/ImageValidatorTest.php b/Tests/Constraints/ImageValidatorTest.php index 8811c5774..a79bd9dd4 100644 --- a/Tests/Constraints/ImageValidatorTest.php +++ b/Tests/Constraints/ImageValidatorTest.php @@ -545,7 +545,7 @@ public function testInvalidMimeTypeWithNarrowedSetDoctrineStyle() ])); $this->buildViolation('The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.') - ->setParameter('{{ file }}', sprintf('"%s"', $this->image)) + ->setParameter('{{ file }}', \sprintf('"%s"', $this->image)) ->setParameter('{{ type }}', '"image/gif"') ->setParameter('{{ types }}', '"image/jpeg", "image/png"') ->setParameter('{{ name }}', '"test.gif"') diff --git a/Tests/Constraints/IsbnValidatorTest.php b/Tests/Constraints/IsbnValidatorTest.php index 9d2336f7f..f9393158d 100644 --- a/Tests/Constraints/IsbnValidatorTest.php +++ b/Tests/Constraints/IsbnValidatorTest.php @@ -159,6 +159,7 @@ public function testValidIsbn10($isbn) /** * @group legacy + * * @dataProvider getInvalidIsbn10 */ public function testInvalidIsbn10($isbn, $code) @@ -203,6 +204,7 @@ public function testValidIsbn13($isbn) /** * @group legacy + * * @dataProvider getInvalidIsbn13 */ public function testInvalidIsbn13($isbn, $code) diff --git a/Tests/Constraints/LengthValidatorTest.php b/Tests/Constraints/LengthValidatorTest.php index 0c228f25d..10f61f50b 100644 --- a/Tests/Constraints/LengthValidatorTest.php +++ b/Tests/Constraints/LengthValidatorTest.php @@ -271,7 +271,7 @@ public function testInvalidValuesExactLessThanFour(int|string $value, int $value $constraint = new Length( min: 4, max: 4, - exactMessage: 'myMessage', + exactMessage: 'myMessage', ); $this->validator->validate($value, $constraint); diff --git a/Tests/Constraints/RangeValidatorTest.php b/Tests/Constraints/RangeValidatorTest.php index f8765af18..423c8d460 100644 --- a/Tests/Constraints/RangeValidatorTest.php +++ b/Tests/Constraints/RangeValidatorTest.php @@ -71,6 +71,7 @@ public static function getMoreThanTwenty(): array /** * @group legacy + * * @dataProvider getTenToTwenty */ public function testValidValuesMin($value) @@ -94,6 +95,7 @@ public function testValidValuesMinNamed($value) /** * @group legacy + * * @dataProvider getTenToTwenty */ public function testValidValuesMax($value) @@ -117,6 +119,7 @@ public function testValidValuesMaxNamed($value) /** * @group legacy + * * @dataProvider getTenToTwenty */ public function testValidValuesMinMax($value) @@ -140,6 +143,7 @@ public function testValidValuesMinMaxNamed($value) /** * @group legacy + * * @dataProvider getLessThanTen */ public function testInvalidValuesMin($value, $formattedValue) @@ -176,6 +180,7 @@ public function testInvalidValuesMinNamed($value, $formattedValue) /** * @group legacy + * * @dataProvider getMoreThanTwenty */ public function testInvalidValuesMax($value, $formattedValue) @@ -212,6 +217,7 @@ public function testInvalidValuesMaxNamed($value, $formattedValue) /** * @group legacy + * * @dataProvider getMoreThanTwenty */ public function testInvalidValuesCombinedMax($value, $formattedValue) @@ -251,6 +257,7 @@ public function testInvalidValuesCombinedMaxNamed($value, $formattedValue) /** * @group legacy + * * @dataProvider getLessThanTen */ public function testInvalidValuesCombinedMin($value, $formattedValue) @@ -629,6 +636,7 @@ public function testNoViolationOnNullObjectWithPropertyPaths() /** * @group legacy + * * @dataProvider getTenToTwenty */ public function testValidValuesMinPropertyPath($value) @@ -741,6 +749,7 @@ public function testInvalidValuesMaxPropertyPath($value, $formattedValue) /** * @group legacy + * * @dataProvider getMoreThanTwenty */ public function testInvalidValuesCombinedMaxPropertyPath($value, $formattedValue) @@ -792,6 +801,7 @@ public function testInvalidValuesCombinedMaxPropertyPathNamed($value, $formatted /** * @group legacy + * * @dataProvider getLessThanTen */ public function testInvalidValuesCombinedMinPropertyPath($value, $formattedValue) diff --git a/Tests/Constraints/RegexValidatorTest.php b/Tests/Constraints/RegexValidatorTest.php index 576df3748..bafc752c3 100644 --- a/Tests/Constraints/RegexValidatorTest.php +++ b/Tests/Constraints/RegexValidatorTest.php @@ -56,6 +56,7 @@ public function testValidValues($value) /** * @group legacy + * * @dataProvider getValidValuesWithWhitespaces */ public function testValidValuesWithWhitespaces($value) @@ -107,6 +108,7 @@ public static function getValidValuesWithWhitespaces() /** * @group legacy + * * @dataProvider getInvalidValues */ public function testInvalidValues($value) diff --git a/Tests/Mapping/Loader/FilesLoaderTest.php b/Tests/Mapping/Loader/FilesLoaderTest.php index 765b84fd6..ffb0dd23b 100644 --- a/Tests/Mapping/Loader/FilesLoaderTest.php +++ b/Tests/Mapping/Loader/FilesLoaderTest.php @@ -36,11 +36,13 @@ public function testCallsActualFileLoaderForMetadata() public function getFilesLoader(LoaderInterface $loader) { - return new class([ + $files = [ __DIR__.'/constraint-mapping.xml', __DIR__.'/constraint-mapping.yaml', __DIR__.'/constraint-mapping.test', __DIR__.'/constraint-mapping.txt', - ], $loader) extends FilesLoader {}; + ]; + + return new class($files, $loader) extends FilesLoader {}; } } From 90190df2419927059b9c286a7f2fa6db62148885 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Thu, 27 Mar 2025 11:21:50 +0100 Subject: [PATCH 19/74] [Validator] Don't skip `WhenTest` case after fix merge in `php-src` --- Tests/Constraints/WhenTest.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tests/Constraints/WhenTest.php b/Tests/Constraints/WhenTest.php index a1b4bd501..8f04376b3 100644 --- a/Tests/Constraints/WhenTest.php +++ b/Tests/Constraints/WhenTest.php @@ -118,8 +118,6 @@ public function testAttributes() */ public function testAttributesWithClosure() { - $this->markTestSkipped('Requires https://github.com/php/php-src/issues/17851 to be fixed'); - $loader = new AttributeLoader(); $metadata = new ClassMetadata(WhenTestWithClosure::class); From d0f8a8f7f754f809e758ae55463862ef8d3a0c4e Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 18 Apr 2025 14:51:48 +0200 Subject: [PATCH 20/74] Don't enable tracing unless the profiler is enabled --- Validator/TraceableValidator.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Validator/TraceableValidator.php b/Validator/TraceableValidator.php index 5442c53da..6f9ab5bbc 100644 --- a/Validator/TraceableValidator.php +++ b/Validator/TraceableValidator.php @@ -29,6 +29,7 @@ class TraceableValidator implements ValidatorInterface, ResetInterface public function __construct( private ValidatorInterface $validator, + protected readonly ?\Closure $disabled = null, ) { } @@ -56,6 +57,10 @@ public function validate(mixed $value, Constraint|array|null $constraints = null { $violations = $this->validator->validate($value, $constraints, $groups); + if ($this->disabled?->__invoke()) { + return $violations; + } + $trace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 7); $file = $trace[0]['file']; From 9ded0f389dfb8f4473b580d9b874052bc2385b3d Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 15 May 2025 09:25:30 +0200 Subject: [PATCH 21/74] let the SlugValidator accept AsciiSlugger results --- Constraints/Slug.php | 2 +- Tests/Constraints/SlugValidatorTest.php | 19 ++++++++++++++++--- composer.json | 1 + 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Constraints/Slug.php b/Constraints/Slug.php index 52a5d94c2..55d847ccb 100644 --- a/Constraints/Slug.php +++ b/Constraints/Slug.php @@ -25,7 +25,7 @@ class Slug extends Constraint public const NOT_SLUG_ERROR = '14e6df1e-c8ab-4395-b6ce-04b132a3765e'; public string $message = 'This value is not a valid slug.'; - public string $regex = '/^[a-z0-9]+(?:-[a-z0-9]+)*$/'; + public string $regex = '/^[a-z0-9]+(?:-[a-z0-9]+)*$/i'; #[HasNamedArguments] public function __construct( diff --git a/Tests/Constraints/SlugValidatorTest.php b/Tests/Constraints/SlugValidatorTest.php index e8d210b83..f88bff3e1 100644 --- a/Tests/Constraints/SlugValidatorTest.php +++ b/Tests/Constraints/SlugValidatorTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Tests\Constraints; +use Symfony\Component\String\Slugger\AsciiSlugger; use Symfony\Component\Validator\Constraints\Slug; use Symfony\Component\Validator\Constraints\SlugValidator; use Symfony\Component\Validator\Exception\UnexpectedValueException; @@ -47,6 +48,7 @@ public function testExpectsStringCompatibleType() * @testWith ["test-slug"] * ["slug-123-test"] * ["slug"] + * ["TestSlug"] */ public function testValidSlugs($slug) { @@ -56,8 +58,7 @@ public function testValidSlugs($slug) } /** - * @testWith ["NotASlug"] - * ["Not a slug"] + * @testWith ["Not a slug"] * ["not-á-slug"] * ["not-@-slug"] */ @@ -91,7 +92,7 @@ public function testCustomRegexInvalidSlugs($slug) /** * @testWith ["slug"] - * @testWith ["test1234"] + * ["test1234"] */ public function testCustomRegexValidSlugs($slug) { @@ -101,4 +102,16 @@ public function testCustomRegexValidSlugs($slug) $this->assertNoViolation(); } + + /** + * @testWith ["PHP"] + * ["Symfony is cool"] + * ["Lorem ipsum dolor sit amet"] + */ + public function testAcceptAsciiSluggerResults(string $text) + { + $this->validator->validate((new AsciiSlugger())->slug($text), new Slug()); + + $this->assertNoViolation(); + } } diff --git a/composer.json b/composer.json index 5177d37d2..0eaac5f6b 100644 --- a/composer.json +++ b/composer.json @@ -38,6 +38,7 @@ "symfony/mime": "^6.4|^7.0", "symfony/property-access": "^6.4|^7.0", "symfony/property-info": "^6.4|^7.0", + "symfony/string": "^6.4|^7.0", "symfony/translation": "^6.4.3|^7.0.3", "symfony/type-info": "^7.1", "egulias/email-validator": "^2.1.10|^3|^4" From 4e192e532505fa6226f09a580fd0c5d1eaa63b62 Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Mon, 19 May 2025 10:27:13 +0200 Subject: [PATCH 22/74] Revert Slug constraint This commit reverts #58542. --- CHANGELOG.md | 1 - Constraints/Slug.php | 42 --------- Constraints/SlugValidator.php | 47 ---------- Tests/Constraints/SlugTest.php | 47 ---------- Tests/Constraints/SlugValidatorTest.php | 117 ------------------------ 5 files changed, 254 deletions(-) delete mode 100644 Constraints/Slug.php delete mode 100644 Constraints/SlugValidator.php delete mode 100644 Tests/Constraints/SlugTest.php delete mode 100644 Tests/Constraints/SlugValidatorTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index ae1ae20da..a7363d7f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,6 @@ CHANGELOG * Deprecate defining custom constraints not supporting named arguments * Deprecate passing an array of options to the constructors of the constraint classes, pass each option as a dedicated argument instead * Add support for ratio checks for SVG files to the `Image` constraint - * Add the `Slug` constraint * Add support for the `otherwise` option in the `When` constraint * Add support for multiple fields containing nested constraints in `Composite` constraints * Add the `stopOnFirstError` option to the `Unique` constraint to validate all elements diff --git a/Constraints/Slug.php b/Constraints/Slug.php deleted file mode 100644 index 55d847ccb..000000000 --- a/Constraints/Slug.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Attribute\HasNamedArguments; -use Symfony\Component\Validator\Constraint; - -/** - * Validates that a value is a valid slug. - * - * @author Raffaele Carelle - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Slug extends Constraint -{ - public const NOT_SLUG_ERROR = '14e6df1e-c8ab-4395-b6ce-04b132a3765e'; - - public string $message = 'This value is not a valid slug.'; - public string $regex = '/^[a-z0-9]+(?:-[a-z0-9]+)*$/i'; - - #[HasNamedArguments] - public function __construct( - ?string $regex = null, - ?string $message = null, - ?array $groups = null, - mixed $payload = null, - ) { - parent::__construct([], $groups, $payload); - - $this->message = $message ?? $this->message; - $this->regex = $regex ?? $this->regex; - } -} diff --git a/Constraints/SlugValidator.php b/Constraints/SlugValidator.php deleted file mode 100644 index b914cad31..000000000 --- a/Constraints/SlugValidator.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; - -/** - * @author Raffaele Carelle - */ -class SlugValidator extends ConstraintValidator -{ - public function validate(mixed $value, Constraint $constraint): void - { - if (!$constraint instanceof Slug) { - throw new UnexpectedTypeException($constraint, Slug::class); - } - - if (null === $value || '' === $value) { - return; - } - - if (!\is_scalar($value) && !$value instanceof \Stringable) { - throw new UnexpectedValueException($value, 'string'); - } - - $value = (string) $value; - - if (0 === preg_match($constraint->regex, $value)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Slug::NOT_SLUG_ERROR) - ->addViolation(); - } - } -} diff --git a/Tests/Constraints/SlugTest.php b/Tests/Constraints/SlugTest.php deleted file mode 100644 index a2c5b07d3..000000000 --- a/Tests/Constraints/SlugTest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * 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; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\Validator\Constraints\Slug; -use Symfony\Component\Validator\Mapping\ClassMetadata; -use Symfony\Component\Validator\Mapping\Loader\AttributeLoader; - -class SlugTest extends TestCase -{ - public function testAttributes() - { - $metadata = new ClassMetadata(SlugDummy::class); - $loader = new AttributeLoader(); - self::assertTrue($loader->loadClassMetadata($metadata)); - - [$bConstraint] = $metadata->properties['b']->getConstraints(); - self::assertSame('myMessage', $bConstraint->message); - self::assertSame(['Default', 'SlugDummy'], $bConstraint->groups); - - [$cConstraint] = $metadata->properties['c']->getConstraints(); - self::assertSame(['my_group'], $cConstraint->groups); - self::assertSame('some attached data', $cConstraint->payload); - } -} - -class SlugDummy -{ - #[Slug] - private $a; - - #[Slug(message: 'myMessage')] - private $b; - - #[Slug(groups: ['my_group'], payload: 'some attached data')] - private $c; -} diff --git a/Tests/Constraints/SlugValidatorTest.php b/Tests/Constraints/SlugValidatorTest.php deleted file mode 100644 index f88bff3e1..000000000 --- a/Tests/Constraints/SlugValidatorTest.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * 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; - -use Symfony\Component\String\Slugger\AsciiSlugger; -use Symfony\Component\Validator\Constraints\Slug; -use Symfony\Component\Validator\Constraints\SlugValidator; -use Symfony\Component\Validator\Exception\UnexpectedValueException; -use Symfony\Component\Validator\Test\ConstraintValidatorTestCase; - -class SlugValidatorTest extends ConstraintValidatorTestCase -{ - protected function createValidator(): SlugValidator - { - return new SlugValidator(); - } - - public function testNullIsValid() - { - $this->validator->validate(null, new Slug()); - - $this->assertNoViolation(); - } - - public function testEmptyStringIsValid() - { - $this->validator->validate('', new Slug()); - - $this->assertNoViolation(); - } - - public function testExpectsStringCompatibleType() - { - $this->expectException(UnexpectedValueException::class); - $this->validator->validate(new \stdClass(), new Slug()); - } - - /** - * @testWith ["test-slug"] - * ["slug-123-test"] - * ["slug"] - * ["TestSlug"] - */ - public function testValidSlugs($slug) - { - $this->validator->validate($slug, new Slug()); - - $this->assertNoViolation(); - } - - /** - * @testWith ["Not a slug"] - * ["not-á-slug"] - * ["not-@-slug"] - */ - public function testInvalidSlugs($slug) - { - $constraint = new Slug(message: 'myMessage'); - - $this->validator->validate($slug, $constraint); - - $this->buildViolation('myMessage') - ->setParameter('{{ value }}', '"'.$slug.'"') - ->setCode(Slug::NOT_SLUG_ERROR) - ->assertRaised(); - } - - /** - * @testWith ["test-slug", true] - * ["slug-123-test", true] - */ - public function testCustomRegexInvalidSlugs($slug) - { - $constraint = new Slug(regex: '/^[a-z0-9]+$/i'); - - $this->validator->validate($slug, $constraint); - - $this->buildViolation($constraint->message) - ->setParameter('{{ value }}', '"'.$slug.'"') - ->setCode(Slug::NOT_SLUG_ERROR) - ->assertRaised(); - } - - /** - * @testWith ["slug"] - * ["test1234"] - */ - public function testCustomRegexValidSlugs($slug) - { - $constraint = new Slug(regex: '/^[a-z0-9]+$/i'); - - $this->validator->validate($slug, $constraint); - - $this->assertNoViolation(); - } - - /** - * @testWith ["PHP"] - * ["Symfony is cool"] - * ["Lorem ipsum dolor sit amet"] - */ - public function testAcceptAsciiSluggerResults(string $text) - { - $this->validator->validate((new AsciiSlugger())->slug($text), new Slug()); - - $this->assertNoViolation(); - } -} From a9e21997ff6ea9fc13a93572633488582301a36b Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 3 Jun 2025 21:58:06 +0200 Subject: [PATCH 23/74] re-add accidentally removed changelog examples --- CHANGELOG.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7363d7f5..e8146d2a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,55 @@ CHANGELOG * Add the `filenameCharset` and `filenameCountUnit` options to the `File` constraint * Deprecate defining custom constraints not supporting named arguments + + Before: + + ```php + use Symfony\Component\Validator\Constraint; + + class CustomConstraint extends Constraint + { + public function __construct(array $options) + { + // ... + } + } + ``` + + After: + + ```php + use Symfony\Component\Validator\Attribute\HasNamedArguments; + use Symfony\Component\Validator\Constraint; + + class CustomConstraint extends Constraint + { + #[HasNamedArguments] + public function __construct($option1, $option2, $groups, $payload) + { + // ... + } + } + ``` * Deprecate passing an array of options to the constructors of the constraint classes, pass each option as a dedicated argument instead + + Before: + + ```php + new NotNull([ + 'groups' => ['foo', 'bar'], + 'message' => 'a custom constraint violation message', + ]) + ``` + + After: + + ```php + new NotNull( + groups: ['foo', 'bar'], + message: 'a custom constraint violation message', + ) + ``` * Add support for ratio checks for SVG files to the `Image` constraint * Add support for the `otherwise` option in the `When` constraint * Add support for multiple fields containing nested constraints in `Composite` constraints From 230dd2f02ead4d83d18dbc43bd6316babb3ad85b Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sun, 15 Jun 2025 12:48:34 +0200 Subject: [PATCH 24/74] fix merge --- Tests/Constraints/CascadeTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tests/Constraints/CascadeTest.php b/Tests/Constraints/CascadeTest.php index 2ef4c9c83..fc4d7ce0f 100644 --- a/Tests/Constraints/CascadeTest.php +++ b/Tests/Constraints/CascadeTest.php @@ -35,6 +35,9 @@ public function testExcludeProperties() self::assertSame(['foo' => 0, 'bar' => 1], $constraint->exclude); } + /** + * @group legacy + */ public function testExcludePropertiesDoctrineStyle() { $constraint = new Cascade(['exclude' => ['foo', 'bar']]); From a19337e1324736024cfd74a743586e98791a779d Mon Sep 17 00:00:00 2001 From: JK Groupe Date: Thu, 19 Jun 2025 16:15:46 +0200 Subject: [PATCH 25/74] [Validator] Add missing HasNamedArguments to some constraints --- Constraints/AtLeastOneOf.php | 2 ++ Constraints/Composite.php | 2 ++ Constraints/Compound.php | 2 ++ Constraints/GroupSequence.php | 3 +++ Constraints/Image.php | 3 +++ Constraints/Sequentially.php | 2 ++ 6 files changed, 14 insertions(+) diff --git a/Constraints/AtLeastOneOf.php b/Constraints/AtLeastOneOf.php index b20ea0df0..20d55f458 100644 --- a/Constraints/AtLeastOneOf.php +++ b/Constraints/AtLeastOneOf.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -39,6 +40,7 @@ class AtLeastOneOf extends Composite * @param string|null $messageCollection Failure message for All and Collection inner constraints * @param bool|null $includeInternalMessages Whether to include inner constraint messages (defaults to true) */ + #[HasNamedArguments] public function __construct(mixed $constraints = null, ?array $groups = null, mixed $payload = null, ?string $message = null, ?string $messageCollection = null, ?bool $includeInternalMessages = null) { if (\is_array($constraints) && !array_is_list($constraints)) { diff --git a/Constraints/Composite.php b/Constraints/Composite.php index deac22cc5..ce6283b84 100644 --- a/Constraints/Composite.php +++ b/Constraints/Composite.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; @@ -49,6 +50,7 @@ abstract class Composite extends Constraint * cached. When constraints are loaded from the cache, no more group * checks need to be done. */ + #[HasNamedArguments] public function __construct(mixed $options = null, ?array $groups = null, mixed $payload = null) { parent::__construct($options, $groups, $payload); diff --git a/Constraints/Compound.php b/Constraints/Compound.php index ac2b5ac98..261871533 100644 --- a/Constraints/Compound.php +++ b/Constraints/Compound.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; @@ -24,6 +25,7 @@ abstract class Compound extends Composite /** @var Constraint[] */ public array $constraints = []; + #[HasNamedArguments] public function __construct(mixed $options = null, ?array $groups = null, mixed $payload = null) { if (isset($options[$this->getCompositeOption()])) { diff --git a/Constraints/GroupSequence.php b/Constraints/GroupSequence.php index 3c2cc48ba..e3e4f47f9 100644 --- a/Constraints/GroupSequence.php +++ b/Constraints/GroupSequence.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; + /** * A sequence of validation groups. * @@ -75,6 +77,7 @@ class GroupSequence * * @param array $groups The groups in the sequence */ + #[HasNamedArguments] public function __construct(array $groups) { $this->groups = $groups['value'] ?? $groups; diff --git a/Constraints/Image.php b/Constraints/Image.php index 5a4b3e129..d9b7c8822 100644 --- a/Constraints/Image.php +++ b/Constraints/Image.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; + /** * Validates that a file (or a path to a file) is a valid image. * @@ -118,6 +120,7 @@ class Image extends File * * @see https://www.iana.org/assignments/media-types/media-types.xhtml Existing media types */ + #[HasNamedArguments] public function __construct( ?array $options = null, int|string|null $maxSize = null, diff --git a/Constraints/Sequentially.php b/Constraints/Sequentially.php index 1096a994d..6389ebb89 100644 --- a/Constraints/Sequentially.php +++ b/Constraints/Sequentially.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** @@ -28,6 +29,7 @@ class Sequentially extends Composite * @param Constraint[]|array|null $constraints An array of validation constraints * @param string[]|null $groups */ + #[HasNamedArguments] public function __construct(mixed $constraints = null, ?array $groups = null, mixed $payload = null) { if (\is_array($constraints) && !array_is_list($constraints)) { From e2f2497c869fc57446f735fbf00cff4de32ae8c3 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 26 Jun 2025 15:22:23 +0200 Subject: [PATCH 26/74] fix merge --- Tests/Constraints/LocaleValidatorTest.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Tests/Constraints/LocaleValidatorTest.php b/Tests/Constraints/LocaleValidatorTest.php index 9ca252cf8..5a060e4da 100644 --- a/Tests/Constraints/LocaleValidatorTest.php +++ b/Tests/Constraints/LocaleValidatorTest.php @@ -91,9 +91,7 @@ public static function getInvalidLocales() public function testTooLongLocale() { - $constraint = new Locale([ - 'message' => 'myMessage', - ]); + $constraint = new Locale(message: 'myMessage'); $locale = str_repeat('a', (\defined('INTL_MAX_LOCALE_LEN') ? \INTL_MAX_LOCALE_LEN : 85) + 1); $this->validator->validate($locale, $constraint); From bb88dce92bb63015b72913adfd3e2134960b3c96 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 15 Jul 2025 23:14:40 +0200 Subject: [PATCH 27/74] fix merge --- Tests/Constraints/ExpressionTest.php | 3 +++ Tests/Constraints/RegexTest.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Tests/Constraints/ExpressionTest.php b/Tests/Constraints/ExpressionTest.php index 97fcab838..07abb071d 100644 --- a/Tests/Constraints/ExpressionTest.php +++ b/Tests/Constraints/ExpressionTest.php @@ -51,6 +51,9 @@ public function testMissingPattern() new Expression(null); } + /** + * @group legacy + */ public function testMissingPatternDoctrineStyle() { $this->expectException(MissingOptionsException::class); diff --git a/Tests/Constraints/RegexTest.php b/Tests/Constraints/RegexTest.php index 3d13dcdc9..853e0d785 100644 --- a/Tests/Constraints/RegexTest.php +++ b/Tests/Constraints/RegexTest.php @@ -148,6 +148,9 @@ public function testMissingPattern() new Regex(null); } + /** + * @group legacy + */ public function testMissingPatternDoctrineStyle() { $this->expectException(MissingOptionsException::class); From 2f893f1f970a0ae5670cb82bb3bcf8196b487b55 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 15 Jul 2025 23:26:24 +0200 Subject: [PATCH 28/74] error if the fields option is missing for the Collection constraint --- Constraints/Collection.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Constraints/Collection.php b/Constraints/Collection.php index eca5a4eee..3de2c14ab 100644 --- a/Constraints/Collection.php +++ b/Constraints/Collection.php @@ -45,13 +45,20 @@ class Collection extends Composite #[HasNamedArguments] public function __construct(mixed $fields = null, ?array $groups = null, mixed $payload = null, ?bool $allowExtraFields = null, ?bool $allowMissingFields = null, ?string $extraFieldsMessage = null, ?string $missingFieldsMessage = null) { + $options = $fields; + if (self::isFieldsOption($fields)) { + $options = []; + + if (null !== $fields) { + $options['fields'] = $fields; + } $fields = ['fields' => $fields]; } else { trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } - parent::__construct($fields, $groups, $payload); + parent::__construct($options, $groups, $payload); $this->allowExtraFields = $allowExtraFields ?? $this->allowExtraFields; $this->allowMissingFields = $allowMissingFields ?? $this->allowMissingFields; @@ -88,6 +95,10 @@ protected function getCompositeOption(): string private static function isFieldsOption($options): bool { + if (null === $options) { + return true; + } + if (!\is_array($options)) { return false; } From 8d6884cc5fd27e287aa90b59ba66d438f75ec3fa Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 16 Jul 2025 10:27:38 +0200 Subject: [PATCH 29/74] fix CS --- Constraints/Collection.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Constraints/Collection.php b/Constraints/Collection.php index 3de2c14ab..b59caa89d 100644 --- a/Constraints/Collection.php +++ b/Constraints/Collection.php @@ -53,7 +53,6 @@ public function __construct(mixed $fields = null, ?array $groups = null, mixed $ if (null !== $fields) { $options['fields'] = $fields; } - $fields = ['fields' => $fields]; } else { trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); } From dd9b63c43274b02896c39fff9502beca8b612344 Mon Sep 17 00:00:00 2001 From: "M.Mahdi Mahmoodian" <34606033+MMMahmoodian@users.noreply.github.com> Date: Tue, 29 Jul 2025 20:57:15 +0330 Subject: [PATCH 30/74] [Validator] review Persian translation for Twig template --- Resources/translations/validators.fa.xlf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/translations/validators.fa.xlf b/Resources/translations/validators.fa.xlf index f47633fd4..97c3a9410 100644 --- a/Resources/translations/validators.fa.xlf +++ b/Resources/translations/validators.fa.xlf @@ -468,7 +468,7 @@ This value is not a valid Twig template. - این مقدار یک قالب معتبر Twig نیست. + این مقدار یک قالب معتبر Twig نیست. From b23055946db106c8b11fc14c8c06ea687d119fd3 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 1 Aug 2025 17:44:34 +0200 Subject: [PATCH 31/74] Fix wrong boolean values --- Tests/Constraints/CountryValidatorTest.php | 2 +- Tests/Constraints/CurrencyValidatorTest.php | 2 +- Tests/Constraints/LanguageValidatorTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Constraints/CountryValidatorTest.php b/Tests/Constraints/CountryValidatorTest.php index 524d0bc54..4be378926 100644 --- a/Tests/Constraints/CountryValidatorTest.php +++ b/Tests/Constraints/CountryValidatorTest.php @@ -169,7 +169,7 @@ public function testInvalidAlpha3CountryNamed() public function testValidateUsingCountrySpecificLocale() { // in order to test with "en_GB" - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('en_GB'); diff --git a/Tests/Constraints/CurrencyValidatorTest.php b/Tests/Constraints/CurrencyValidatorTest.php index a0e16ec14..d63c5ab99 100644 --- a/Tests/Constraints/CurrencyValidatorTest.php +++ b/Tests/Constraints/CurrencyValidatorTest.php @@ -75,7 +75,7 @@ public function testValidCurrencies($currency) **/ public function testValidCurrenciesWithCountrySpecificLocale($currency) { - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('en_GB'); diff --git a/Tests/Constraints/LanguageValidatorTest.php b/Tests/Constraints/LanguageValidatorTest.php index 9abb9cfc4..575243080 100644 --- a/Tests/Constraints/LanguageValidatorTest.php +++ b/Tests/Constraints/LanguageValidatorTest.php @@ -167,7 +167,7 @@ public function testInvalidAlpha3LanguageNamed() public function testValidateUsingCountrySpecificLocale() { - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('fr_FR'); $existingLanguage = 'en'; From b1e4882664eb0fd43af4667015a4e8ba17d8b2ea Mon Sep 17 00:00:00 2001 From: phpner Date: Thu, 7 Aug 2025 08:05:21 +0100 Subject: [PATCH 32/74] (60474) Remove translation state attribute for Twig template validator in Ukrainian translation --- Resources/translations/validators.uk.xlf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/translations/validators.uk.xlf b/Resources/translations/validators.uk.xlf index 5f132bc77..46b692c2d 100644 --- a/Resources/translations/validators.uk.xlf +++ b/Resources/translations/validators.uk.xlf @@ -468,7 +468,7 @@ This value is not a valid Twig template. - Це значення не є дійсним шаблоном Twig. + Це значення не є дійсним шаблоном Twig. From d0ebf2574df1f0af44000d39a8081794748fe85a Mon Sep 17 00:00:00 2001 From: Zouaoui Montassar Date: Thu, 7 Aug 2025 10:56:01 +0100 Subject: [PATCH 33/74] [Validator] (60455) Validate translations for Arabic (ar) --- Resources/translations/validators.ar.xlf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/translations/validators.ar.xlf b/Resources/translations/validators.ar.xlf index 827eed1bc..38d3e717d 100644 --- a/Resources/translations/validators.ar.xlf +++ b/Resources/translations/validators.ar.xlf @@ -468,7 +468,7 @@ This value is not a valid Twig template. - هذه القيمة ليست نموذج Twig صالح. + هذه القيمة ليست نموذج Twig صالح. From 22d2015eb85df70667124ad66c35a4d460b29516 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 13 Aug 2025 11:47:18 +0200 Subject: [PATCH 34/74] Remove calls to no-op functions, deprecated in PHP 8.5 --- Constraints/ImageValidator.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/Constraints/ImageValidator.php b/Constraints/ImageValidator.php index c235ff030..0c2fd318a 100644 --- a/Constraints/ImageValidator.php +++ b/Constraints/ImageValidator.php @@ -230,8 +230,6 @@ public function validate(mixed $value, Constraint $constraint) return; } - - imagedestroy($resource); } } } From d8d144603dce940e7eb66217149d8ab80be0ab0d Mon Sep 17 00:00:00 2001 From: Yurguis Garcia Date: Thu, 21 Aug 2025 15:23:36 -0400 Subject: [PATCH 35/74] [Security][Validator] Review translations. --- Resources/translations/validators.es.xlf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/translations/validators.es.xlf b/Resources/translations/validators.es.xlf index a9ad8a76b..0d47977de 100644 --- a/Resources/translations/validators.es.xlf +++ b/Resources/translations/validators.es.xlf @@ -468,7 +468,7 @@ This value is not a valid Twig template. - Este valor no es una plantilla Twig válida. + Este valor no es una plantilla Twig válida. From 9352177c0e937793423053846f80bee805552324 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 27 Aug 2025 12:16:40 +0200 Subject: [PATCH 36/74] [Validator] Skip tests using unavailable timezone on the local host --- Tests/Constraints/TimezoneValidatorTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tests/Constraints/TimezoneValidatorTest.php b/Tests/Constraints/TimezoneValidatorTest.php index 25451c5d2..c4127c920 100644 --- a/Tests/Constraints/TimezoneValidatorTest.php +++ b/Tests/Constraints/TimezoneValidatorTest.php @@ -274,6 +274,11 @@ public function testGroupedTimezonesWithInvalidCountry() */ public function testDeprecatedTimezonesAreValidWithBC(string $timezone) { + // Skip test if the timezone is not available in the current timezone database + if (!\in_array($timezone, \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC), true)) { + $this->markTestSkipped(sprintf('Timezone "%s" is not available in the current timezone database', $timezone)); + } + $constraint = new Timezone(\DateTimeZone::ALL_WITH_BC); $this->validator->validate($timezone, $constraint); From b5e5c9c0a881c13fe596176b40cf26014e8e4767 Mon Sep 17 00:00:00 2001 From: Romeo Date: Sun, 31 Aug 2025 17:50:22 +0300 Subject: [PATCH 37/74] [Validator] Update Romanian translations --- Resources/translations/validators.ro.xlf | 80 ++++++++++++------------ 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/Resources/translations/validators.ro.xlf b/Resources/translations/validators.ro.xlf index d6c3b4fb8..0dcbd1295 100644 --- a/Resources/translations/validators.ro.xlf +++ b/Resources/translations/validators.ro.xlf @@ -4,11 +4,11 @@ This value should be false. - Această valoare ar trebui să fie falsă (false). + Această valoare ar trebui să fie falsă. This value should be true. - Această valoare ar trebui să fie adevărată (true). + Această valoare ar trebui să fie adevărată. This value should be of type {{ type }}. @@ -16,7 +16,7 @@ This value should be blank. - Această valoare ar trebui sa fie goală. + Această valoare ar trebui să fie necompletată. The value you selected is not a valid choice. @@ -24,11 +24,11 @@ You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. - Trebuie să selectați cel puțin {{ limit }} opțiune.|Trebuie să selectați cel puțin {{ limit }} opțiuni.|Trebuie să selectați cel puțin {{ limit }} de opțiuni + Trebuie să selectați cel puțin {{ limit }} opțiune.|Trebuie să selectați cel puțin {{ limit }} opțiuni. You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. - Trebuie să selectați cel mult {{ limit }} opțiune.|Trebuie să selectați cel mult {{ limit }} opțiuni.|Trebuie să selectați cel mult {{ limit }} de opțiuni. + Trebuie să selectați cel mult {{ limit }} opțiune.|Trebuie să selectați cel mult {{ limit }} opțiuni. One or more of the given values is invalid. @@ -36,11 +36,11 @@ This field was not expected. - Acest câmp nu era de aşteptat. + Acest câmp nu era prevăzut. This field is missing. - Acest câmp este lipsă. + Acest câmp lipsește. This value is not a valid date. @@ -68,7 +68,7 @@ The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - Tipul fișierului este invalid ({{ type }}). Tipurile permise de fișiere sunt ({{ types }}). + Tipul fișierului este invalid ({{ type }}). Tipurile de fișiere permise sunt {{ types }}. This value should be {{ limit }} or less. @@ -76,7 +76,7 @@ This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. - Această valoare este prea lungă. Ar trebui să aibă maxim {{ limit }} caracter.|Această valoare este prea lungă. Ar trebui să aibă maxim {{ limit }} caractere.|Această valoare este prea lungă. Ar trebui să aibă maxim {{ limit }} de caractere. + Această valoare este prea lungă. Ar trebui să aibă maxim {{ limit }} caracter.|Această valoare este prea lungă. Ar trebui să aibă maxim {{ limit }} caractere. This value should be {{ limit }} or more. @@ -84,19 +84,19 @@ This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. - Această valoare este prea scurtă. Ar trebui să aibă minim {{ limit }} caracter.|Această valoare este prea scurtă. Ar trebui să aibă minim {{ limit }} caractere.|Această valoare este prea scurtă. Ar trebui să aibă minim {{ limit }} de caractere. + Această valoare este prea scurtă. Ar trebui să aibă minim {{ limit }} caracter.|Această valoare este prea scurtă. Ar trebui să aibă minim {{ limit }} caractere. This value should not be blank. - Această valoare nu ar trebui să fie goală. + Această valoare nu ar trebui să fie necompletată. This value should not be null. - Această valoare nu ar trebui să fie nulă (null). + Această valoare nu ar trebui să fie nulă. This value should be null. - Această valoare ar trebui să fie nulă (null). + Această valoare ar trebui să fie nulă. This value is not valid. @@ -108,7 +108,7 @@ This value is not a valid URL. - Această valoare nu reprezintă un URL (link) valid. + Această valoare nu reprezintă un URL valid. The two values should be equal. @@ -116,7 +116,7 @@ The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. - Fișierul este prea mare. Mărimea maximă permisă este {{ limit }} {{ suffix }}. + Fișierul este prea mare. Mărimea maximă permisă este de {{ limit }} {{ suffix }}. The file is too large. @@ -144,7 +144,7 @@ This value is not a valid locale. - Această valoare nu reprezintă un dialect (o limbă) corect. + Această valoare nu este o localizare validă. This value is not a valid country. @@ -180,7 +180,7 @@ This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - Această valoare trebuie să conțină exact {{ limit }} caracter.|Această valoare trebuie să conțină exact {{ limit }} caractere.|Această valoare trebuie să conțină exact {{ limit }} de caractere. + Această valoare trebuie să conțină exact {{ limit }} caracter.|Această valoare trebuie să conțină exact {{ limit }} caractere. The file was only partially uploaded. @@ -188,7 +188,7 @@ No file was uploaded. - Nu a fost încărcat nici un fișier. + Nu a fost încărcat niciun fișier. No temporary folder was configured in php.ini, or the configured folder does not exist. @@ -200,27 +200,27 @@ A PHP extension caused the upload to fail. - O extensie PHP a prevenit încărcarea cu succes a fișierului. + O extensie PHP a cauzat eșecul încărcării. This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - Această colecție trebuie să conțină cel puțin {{ limit }} element.|Această colecție trebuie să conțină cel puțin {{ limit }} elemente.|Această colecție trebuie să conțină cel puțin {{ limit }} de elemente. + Această colecție trebuie să conțină cel puțin {{ limit }} element.|Această colecție trebuie să conțină cel puțin {{ limit }} elemente. This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. - Această colecție trebuie să conțină cel mult {{ limit }} element.|Această colecție trebuie să conțină cel mult {{ limit }} elemente.|Această colecție trebuie să conțină cel mult {{ limit }} de elemente. + Această colecție trebuie să conțină cel mult {{ limit }} element.|Această colecție trebuie să conțină cel mult {{ limit }} elemente. This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. - Această colecție trebuie să conțină {{ limit }} element.|Această colecție trebuie să conțină {{ limit }} elemente.|Această colecție trebuie să conțină {{ limit }} de elemente. + Această colecție trebuie să conțină exact {{ limit }} element.|Această colecție trebuie să conțină exact {{ limit }} elemente. Invalid card number. - Numărul card invalid. + Numărul cardului este invalid. Unsupported card type or invalid card number. - Tipul sau numărul cardului nu sunt valide. + Tipul sau numărul cardului sunt invalide. This value is not a valid International Bank Account Number (IBAN). @@ -252,7 +252,7 @@ This value should be greater than {{ compared_value }}. - Această valoare trebuie să fie mai mare de {{ compared_value }}. + Această valoare trebuie să fie mai mare decât {{ compared_value }}. This value should be greater than or equal to {{ compared_value }}. @@ -260,11 +260,11 @@ This value should be identical to {{ compared_value_type }} {{ compared_value }}. - Această valoare trebuie identică cu {{ compared_value_type }} {{ compared_value }}. + Această valoare trebuie să fie identică cu {{ compared_value_type }} {{ compared_value }}. This value should be less than {{ compared_value }}. - Această valoare trebuie să fie mai mică de {{ compared_value }}. + Această valoare trebuie să fie mai mică decât {{ compared_value }}. This value should be less than or equal to {{ compared_value }}. @@ -288,11 +288,11 @@ The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Imaginea este un pătrat ({{ width }}x{{ height }}px). Imaginile pătrat nu sunt permise. + Imaginea este pătrată ({{ width }}x{{ height }}px). Imaginile pătrate nu sunt permise. The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Imaginea are orientarea peisaj ({{ width }}x{{ height }}px). Imaginile cu orientare peisaj nu sunt permise. + Imaginea are orientarea orizontală ({{ width }}x{{ height }}px). Imaginile cu orientare orizontală nu sunt permise. The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. @@ -304,7 +304,7 @@ The host could not be resolved. - Numele host nu a putut fi rezolvat către o adresă IP. + Host-ul nu a putut fi rezolvat. This value does not match the expected {{ charset }} charset. @@ -336,7 +336,7 @@ This collection should contain only unique elements. - Acest set ar trebui să conțină numai elemente unice. + Această colecție ar trebui să conțină numai elemente unice. This value should be positive. @@ -368,19 +368,19 @@ This value is not a valid hostname. - Această valoare nu este un numele gazdei valid. + Această valoare nu este un hostname valid. The number of elements in this collection should be a multiple of {{ compared_value }}. - Numărul de elemente din această colecție ar trebui să fie un multiplu al {{ compared_value }}. + Numărul de elemente din această colecție ar trebui să fie un multiplu de {{ compared_value }}. This value should satisfy at least one of the following constraints: - Această valoare trebuie să îndeplinească cel puțin una dintre următoarele reguli: + Această valoare trebuie să îndeplinească cel puțin una dintre următoarele condiții: Each element of this collection should satisfy its own set of constraints. - Fiecare element din acest set ar trebui să îndeplinească propriul set de reguli. + Fiecare element din acest set ar trebui să îndeplinească propriul set de condiții. This value is not a valid International Securities Identification Number (ISIN). @@ -400,11 +400,11 @@ The value of the netmask should be between {{ min }} and {{ max }}. - Valoarea netmask-ului trebuie sa fie intre {{ min }} si {{ max }}. + Valoarea măștii de rețea trebuie să fie între {{ min }} și {{ max }}. 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. - Denumirea fișierului este prea lungă. Ea trebuie să conțină {{ filename_max_length }} caractere sau mai puține.|Denumirea fișierului este prea lungă. Ea trebuie să conțină {{ filename_max_length }} caractere sau mai puține. + Denumirea fișierului este prea lungă. Trebuie să conțină {{ filename_max_length }} caracter sau mai puțin.|Denumirea fișierului este prea lungă. Trebuie să conțină {{ filename_max_length }} caractere sau mai puține. The password strength is too low. Please use a stronger password. @@ -424,7 +424,7 @@ Using hidden overlay characters is not allowed. - Folosirea caracterelor invizibile suprapuse nu este permisă. + Folosirea caracterelor ascunse nu este permisă. The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}. @@ -432,7 +432,7 @@ The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. - Codificarea caracterelor detectate nu este valabilă ({{ detected }}). Codificările permise sunt {{ encodings }}. + Codificarea caracterelor detectate este invalidă ({{ detected }}). Codificările permise sunt {{ encodings }}. This value is not a valid MAC address. @@ -468,7 +468,7 @@ This value is not a valid Twig template. - Această valoare nu este un șablon Twig valid. + Această valoare nu este un șablon Twig valid. From 249fc8467ff3bfade4be128b23c83d594f3ad7e8 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 2 Sep 2025 15:17:51 +0200 Subject: [PATCH 38/74] [Validator] Update translation for the Video constraint --- Constraints/Range.php | 2 +- Resources/translations/validators.af.xlf | 84 +++++++++++++++++++ Resources/translations/validators.ar.xlf | 84 +++++++++++++++++++ Resources/translations/validators.az.xlf | 84 +++++++++++++++++++ Resources/translations/validators.be.xlf | 84 +++++++++++++++++++ Resources/translations/validators.bg.xlf | 84 +++++++++++++++++++ Resources/translations/validators.bs.xlf | 84 +++++++++++++++++++ Resources/translations/validators.ca.xlf | 84 +++++++++++++++++++ Resources/translations/validators.cs.xlf | 84 +++++++++++++++++++ Resources/translations/validators.cy.xlf | 84 +++++++++++++++++++ Resources/translations/validators.da.xlf | 84 +++++++++++++++++++ Resources/translations/validators.de.xlf | 84 +++++++++++++++++++ Resources/translations/validators.el.xlf | 84 +++++++++++++++++++ Resources/translations/validators.en.xlf | 84 +++++++++++++++++++ Resources/translations/validators.es.xlf | 84 +++++++++++++++++++ Resources/translations/validators.et.xlf | 84 +++++++++++++++++++ Resources/translations/validators.eu.xlf | 84 +++++++++++++++++++ Resources/translations/validators.fa.xlf | 84 +++++++++++++++++++ Resources/translations/validators.fi.xlf | 84 +++++++++++++++++++ Resources/translations/validators.fr.xlf | 84 +++++++++++++++++++ Resources/translations/validators.gl.xlf | 84 +++++++++++++++++++ Resources/translations/validators.he.xlf | 84 +++++++++++++++++++ Resources/translations/validators.hr.xlf | 84 +++++++++++++++++++ Resources/translations/validators.hu.xlf | 84 +++++++++++++++++++ Resources/translations/validators.hy.xlf | 84 +++++++++++++++++++ Resources/translations/validators.id.xlf | 84 +++++++++++++++++++ Resources/translations/validators.it.xlf | 84 +++++++++++++++++++ Resources/translations/validators.ja.xlf | 84 +++++++++++++++++++ Resources/translations/validators.lb.xlf | 84 +++++++++++++++++++ Resources/translations/validators.lt.xlf | 84 +++++++++++++++++++ Resources/translations/validators.lv.xlf | 84 +++++++++++++++++++ Resources/translations/validators.mk.xlf | 84 +++++++++++++++++++ Resources/translations/validators.mn.xlf | 84 +++++++++++++++++++ Resources/translations/validators.my.xlf | 84 +++++++++++++++++++ Resources/translations/validators.nb.xlf | 84 +++++++++++++++++++ Resources/translations/validators.nl.xlf | 84 +++++++++++++++++++ Resources/translations/validators.nn.xlf | 84 +++++++++++++++++++ Resources/translations/validators.no.xlf | 84 +++++++++++++++++++ Resources/translations/validators.pl.xlf | 84 +++++++++++++++++++ Resources/translations/validators.pt.xlf | 84 +++++++++++++++++++ Resources/translations/validators.pt_BR.xlf | 84 +++++++++++++++++++ Resources/translations/validators.ro.xlf | 84 +++++++++++++++++++ Resources/translations/validators.ru.xlf | 84 +++++++++++++++++++ Resources/translations/validators.sk.xlf | 84 +++++++++++++++++++ Resources/translations/validators.sl.xlf | 84 +++++++++++++++++++ Resources/translations/validators.sq.xlf | 84 +++++++++++++++++++ Resources/translations/validators.sr_Cyrl.xlf | 84 +++++++++++++++++++ Resources/translations/validators.sr_Latn.xlf | 84 +++++++++++++++++++ Resources/translations/validators.sv.xlf | 84 +++++++++++++++++++ Resources/translations/validators.th.xlf | 84 +++++++++++++++++++ Resources/translations/validators.tl.xlf | 84 +++++++++++++++++++ Resources/translations/validators.tr.xlf | 84 +++++++++++++++++++ Resources/translations/validators.uk.xlf | 84 +++++++++++++++++++ Resources/translations/validators.ur.xlf | 84 +++++++++++++++++++ Resources/translations/validators.uz.xlf | 84 +++++++++++++++++++ Resources/translations/validators.vi.xlf | 84 +++++++++++++++++++ Resources/translations/validators.zh_CN.xlf | 84 +++++++++++++++++++ Resources/translations/validators.zh_TW.xlf | 84 +++++++++++++++++++ 58 files changed, 4789 insertions(+), 1 deletion(-) diff --git a/Constraints/Range.php b/Constraints/Range.php index 29e363d84..48dc39487 100644 --- a/Constraints/Range.php +++ b/Constraints/Range.php @@ -47,7 +47,7 @@ class Range extends Constraint public $minMessage = 'This value should be {{ limit }} or more.'; public $maxMessage = 'This value should be {{ limit }} or less.'; public $invalidMessage = 'This value should be a valid number.'; - public $invalidDateTimeMessage = 'This value should be a valid datetime.'; + public $invalidDateTimeMessage = 'This value is not a valid datetime.'; public $min; public $minPropertyPath; public $max; diff --git a/Resources/translations/validators.af.xlf b/Resources/translations/validators.af.xlf index 9f53b1afe..61a8b3724 100644 --- a/Resources/translations/validators.af.xlf +++ b/Resources/translations/validators.af.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Hierdie waarde is nie 'n geldige Twig-sjabloon nie. + + This file is not a valid video. + Hierdie lêer is nie 'n geldige video nie. + + + The size of the video could not be detected. + Die grootte van die video kon nie bepaal word nie. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Die videowydte is te groot ({{ width }}px). Toegelate maksimum wydte is {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Die videobreedte is te klein ({{ width }}px). Minimum verwagte breedte is {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Die videohoogte is te groot ({{ height }}px). Toegelate maksimum hoogte is {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Die videohoogte is te klein ({{ height }}px). Minimum hoogte verwag is {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Die video het te min pixels ({{ pixels }}). Minimum hoeveelheid verwag is {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Die video het te veel pixels ({{ pixels }}). Maksimum verwagte hoeveelheid is {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Die videoratio is te groot ({{ ratio }}). Toegelate maksimum ratio is {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Die videoratio is te klein ({{ ratio }}). Minimum verwagte ratio is {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Die video is vierkantig ({{ width }}x{{ height }}px). Vierkantige video's word nie toegelaat nie. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Die video is landskap georiënteer ({{ width }}x{{ height }} px). Landskapvideo's word nie toegelaat nie. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Die video is portretgeoriënteerd ({{ width }}x{{ height }}px). Portretgeoriënteerde video's word nie toegelaat nie. + + + The video file is corrupted. + Die videolêer is korrup. + + + The video contains multiple streams. Only one stream is allowed. + Die video bevat veelvuldige strome. Slegs een stroom word toegelaat. + + + Unsupported video codec "{{ codec }}". + Nie-ondersteunde videokodek "{{ codec }}". + + + Unsupported video container "{{ container }}". + Nie-ondersteunde videohouer "{{ container }}". + + + The image file is corrupted. + Die beeldlêer is beskadig. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Die beeld het te min pixels ({{ pixels }}). Minimum hoeveelheid verwag is {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Die beeld het te veel pixels ({{ pixels }}). Maksimum verwagte aantal is {{ max_pixels }}. + + + This filename does not match the expected charset. + Hierdie lêernaam stem nie ooreen met die verwagte karakterstel nie. + diff --git a/Resources/translations/validators.ar.xlf b/Resources/translations/validators.ar.xlf index 38d3e717d..99c5dde9c 100644 --- a/Resources/translations/validators.ar.xlf +++ b/Resources/translations/validators.ar.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. هذه القيمة ليست نموذج Twig صالح. + + This file is not a valid video. + هذا الملف ليس فيديو صالحًا. + + + The size of the video could not be detected. + تعذّر اكتشاف حجم الفيديو. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + عرض الفيديو كبير جدًا ({{ width }}px). الحد الأقصى المسموح للعرض هو {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + عرض الفيديو صغير جدًا ({{ width }}px). العرض الأدنى المتوقع هو {{ min_width }} بكسل. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + ارتفاع الفيديو كبير جدًا ({{ height }}px). الحد الأقصى المسموح للارتفاع هو {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + ارتفاع الفيديو صغير جدًا ({{ height }} بكسل). الارتفاع الأدنى المتوقع هو {{ min_height }} بكسل. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + الفيديو يحتوي على عدد قليل جدًا من البكسلات ({{ pixels }}). الحد الأدنى المتوقع هو {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + الفيديو يحتوي على عدد كبير جدًا من البكسلات ({{ pixels }}). الحد الأقصى المتوقع هو {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + نسبة الفيديو كبيرة جدًا ({{ ratio }}). الحد الأقصى المسموح للنسبة هو {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + نسبة الفيديو صغيرة جدًا ({{ ratio }}). النسبة الدنيا المتوقعة هي {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + الفيديو مربع ({{ width }}x{{ height }}px). مقاطع الفيديو المربعة غير مسموح بها. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + الفيديو بوضعية أفقية ({{ width }}x{{ height }} بكسل). مقاطع الفيديو الأفقية غير مسموح بها. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + الفيديو ذو اتجاه عمودي ({{ width }}x{{ height }} بكسل). مقاطع الفيديو ذات الاتجاه العمودي غير مسموح بها. + + + The video file is corrupted. + ملف الفيديو تالف. + + + The video contains multiple streams. Only one stream is allowed. + يحتوي الفيديو على عدة تدفقات. يُسمح بتدفق واحد فقط. + + + Unsupported video codec "{{ codec }}". + برنامج ترميز فيديو غير مدعوم "{{ codec }}". + + + Unsupported video container "{{ container }}". + حاوية فيديو غير مدعومة "{{ container }}". + + + The image file is corrupted. + ملف الصورة تالف. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + تحتوي الصورة على عدد قليل جدًا من البكسلات ({{ pixels }}). الحد الأدنى المتوقع هو {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + تحتوي الصورة على عدد كبير جدا من البكسلات ({{ pixels }}). العدد الأقصى المتوقع هو {{ max_pixels }}. + + + This filename does not match the expected charset. + اسم الملف هذا لا يطابق مجموعة المحارف المتوقعة. + diff --git a/Resources/translations/validators.az.xlf b/Resources/translations/validators.az.xlf index 9332c9ec2..a9d281384 100644 --- a/Resources/translations/validators.az.xlf +++ b/Resources/translations/validators.az.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Bu dəyər etibarlı Twig şablonu deyil. + + This file is not a valid video. + Bu fayl etibarlı video deyil. + + + The size of the video could not be detected. + Videonun ölçüsünü təyin etmək mümkün olmadı. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Video enliyi çox böyükdür ({{ width }}px). İcazə verilən maksimal enlik {{ max_width }}px-dir. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Video eni çox kiçikdir ({{ width }}px). Gözlənilən minimum en {{ min_width }}px-dir. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Video hündürlüyü çox böyükdür ({{ height }}px). İcazə verilən maksimum hündürlük {{ max_height }}px-dir. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Videonun hündürlüyü çox kiçikdir ({{ height }}px). Gözlənilən minimum hündürlük {{ min_height }}px-dir. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Videoda piksellərin sayı çox azdır ({{ pixels }}). Gözlənilən minimum miqdar {{ min_pixels }}-dir. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Videoda həddindən artıq piksel var ({{ pixels }}). Gözlənilən maksimum miqdar {{ max_pixels }}-dir. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Video nisbəti çox böyükdür ({{ ratio }}). İcazə verilən maksimal nisbət {{ max_ratio }}‑dir. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Video nisbəti çox kiçikdir ({{ ratio }}). Gözlənilən minimal nisbət {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Video kvadratdır ({{ width }}x{{ height }}px). Kvadrat videolara icazə verilmir. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Video üfiqi istiqamətdədir ({{ width }}x{{ height }} piksel). Üfiqi videolara icazə verilmir. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Video portret istiqamətindədir ({{ width }}x{{ height }} piksel). Portret istiqamətli videolara icazə verilmir. + + + The video file is corrupted. + Video faylı zədələnib. + + + The video contains multiple streams. Only one stream is allowed. + Video bir neçə axın ehtiva edir. Yalnız bir axına icazə verilir. + + + Unsupported video codec "{{ codec }}". + Dəstəklənməyən video kodeki "{{ codec }}". + + + Unsupported video container "{{ container }}". + Dəstəklənməyən video konteyneri "{{ container }}". + + + The image file is corrupted. + Şəkil faylı korlanıb. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Şəkildə piksel sayı çox azdır ({{ pixels }}). Gözlənilən minimum miqdar {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Şəkildə çox piksel var ({{ pixels }}). Gözlənilən maksimum say {{ max_pixels }}. + + + This filename does not match the expected charset. + Bu fayl adı gözlənilən simvol dəstinə uyğun gəlmir. + diff --git a/Resources/translations/validators.be.xlf b/Resources/translations/validators.be.xlf index 7b24df5e5..d7060b5e0 100644 --- a/Resources/translations/validators.be.xlf +++ b/Resources/translations/validators.be.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Гэта значэнне не з'яўляецца сапраўдным шаблонам Twig. + + This file is not a valid video. + Гэты файл не з'яўляецца сапраўдным відэа. + + + The size of the video could not be detected. + Не ўдалося вызначыць памер відэа. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Шырыня відэа занадта вялікая ({{ width }}px). Дапушчальная максімальная шырыня — {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Шырыня відэа занадта малая ({{ width }}px). Мінімальная чаканая шырыня — {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Вышыня відэа занадта вялікая ({{ height }}px). Дазволеная максімальная вышыня — {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Вышыня відэа занадта малая ({{ height }}px). Чаканая мінімальная вышыня — {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Відэа мае занадта мала пікселяў ({{ pixels }}). Мінімальная колькасць чакаецца {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Відэа мае занадта шмат пікселяў ({{ pixels }}). Максімальна дапушчальная колькасць — {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Суадносіны відэа занадта вялікія ({{ ratio }}). Дапушчальна максімальнае суадносіны — {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Суадносіны відэа занадта малыя ({{ ratio }}). Мінімальнае чаканае суадносіны — {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Відэа квадратнае ({{ width }}x{{ height }}px). Квадратныя відэа не дазволены. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Відэа ў ландшафтнай арыентацыі ({{ width }}x{{ height }} пікс.). Ландшафтныя відэа не дазваляюцца. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Відэа ў партрэтнай арыентацыі ({{ width }}x{{ height }}px). Відэа ў партрэтнай арыентацыі не дазваляюцца. + + + The video file is corrupted. + Відэафайл пашкоджаны. + + + The video contains multiple streams. Only one stream is allowed. + Відэа змяшчае некалькі патокаў. Дазволены толькі адзін паток. + + + Unsupported video codec "{{ codec }}". + Непадтрымліваемы відэакодэк «{{ codec }}». + + + Unsupported video container "{{ container }}". + Непадтрымліваемы кантэйнер відэа "{{ container }}". + + + The image file is corrupted. + Файл выявы пашкоджаны. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + У выяве занадта мала пікселяў ({{ pixels }}). Чакаемы мінімум — {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Малюнак мае занадта шмат пікселяў ({{ pixels }}). Чаканая максімальная колькасць {{ max_pixels }}. + + + This filename does not match the expected charset. + Гэта назва файла не адпавядае чаканаму набору знакаў. + diff --git a/Resources/translations/validators.bg.xlf b/Resources/translations/validators.bg.xlf index afd7590f5..79c06e5bc 100644 --- a/Resources/translations/validators.bg.xlf +++ b/Resources/translations/validators.bg.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Тази стойност не е валиден Twig шаблон. + + This file is not a valid video. + Този файл не е валидно видео. + + + The size of the video could not be detected. + Размерът на видеото не може да бъде установен. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Ширината на видеото е твърде голяма ({{ width }}px). Допустимата максимална ширина е {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Ширината на видеото е твърде малка ({{ width }}px). Минималната изисквана ширина е {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Височината на видеото е твърде голяма ({{ height }}px). Максимално допустимата височина е {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Височината на видеото е твърде малка ({{ height }}px). Очакваната минимална височина е {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Видеото има твърде малко пиксели ({{ pixels }}). Минимално изискуемото количество е {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Видеото има твърде много пиксели ({{ pixels }}). Очакваният максимум е {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Съотношението на видеото е твърде голямо ({{ ratio }}). Позволеното максимално съотношение е {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Съотношението на видеото е твърде малко ({{ ratio }}). Минималното очаквано съотношение е {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Видеото е квадратно ({{ width }}x{{ height }}px). Квадратни видеа не са позволени. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Видеото е в хоризонтална ориентация ({{ width }}x{{ height }} px). Хоризонтални видеа не са позволени. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Видеото е с портретна ориентация ({{ width }}x{{ height }}px). Видеа с портретна ориентация не са позволени. + + + The video file is corrupted. + Видеофайлът е повреден. + + + The video contains multiple streams. Only one stream is allowed. + Видеото съдържа множество потоци. Разрешен е само един поток. + + + Unsupported video codec "{{ codec }}". + Неподдържан видео кодек „{{ codec }}“. + + + Unsupported video container "{{ container }}". + Неподдържан видео контейнер "{{ container }}". + + + The image file is corrupted. + Файлът с изображение е повреден. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Изображението има твърде малко пиксели ({{ pixels }}). Очакваният минимален брой е {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Изображението има твърде много пиксели ({{ pixels }}). Очакваният максимален брой е {{ max_pixels }}. + + + This filename does not match the expected charset. + Името на файла не съответства на очаквания набор от знаци. + diff --git a/Resources/translations/validators.bs.xlf b/Resources/translations/validators.bs.xlf index d6b7de576..43a118e08 100644 --- a/Resources/translations/validators.bs.xlf +++ b/Resources/translations/validators.bs.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Ova vrijednost nije važeći Twig šablon. + + This file is not a valid video. + Ova datoteka nije važeći video. + + + The size of the video could not be detected. + Veličina videa nije mogla biti utvrđena. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Širina videa je prevelika ({{ width }}px). Dozvoljena maksimalna širina je {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Širina videa je premala ({{ width }}px). Minimalna očekivana širina je {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Visina videa je prevelika ({{ height }}px). Dozvoljena maksimalna visina je {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Visina videa je premala ({{ height }}px). Očekivana minimalna visina je {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Video ima premalo piksela ({{ pixels }}). Očekivana minimalna količina je {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Video ima previše piksela ({{ pixels }}). Očekivana maksimalna količina je {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Omjer videa je prevelik ({{ ratio }}). Dozvoljeni maksimalni omjer je {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Omjer videa je premali ({{ ratio }}). Minimalni očekivani omjer je {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Video je kvadratan ({{ width }}x{{ height }}px). Kvadratni video zapisi nisu dozvoljeni. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Video je vodoravne orijentacije ({{ width }}x{{ height }} px). Vodoravni video zapisi nisu dozvoljeni. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Video je uspravno orijentisan ({{ width }}x{{ height }}px). Video zapisi uspravne orijentacije nisu dozvoljeni. + + + The video file is corrupted. + Video datoteka je oštećena. + + + The video contains multiple streams. Only one stream is allowed. + Video sadrži više tokova. Dozvoljen je samo jedan tok. + + + Unsupported video codec "{{ codec }}". + Nepodržani video kodek "{{ codec }}". + + + Unsupported video container "{{ container }}". + Nepodržani video kontejner "{{ container }}". + + + The image file is corrupted. + Datoteka slike je oštećena. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Slika ima premalo piksela ({{ pixels }}). Očekivani minimalni broj je {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Slika ima previše piksela ({{ pixels }}). Očekivani maksimalni broj je {{ max_pixels }}. + + + This filename does not match the expected charset. + Naziv ove datoteke ne odgovara očekivanom skupu znakova. + diff --git a/Resources/translations/validators.ca.xlf b/Resources/translations/validators.ca.xlf index d656ef540..6b9b2cd73 100644 --- a/Resources/translations/validators.ca.xlf +++ b/Resources/translations/validators.ca.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Aquest valor no és una plantilla Twig vàlida. + + This file is not a valid video. + Aquest fitxer no és un vídeo vàlid. + + + The size of the video could not be detected. + No s'ha pogut detectar la mida del vídeo. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + L'amplada del vídeo és massa gran ({{ width }}px). L'amplada màxima permesa és {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + L’amplada del vídeo és massa petita ({{ width }}px). L’amplada mínima esperada és {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + L'alçada del vídeo és massa gran ({{ height }}px). L'alçada màxima permesa és {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + L'alçada del vídeo és massa petita ({{ height }}px). L'alçada mínima esperada és {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + El vídeo té massa pocs píxels ({{ pixels }}). La quantitat mínima esperada és {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + El vídeo té massa píxels ({{ pixels }}). La quantitat màxima prevista és {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + La relació del vídeo és massa gran ({{ ratio }}). La relació màxima permesa és {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + La relació del vídeo és massa petita ({{ ratio }}). La relació mínima esperada és {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + El vídeo és quadrat ({{ width }}x{{ height }}px). No es permeten vídeos quadrats. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + El vídeo té orientació horitzontal ({{ width }}x{{ height }} px). No es permeten vídeos horitzontals. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + El vídeo és en orientació vertical ({{ width }}x{{ height }} px). No es permeten vídeos en orientació vertical. + + + The video file is corrupted. + El fitxer de vídeo està corrupte. + + + The video contains multiple streams. Only one stream is allowed. + El vídeo conté diversos fluxos. Només es permet un sol flux. + + + Unsupported video codec "{{ codec }}". + Còdec de vídeo no compatible «{{ codec }}». + + + Unsupported video container "{{ container }}". + Contenidor de vídeo no compatible "{{ container }}". + + + The image file is corrupted. + El fitxer d'imatge està malmès. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + La imatge té massa pocs píxels ({{ pixels }}). La quantitat mínima esperada és {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + La imatge té massa píxels ({{ pixels }}). El nombre màxim esperat és {{ max_pixels }}. + + + This filename does not match the expected charset. + Aquest nom de fitxer no coincideix amb el joc de caràcters esperat. + diff --git a/Resources/translations/validators.cs.xlf b/Resources/translations/validators.cs.xlf index d5f48f0ae..c75e33c45 100644 --- a/Resources/translations/validators.cs.xlf +++ b/Resources/translations/validators.cs.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Tato hodnota není platná Twig šablona. + + This file is not a valid video. + Tento soubor není platné video. + + + The size of the video could not be detected. + Velikost videa se nepodařilo zjistit. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Šířka videa je příliš velká ({{ width }}px). Povolená maximální šířka je {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Šířka videa je příliš malá ({{ width }}px). Minimální očekávaná šířka je {{ min_width }} px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Výška videa je příliš velká ({{ height }}px). Povolená maximální výška je {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Výška videa je příliš malá ({{ height }}px). Očekávaná minimální výška je {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Video má příliš málo pixelů ({{ pixels }}). Očekávané minimální množství je {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Video má příliš mnoho pixelů ({{ pixels }}). Očekávané maximum je {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Poměr videa je příliš velký ({{ ratio }}). Povolený maximální poměr je {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Poměr videa je příliš malý ({{ ratio }}). Minimální očekávaný poměr je {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Video je čtvercové ({{ width }}x{{ height }}px). Čtvercová videa nejsou povolena. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Video je na šířku ({{ width }}x{{ height }} px). Videa na šířku nejsou povolena. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Video je orientován na výšku ({{ width }}x{{ height }} px). Videa na výšku nejsou povolena. + + + The video file is corrupted. + Videosoubor je poškozen. + + + The video contains multiple streams. Only one stream is allowed. + Video obsahuje více streamů. Povolen je pouze jeden stream. + + + Unsupported video codec "{{ codec }}". + Nepodporovaný video kodek „{{ codec }}“. + + + Unsupported video container "{{ container }}". + Nepodporovaný videokontejner "{{ container }}". + + + The image file is corrupted. + Soubor obrázku je poškozen. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Obrázek má příliš málo pixelů ({{ pixels }}). Očekávané minimum je {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Obrázek má příliš mnoho pixelů ({{ pixels }}). Očekávané maximum je {{ max_pixels }}. + + + This filename does not match the expected charset. + Název tohoto souboru neodpovídá očekávané znakové sadě. + diff --git a/Resources/translations/validators.cy.xlf b/Resources/translations/validators.cy.xlf index 08a76667d..366edef03 100644 --- a/Resources/translations/validators.cy.xlf +++ b/Resources/translations/validators.cy.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Nid yw'r gwerth hwn yn dempled Twig dilys. + + This file is not a valid video. + Nid yw’r ffeil hon yn fideo dilys. + + + The size of the video could not be detected. + Nid oedd modd canfod maint y fideo. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Mae lled y fideo yn rhy fawr ({{ width }}px). Y lled uchaf a ganiateir yw {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Mae lled y fideo yn rhy fach ({{ width }}px). Lled lleiaf disgwyliedig yw {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Mae uchder y fideo yn rhy fawr ({{ height }}px). Yr uchder mwyaf a ganiateir yw {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Mae uchder y fideo yn rhy fach ({{ height }}px). Yr uchder lleiaf disgwyliedig yw {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Mae gan y fideo rhy ychydig o bicseli ({{ pixels }}). Y swm lleiaf disgwyliedig yw {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Mae gan y fideo ormod o bicseli ({{ pixels }}). Y swm uchaf disgwyliedig yw {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Mae cymhareb y fideo yn rhy fawr ({{ ratio }}). Y gymhareb uchaf a ganiateir yw {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Mae cymhareb y fideo yn rhy fach ({{ ratio }}). Y gymhareb leiaf ddisgwyliedig yw {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Mae'r fideo'n sgwâr ({{ width }}x{{ height }}px). Nid yw fideos sgwâr yn cael eu caniatáu. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Mae’r fideo yn dirwedd ({{ width }}x{{ height }} px). Ni chaniateir fideos tirwedd. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Mae'r fideo wedi'i gyfeirio'n bortread ({{ width }}x{{ height }}px). Nid yw fideos portread yn cael eu caniatáu. + + + The video file is corrupted. + Mae'r ffeil fideo wedi'i llygru. + + + The video contains multiple streams. Only one stream is allowed. + Mae'r fideo yn cynnwys sawl ffrwd. Dim ond un ffrwd a ganiateir. + + + Unsupported video codec "{{ codec }}". + Codec fideo heb ei gefnogi "{{ codec }}". + + + Unsupported video container "{{ container }}". + Cynhwysydd fideo heb ei gefnogi "{{ container }}". + + + The image file is corrupted. + Mae'r ffeil delwedd wedi'i llygru. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Mae gan y ddelwedd rhy ychydig o bicseli ({{ pixels }}). Y lleiafswm disgwyliedig yw {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Mae gan y ddelwedd ormod o bicseli ({{ pixels }}). Y nifer uchaf disgwyliedig yw {{ max_pixels }}. + + + This filename does not match the expected charset. + Nid yw'r enw ffeil hwn yn cyfateb i'r set nodau ddisgwyliedig. + diff --git a/Resources/translations/validators.da.xlf b/Resources/translations/validators.da.xlf index bb05bba2e..b94d0785f 100644 --- a/Resources/translations/validators.da.xlf +++ b/Resources/translations/validators.da.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Denne værdi er ikke en gyldig Twig-skabelon. + + This file is not a valid video. + Denne fil er ikke en gyldig video. + + + The size of the video could not be detected. + Videostørrelsen kunne ikke registreres. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Videobredden er for stor ({{ width }}px). Tilladt maksimal bredde er {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Videobredden er for lille ({{ width }}px). Mindste forventede bredde er {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Videoens højde er for stor ({{ height }}px). Tilladt maksimal højde er {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Videoens højde er for lille ({{ height }}px). Forventet minimumshøjde er {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Videoen har for få pixels ({{ pixels }}). Forventet minimum er {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Videoen har for mange pixels ({{ pixels }}). Forventet maksimummængde er {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Videoforholdet er for stort ({{ ratio }}). Tilladt maksimalforhold er {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Videoforholdet er for lille ({{ ratio }}). Forventet minimumsforhold er {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Videoen er kvadratisk ({{ width }}x{{ height }}px). Kvadratiske videoer er ikke tilladt. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Videoen er i liggende format ({{ width }}x{{ height }} px). Liggende videoer er ikke tilladt. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Videoen er i portrætformat ({{ width }}x{{ height }}px). Portrætvideoer er ikke tilladt. + + + The video file is corrupted. + Videofilen er beskadiget. + + + The video contains multiple streams. Only one stream is allowed. + Videoen indeholder flere streams. Kun én stream er tilladt. + + + Unsupported video codec "{{ codec }}". + Ikke-understøttet videokodek "{{ codec }}". + + + Unsupported video container "{{ container }}". + Ikke-understøttet videocontainer "{{ container }}". + + + The image file is corrupted. + Billedfilen er beskadiget. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Billedet har for få pixels ({{ pixels }}). Forventet minimum er {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Billedet har for mange pixels ({{ pixels }}). Forventet maksimalt antal er {{ max_pixels }}. + + + This filename does not match the expected charset. + Dette filnavn matcher ikke det forventede tegnsæt. + diff --git a/Resources/translations/validators.de.xlf b/Resources/translations/validators.de.xlf index f02c56c6c..dd54a9233 100644 --- a/Resources/translations/validators.de.xlf +++ b/Resources/translations/validators.de.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Dieser Wert ist kein valides Twig-Template. + + This file is not a valid video. + Diese Datei ist kein gültiges Video. + + + The size of the video could not be detected. + Die Größe des Videos konnte nicht ermittelt werden. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Die Videobreite ist zu groß ({{ width }}px). Zulässige maximale Breite ist {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Die Videobreite ist zu klein ({{ width }}px). Erwartete Mindestbreite ist {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Die Videohöhe ist zu groß ({{ height }}px). Zulässige maximale Höhe ist {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Die Videohöhe ist zu klein ({{ height }}px). Erwartete Mindesthöhe ist {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Das Video hat zu wenige Pixel ({{ pixels }}). Erwartete Mindestmenge ist {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Das Video hat zu viele Pixel ({{ pixels }}). Die erwartete Höchstanzahl ist {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Das Videoverhältnis ist zu groß ({{ ratio }}). Zulässiges maximales Verhältnis ist {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Das Video-Seitenverhältnis ist zu klein ({{ ratio }}). Erwartetes Mindestverhältnis ist {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Das Video ist quadratisch ({{ width }}x{{ height }}px). Quadratische Videos sind nicht erlaubt. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Das Video ist im Querformat ({{ width }}x{{ height }} px). Querformat-Videos sind nicht erlaubt. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Das Video ist hochkant ausgerichtet ({{ width }}x{{ height }}px). Hochkant-Videos sind nicht erlaubt. + + + The video file is corrupted. + Die Videodatei ist beschädigt. + + + The video contains multiple streams. Only one stream is allowed. + Das Video enthält mehrere Streams. Es ist nur ein Stream erlaubt. + + + Unsupported video codec "{{ codec }}". + Nicht unterstützter Videocodec „{{ codec }}“. + + + Unsupported video container "{{ container }}". + Nicht unterstützter Videocontainer "{{ container }}". + + + The image file is corrupted. + Die Bilddatei ist beschädigt. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Das Bild hat zu wenige Pixel ({{ pixels }}). Erwartete Mindestmenge ist {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Das Bild hat zu viele Pixel ({{ pixels }}). Erwartete Höchstmenge ist {{ max_pixels }}. + + + This filename does not match the expected charset. + Dieser Dateiname entspricht nicht dem erwarteten Zeichensatz. + diff --git a/Resources/translations/validators.el.xlf b/Resources/translations/validators.el.xlf index 9aec12ff8..dc5f1a961 100644 --- a/Resources/translations/validators.el.xlf +++ b/Resources/translations/validators.el.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Αυτή η τιμή δεν είναι έγκυρο πρότυπο Twig. + + This file is not a valid video. + Αυτό το αρχείο δεν είναι έγκυρο βίντεο. + + + The size of the video could not be detected. + Δεν ήταν δυνατός ο εντοπισμός του μεγέθους του βίντεο. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Το πλάτος του βίντεο είναι πολύ μεγάλο ({{ width }}px). Το επιτρεπόμενο μέγιστο πλάτος είναι {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Το πλάτος του βίντεο είναι πολύ μικρό ({{ width }}px). Το ελάχιστο αναμενόμενο πλάτος είναι {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Το ύψος του βίντεο είναι πολύ μεγάλο ({{ height }}px). Το επιτρεπόμενο μέγιστο ύψος είναι {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Το ύψος του βίντεο είναι πολύ μικρό ({{ height }}px). Το αναμενόμενο ελάχιστο ύψος είναι {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Το βίντεο έχει πολύ λίγα εικονοστοιχεία ({{ pixels }}). Η ελάχιστη αναμενόμενη ποσότητα είναι {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Το βίντεο έχει πάρα πολλά εικονοστοιχεία ({{ pixels }}). Η μέγιστη αναμενόμενη ποσότητα είναι {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Η αναλογία του βίντεο είναι πολύ μεγάλη ({{ ratio }}). Η μέγιστη επιτρεπτή αναλογία είναι {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Η αναλογία βίντεο είναι πολύ μικρή ({{ ratio }}). Η ελάχιστη αναμενόμενη αναλογία είναι {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Το βίντεο είναι τετράγωνο ({{ width }}x{{ height }}px). Τα τετράγωνα βίντεο δεν επιτρέπονται. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Το βίντεο είναι σε οριζόντιο προσανατολισμό ({{ width }}x{{ height }} px). Τα οριζόντια βίντεο δεν επιτρέπονται. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Το βίντεο είναι σε κατακόρυφο προσανατολισμό ({{ width }}x{{ height }}px). Βίντεο κάθετου προσανατολισμού δεν επιτρέπονται. + + + The video file is corrupted. + Το αρχείο βίντεο είναι κατεστραμμένο. + + + The video contains multiple streams. Only one stream is allowed. + Το βίντεο περιέχει πολλαπλά ρεύματα. Επιτρέπεται μόνο ένα ρεύμα. + + + Unsupported video codec "{{ codec }}". + Μη υποστηριζόμενος κωδικοποιητής βίντεο «{{ codec }}». + + + Unsupported video container "{{ container }}". + Μη υποστηριζόμενο κοντέινερ βίντεο "{{ container }}". + + + The image file is corrupted. + Το αρχείο εικόνας είναι κατεστραμμένο. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Η εικόνα έχει πολύ λίγα εικονοστοιχεία ({{ pixels }}). Η αναμενόμενη ελάχιστη ποσότητα είναι {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Η εικόνα έχει πάρα πολλούς εικονοστοιχείους ({{ pixels }}). Ο μέγιστος αναμενόμενος αριθμός είναι {{ max_pixels }}. + + + This filename does not match the expected charset. + Αυτό το όνομα αρχείου δεν αντιστοιχεί στο αναμενόμενο σύνολο χαρακτήρων. + diff --git a/Resources/translations/validators.en.xlf b/Resources/translations/validators.en.xlf index f8c664f18..9a00253e3 100644 --- a/Resources/translations/validators.en.xlf +++ b/Resources/translations/validators.en.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. This value is not a valid Twig template. + + This file is not a valid video. + This file is not a valid video. + + + The size of the video could not be detected. + The size of the video could not be detected. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + + + The video file is corrupted. + The video file is corrupted. + + + The video contains multiple streams. Only one stream is allowed. + The video contains multiple streams. Only one stream is allowed. + + + Unsupported video codec "{{ codec }}". + Unsupported video codec "{{ codec }}". + + + Unsupported video container "{{ container }}". + Unsupported video container "{{ container }}". + + + The image file is corrupted. + The image file is corrupted. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + + + This filename does not match the expected charset. + This filename does not match the expected charset. + diff --git a/Resources/translations/validators.es.xlf b/Resources/translations/validators.es.xlf index 0d47977de..c2bdb7c4e 100644 --- a/Resources/translations/validators.es.xlf +++ b/Resources/translations/validators.es.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Este valor no es una plantilla Twig válida. + + This file is not a valid video. + Este archivo no es un video válido. + + + The size of the video could not be detected. + No se pudo detectar el tamaño del video. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + El ancho del vídeo es demasiado grande ({{ width }}px). El ancho máximo permitido es {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + El ancho del video es demasiado pequeño ({{ width }}px). El ancho mínimo esperado es {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + La altura del video es demasiado grande ({{ height }}px). La altura máxima permitida es {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + La altura del video es demasiado pequeña ({{ height }}px). La altura mínima esperada es {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + El vídeo tiene muy pocos píxeles ({{ pixels }}). La cantidad mínima esperada es {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + El vídeo tiene demasiados píxeles ({{ pixels }}). La cantidad máxima esperada es {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + La relación del video es demasiado grande ({{ ratio }}). La relación máxima permitida es {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + La relación del video es demasiado pequeña ({{ ratio }}). La relación mínima esperada es {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + El video es cuadrado ({{ width }}x{{ height }}px). No se permiten videos cuadrados. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + El video tiene orientación horizontal ({{ width }}x{{ height }} px). No se permiten videos en formato horizontal. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + El video tiene orientación vertical ({{ width }}x{{ height }} px). No se permiten videos en orientación vertical. + + + The video file is corrupted. + El archivo de video está dañado. + + + The video contains multiple streams. Only one stream is allowed. + El video contiene múltiples flujos. Solo se permite un flujo. + + + Unsupported video codec "{{ codec }}". + Códec de vídeo no compatible «{{ codec }}». + + + Unsupported video container "{{ container }}". + Contenedor de vídeo no compatible "{{ container }}". + + + The image file is corrupted. + El archivo de imagen está dañado. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + La imagen tiene muy pocos píxeles ({{ pixels }}). La cantidad mínima esperada es {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + La imagen tiene demasiados píxeles ({{ pixels }}). La cantidad máxima esperada es {{ max_pixels }}. + + + This filename does not match the expected charset. + Este nombre de archivo no coincide con el conjunto de caracteres esperado. + diff --git a/Resources/translations/validators.et.xlf b/Resources/translations/validators.et.xlf index 2375aa4ad..12a2671d9 100644 --- a/Resources/translations/validators.et.xlf +++ b/Resources/translations/validators.et.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. See väärtus ei ole kehtiv Twig'i mall. + + This file is not a valid video. + See fail ei ole kehtiv video. + + + The size of the video could not be detected. + Video suurust ei õnnestunud tuvastada. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Video laius on liiga suur ({{ width }}px). Lubatud maksimaalne laius on {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Video laius on liiga väike ({{ width }}px). Oodatav minimaalne laius on {{ min_width }} px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Video kõrgus on liiga suur ({{ height }}px). Lubatud maksimaalne kõrgus on {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Video kõrgus on liiga väike ({{ height }}px). Oodatav minimaalne kõrgus on {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Videol on liiga vähe piksleid ({{ pixels }}). Oodatav miinimum on {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Videol on liiga palju piksleid ({{ pixels }}). Eeldatav maksimaalne kogus on {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Video suhe on liiga suur ({{ ratio }}). Lubatud maksimaalne suhe on {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Video kuvasuhe on liiga väike ({{ ratio }}). Eeldatav miinimumsuhe on {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Video on ruudukujuline ({{ width }}x{{ height }}px). Ruutvideod pole lubatud. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Video on horisontaalses asendis ({{ width }}x{{ height }} px). Horisontaalseid videoid ei ole lubatud. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Video on püstsuunas ({{ width }}x{{ height }} px). Püstsuunalised videod pole lubatud. + + + The video file is corrupted. + Videofail on rikutud. + + + The video contains multiple streams. Only one stream is allowed. + Video sisaldab mitu voogu. Lubatud on ainult üks voog. + + + Unsupported video codec "{{ codec }}". + Toetamata videokoodek „{{ codec }}“. + + + Unsupported video container "{{ container }}". + Toetamata videokonteiner "{{ container }}". + + + The image file is corrupted. + Pildifail on rikutud. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Pildil on liiga vähe piksleid ({{ pixels }}). Oodatav miinimum on {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Pildil on liiga palju piksleid ({{ pixels }}). Oodatav maksimaalne hulk on {{ max_pixels }}. + + + This filename does not match the expected charset. + See failinimi ei vasta eeldatavale märgistikule. + diff --git a/Resources/translations/validators.eu.xlf b/Resources/translations/validators.eu.xlf index 830f8673d..e498afc26 100644 --- a/Resources/translations/validators.eu.xlf +++ b/Resources/translations/validators.eu.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Balio hau ez da Twig txantiloi baliozko bat. + + This file is not a valid video. + Fitxategi hau ez da baliozko bideo bat. + + + The size of the video could not be detected. + Ezin izan da bideoaren tamaina detektatu. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Bideoaren zabalera handiegia da ({{ width }}px). Baimendutako gehieneko zabalera {{ max_width }}px da. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Bideoaren zabalera txikiegia da ({{ width }}px). Gutxieneko espero den zabalera {{ min_width }}px da. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Bideoaren altuera handiegia da ({{ height }}px). Onartutako gehienezko altuera {{ max_height }}px da. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Bideoaren altuera txikiegia da ({{ height }}px). Espero den gutxieneko altuera {{ min_height }}px da. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Bideoak pixel gutiegi ditu ({{ pixels }}). Gutxieneko espero den kopurua {{ min_pixels }} da. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Bideoak pixel gehiegi ditu ({{ pixels }}). Espero den gehieneko kopurua {{ max_pixels }} da. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Bideoaren erlazioa handiegia da ({{ ratio }}). Onartutako gehieneko erlazioa {{ max_ratio }} da. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Bideoaren erlazioa txikiegia da ({{ ratio }}). Espero den gutxieneko erlazioa {{ min_ratio }} da. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Bideoa karratua da ({{ width }}x{{ height }}px). Bideo karratuak ez dira onartzen. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Bideoa paisaia orientazioan dago ({{ width }}x{{ height }} px). Paisaia-orientazioko bideoak ez daude baimenduta. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Bideoa bertikal orientatuta dago ({{ width }}x{{ height }} px). Orientazio bertikaleko bideoak ez dira onartzen. + + + The video file is corrupted. + Bideo fitxategia hondatuta dago. + + + The video contains multiple streams. Only one stream is allowed. + Bideoak korronte anitz ditu. Korronte bakarra onartzen da. + + + Unsupported video codec "{{ codec }}". + Bideo kodek onartugabea "{{ codec }}". + + + Unsupported video container "{{ container }}". + Onartzen ez den bideo edukiontzia "{{ container }}". + + + The image file is corrupted. + Irudi fitxategia hondatuta dago. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Irudiak pixelen kopuru gutiegi du ({{ pixels }}). Espero den gutxienekoa {{ min_pixels }} da. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Irudiak pixel gehiegi ditu ({{ pixels }}). Espero den gehienezko kopurua {{ max_pixels }} da. + + + This filename does not match the expected charset. + Fitxategi-izen honek ez du espero zen karaktere multzoarekin bat egiten. + diff --git a/Resources/translations/validators.fa.xlf b/Resources/translations/validators.fa.xlf index 97c3a9410..2e7516799 100644 --- a/Resources/translations/validators.fa.xlf +++ b/Resources/translations/validators.fa.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. این مقدار یک قالب معتبر Twig نیست. + + This file is not a valid video. + این فایل یک ویدیوی معتبر نیست. + + + The size of the video could not be detected. + اندازه ویدئو قابل تشخیص نبود. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + عرض ویدئو خیلی زیاد است ({{ width }}px). حداکثر عرض مجاز {{ max_width }}px است. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + عرض ویدئو خیلی کم است ({{ width }}px). حداقل عرض مورد انتظار {{ min_width }} پیکسل است. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + ارتفاع ویدیو خیلی زیاد است ({{ height }}px). حداکثر ارتفاع مجاز {{ max_height }}px است. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + ارتفاع ویدیو خیلی کم است ({{ height }}px). حداقل ارتفاع مورد انتظار {{ min_height }}px است. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + ویدیو پیکسل‌های بسیار کمی دارد ({{ pixels }}). حداقل مقدار مورد انتظار {{ min_pixels }} است. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + ویدئو پیکسل‌های زیادی دارد ({{ pixels }}). حداکثر مقدار مورد انتظار {{ max_pixels }} است. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + نسبت ویدیو خیلی بزرگ است ({{ ratio }}). حداکثر نسبت مجاز {{ max_ratio }} است. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + نسبت ویدیو خیلی کوچک است ({{ ratio }}). نسبت حداقل مورد انتظار {{ min_ratio }} است. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + ویدئو مربعی است ({{ width }}x{{ height }}px). ویدئوهای مربعی مجاز نیستند. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + ویدیو به صورت افقی است ({{ width }}x{{ height }} پیکسل). ویدیوهای افقی مجاز نیستند. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + ویدیو با جهت عمودی است ({{ width }}x{{ height }}px). ویدیوهای با جهت عمودی مجاز نیستند. + + + The video file is corrupted. + فایل ویدیو خراب است. + + + The video contains multiple streams. Only one stream is allowed. + ویدئو شامل چندین استریم است. فقط یک استریم مجاز است. + + + Unsupported video codec "{{ codec }}". + کُدک ویدیویی پشتیبانی نمی‌شود «{{ codec }}». + + + Unsupported video container "{{ container }}". + ظرف ویدئو پشتیبانی نمی‌شود "{{ container }}". + + + The image file is corrupted. + فایل تصویر خراب است. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + تصویر پیکسل‌های بسیار کمی دارد ({{ pixels }}). حداقل مقدار مورد انتظار {{ min_pixels }} است. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + تصویر پیکسل‌های زیادی دارد ({{ pixels }}). حداکثر مقدار مورد انتظار {{ max_pixels }} است. + + + This filename does not match the expected charset. + نام این فایل با مجموعه نویسه‌های مورد انتظار مطابقت ندارد. + diff --git a/Resources/translations/validators.fi.xlf b/Resources/translations/validators.fi.xlf index c046963f7..d7d88d8b7 100644 --- a/Resources/translations/validators.fi.xlf +++ b/Resources/translations/validators.fi.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Tämä arvo ei ole kelvollinen Twig-malli. + + This file is not a valid video. + Tämä tiedosto ei ole kelvollinen video. + + + The size of the video could not be detected. + Videon kokoa ei voitu tunnistaa. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Videon leveys on liian suuri ({{ width }}px). Sallittu enimmäisleveys on {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Videon leveys on liian pieni ({{ width }}px). Odotettu vähimmäisleveys on {{ min_width }} px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Videon korkeus on liian suuri ({{ height }}px). Sallittu enimmäiskorkeus on {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Videon korkeus on liian pieni ({{ height }}px). Odotettu vähimmäiskorkeus on {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Videossa on liian vähän pikseleitä ({{ pixels }}). Odotettu vähimmäismäärä on {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Videossa on liikaa pikseleitä ({{ pixels }}). Odotettu enimmäismäärä on {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Videon suhde on liian suuri ({{ ratio }}). Sallittu enimmäissuhde on {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Videon kuvasuhde on liian pieni ({{ ratio }}). Odotettu vähimmäissuhde on {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Video on neliömäinen ({{ width }}x{{ height }}px). Neliövideot eivät ole sallittuja. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Video on vaakanäytössä ({{ width }}x{{ height }} px). Vaaka-asentoiset videot eivät ole sallittuja. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Video on pystysuunnassa ({{ width }}x{{ height }} px). Pystyvideot eivät ole sallittuja. + + + The video file is corrupted. + Videotiedosto on vioittunut. + + + The video contains multiple streams. Only one stream is allowed. + Videossa on useita virtoja. Vain yksi virta on sallittu. + + + Unsupported video codec "{{ codec }}". + Ei-tuettu videokoodekki ”{{ codec }}”. + + + Unsupported video container "{{ container }}". + Ei-tuettu videokontti "{{ container }}". + + + The image file is corrupted. + Kuvatiedosto on vioittunut. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Kuvassa on liian vähän pikseleitä ({{ pixels }}). Odotettu vähimmäismäärä on {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Kuvassa on liikaa pikseleitä ({{ pixels }}). Odotettu enimmäismäärä on {{ max_pixels }}. + + + This filename does not match the expected charset. + Tämän tiedostonimi ei vastaa odotettua merkistöä. + diff --git a/Resources/translations/validators.fr.xlf b/Resources/translations/validators.fr.xlf index 13033c019..3d44ec38e 100644 --- a/Resources/translations/validators.fr.xlf +++ b/Resources/translations/validators.fr.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Cette valeur n'est pas un modèle Twig valide. + + This file is not a valid video. + Ce fichier n’est pas une vidéo valide. + + + The size of the video could not be detected. + La taille de la vidéo n’a pas pu être détectée. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + La largeur de la vidéo est trop grande ({{ width }}px). La largeur maximale autorisée est de {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + La largeur de la vidéo est trop petite ({{ width }}px). La largeur minimale attendue est de {{ min_width }} px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + La hauteur de la vidéo est trop grande ({{ height }}px). La hauteur maximale autorisée est de {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + La hauteur de la vidéo est trop petite ({{ height }}px). La hauteur minimale attendue est de {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + La vidéo a trop peu de pixels ({{ pixels }}). La quantité minimale attendue est {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + La vidéo contient trop de pixels ({{ pixels }}). La quantité maximale attendue est {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Le ratio de la vidéo est trop élevé ({{ ratio }}). Le ratio maximal autorisé est {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Le ratio de la vidéo est trop petit ({{ ratio }}). Le ratio minimum attendu est {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + La vidéo est carrée ({{ width }}x{{ height }}px). Les vidéos carrées ne sont pas autorisées. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + La vidéo est au format paysage ({{ width }}x{{ height }} px). Les vidéos au format paysage ne sont pas autorisées. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + La vidéo est orientée en portrait ({{ width }}x{{ height }} px). Les vidéos en orientation portrait ne sont pas autorisées. + + + The video file is corrupted. + Le fichier vidéo est corrompu. + + + The video contains multiple streams. Only one stream is allowed. + La vidéo contient plusieurs flux. Un seul flux est autorisé. + + + Unsupported video codec "{{ codec }}". + Codec vidéo non pris en charge « {{ codec }} ». + + + Unsupported video container "{{ container }}". + Conteneur vidéo non pris en charge "{{ container }}". + + + The image file is corrupted. + Le fichier image est corrompu. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + L’image comporte trop peu de pixels ({{ pixels }}). La quantité minimale attendue est {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + L’image contient trop de pixels ({{ pixels }}). La quantité maximale attendue est {{ max_pixels }}. + + + This filename does not match the expected charset. + Ce nom de fichier ne correspond pas au jeu de caractères attendu. + diff --git a/Resources/translations/validators.gl.xlf b/Resources/translations/validators.gl.xlf index 391d741e9..33bdc3c7f 100644 --- a/Resources/translations/validators.gl.xlf +++ b/Resources/translations/validators.gl.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Este valor non é un modelo Twig válido. + + This file is not a valid video. + Este ficheiro non é un vídeo válido. + + + The size of the video could not be detected. + Non se puido detectar o tamaño do vídeo. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + A largura do vídeo é demasiado grande ({{ width }}px). A largura máxima permitida é {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + A largura do vídeo é demasiado pequena ({{ width }}px). A largura mínima agardada é {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + A altura do vídeo é demasiado grande ({{ height }}px). A altura máxima permitida é {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + A altura do vídeo é demasiado pequena ({{ height }}px). A altura mínima agardada é {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + O vídeo ten moi poucos píxeles ({{ pixels }}). A cantidade mínima agardada é {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + O vídeo ten demasiados píxeles ({{ pixels }}). A cantidade máxima agardada é {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + A relación do vídeo é demasiado grande ({{ ratio }}). A relación máxima permitida é {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + A relación do vídeo é demasiado pequena ({{ ratio }}). A relación mínima agardada é {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + O vídeo é cadrado ({{ width }}x{{ height }}px). Non se permiten vídeos cadrados. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + O vídeo está en orientación horizontal ({{ width }}x{{ height }} px). Non se permiten vídeos en horizontal. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + O vídeo está en orientación vertical ({{ width }}x{{ height }} px). Non se permiten vídeos en orientación vertical. + + + The video file is corrupted. + O ficheiro de vídeo está danado. + + + The video contains multiple streams. Only one stream is allowed. + O vídeo contén múltiples fluxos. Só se permite un fluxo. + + + Unsupported video codec "{{ codec }}". + Códec de vídeo non compatible «{{ codec }}». + + + Unsupported video container "{{ container }}". + Contedor de vídeo non compatible "{{ container }}". + + + The image file is corrupted. + O ficheiro de imaxe está danado. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + A imaxe ten moi poucos píxeles ({{ pixels }}). A cantidade mínima esperada é {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + A imaxe ten demasiados píxeles ({{ pixels }}). A cantidade máxima esperada é {{ max_pixels }}. + + + This filename does not match the expected charset. + Este nome de ficheiro non coincide co conxunto de caracteres agardado. + diff --git a/Resources/translations/validators.he.xlf b/Resources/translations/validators.he.xlf index 671a98881..e19c438e4 100644 --- a/Resources/translations/validators.he.xlf +++ b/Resources/translations/validators.he.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. ערך זה אינו תבנית Twig חוקית. + + This file is not a valid video. + קובץ זה אינו וידאו תקין. + + + The size of the video could not be detected. + לא ניתן היה לזהות את גודל הווידאו. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + רוחב הווידאו גדול מדי ({{ width }}px). רוחב מרבי מותר הוא {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + רוחב הווידאו קטן מדי ({{ width }}px). רוחב מינימלי צפוי הוא {{ min_width }} פיקסלים. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + גובה הווידאו גדול מדי ({{ height }}px). הגובה המקסימלי המותר הוא {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + גובה הווידאו קטן מדי ({{ height }}px). הגובה המינימלי הצפוי הוא {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + לסרטון יש מעט מדי פיקסלים ({{ pixels }}). הכמות המינימלית הצפויה היא {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + לסרטון יש יותר מדי פיקסלים ({{ pixels }}). הכמות המרבית הצפויה היא {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + יחס הווידאו גדול מדי ({{ ratio }}). יחס מקסימלי מותר הוא {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + יחס הווידאו קטן מדי ({{ ratio }}). יחס מינימלי צפוי הוא {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + הווידאו הוא מרובע ({{ width }}x{{ height }}px). סרטוני וידאו מרובעים אינם מותרים. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + הווידאו במצב לרוחב ({{ width }}x{{ height }} פיקסלים). סרטוני לרוחב אינם מותרים. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + הווידאו הוא בתצורת דיוקן ({{ width }}x{{ height }}px). סרטוני וידאו בתצורת דיוקן אינם מותרים. + + + The video file is corrupted. + קובץ הווידאו פגום. + + + The video contains multiple streams. Only one stream is allowed. + הווידאו מכיל מספר זרמים. מותר זרם אחד בלבד. + + + Unsupported video codec "{{ codec }}". + מקודד וידאו שאינו נתמך "{{ codec }}". + + + Unsupported video container "{{ container }}". + מיכל וידאו שאינו נתמך "{{ container }}". + + + The image file is corrupted. + קובץ התמונה פגום. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + לתמונה יש מעט מדי פיקסלים ({{ pixels }}). הכמות המינימלית הצפויה היא {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + לתמונה יש יותר מדי פיקסלים ({{ pixels }}). הכמות המרבית הצפויה היא {{ max_pixels }}. + + + This filename does not match the expected charset. + שם הקובץ הזה אינו תואם את מערך התווים הצפוי. + diff --git a/Resources/translations/validators.hr.xlf b/Resources/translations/validators.hr.xlf index 0951d4192..dfdcc297f 100644 --- a/Resources/translations/validators.hr.xlf +++ b/Resources/translations/validators.hr.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Ova vrijednost nije valjani Twig predložak. + + This file is not a valid video. + Ova datoteka nije valjani videozapis. + + + The size of the video could not be detected. + Veličina videozapisa nije mogla biti određena. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Širina videozapisa je prevelika ({{ width }}px). Dopuštenа maksimalna širina je {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Širina videozapisa je premala ({{ width }}px). Očekivana minimalna širina je {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Visina videozapisa je prevelika ({{ height }}px). Dopuštena maksimalna visina je {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Visina videozapisa je premala ({{ height }}px). Očekivana minimalna visina je {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Video ima premalo piksela ({{ pixels }}). Očekivana minimalna količina je {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Video ima previše piksela ({{ pixels }}). Očekivana maksimalna količina je {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Omjer videa je prevelik ({{ ratio }}). Dopušteni maksimalni omjer je {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Omjer videa je premalen ({{ ratio }}). Minimalni očekivani omjer je {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Video je kvadratan ({{ width }}x{{ height }}px). Kvadratni videozapisi nisu dopušteni. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Video je vodoravne orijentacije ({{ width }}x{{ height }} px). Vodoravni videozapisi nisu dopušteni. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Video je okomitog usmjerenja ({{ width }}x{{ height }} px). Videozapisi okomite orijentacije nisu dopušteni. + + + The video file is corrupted. + Videodatoteka je oštećena. + + + The video contains multiple streams. Only one stream is allowed. + Video sadrži više tokova. Dopušten je samo jedan tok. + + + Unsupported video codec "{{ codec }}". + Nepodržani video kodek „{{ codec }}“. + + + Unsupported video container "{{ container }}". + Nepodržani video kontejner "{{ container }}". + + + The image file is corrupted. + Datoteka slike je oštećena. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Slika ima premalo piksela ({{ pixels }}). Očekivana minimalna količina je {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Slika ima previše piksela ({{ pixels }}). Očekivana maksimalna količina je {{ max_pixels }}. + + + This filename does not match the expected charset. + Naziv ove datoteke ne odgovara očekivanom skupu znakova. + diff --git a/Resources/translations/validators.hu.xlf b/Resources/translations/validators.hu.xlf index dffab0ccb..05bd279ae 100644 --- a/Resources/translations/validators.hu.xlf +++ b/Resources/translations/validators.hu.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Ez az érték nem érvényes Twig sablon. + + This file is not a valid video. + Ez a fájl nem érvényes videó. + + + The size of the video could not be detected. + A videó méretét nem sikerült megállapítani. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + A videó szélessége túl nagy ({{ width }}px). A megengedett maximális szélesség {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + A videó szélessége túl kicsi ({{ width }}px). A várható minimális szélesség {{ min_width }} px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + A videó magassága túl nagy ({{ height }}px). A megengedett maximális magasság {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + A videó magassága túl kicsi ({{ height }}px). A minimálisan elvárt magasság {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + A videóban túl kevés a képpont ({{ pixels }}). Az elvárt minimális mennyiség {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + A videóban túl sok a képpont ({{ pixels }}). A várható maximális mennyiség {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + A videó aránya túl nagy ({{ ratio }}). A megengedett maximális arány {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + A videó képaránya túl kicsi ({{ ratio }}). A minimálisan elvárt arány {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + A videó négyzetes ({{ width }}x{{ height }}px). A négyzetes videók nem engedélyezettek. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + A videó fekvő tájolású ({{ width }}x{{ height }} px). Fekvő tájolású videók nem engedélyezettek. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + A videó álló tájolású ({{ width }}x{{ height }} px). Álló tájolású videók nem engedélyezettek. + + + The video file is corrupted. + A videófájl sérült. + + + The video contains multiple streams. Only one stream is allowed. + A videó több adatfolyamot tartalmaz. Csak egy adatfolyam engedélyezett. + + + Unsupported video codec "{{ codec }}". + Nem támogatott videokodek „{{ codec }}”. + + + Unsupported video container "{{ container }}". + Nem támogatott videokonténer "{{ container }}". + + + The image file is corrupted. + A képfájl sérült. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + A képen túl kevés pixel van ({{ pixels }}). Az elvárt minimum {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + A kép túl sok pixelt tartalmaz ({{ pixels }}). A várható maximális mennyiség {{ max_pixels }}. + + + This filename does not match the expected charset. + Ez a fájlnév nem felel meg a várt karakterkészletnek. + diff --git a/Resources/translations/validators.hy.xlf b/Resources/translations/validators.hy.xlf index 856babbd5..e537733c7 100644 --- a/Resources/translations/validators.hy.xlf +++ b/Resources/translations/validators.hy.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Այս արժեքը վավեր Twig ձևանմուշ չէ: + + This file is not a valid video. + Այս ֆայլը վավեր տեսանյութ չէ։ + + + The size of the video could not be detected. + Չհաջողվեց հայտնաբերել տեսանյութի չափը. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Տեսահոլովակի լայնությունը չափազանց մեծ է ({{ width }}px)։ Թույլատրելի առավելագույն լայնությունը {{ max_width }}px է։ + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Տեսանյութի լայնությունը չափազանց փոքր է ({{ width }}px). Սպասվող նվազագույն լայնքը {{ min_width }}px է. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Վիդեոյի բարձրությունը չափազանց մեծ է ({{ height }}px)։ Թույլատրելի առավելագույն բարձրությունը {{ max_height }}px է։ + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Վիդեոյի բարձրությունը շատ փոքր է ({{ height }}px)։ Սպասվող նվազագույն բարձրությունը {{ min_height }}px է։ + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Տեսանյութը ունի չափազանց քիչ պիքսելներ ({{ pixels }}). Սպասվող նվազագույն քանակը {{ min_pixels }} է։ + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Տեսանյութը ունի չափազանց շատ պիքսելներ ({{ pixels }}). Սպասվող առավելագույն քանակը {{ max_pixels }} է։ + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Տեսանյութի հարաբերակցությունը չափազանց մեծ է ({{ ratio }}): Թույլատրելի առավելագույն հարաբերակցությունը {{ max_ratio }} է։ + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Վիդեոյի հարաբերակցությունը շատ փոքր է ({{ ratio }}). Ավելի փոքրագույն սպասվող հարաբերակցությունը {{ min_ratio }} է. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Տեսանյութը քառակուսի է ({{ width }}x{{ height }}px). Քառակուսի տեսանյութերը թույլատրելի չեն. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Տեսանյութը հորիզոնական կողմնորոշմամբ է ({{ width }}x{{ height }} px). Հորիզոնական տեսանյութերը թույլատրելի չեն. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Վիդեոն ուղղահայաց կողմնորոշված է ({{ width }}x{{ height }}px)։ Ուղղահայաց կողմնորոշմամբ տեսանյութերը թույլատրելի չեն։ + + + The video file is corrupted. + Տեսանյութի ֆայլը վնասված է. + + + The video contains multiple streams. Only one stream is allowed. + Տեսանյութը պարունակում է բազմաթիվ հոսքեր։ Թույլատրվում է միայն մեկ հոսք։ + + + Unsupported video codec "{{ codec }}". + Չաջակցվող տեսանյութի կոդեկ «{{ codec }}»։ + + + Unsupported video container "{{ container }}". + Չաջակցվող վիդեո կոնտեյներ "{{ container }}". + + + The image file is corrupted. + Պատկերի ֆայլը վնասված է։ + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Պատկերը ունի չափազանց քիչ պիքսելներ ({{ pixels }}). Սպասվող նվազագույնը {{ min_pixels }} է։ + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Պատկերը ունի չափազանց շատ պիքսել ({{ pixels }}). Սպասվող առավելագույն քանակը {{ max_pixels }} է. + + + This filename does not match the expected charset. + Այս ֆայլի անունը չի համապատասխանում սպասվող նիշքերի հավաքածուին. + diff --git a/Resources/translations/validators.id.xlf b/Resources/translations/validators.id.xlf index b9796f888..d2ae0328e 100644 --- a/Resources/translations/validators.id.xlf +++ b/Resources/translations/validators.id.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Nilai ini bukan templat Twig yang valid. + + This file is not a valid video. + Berkas ini bukan video yang valid. + + + The size of the video could not be detected. + Ukuran video tidak dapat dideteksi. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Lebar video terlalu besar ({{ width }}px). Lebar maksimum yang diizinkan adalah {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Lebar video terlalu kecil ({{ width }}px). Lebar minimum yang diharapkan adalah {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Tinggi video terlalu besar ({{ height }}px). Tinggi maksimum yang diizinkan adalah {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Tinggi video terlalu kecil ({{ height }}px). Tinggi minimum yang diharapkan adalah {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Video memiliki terlalu sedikit piksel ({{ pixels }}). Jumlah minimum yang diharapkan adalah {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Video memiliki terlalu banyak piksel ({{ pixels }}). Jumlah maksimum yang diharapkan adalah {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Rasio video terlalu besar ({{ ratio }}). Rasio maksimum yang diizinkan adalah {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Rasio video terlalu kecil ({{ ratio }}). Rasio minimum yang diharapkan adalah {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Video berbentuk persegi ({{ width }}x{{ height }}px). Video persegi tidak diizinkan. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Video berorientasi lanskap ({{ width }}x{{ height }} px). Video berorientasi lanskap tidak diizinkan. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Video berorientasi potret ({{ width }}x{{ height }}px). Video berorientasi potret tidak diizinkan. + + + The video file is corrupted. + Berkas video rusak. + + + The video contains multiple streams. Only one stream is allowed. + Video berisi beberapa aliran. Hanya satu aliran yang diizinkan. + + + Unsupported video codec "{{ codec }}". + Kodek video tidak didukung "{{ codec }}". + + + Unsupported video container "{{ container }}". + Kontainer video tidak didukung "{{ container }}". + + + The image file is corrupted. + File gambar rusak. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Gambar memiliki terlalu sedikit piksel ({{ pixels }}). Jumlah minimum yang diharapkan adalah {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Gambar memiliki terlalu banyak piksel ({{ pixels }}). Jumlah maksimum yang diharapkan adalah {{ max_pixels }}. + + + This filename does not match the expected charset. + Nama berkas ini tidak sesuai dengan set karakter yang diharapkan. + diff --git a/Resources/translations/validators.it.xlf b/Resources/translations/validators.it.xlf index 34ef61ed5..67cddc393 100644 --- a/Resources/translations/validators.it.xlf +++ b/Resources/translations/validators.it.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Questo valore non è un template Twig valido. + + This file is not a valid video. + Questo file non è un video valido. + + + The size of the video could not be detected. + Non è stato possibile rilevare la dimensione del video. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + La larghezza del video è troppo grande ({{ width }}px). La larghezza massima consentita è {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + La larghezza del video è troppo piccola ({{ width }}px). La larghezza minima prevista è {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + L'altezza del video è troppo grande ({{ height }}px). L'altezza massima consentita è {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + L'altezza del video è troppo piccola ({{ height }}px). L'altezza minima prevista è {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Il video ha troppo pochi pixel ({{ pixels }}). La quantità minima prevista è {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Il video ha troppi pixel ({{ pixels }}). La quantità massima prevista è {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Il rapporto del video è troppo alto ({{ ratio }}). Il rapporto massimo consentito è {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Il rapporto del video è troppo piccolo ({{ ratio }}). Il rapporto minimo previsto è {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Il video è quadrato ({{ width }}x{{ height }}px). I video quadrati non sono consentiti. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Il video è in orientamento orizzontale ({{ width }}x{{ height }} px). I video orizzontali non sono consentiti. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Il video è in orientamento verticale ({{ width }}x{{ height }}px). I video in orientamento verticale non sono consentiti. + + + The video file is corrupted. + Il file video è danneggiato. + + + The video contains multiple streams. Only one stream is allowed. + Il video contiene più flussi. È consentito un solo flusso. + + + Unsupported video codec "{{ codec }}". + Codec video non supportato «{{ codec }}». + + + Unsupported video container "{{ container }}". + Container video non supportato "{{ container }}". + + + The image file is corrupted. + Il file immagine è danneggiato. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + L’immagine ha troppo pochi pixel ({{ pixels }}). La quantità minima prevista è {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + L’immagine ha troppi pixel ({{ pixels }}). La quantità massima prevista è {{ max_pixels }}. + + + This filename does not match the expected charset. + Questo nome file non corrisponde al set di caratteri previsto. + diff --git a/Resources/translations/validators.ja.xlf b/Resources/translations/validators.ja.xlf index 42e51903c..860696d2c 100644 --- a/Resources/translations/validators.ja.xlf +++ b/Resources/translations/validators.ja.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. 有効なTwigテンプレートではありません。 + + This file is not a valid video. + このファイルは有効な動画ではありません。 + + + The size of the video could not be detected. + 動画のサイズを検出できませんでした。 + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + 動画の幅が大きすぎます({{ width }}px)。許可されている最大幅は {{ max_width }}px です。 + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + 動画の幅が小さすぎます({{ width }}px)。想定される最小幅は {{ min_width }}px です。 + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + 動画の高さが大きすぎます ({{ height }}px)。許可されている最大の高さは {{ max_height }}px です。 + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + ビデオの高さが小さすぎます ({{ height }}px)。想定される最小高さは {{ min_height }}px です。 + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + この動画のピクセル数が少なすぎます ({{ pixels }}). 期待される最小量は {{ min_pixels }} です。 + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + この動画のピクセル数が多すぎます ({{ pixels }})。想定される最大値は {{ max_pixels }} です。 + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + 動画の比率が大きすぎます ({{ ratio }})。許可されている最大比率は {{ max_ratio }} です。 + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + ビデオのアスペクト比が小さすぎます ({{ ratio }})。想定される最小比率は {{ min_ratio }} です。 + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + 動画は正方形です ({{ width }}x{{ height }}px)。正方形の動画は許可されていません。 + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + 動画は横向きです({{ width }}x{{ height }}px)。横向きの動画は許可されていません。 + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + 動画は縦向きです({{ width }}x{{ height }}px)。縦向きの動画は許可されていません。 + + + The video file is corrupted. + ビデオファイルが破損しています。 + + + The video contains multiple streams. Only one stream is allowed. + この動画には複数のストリームが含まれています。許可されるのは1つのストリームのみです。 + + + Unsupported video codec "{{ codec }}". + サポートされていないビデオコーデック「{{ codec }}」。 + + + Unsupported video container "{{ container }}". + サポートされていない動画コンテナ "{{ container }}". + + + The image file is corrupted. + 画像ファイルが破損しています。 + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + 画像のピクセル数が少なすぎます({{ pixels }})。想定される最小数は {{ min_pixels }} です。 + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + 画像のピクセル数が多すぎます ({{ pixels }}). 想定される最大値は {{ max_pixels }} です. + + + This filename does not match the expected charset. + このファイル名は期待される文字セットと一致しません。 + diff --git a/Resources/translations/validators.lb.xlf b/Resources/translations/validators.lb.xlf index d1b5cef57..122886199 100644 --- a/Resources/translations/validators.lb.xlf +++ b/Resources/translations/validators.lb.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Dëse Wäert ass kee valabelen Twig-Template. + + This file is not a valid video. + Dës Datei ass kee gëltegen Video. + + + The size of the video could not be detected. + D’Gréisst vum Video konnt net erkannt ginn. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + D'Videobreed ass ze grouss ({{ width }}px). Erlaabt maximal Breed ass {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + D’Videobreed ass ze kleng ({{ width }}px). Minimal erwaart Breed ass {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + D'Videohéicht ass ze grouss ({{ height }}px). Erlaabt maximal Héicht ass {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + D'Videohéicht ass ze kleng ({{ height }}px). Erwaart Mindesthéicht ass {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + De Video huet ze wéineg Pixel ({{ pixels }}). Erwaart Minimum ass {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + De Video huet ze vill Pixel ({{ pixels }}). Déi erwaart maximal Zuel ass {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + D’Videoproportioun ass ze grouss ({{ ratio }}). Erlaabt maximal Proportioun ass {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + D'Videoratio ass ze kleng ({{ ratio }}). Minimal erwaart Ratio ass {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + De Video ass quadratesch ({{ width }}x{{ height }}px). Quadratesch Videoe sinn net erlaabt. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + De Video ass am Landschaftsformat ({{ width }}x{{ height }} px). Landschafts-Videoe sinn net erlaabt. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + De Video ass am Portraitformat ({{ width }}x{{ height }}px). Portrait-Videoe sinn net erlaabt. + + + The video file is corrupted. + D'Videodatei ass beschiedegt. + + + The video contains multiple streams. Only one stream is allowed. + De Video enthält verschidde Stréimen. Nëmmen ee Stroum ass erlaabt. + + + Unsupported video codec "{{ codec }}". + Net ënnerstëtzte Videocodec „{{ codec }}“. + + + Unsupported video container "{{ container }}". + Net ënnerstëtzte Video-Container "{{ container }}". + + + The image file is corrupted. + D'Bilddatei ass beschiedegt. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + D’Bild huet ze wéineg Pixel ({{ pixels }}). Déi erwaart Mindestzuel ass {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + D’Bild huet ze vill Pixel ({{ pixels }}). Déi erwaart maximal Zuel ass {{ max_pixels }}. + + + This filename does not match the expected charset. + Dësen Dateinumm entsprécht net dem erwaarten Zeechesaz. + diff --git a/Resources/translations/validators.lt.xlf b/Resources/translations/validators.lt.xlf index 46abd9503..ab4bdc57e 100644 --- a/Resources/translations/validators.lt.xlf +++ b/Resources/translations/validators.lt.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Ši reikšmė nėra tinkamas „Twig“ šablonas. + + This file is not a valid video. + Šis failas nėra galiojantis vaizdo įrašas. + + + The size of the video could not be detected. + Nepavyko nustatyti vaizdo įrašo dydžio. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Vaizdo įrašo plotis per didelis ({{ width }}px). Leidžiamas didžiausias plotis yra {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Vaizdo įrašo plotis per mažas ({{ width }}px). Tikėtinas mažiausias plotis yra {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Vaizdo aukštis per didelis ({{ height }}px). Leidžiamas maksimalus aukštis yra {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Vaizdo aukštis per mažas ({{ height }}px). Tikėtinas minimalus aukštis yra {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Vaizdo įraše per mažai pikselių ({{ pixels }}). Tikimasi mažiausiai {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Vaizdo įraše per daug pikselių ({{ pixels }}). Tikimasi, kad didžiausias kiekis yra {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Vaizdo santykis per didelis ({{ ratio }}). Leidžiamas didžiausias santykis yra {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Vaizdo santykis per mažas ({{ ratio }}). Tikimasi mažiausias santykis yra {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Vaizdo įrašas yra kvadratinis ({{ width }}x{{ height }}px). Kvadratiniai vaizdo įrašai neleidžiami. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Vaizdo įrašas yra gulsčio formato ({{ width }}x{{ height }} px). Gulsčio formato vaizdo įrašai neleidžiami. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Vaizdo įrašas yra portreto orientacijos ({{ width }}x{{ height }}px). Portreto orientacijos vaizdo įrašai neleidžiami. + + + The video file is corrupted. + Vaizdo failas sugadintas. + + + The video contains multiple streams. Only one stream is allowed. + Vaizdo įraše yra keli srautai. Leidžiamas tik vienas srautas. + + + Unsupported video codec "{{ codec }}". + Nepalaikomas vaizdo kodekas „{{ codec }}“. + + + Unsupported video container "{{ container }}". + Nepalaikomas vaizdo konteineris "{{ container }}". + + + The image file is corrupted. + Paveikslėlio failas sugadintas. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Paveikslėlyje per mažai pikselių ({{ pixels }}). Tikimasi mažiausiai {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Paveikslėlis turi per daug pikselių ({{ pixels }}). Tikėtinas didžiausias kiekis yra {{ max_pixels }}. + + + This filename does not match the expected charset. + Šis failo pavadinimas neatitinka laukiamo ženklų rinkinio. + diff --git a/Resources/translations/validators.lv.xlf b/Resources/translations/validators.lv.xlf index 3e2d51a30..2d78bfd3e 100644 --- a/Resources/translations/validators.lv.xlf +++ b/Resources/translations/validators.lv.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Šī vērtība nav derīgs Twig šablons. + + This file is not a valid video. + Šī datne nav derīgs video fails. + + + The size of the video could not be detected. + Neizdevās noteikt video izmēru. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Video platums ir pārāk liels ({{ width }}px). Atļautais maksimālais platums ir {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Video platums ir pārāk mazs ({{ width }}px). Sagaidāmais minimālais platums ir {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Video augstums ir pārāk liels ({{ height }}px). Atļautais maksimālais augstums ir {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Video augstums ir pārāk mazs ({{ height }}px). Sagaidāmais minimālais augstums ir {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Video ir pārāk maz pikseļu ({{ pixels }}). Sagaidāmais minimālais daudzums ir {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Video ir pārāk daudz pikseļu ({{ pixels }}). Paredzētais maksimālais daudzums ir {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Video attiecība ir pārāk liela ({{ ratio }}). Atļautā maksimālā attiecība ir {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Video attiecība ir pārāk maza ({{ ratio }}). Sagaidāmā minimālā attiecība ir {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Video ir kvadrātveida ({{ width }}x{{ height }}px). Kvadrātveida video nav atļauti. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Video ir ainavas orientācijā ({{ width }}x{{ height }} px). Ainavas formāta video nav atļauti. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Video ir portreta orientācijā ({{ width }}x{{ height }}px). Portreta orientācijas video nav atļauti. + + + The video file is corrupted. + Video fails ir bojāts. + + + The video contains multiple streams. Only one stream is allowed. + Video satur vairākus straumējumus. Atļauta ir tikai viena straume. + + + Unsupported video codec "{{ codec }}". + Neatbalstīts video kodeks “{{ codec }}”. + + + Unsupported video container "{{ container }}". + Neatbalstīts video konteiners "{{ container }}". + + + The image file is corrupted. + Attēla fails ir bojāts. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Attēlam ir par maz pikseļu ({{ pixels }}). Sagaidāmais minimālais daudzums ir {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Attēlam ir pārāk daudz pikseļu ({{ pixels }}). Sagaidāmais maksimālais daudzums ir {{ max_pixels }}. + + + This filename does not match the expected charset. + Šis faila nosaukums neatbilst paredzētajam rakstzīmju kopumam. + diff --git a/Resources/translations/validators.mk.xlf b/Resources/translations/validators.mk.xlf index 99b1a191b..a21621b17 100644 --- a/Resources/translations/validators.mk.xlf +++ b/Resources/translations/validators.mk.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Оваа вредност не е валиден Twig шаблон. + + This file is not a valid video. + Оваа датотека не е валидно видео. + + + The size of the video could not be detected. + Големината на видеото не можеше да се утврди. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Ширината на видеото е премногу голема ({{ width }}px). Дозволената максимална ширина е {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Ширината на видеото е премала ({{ width }}px). Минималната очекувана ширина е {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Висината на видеото е премногу голема ({{ height }}px). Дозволената максимална висина е {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Висината на видеото е премала ({{ height }}px). Очекуваната минимална висина е {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Видеото има премалку пиксели ({{ pixels }}). Очекуван минимален износ е {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Видеото има премногу пиксели ({{ pixels }}). Очекуваниот максимален износ е {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Соодносот на видеото е преголем ({{ ratio }}). Дозволениот максимален сооднос е {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Односот на видеото е премал ({{ ratio }}). Очекуваниот минимален однос е {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Видеото е квадратно ({{ width }}x{{ height }}px). Квадратни видеа не се дозволени. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Видеото е во хоризонтална ориентација ({{ width }}x{{ height }} px). Хоризонтални видеа не се дозволени. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Видеото е во портретна ориентација ({{ width }}x{{ height }}px). Видеа со портретна ориентација не се дозволени. + + + The video file is corrupted. + Видео датотеката е оштетена. + + + The video contains multiple streams. Only one stream is allowed. + Видеото содржи повеќе струи. Дозволена е само една струја. + + + Unsupported video codec "{{ codec }}". + Неподдржан видео кодек „{{ codec }}“. + + + Unsupported video container "{{ container }}". + Неподдржан видео контејнер "{{ container }}". + + + The image file is corrupted. + Датотеката со слика е оштетена. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Сликата има премалку пиксели ({{ pixels }}). Очекуваниот минимален број е {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Сликата има премногу пиксели ({{ pixels }}). Очекуваната максимална количина е {{ max_pixels }}. + + + This filename does not match the expected charset. + Името на датотеката не одговара на очекуваниот збир на знаци. + diff --git a/Resources/translations/validators.mn.xlf b/Resources/translations/validators.mn.xlf index 3344675d9..42a841f7d 100644 --- a/Resources/translations/validators.mn.xlf +++ b/Resources/translations/validators.mn.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Энэ утга нь Twig-ийн хүчинтэй загвар биш юм. + + This file is not a valid video. + Энэ файл хүчинтэй видео биш байна. + + + The size of the video could not be detected. + Видеоны хэмжээг тодорхойлох боломжгүй байлаа. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Видео өргөн хэт их байна ({{ width }}px). Зөвшөөрөгдөх дээд өргөн нь {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Видео өргөн хэт бага байна ({{ width }}px). Хамгийн бага хүлээгдэж буй өргөн {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Видеоны өндөр хэт их байна ({{ height }}px). Зөвшөөрөгдсөн дээд өндөр нь {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Видео өндрийг хэт бага байна ({{ height }}px). Хамгийн бага өндрийн шаардлага {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Видео хэт цөөн пикселтэй байна ({{ pixels }}). Хүлээгдэж буй хамгийн бага хэмжээ нь {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Видео хэт олон пикселтэй байна ({{ pixels }}). Хүлээгдэж буй дээд хэмжээ нь {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Видео харьцаа хэт их байна ({{ ratio }}). Зөвшөөрөгдөх дээд харьцаа {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Видеоны харьцаа хэт жижиг байна ({{ ratio }}). Хамгийн бага хүлээгдэж буй харьцаа {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Видео дөрвөлжин байна ({{ width }}x{{ height }}px). Дөрвөлжин видеонууд зөвшөөрөгдөхгүй. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Видео хэвтээ чиглэлтэй байна ({{ width }}x{{ height }} px). Хэвтээ видеонууд зөвшөөрөгдөхгүй. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Видео босоо чиглэлтэй ({{ width }}x{{ height }}px). Босоо чиглэлийн видеонууд зөвшөөрөгдөхгүй. + + + The video file is corrupted. + Видео файл гэмтсэн байна. + + + The video contains multiple streams. Only one stream is allowed. + Видео нь олон урсгал агуулсан байна. Зөвхөн нэг урсгалыг зөвшөөрнө. + + + Unsupported video codec "{{ codec }}". + Дэмжигдээгүй видео кодек "{{ codec }}". + + + Unsupported video container "{{ container }}". + Дэмжигдээгүй видео контейнер "{{ container }}". + + + The image file is corrupted. + Зургийн файл гэмтсэн. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Зурган дээрх пикселийн тоо дэндүү цөөн байна ({{ pixels }}). Хүлээгдэж буй доод хэмжээ нь {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Зурагт хэт олон пиксел байна ({{ pixels }}). Хүлээгдэж буй дээд хэмжээ нь {{ max_pixels }}. + + + This filename does not match the expected charset. + Энэ файлын нэр хүлээгдэж буй тэмдэгтийн багцтай нийцэхгүй байна. + diff --git a/Resources/translations/validators.my.xlf b/Resources/translations/validators.my.xlf index 04c955f75..bf23d6363 100644 --- a/Resources/translations/validators.my.xlf +++ b/Resources/translations/validators.my.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. ဤတန်ဖိုးသည် မှန်ကန်သော Twig တင်းပလိတ်မဟုတ်ပါ။ + + This file is not a valid video. + ဤဖိုင်သည် မှန်ကန်သော ဗီဒီယို မဟုတ်ပါ။ + + + The size of the video could not be detected. + ဗီဒီယို၏ အရွယ်အစားကို စိစစ်မရနိုင်ခဲ့ပါ။ + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + ဗီဒီယိုအကျယ် {{ width }}px သည် အလွန်ကြီးနေသည်။ ခွင့်ပြုထားသော အများဆုံးအကျယ်မှာ {{ max_width }}px ဖြစ်သည်။ + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + ဗီဒီယိုအကျယ်အဝန်းမှာ သေးလွန်းနေပါတယ် ({{ width }}px)။ ခန့်မှန်းထားသော အနည်းဆုံး အကျယ်မှာ {{ min_width }}px ဖြစ်ပါတယ်။ + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + ဗီဒီယိုအမြင့် ကြီးလွန်းသည် ({{ height }}px)။ ခွင့်ပြုထားသော အမြင့်အများဆုံးမှာ {{ max_height }}px ဖြစ်သည်။ + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + ဗွီဒီယိုအမြင့် သက်သက်ငယ်နေပါသည် ({{ height }}px)။ မျှော်မှန်းထားသော အနည်းဆုံးအမြင့်မှာ {{ min_height }}px ဖြစ်သည်။ + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + ဗီဒီယိုတွင် ပစ်ဆယ် အရေအတွက် နည်းလွန်းသည် ({{ pixels }})။ မျှော်လင့်ထားသည့် အနည်းဆုံး အရေအတွက်မှာ {{ min_pixels }} ဖြစ်သည်။ + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + ဗီဒီယိုတွင် pixel များ အလွန်များနေသည် ({{ pixels }})။ မျှော်မှန်းထားသော အများဆုံးပမာဏမှာ {{ max_pixels }} ဖြစ်သည်။ + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + ဗီဒီယို အချိုးအစား များလွန်းသည် ({{ ratio }})။ ခွင့်ပြုထားသော အများဆုံး အချိုးအစားမှာ {{ max_ratio }} ဖြစ်သည်။ + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + ဗီဒီယိုအချိုးအစား သောလွန်းငယ်သည် ({{ ratio }})။ ခန့်မှန်းထားသော အနည်းဆုံး အချိုးအစားမှာ {{ min_ratio }} ဖြစ်သည်။ + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + ဗီဒီယိုသည် စတုဂံဖြစ်သည် ({{ width }}x{{ height }}px)။ စတုဂံ ဗီဒီယိုများကို ခွင့်မပြုပါ။ + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + ဗီဒီယိုသည် အလျားလိုက် ({{ width }}x{{ height }} px) ဖြစ်သည်။ အလျားလိုက်ဗီဒီယိုများကို ခွင့်မပြုပါ။ + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + ဗီဒီယိုသည် ဒေါင်လိုက် ရှုထောင့်ဖြစ်သည် ({{ width }}x{{ height }}px)။ ဒေါင်လိုက် ဗီဒီယိုများကို ခွင့်မပြုပါ။ + + + The video file is corrupted. + ဗီဒီယိုဖိုင် ပျက်စီးထားသည်။ + + + The video contains multiple streams. Only one stream is allowed. + ဗီဒီယိုတွင် စီးဆင်းမှုများ များစွာ ပါရှိသည်။ စီးဆင်းမှုတစ်ခုသာ ခွင့်ပြုထားသည်။ + + + Unsupported video codec "{{ codec }}". + ပံ့ပိုးမထားသော ဗီဒီယိုကုဒက် "{{ codec }}" ။ + + + Unsupported video container "{{ container }}". + မပံ့ပိုးထားသော ဗီဒီယို ကွန်တိနာ "{{ container }}". + + + The image file is corrupted. + ပုံဖိုင် ပျက်စီးနေသည်။ + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + ပုံတွင် ပစ်ဆယ်များအလွန်နည်းပါးသည် ({{ pixels }})။ မျှော်မှန်းထားသော အနည်းဆုံး အရေအတွက်မှာ {{ min_pixels }} ဖြစ်သည်။ + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + ပုံတွင် ပစ်ကဆယ်များ အလွန်များနေသည် ({{ pixels }}). လျှောက်ထားထားသော အများဆုံး ပမာဏမှာ {{ max_pixels }} ဖြစ်သည်. + + + This filename does not match the expected charset. + ဤဖိုင်နာမည်သည် မျှော်မှန်းထားသော အက္ခရာစုနှင့် ကိုက်ညီမှုမရှိပါ။ + diff --git a/Resources/translations/validators.nb.xlf b/Resources/translations/validators.nb.xlf index 58696f671..a81565455 100644 --- a/Resources/translations/validators.nb.xlf +++ b/Resources/translations/validators.nb.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Denne verdien er ikke en gyldig Twig-mal. + + This file is not a valid video. + Denne filen er ikke en gyldig video. + + + The size of the video could not be detected. + Videostørrelsen kunne ikke oppdages. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Videobredden er for stor ({{ width }}px). Tillatt maksimal bredde er {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Videobredden er for liten ({{ width }}px). Forventet minimumsbredde er {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Videohøyden er for stor ({{ height }}px). Tillatt maksimal høyde er {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Videoens høyde er for liten ({{ height }}px). Forventet minstehøyde er {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Videoen har for få piksler ({{ pixels }}). Forventet minimum er {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Videoen har for mange piksler ({{ pixels }}). Forventet maksimalt antall er {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Video-forholdet er for stort ({{ ratio }}). Tillatt maksimalt forhold er {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Videoforholdet er for lite ({{ ratio }}). Forventet minimumsforhold er {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Videoen er kvadratisk ({{ width }}x{{ height }}px). Kvadratiske videoer er ikke tillatt. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Videoen er i liggende format ({{ width }}x{{ height }} px). Liggende videoer er ikke tillatt. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Videoen er i portrettformat ({{ width }}x{{ height }}px). Portrettvideoer er ikke tillatt. + + + The video file is corrupted. + Videofilen er ødelagt. + + + The video contains multiple streams. Only one stream is allowed. + Videoen inneholder flere strømmer. Kun én strøm er tillatt. + + + Unsupported video codec "{{ codec }}". + Ikke støttet videokodek «{{ codec }}». + + + Unsupported video container "{{ container }}". + Ikke-støttet videokontainer "{{ container }}". + + + The image file is corrupted. + Bildefilen er ødelagt. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Bildet har for få piksler ({{ pixels }}). Forventet minimum er {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Bildet har for mange piksler ({{ pixels }}). Forventet maksimalt antall er {{ max_pixels }}. + + + This filename does not match the expected charset. + Dette filnavnet samsvarer ikke med forventet tegnsett. + diff --git a/Resources/translations/validators.nl.xlf b/Resources/translations/validators.nl.xlf index 1781b1f29..b2123142c 100644 --- a/Resources/translations/validators.nl.xlf +++ b/Resources/translations/validators.nl.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Deze waarde is geen geldige Twig-template. + + This file is not a valid video. + Dit bestand is geen geldige video. + + + The size of the video could not be detected. + De grootte van de video kon niet worden gedetecteerd. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + De videobreedte is te groot ({{ width }}px). Toegestane maximale breedte is {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + De videobreedte is te klein ({{ width }}px). Verwachte minimum breedte is {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + De videohogte is te groot ({{ height }}px). Toegestane maximale hoogte is {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + De videohoogte is te klein ({{ height }}px). Verwachte minimale hoogte is {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + De video heeft te weinig pixels ({{ pixels }}). Verwachte minimumaantal is {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + De video heeft te veel pixels ({{ pixels }}). Het verwachte maximum is {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + De videoratio is te groot ({{ ratio }}). Toegestane maximale ratio is {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + De videoratio is te klein ({{ ratio }}). Verwachte minimumverhouding is {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + De video is vierkant ({{ width }}x{{ height }}px). Vierkante video's zijn niet toegestaan. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + De video is in liggende oriëntatie ({{ width }}x{{ height }} px). Liggende video's zijn niet toegestaan. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + De video is in portretstand ({{ width }}x{{ height }}px). Video's in portretstand zijn niet toegestaan. + + + The video file is corrupted. + Het videobestand is beschadigd. + + + The video contains multiple streams. Only one stream is allowed. + De video bevat meerdere streams. Slechts één stream is toegestaan. + + + Unsupported video codec "{{ codec }}". + Niet-ondersteunde videocodec ‘{{ codec }}’. + + + Unsupported video container "{{ container }}". + Niet-ondersteunde videocontainer "{{ container }}". + + + The image file is corrupted. + Het afbeeldingsbestand is beschadigd. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + De afbeelding heeft te weinig pixels ({{ pixels }}). Verwachte minimumhoeveelheid is {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + De afbeelding heeft te veel pixels ({{ pixels }}). Het verwachte maximum is {{ max_pixels }}. + + + This filename does not match the expected charset. + Deze bestandsnaam komt niet overeen met de verwachte tekenset. + diff --git a/Resources/translations/validators.nn.xlf b/Resources/translations/validators.nn.xlf index 74d332c06..16dbe2727 100644 --- a/Resources/translations/validators.nn.xlf +++ b/Resources/translations/validators.nn.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Denne verdien er ikkje ein gyldig Twig-mal. + + This file is not a valid video. + Denne fila er ikkje ein gyldig video. + + + The size of the video could not be detected. + Storleiken på videoen kunne ikkje oppdagast. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Videobreidda er for stor ({{ width }}px). Tillaten maksimal breidde er {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Videobreidda er for lita ({{ width }}px). Forventa minimumsbreidde er {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Videoen si høgd er for stor ({{ height }}px). Tillaten maksimal høgd er {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Videohøgda er for lita ({{ height }}px). Forventa minstehøgd er {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Videoen har for få pikslar ({{ pixels }}). Forventa minimum er {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Videoen har for mange pikslar ({{ pixels }}). Forventa maksimalt tal er {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Videoforholdet er for stort ({{ ratio }}). Tillaten maksimal forhold er {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Videoforholdet er for lite ({{ ratio }}). Forventa minimumsforhold er {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Videoen er kvadratisk ({{ width }}x{{ height }}px). Kvadratiske videoar er ikkje tillatne. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Videoen er i liggjande format ({{ width }}x{{ height }} px). Liggjande videoar er ikkje tillatne. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Videoen er i portrettformat ({{ width }}x{{ height }}px). Portrettvideoar er ikkje tillatne. + + + The video file is corrupted. + Videofila er skadd. + + + The video contains multiple streams. Only one stream is allowed. + Videoen inneheld fleire straumar. Berre éin straum er tillaten. + + + Unsupported video codec "{{ codec }}". + Ikkje støtta videokodek «{{ codec }}». + + + Unsupported video container "{{ container }}". + Ikkje-støtta videokontainer "{{ container }}". + + + The image file is corrupted. + Bildefila er skadd. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Biletet har for få pikslar ({{ pixels }}). Forventa minimum er {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Biletet har for mange pikslar ({{ pixels }}). Forventa maksimalt tal er {{ max_pixels }}. + + + This filename does not match the expected charset. + Dette filnamnet samsvarar ikkje med forventa teiknsett. + diff --git a/Resources/translations/validators.no.xlf b/Resources/translations/validators.no.xlf index 58696f671..a81565455 100644 --- a/Resources/translations/validators.no.xlf +++ b/Resources/translations/validators.no.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Denne verdien er ikke en gyldig Twig-mal. + + This file is not a valid video. + Denne filen er ikke en gyldig video. + + + The size of the video could not be detected. + Videostørrelsen kunne ikke oppdages. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Videobredden er for stor ({{ width }}px). Tillatt maksimal bredde er {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Videobredden er for liten ({{ width }}px). Forventet minimumsbredde er {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Videohøyden er for stor ({{ height }}px). Tillatt maksimal høyde er {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Videoens høyde er for liten ({{ height }}px). Forventet minstehøyde er {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Videoen har for få piksler ({{ pixels }}). Forventet minimum er {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Videoen har for mange piksler ({{ pixels }}). Forventet maksimalt antall er {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Video-forholdet er for stort ({{ ratio }}). Tillatt maksimalt forhold er {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Videoforholdet er for lite ({{ ratio }}). Forventet minimumsforhold er {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Videoen er kvadratisk ({{ width }}x{{ height }}px). Kvadratiske videoer er ikke tillatt. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Videoen er i liggende format ({{ width }}x{{ height }} px). Liggende videoer er ikke tillatt. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Videoen er i portrettformat ({{ width }}x{{ height }}px). Portrettvideoer er ikke tillatt. + + + The video file is corrupted. + Videofilen er ødelagt. + + + The video contains multiple streams. Only one stream is allowed. + Videoen inneholder flere strømmer. Kun én strøm er tillatt. + + + Unsupported video codec "{{ codec }}". + Ikke støttet videokodek «{{ codec }}». + + + Unsupported video container "{{ container }}". + Ikke-støttet videokontainer "{{ container }}". + + + The image file is corrupted. + Bildefilen er ødelagt. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Bildet har for få piksler ({{ pixels }}). Forventet minimum er {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Bildet har for mange piksler ({{ pixels }}). Forventet maksimalt antall er {{ max_pixels }}. + + + This filename does not match the expected charset. + Dette filnavnet samsvarer ikke med forventet tegnsett. + diff --git a/Resources/translations/validators.pl.xlf b/Resources/translations/validators.pl.xlf index 04fe2fc1f..19d11497d 100644 --- a/Resources/translations/validators.pl.xlf +++ b/Resources/translations/validators.pl.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Ta wartość nie jest prawidłowym szablonem Twig. + + This file is not a valid video. + Ten plik nie jest prawidłowym plikiem wideo. + + + The size of the video could not be detected. + Nie można było wykryć rozmiaru wideo. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Szerokość wideo jest zbyt duża ({{ width }}px). Dozwolona maksymalna szerokość to {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Szerokość wideo jest zbyt mała ({{ width }}px). Minimalna oczekiwana szerokość to {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Wysokość wideo jest zbyt duża ({{ height }}px). Dozwolona maksymalna wysokość to {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Wysokość wideo jest zbyt mała ({{ height }}px). Oczekiwana minimalna wysokość to {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Wideo ma za mało pikseli ({{ pixels }}). Oczekiwana minimalna ilość to {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Wideo ma zbyt wiele pikseli ({{ pixels }}). Oczekiwana maksymalna liczba to {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Współczynnik wideo jest zbyt duży ({{ ratio }}). Dozwolony maksymalny współczynnik to {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Proporcje wideo są zbyt małe ({{ ratio }}). Oczekiwany minimalny współczynnik to {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Wideo ma kształt kwadratu ({{ width }}x{{ height }}px). Kwadratowe filmy są niedozwolone. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Wideo ma orientację poziomą ({{ width }}x{{ height }} px). Filmy w orientacji poziomej są niedozwolone. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Wideo ma orientację pionową ({{ width }}x{{ height }}px). Filmy w orientacji pionowej są niedozwolone. + + + The video file is corrupted. + Plik wideo jest uszkodzony. + + + The video contains multiple streams. Only one stream is allowed. + Wideo zawiera wiele strumieni. Dozwolony jest tylko jeden strumień. + + + Unsupported video codec "{{ codec }}". + Nieobsługiwany kodek wideo „{{ codec }}”. + + + Unsupported video container "{{ container }}". + Nieobsługiwany kontener wideo "{{ container }}". + + + The image file is corrupted. + Plik obrazu jest uszkodzony. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Obraz ma zbyt mało pikseli ({{ pixels }}). Oczekiwana minimalna liczba to {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Obraz ma zbyt wiele pikseli ({{ pixels }}). Oczekiwana maksymalna liczba to {{ max_pixels }}. + + + This filename does not match the expected charset. + Ta nazwa pliku nie odpowiada oczekiwanemu zestawowi znaków. + diff --git a/Resources/translations/validators.pt.xlf b/Resources/translations/validators.pt.xlf index b6562dbfe..0b25e1148 100644 --- a/Resources/translations/validators.pt.xlf +++ b/Resources/translations/validators.pt.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Este valor não é um modelo Twig válido. + + This file is not a valid video. + Este ficheiro não é um vídeo válido. + + + The size of the video could not be detected. + Não foi possível detetar o tamanho do vídeo. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + A largura do vídeo é demasiado grande ({{ width }}px). A largura máxima permitida é {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + A largura do vídeo é muito pequena ({{ width }}px). A largura mínima esperada é {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + A altura do vídeo é demasiado grande ({{ height }}px). A altura máxima permitida é {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + A altura do vídeo é muito pequena ({{ height }}px). A altura mínima esperada é {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + O vídeo tem poucos píxeis ({{ pixels }}). A quantidade mínima esperada é {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + O vídeo tem píxeis a mais ({{ pixels }}). A quantidade máxima esperada é {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + A proporção do vídeo é muito grande ({{ ratio }}). A proporção máxima permitida é {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + A proporção do vídeo é muito pequena ({{ ratio }}). A proporção mínima esperada é {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + O vídeo é quadrado ({{ width }}x{{ height }}px). Vídeos quadrados não são permitidos. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + O vídeo está em modo paisagem ({{ width }}x{{ height }} px). Vídeos em paisagem não são permitidos. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + O vídeo está em orientação vertical ({{ width }}x{{ height }}px). Vídeos em orientação vertical não são permitidos. + + + The video file is corrupted. + O ficheiro de vídeo está corrompido. + + + The video contains multiple streams. Only one stream is allowed. + O vídeo contém vários fluxos. É permitido apenas um fluxo. + + + Unsupported video codec "{{ codec }}". + Codec de vídeo não suportado «{{ codec }}». + + + Unsupported video container "{{ container }}". + Contentor de vídeo não suportado "{{ container }}". + + + The image file is corrupted. + O ficheiro de imagem está corrompido. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + A imagem tem píxeis a menos ({{ pixels }}). A quantidade mínima esperada é {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + A imagem tem píxeis a mais ({{ pixels }}). A quantidade máxima esperada é {{ max_pixels }}. + + + This filename does not match the expected charset. + Este nome de ficheiro não corresponde ao conjunto de caracteres esperado. + diff --git a/Resources/translations/validators.pt_BR.xlf b/Resources/translations/validators.pt_BR.xlf index 0acf6dbf2..0d3a30c6c 100644 --- a/Resources/translations/validators.pt_BR.xlf +++ b/Resources/translations/validators.pt_BR.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Este valor não é um modelo Twig válido. + + This file is not a valid video. + Este arquivo não é um vídeo válido. + + + The size of the video could not be detected. + Não foi possível detectar o tamanho do vídeo. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + A largura do vídeo é muito grande ({{ width }}px). A largura máxima permitida é {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + A largura do vídeo é muito pequena ({{ width }}px). A largura mínima esperada é {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + A altura do vídeo é muito grande ({{ height }}px). A altura máxima permitida é {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + A altura do vídeo é muito pequena ({{ height }}px). A altura mínima esperada é {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + O vídeo tem poucos pixels ({{ pixels }}). A quantidade mínima esperada é {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + O vídeo tem pixels demais ({{ pixels }}). A quantidade máxima esperada é {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + A proporção do vídeo é muito grande ({{ ratio }}). A proporção máxima permitida é {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + A proporção do vídeo é muito pequena ({{ ratio }}). A proporção mínima esperada é {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + O vídeo é quadrado ({{ width }}x{{ height }}px). Vídeos quadrados não são permitidos. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + O vídeo está no modo paisagem ({{ width }}x{{ height }} px). Vídeos em paisagem não são permitidos. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + O vídeo está em orientação vertical ({{ width }}x{{ height }}px). Vídeos em orientação vertical não são permitidos. + + + The video file is corrupted. + O arquivo de vídeo está corrompido. + + + The video contains multiple streams. Only one stream is allowed. + O vídeo contém múltiplos fluxos. Apenas um fluxo é permitido. + + + Unsupported video codec "{{ codec }}". + Codec de vídeo não suportado «{{ codec }}». + + + Unsupported video container "{{ container }}". + Contêiner de vídeo não suportado "{{ container }}". + + + The image file is corrupted. + O arquivo de imagem está corrompido. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + A imagem tem pixels de menos ({{ pixels }}). A quantidade mínima esperada é {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + A imagem tem pixels demais ({{ pixels }}). A quantidade máxima esperada é {{ max_pixels }}. + + + This filename does not match the expected charset. + Este nome de arquivo não corresponde ao conjunto de caracteres esperado. + diff --git a/Resources/translations/validators.ro.xlf b/Resources/translations/validators.ro.xlf index 0dcbd1295..724368fdb 100644 --- a/Resources/translations/validators.ro.xlf +++ b/Resources/translations/validators.ro.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Această valoare nu este un șablon Twig valid. + + This file is not a valid video. + Acest fișier nu este un videoclip valid. + + + The size of the video could not be detected. + Dimensiunea videoclipului nu a putut fi detectată. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Lățimea videoclipului este prea mare ({{ width }}px). Lățimea maximă permisă este {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Lățimea videoclipului este prea mică ({{ width }}px). Lățimea minimă așteptată este {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Înălțimea videoclipului este prea mare ({{ height }}px). Înălțimea maximă permisă este {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Înălțimea videoclipului este prea mică ({{ height }}px). Înălțimea minimă așteptată este {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Videoclipul are prea puțini pixeli ({{ pixels }}). Cantitatea minimă așteptată este {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Videoclipul are prea mulți pixeli ({{ pixels }}). Cantitatea maximă așteptată este {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Raportul video este prea mare ({{ ratio }}). Raportul maxim permis este {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Raportul video este prea mic ({{ ratio }}). Raportul minim așteptat este {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Videoclipul este pătrat ({{ width }}x{{ height }}px). Videoclipurile pătrate nu sunt permise. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Videoclipul are orientare peisaj ({{ width }}x{{ height }} px). Videoclipurile în orientare peisaj nu sunt permise. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Videoclipul este în orientare portret ({{ width }}x{{ height }}px). Videoclipurile cu orientare portret nu sunt permise. + + + The video file is corrupted. + Fișierul video este corupt. + + + The video contains multiple streams. Only one stream is allowed. + Videoclipul conține mai multe fluxuri. Doar un singur flux este permis. + + + Unsupported video codec "{{ codec }}". + Codec video neacceptat „{{ codec }}”. + + + Unsupported video container "{{ container }}". + Container video nesuportat "{{ container }}". + + + The image file is corrupted. + Fișierul imagine este deteriorat. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Imaginea are prea puțini pixeli ({{ pixels }}). Cantitatea minimă așteptată este {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Imaginea are prea mulți pixeli ({{ pixels }}). Cantitatea maximă așteptată este {{ max_pixels }}. + + + This filename does not match the expected charset. + Acest nume de fișier nu corespunde setului de caractere așteptat. + diff --git a/Resources/translations/validators.ru.xlf b/Resources/translations/validators.ru.xlf index 727ae0aef..482595c23 100644 --- a/Resources/translations/validators.ru.xlf +++ b/Resources/translations/validators.ru.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Это значение не является корректным шаблоном Twig. + + This file is not a valid video. + Этот файл не является допустимым видео. + + + The size of the video could not be detected. + Не удалось определить размер видео. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Ширина видео слишком велика ({{ width }}px). Допустимая максимальная ширина — {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Ширина видео слишком мала ({{ width }}px). Ожидаемая минимальная ширина — {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Высота видео слишком большая ({{ height }}px). Допустимая максимальная высота — {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Высота видео слишком мала ({{ height }}px). Ожидаемая минимальная высота — {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + В видео слишком мало пикселей ({{ pixels }}). Ожидаемое минимальное количество {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + В видео слишком много пикселей ({{ pixels }}). Ожидаемое максимальное количество — {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Соотношение сторон видео слишком велико ({{ ratio }}). Допустимое максимальное соотношение — {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Соотношение сторон видео слишком маленькое ({{ ratio }}). Ожидаемое минимальное соотношение — {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Видео квадратное ({{ width }}x{{ height }}px). Квадратные видео не допускаются. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Видео в альбомной ориентации ({{ width }}x{{ height }} px). Видео в альбомной ориентации не допускаются. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Видео имеет портретную ориентацию ({{ width }}x{{ height }}px). Видео с портретной ориентацией не допускаются. + + + The video file is corrupted. + Видеофайл повреждён. + + + The video contains multiple streams. Only one stream is allowed. + Видео содержит несколько потоков. Разрешён только один поток. + + + Unsupported video codec "{{ codec }}". + Неподдерживаемый видеокодек «{{ codec }}». + + + Unsupported video container "{{ container }}". + Неподдерживаемый видеоконтейнер "{{ container }}". + + + The image file is corrupted. + Файл изображения повреждён. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + В изображении слишком мало пикселей ({{ pixels }}). Ожидаемое минимальное количество — {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Изображение содержит слишком много пикселей ({{ pixels }}). Ожидаемое максимальное количество — {{ max_pixels }}. + + + This filename does not match the expected charset. + Это имя файла не соответствует ожидаемому набору символов. + diff --git a/Resources/translations/validators.sk.xlf b/Resources/translations/validators.sk.xlf index bba3c291a..dd86c1ddd 100644 --- a/Resources/translations/validators.sk.xlf +++ b/Resources/translations/validators.sk.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Táto hodnota nie je platná šablóna Twig. + + This file is not a valid video. + Tento súbor nie je platné video. + + + The size of the video could not be detected. + Veľkosť videa sa nepodarilo zistiť. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Šírka videa je príliš veľká ({{ width }}px). Povolená maximálna šírka je {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Šírka videa je príliš malá ({{ width }}px). Očakávaná minimálna šírka je {{ min_width }} px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Výška videa je príliš veľká ({{ height }}px). Povolená maximálna výška je {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Výška videa je príliš malá ({{ height }}px). Očakávaná minimálna výška je {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Video má príliš málo pixelov ({{ pixels }}). Očakávané minimálne množstvo je {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Video má príliš veľa pixelov ({{ pixels }}). Očakávané maximum je {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Pomer videa je príliš veľký ({{ ratio }}). Povolený maximálny pomer je {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Pomer videa je príliš malý ({{ ratio }}). Očakávaný minimálny pomer je {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Video je štvorcové ({{ width }}x{{ height }}px). Štvorcové videá nie sú povolené. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Video je na šírku ({{ width }}x{{ height }} px). Videá na šírku nie sú povolené. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Video je orientované na výšku ({{ width }}x{{ height }}px). Videá s orientáciou na výšku nie sú povolené. + + + The video file is corrupted. + Videosúbor je poškodený. + + + The video contains multiple streams. Only one stream is allowed. + Video obsahuje viacero tokov. Povolený je len jeden tok. + + + Unsupported video codec "{{ codec }}". + Nepodporovaný videokodek „{{ codec }}“. + + + Unsupported video container "{{ container }}". + Nepodporovaný kontajner videa "{{ container }}". + + + The image file is corrupted. + Súbor obrázka je poškodený. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Obrázok má príliš málo pixelov ({{ pixels }}). Očakávané minimum je {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Obrázok má príliš veľa pixelov ({{ pixels }}). Očakávané maximum je {{ max_pixels }}. + + + This filename does not match the expected charset. + Tento názov súboru nezodpovedá očakávanej znakovej sade. + diff --git a/Resources/translations/validators.sl.xlf b/Resources/translations/validators.sl.xlf index 28c370e09..515e5d0aa 100644 --- a/Resources/translations/validators.sl.xlf +++ b/Resources/translations/validators.sl.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Ta vrednost ni veljavna predloga Twig. + + This file is not a valid video. + Ta datoteka ni veljaven video. + + + The size of the video could not be detected. + Velikosti videoposnetka ni bilo mogoče zaznati. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Širina videoposnetka je prevelika ({{ width }}px). Dovoljena največja širina je {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Širina videa je premajhna ({{ width }}px). Pričakovana minimalna širina je {{ min_width }} px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Višina videa je prevelika ({{ height }}px). Dovoljena največja višina je {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Višina videa je premajhna ({{ height }}px). Pričakovana najmanjša višina je {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Video ima premalo slikovnih pik ({{ pixels }}). Pričakovana minimalna količina je {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Video ima preveč slikovnih pik ({{ pixels }}). Pričakovano največje število je {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Razmerje videa je preveliko ({{ ratio }}). Dovoljeno največje razmerje je {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Razmerje videa je premajhno ({{ ratio }}). Pričakovano minimalno razmerje je {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Video je kvadratno ({{ width }}x{{ height }}px). Kvadratni videoposnetki niso dovoljeni. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Video je vodoravno orientiran ({{ width }}x{{ height }} px). Vodoravni videi niso dovoljeni. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Video je usmerjeno pokonci ({{ width }}x{{ height }}px). Videi v pokončni usmeritvi niso dovoljeni. + + + The video file is corrupted. + Videodatoteka je poškodovana. + + + The video contains multiple streams. Only one stream is allowed. + Video vsebuje več tokov. Dovoljen je le en tok. + + + Unsupported video codec "{{ codec }}". + Nepodprti video kodek »{{ codec }}«. + + + Unsupported video container "{{ container }}". + Nepodprt videokontejner "{{ container }}". + + + The image file is corrupted. + Slikovna datoteka je poškodovana. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Slika ima premalo slikovnih točk ({{ pixels }}). Pričakovana minimalna količina je {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Slika ima preveč slikovnih pik ({{ pixels }}). Pričakovano največje število je {{ max_pixels }}. + + + This filename does not match the expected charset. + To ime datoteke ne ustreza pričakovanemu naboru znakov. + diff --git a/Resources/translations/validators.sq.xlf b/Resources/translations/validators.sq.xlf index 7d044b8fc..514dd0fd0 100644 --- a/Resources/translations/validators.sq.xlf +++ b/Resources/translations/validators.sq.xlf @@ -479,6 +479,90 @@ This value is not a valid Twig template. Kjo vlerë nuk është një shabllon Twig i vlefshëm. + + This file is not a valid video. + Ky skedar nuk është video e vlefshme. + + + The size of the video could not be detected. + Nuk u zbulua dot madhësia e videos. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Gjerësia e videos është shumë e madhe ({{ width }}px). Gjerësia maksimale e lejuar është {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Gjerësia e videos është shumë e vogël ({{ width }}px). Gjerësia minimale e pritur është {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Lartësia e videos është shumë e madhe ({{ height }}px). Lartësia maksimale e lejuar është {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Lartësia e videos është shumë e vogël ({{ height }}px). Lartësia minimale e pritshme është {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Video ka shumë pak pikselë ({{ pixels }}). Sasia minimale e pritur është {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Videoja ka tepër piksele ({{ pixels }}). Sasia maksimale e pritur është {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Raporti i videos është shumë i madh ({{ ratio }}). Raporti maksimal i lejuar është {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Raporti i videos është shumë i vogël ({{ ratio }}). Raporti minimal i pritshëm është {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Videoja është katrore ({{ width }}x{{ height }}px). Videot katrore nuk lejohen. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Videoja është me orientim horizontal ({{ width }}x{{ height }} px). Videot horizontale nuk lejohen. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Videoja është me orientim portret ({{ width }}x{{ height }}px). Videot me orientim portret nuk lejohen. + + + The video file is corrupted. + Skedari i videos është i korruptuar. + + + The video contains multiple streams. Only one stream is allowed. + Videoja përmban disa rrjedha. Lejohet vetëm një rrjedhë. + + + Unsupported video codec "{{ codec }}". + Kodek video i pambështetur „{{ codec }}“. + + + Unsupported video container "{{ container }}". + Konteiner video i pambështetur "{{ container }}". + + + The image file is corrupted. + Skedari i imazhit është i dëmtuar. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Imazhi ka shumë pak pikselë ({{ pixels }}). Sasia minimale e pritur është {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Imazhi ka shumë pikselë ({{ pixels }}). Shuma maksimale e pritur është {{ max_pixels }}. + + + This filename does not match the expected charset. + Ky emër skedari nuk përputhet me grupin e pritur të karaktereve. + diff --git a/Resources/translations/validators.sr_Cyrl.xlf b/Resources/translations/validators.sr_Cyrl.xlf index 61040270a..987474063 100644 --- a/Resources/translations/validators.sr_Cyrl.xlf +++ b/Resources/translations/validators.sr_Cyrl.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Ова вредност није важећи Twig шаблон. + + This file is not a valid video. + Ова датотека није важећи видео. + + + The size of the video could not be detected. + Није било могуће утврдити величину видео снимка. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Ширина видеа је превелика ({{ width }}px). Дозвољена максимална ширина је {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Ширина видеа је превише мала ({{ width }}px). Очекивана минимална ширина је {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Висина видеа је превелика ({{ height }}px). Дозвољена максимална висина је {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Висина видеа је превише мала ({{ height }}px). Очекивана минимална висина је {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Видео има премало пиксела ({{ pixels }}). Очекивана минимална количина је {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Видео има превише пиксела ({{ pixels }}). Очекивана максимална количина је {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Однос слике видеа је превелик ({{ ratio }}). Дозвољени максимални однос је {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Однос стране видеа је превише мали ({{ ratio }}). Очекивани минимални однос је {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Видео је квадратног облика ({{ width }}x{{ height }}px). Квадратни видео записи нису дозвољени. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Видео је у водоравној оријентацији ({{ width }}x{{ height }} px). Водоравни видео записи нису дозвољени. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Видео је у портрет оријентацији ({{ width }}x{{ height }}px). Видео снимци у портрет оријентацији нису дозвољени. + + + The video file is corrupted. + Видео датотека је оштећена. + + + The video contains multiple streams. Only one stream is allowed. + Видео садржи више токова. Дозвољен је само један ток. + + + Unsupported video codec "{{ codec }}". + Неподржан видео кодек „{{ codec }}“. + + + Unsupported video container "{{ container }}". + Неподржан видео контејнер "{{ container }}". + + + The image file is corrupted. + Датотека слике је оштећена. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Слика има премало пиксела ({{ pixels }}). Очекивани минимални број је {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Слика има превише пиксела ({{ pixels }}). Очекивани максимални број је {{ max_pixels }}. + + + This filename does not match the expected charset. + Ово име датотеке не одговара очекиваном скупу знакова. + diff --git a/Resources/translations/validators.sr_Latn.xlf b/Resources/translations/validators.sr_Latn.xlf index be7ede713..9fac3a261 100644 --- a/Resources/translations/validators.sr_Latn.xlf +++ b/Resources/translations/validators.sr_Latn.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Ova vrednost nije važeći Twig šablon. + + This file is not a valid video. + Ova datoteka nije važeći video. + + + The size of the video could not be detected. + Nije bilo moguće utvrditi veličinu video snimka. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Širina videa je prevelika ({{ width }}px). Dozvoljena maksimalna širina je {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Širina videa je previše mala ({{ width }}px). Očekivana minimalna širina je {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Visina videa je prevelika ({{ height }}px). Dozvoljena maksimalna visina je {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Visina videa je premala ({{ height }}px). Očekivana minimalna visina je {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Video ima premalo piksela ({{ pixels }}). Očekivana minimalna količina je {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Video ima previše piksela ({{ pixels }}). Očekivana maksimalna količina je {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Odnos slike videa je prevelik ({{ ratio }}). Dozvoljeni maksimalni odnos je {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Odnos stranica videa je previše mali ({{ ratio }}). Očekivani minimalni odnos je {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Video je kvadratnog oblika ({{ width }}x{{ height }}px). Kvadratni video zapisi nisu dozvoljeni. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Video je u vodoravnoj orijentaciji ({{ width }}x{{ height }} px). Vodoravni video zapisi nisu dozvoljeni. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Video je u portret orijentaciji ({{ width }}x{{ height }}px). Video zapisi u portret orijentaciji nisu dozvoljeni. + + + The video file is corrupted. + Video datoteka je oštećena. + + + The video contains multiple streams. Only one stream is allowed. + Video sadrži više tokova. Dozvoljen je samo jedan tok. + + + Unsupported video codec "{{ codec }}". + Nepodržan video kodek „{{ codec }}“. + + + Unsupported video container "{{ container }}". + Nepodržan video kontejner "{{ container }}". + + + The image file is corrupted. + Datoteka slike je oštećena. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Slika ima premalo piksela ({{ pixels }}). Očekivani minimalni broj je {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Slika ima previše piksela ({{ pixels }}). Očekivani maksimalni broj je {{ max_pixels }}. + + + This filename does not match the expected charset. + Ovo ime datoteke ne odgovara očekivanom skupu znakova. + diff --git a/Resources/translations/validators.sv.xlf b/Resources/translations/validators.sv.xlf index 692ac7f52..675c0de22 100644 --- a/Resources/translations/validators.sv.xlf +++ b/Resources/translations/validators.sv.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Det här värdet är inte en giltig Twig-mall. + + This file is not a valid video. + Den här filen är inte en giltig video. + + + The size of the video could not be detected. + Videons storlek kunde inte upptäckas. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Videobredden är för stor ({{ width }}px). Tillåten maximal bredd är {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Videobredden är för liten ({{ width }}px). Förväntad minsta bredd är {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Videons höjd är för stor ({{ height }}px). Tillåten maximal höjd är {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Videohöjden är för liten ({{ height }}px). Förväntad minimihöjd är {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Videon har för få pixlar ({{ pixels }}). Förväntad miniminivå är {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Videon har för många pixlar ({{ pixels }}). Förväntat maxantal är {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Videons förhållande är för stort ({{ ratio }}). Tillåtet maxförhållande är {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Videoförhållandet är för litet ({{ ratio }}). Förväntat minimiförhållande är {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Videon är kvadratisk ({{ width }}x{{ height }}px). Kvadratiska videor är inte tillåtna. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Videon är i liggande läge ({{ width }}x{{ height }} px). Liggande videor är inte tillåtna. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Videon är i porträttläge ({{ width }}x{{ height }}px). Videor i porträttläge är inte tillåtna. + + + The video file is corrupted. + Videofilen är skadad. + + + The video contains multiple streams. Only one stream is allowed. + Videon innehåller flera strömmar. Endast en ström är tillåten. + + + Unsupported video codec "{{ codec }}". + Videokodek stöds inte ”{{ codec }}”. + + + Unsupported video container "{{ container }}". + Videokontainer stöds inte "{{ container }}". + + + The image file is corrupted. + Bildfilen är skadad. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Bilden har för få pixlar ({{ pixels }}). Förväntat minimiantal är {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Bilden har för många pixlar ({{ pixels }}). Förväntat maxantal är {{ max_pixels }}. + + + This filename does not match the expected charset. + Detta filnamn stämmer inte med förväntad teckenuppsättning. + diff --git a/Resources/translations/validators.th.xlf b/Resources/translations/validators.th.xlf index 75398a0b8..f9db27cb7 100644 --- a/Resources/translations/validators.th.xlf +++ b/Resources/translations/validators.th.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. ค่านี้ไม่ใช่เทมเพลต Twig ที่ถูกต้อง + + This file is not a valid video. + ไฟล์นี้ไม่ใช่วิดีโอที่ถูกต้อง + + + The size of the video could not be detected. + ไม่สามารถตรวจพบขนาดของวิดีโอได้ + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + ความกว้างของวิดีโอใหญ่เกินไป ({{ width }}px). ความกว้างสูงสุดที่อนุญาตคือ {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + ความกว้างของวิดีโอเล็กเกินไป ({{ width }}px) ความกว้างขั้นต่ำที่คาดหวังคือ {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + ความสูงของวิดีโอสูงเกินไป ({{ height }}px). ความสูงสูงสุดที่อนุญาตคือ {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + ความสูงของวิดีโอมีขนาดเล็กเกินไป ({{ height }}px). ความสูงขั้นต่ำที่คาดไว้คือ {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + วิดีโอนี้มีพิกเซลน้อยเกินไป ({{ pixels }}). ปริมาณขั้นต่ำที่คาดไว้คือ {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + วิดีโอนี้มีพิกเซลมากเกินไป ({{ pixels }}). จำนวนสูงสุดที่คาดไว้คือ {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + อัตราส่วนวิดีโอใหญ่เกินไป ({{ ratio }}) อัตราส่วนสูงสุดที่อนุญาตคือ {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + อัตราส่วนวิดีโอเล็กเกินไป ({{ ratio }}). อัตราส่วนขั้นต่ำที่คาดหวังคือ {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + วิดีโอเป็นสี่เหลี่ยมจัตุรัส ({{ width }}x{{ height }}px). ไม่อนุญาตให้ใช้วิดีโอสี่เหลี่ยมจัตุรัส. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + วิดีโออยู่ในแนวนอน ({{ width }}x{{ height }} พิกเซล). ไม่อนุญาตวิดีโอแนวนอน + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + วิดีโอเป็นแนวตั้ง ({{ width }}x{{ height }}px) วิดีโอแนวตั้งไม่ได้รับอนุญาต + + + The video file is corrupted. + ไฟล์วิดีโอเสียหาย. + + + The video contains multiple streams. Only one stream is allowed. + วิดีโอนี้มีสตรีมหลายสตรีม อนุญาตเฉพาะสตรีมเดียวเท่านั้น + + + Unsupported video codec "{{ codec }}". + ไม่รองรับตัวแปลงสัญญาณวิดีโอ "{{ codec }}". + + + Unsupported video container "{{ container }}". + ไม่รองรับคอนเทนเนอร์วิดีโอ "{{ container }}". + + + The image file is corrupted. + ไฟล์รูปภาพเสียหาย + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + รูปภาพมีพิกเซลน้อยเกินไป ({{ pixels }}). จำนวนขั้นต่ำที่คาดไว้คือ {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + ภาพมีพิกเซลมากเกินไป ({{ pixels }}). จำนวนสูงสุดที่คาดไว้คือ {{ max_pixels }}. + + + This filename does not match the expected charset. + ชื่อไฟล์นี้ไม่ตรงกับชุดอักขระที่คาดไว้. + diff --git a/Resources/translations/validators.tl.xlf b/Resources/translations/validators.tl.xlf index 729ebc9da..7a25e79ea 100644 --- a/Resources/translations/validators.tl.xlf +++ b/Resources/translations/validators.tl.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Ang halagang ito ay hindi isang balidong Twig template. + + This file is not a valid video. + Ang file na ito ay hindi isang wastong video. + + + The size of the video could not be detected. + Hindi matukoy ang laki ng video. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Masyadong malaki ang lapad ng video ({{ width }}px). Ang pinahihintulutang pinakamaksimum na lapad ay {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Masyadong maliit ang lapad ng video ({{ width }}px). Inaasahang minimum na lapad ay {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Sobrang taas ng video ({{ height }}px). Ang pinapahintulutang pinakamataas na taas ay {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Masyadong maliit ang taas ng video ({{ height }}px). Inaasahang pinakamababang taas ay {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Ang video ay may masyadong kaunting pixel ({{ pixels }}). Ang inaasahang pinakamababang dami ay {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Ang video ay may masyadong maraming pixel ({{ pixels }}). Ang inaasahang pinakamataas na bilang ay {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Masyadong malaki ang ratio ng video ({{ ratio }}). Ang pinahihintulutang pinakamataas na ratio ay {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Masyadong maliit ang ratio ng video ({{ ratio }}). Ang inaasahang minimum na ratio ay {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Ang video ay parisukat ({{ width }}x{{ height }}px). Hindi pinapayagan ang mga parisukat na video. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Ang video ay nasa landscape na oryentasyon ({{ width }}x{{ height }} px). Hindi pinapayagan ang mga landscape na video. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Ang video ay naka-portrait ({{ width }}x{{ height }}px). Hindi pinapayagan ang mga video na naka-portrait. + + + The video file is corrupted. + Sira ang file ng video. + + + The video contains multiple streams. Only one stream is allowed. + May ilang stream ang video. Isa lamang na stream ang pinapayagan. + + + Unsupported video codec "{{ codec }}". + Hindi suportadong video codec "{{ codec }}". + + + Unsupported video container "{{ container }}". + Hindi suportadong lalagyan ng video "{{ container }}". + + + The image file is corrupted. + Ang file ng larawan ay sira. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Masyadong kaunti ang pixel ng larawan ({{ pixels }}). Ang inaasahang pinakamababang dami ay {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Ang larawan ay may sobrang daming pixel ({{ pixels }}). Ang inaasahang pinakamataas na dami ay {{ max_pixels }}. + + + This filename does not match the expected charset. + Ang pangalan ng file na ito ay hindi tumutugma sa inaasahang hanay ng mga character. + diff --git a/Resources/translations/validators.tr.xlf b/Resources/translations/validators.tr.xlf index 42c4bbd91..b936290aa 100644 --- a/Resources/translations/validators.tr.xlf +++ b/Resources/translations/validators.tr.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Bu değer geçerli bir Twig şablonu olarak kabul edilmiyor. + + This file is not a valid video. + Bu dosya geçerli bir video değil. + + + The size of the video could not be detected. + Videonun boyutu tespit edilemedi. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Video genişliği çok büyük ({{ width }}px). İzin verilen maksimum genişlik {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Video genişliği çok küçük ({{ width }}px). Beklenen minimum genişlik {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Video yüksekliği çok büyük ({{ height }}px). İzin verilen azami yükseklik {{ max_height }}px'tir. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Video yüksekliği çok küçük ({{ height }}px). Beklenen minimum yükseklik {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Videoda piksel sayısı çok az ({{ pixels }}). Beklenen asgari miktar {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Videoda çok fazla piksel var ({{ pixels }}). Beklenen azami miktar {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Video oranı çok büyük ({{ ratio }}). İzin verilen azami oran {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Video oranı çok küçük ({{ ratio }}). Beklenen minimum oran {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Video kare biçiminde ({{ width }}x{{ height }}px). Kare videolara izin verilmez. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Video yatay yönde ({{ width }}x{{ height }} px). Yatay videolara izin verilmiyor. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Video dikey yönde ({{ width }}x{{ height }}px). Dikey yönlendirilmiş videolara izin verilmez. + + + The video file is corrupted. + Video dosyası bozuk. + + + The video contains multiple streams. Only one stream is allowed. + Video birden fazla akış içeriyor. Yalnızca bir akışa izin verilir. + + + Unsupported video codec "{{ codec }}". + Desteklenmeyen video codec'i "{{ codec }}". + + + Unsupported video container "{{ container }}". + Desteklenmeyen video kapsayıcısı "{{ container }}". + + + The image file is corrupted. + Görüntü dosyası bozulmuş. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Görüntüde piksel sayısı çok az ({{ pixels }}). Beklenen asgari miktar {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Görüntüde çok fazla piksel var ({{ pixels }}). Beklenen maksimum miktar {{ max_pixels }}. + + + This filename does not match the expected charset. + Bu dosya adı beklenen karakter kümesiyle eşleşmiyor. + diff --git a/Resources/translations/validators.uk.xlf b/Resources/translations/validators.uk.xlf index 46b692c2d..96813fd23 100644 --- a/Resources/translations/validators.uk.xlf +++ b/Resources/translations/validators.uk.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Це значення не є дійсним шаблоном Twig. + + This file is not a valid video. + Цей файл не є дійсним відео. + + + The size of the video could not be detected. + Не вдалося визначити розмір відео. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Ширина відео занадто велика ({{ width }}px). Допустима максимальна ширина — {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Ширина відео занадто мала ({{ width }}px). Очікувана мінімальна ширина — {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Висота відео занадто велика ({{ height }}px). Дозволена максимальна висота — {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Висота відео занадто мала ({{ height }}px). Очікувана мінімальна висота — {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + У відео занадто мало пікселів ({{ pixels }}). Очікувана мінімальна кількість — {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + У відео забагато пікселів ({{ pixels }}). Очікувана максимальна кількість — {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Співвідношення сторін відео занадто велике ({{ ratio }}). Допустиме максимальне співвідношення — {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Співвідношення сторін відео надто мале ({{ ratio }}). Очікуване мінімальне співвідношення — {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Відео квадратне ({{ width }}x{{ height }}px). Квадратні відео не дозволені. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Відео в альбомній орієнтації ({{ width }}x{{ height }} px). Відео в альбомній орієнтації заборонені. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Відео має портретну орієнтацію ({{ width }}x{{ height }}px). Відео з портретною орієнтацією не дозволені. + + + The video file is corrupted. + Відеофайл пошкоджено. + + + The video contains multiple streams. Only one stream is allowed. + Відео містить кілька потоків. Дозволено лише один потік. + + + Unsupported video codec "{{ codec }}". + Непідтримуваний відеокодек «{{ codec }}». + + + Unsupported video container "{{ container }}". + Непідтримуваний відеоконтейнер "{{ container }}". + + + The image file is corrupted. + Файл зображення пошкоджений. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Зображення має надто мало пікселів ({{ pixels }}). Очікувана мінімальна кількість — {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Зображення має надто багато пікселів ({{ pixels }}). Очікувана максимальна кількість — {{ max_pixels }}. + + + This filename does not match the expected charset. + Ця назва файлу не відповідає очікуваному набору символів. + diff --git a/Resources/translations/validators.ur.xlf b/Resources/translations/validators.ur.xlf index f13aafb43..18e5a0efd 100644 --- a/Resources/translations/validators.ur.xlf +++ b/Resources/translations/validators.ur.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. یہ قدر ایک درست Twig سانچہ نہیں ہے۔ + + This file is not a valid video. + یہ فائل ایک درست ویڈیو نہیں ہے۔ + + + The size of the video could not be detected. + ویڈیو کا سائز معلوم نہیں کیا جا سکا۔ + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + ویڈیو کی چوڑائی بہت زیادہ ہے ({{ width }}px)۔ اجازت شدہ زیادہ سے زیادہ چوڑائی {{ max_width }}px ہے۔ + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + ویڈیو کی چوڑائی بہت کم ہے ({{ width }}px)۔ متوقع کم از کم چوڑائی {{ min_width }} پکسل ہے۔ + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + ویڈیو کی اونچائی بہت زیادہ ہے ({{ height }}px)۔ مجاز زیادہ سے زیادہ اونچائی {{ max_height }}px ہے۔ + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + ویڈیو کی اونچائی بہت کم ہے ({{ height }}px)۔ متوقع کم از کم اونچائی {{ min_height }}px ہے۔ + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + ویڈیو میں پکسل بہت کم ہیں ({{ pixels }}). متوقع کم از کم مقدار {{ min_pixels }} ہے۔ + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + ویڈیو میں پکسلز بہت زیادہ ہیں ({{ pixels }}). متوقع زیادہ سے زیادہ مقدار {{ max_pixels }} ہے۔ + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + ویڈیو کا تناسب بہت بڑا ہے ({{ ratio }}). اجازت شدہ زیادہ سے زیادہ تناسب {{ max_ratio }} ہے۔ + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + ویڈیو کا تناسب بہت چھوٹا ہے ({{ ratio }}). متوقع کم از کم تناسب {{ min_ratio }} ہے۔ + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + ویڈیو مربع ہے ({{ width }}x{{ height }}px). مربع ویڈیوز کی اجازت نہیں ہے۔ + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + ویڈیو افقی سمت میں ہے ({{ width }}x{{ height }} پکسل). افقی ویڈیوز کی اجازت نہیں ہے۔ + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + ویڈیو عمودی رخ پر ہے ({{ width }}x{{ height }}px). عمودی رخ والی ویڈیوز کی اجازت نہیں ہے۔ + + + The video file is corrupted. + ویڈیو فائل خراب ہے۔ + + + The video contains multiple streams. Only one stream is allowed. + ویڈیو میں متعدد اسٹریمز ہیں۔ صرف ایک اسٹریم کی اجازت ہے۔ + + + Unsupported video codec "{{ codec }}". + غیر معاون ویڈیو کوڈیک "{{ codec }}"۔ + + + Unsupported video container "{{ container }}". + غیر معاونت یافتہ ویڈیو کنٹینر "{{ container }}". + + + The image file is corrupted. + تصویری فائل خراب ہے۔ + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + تصویر میں پکسلز بہت کم ہیں ({{ pixels }})۔ متوقع کم سے کم مقدار {{ min_pixels }} ہے۔ + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + تصویر میں پکسلز بہت زیادہ ہیں ({{ pixels }}). متوقع زیادہ سے زیادہ مقدار {{ max_pixels }} ہے. + + + This filename does not match the expected charset. + اس فائل کا نام متوقع حرفوں کے مجموعے سے مطابقت نہیں رکھتا۔ + diff --git a/Resources/translations/validators.uz.xlf b/Resources/translations/validators.uz.xlf index fe0b49f71..f86216abb 100644 --- a/Resources/translations/validators.uz.xlf +++ b/Resources/translations/validators.uz.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Bu qiymat yaroqli Twig shabloni emas. + + This file is not a valid video. + Ushbu fayl yaroqli video emas. + + + The size of the video could not be detected. + Videoning hajmini aniqlab bo‘lmadi. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Video kengligi juda katta ({{ width }}px). Ruxsat etilgan maksimal kenglik {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Video kengligi juda kichik ({{ width }}px). Kutilayotgan minimal kenglik {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Video balandligi juda katta ({{ height }}px). Ruxsat etilgan maksimal balandlik {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Video balandligi juda kichik ({{ height }}px). Kutilayotgan minimal balandlik {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Videoda piksellar soni juda kam ({{ pixels }}). Kutilgan minimal miqdor {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Videoda juda ko‘p piksellar bor ({{ pixels }}). Kutilayotgan maksimal miqdor {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Video nisbati juda katta ({{ ratio }}). Ruxsat etilgan maksimal nisbat {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Video nisbati juda kichik ({{ ratio }}). Kutilayotgan minimal nisbat {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Video kvadrat ({{ width }}x{{ height }}px). Kvadrat videolarga ruxsat berilmaydi. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Video gorizontal yo‘nalishda ({{ width }}x{{ height }} px). Gorizontal videolarga ruxsat berilmaydi. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Video portret yoʻnalishda ({{ width }}x{{ height }}px). Portret yoʻnalishidagi videolarga ruxsat berilmaydi. + + + The video file is corrupted. + Video fayli buzilgan. + + + The video contains multiple streams. Only one stream is allowed. + Videoda bir nechta oqim mavjud. Faqat bitta oqimga ruxsat beriladi. + + + Unsupported video codec "{{ codec }}". + Qo‘llab-quvvatlanmaydigan video kodek "{{ codec }}". + + + Unsupported video container "{{ container }}". + Qo'llab-quvvatlanmaydigan video konteyner "{{ container }}". + + + The image file is corrupted. + Rasm fayli buzilgan. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Tasvirda piksellar juda kam ({{ pixels }}). Kutilayotgan minimal miqdor {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Tasvirda juda ko‘p piksel bor ({{ pixels }}). Kutilayotgan maksimal miqdor {{ max_pixels }}. + + + This filename does not match the expected charset. + Bu fayl nomi kutilgan belgi to‘plamiga mos kelmaydi. + diff --git a/Resources/translations/validators.vi.xlf b/Resources/translations/validators.vi.xlf index 9daa4fe8a..a7ac211a7 100644 --- a/Resources/translations/validators.vi.xlf +++ b/Resources/translations/validators.vi.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. Giá trị này không phải là một mẫu Twig hợp lệ. + + This file is not a valid video. + Tệp này không phải là video hợp lệ. + + + The size of the video could not be detected. + Không thể phát hiện kích thước của video. + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Chiều rộng video quá lớn ({{ width }}px). Chiều rộng tối đa cho phép là {{ max_width }}px. + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Chiều rộng video quá nhỏ ({{ width }}px). Chiều rộng tối thiểu mong đợi là {{ min_width }}px. + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Chiều cao video quá lớn ({{ height }}px). Chiều cao tối đa cho phép là {{ max_height }}px. + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Chiều cao video quá nhỏ ({{ height }}px). Chiều cao tối thiểu dự kiến là {{ min_height }}px. + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Video có quá ít điểm ảnh ({{ pixels }}). Lượng tối thiểu mong đợi là {{ min_pixels }}. + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Video có quá nhiều điểm ảnh ({{ pixels }}). Số lượng tối đa dự kiến là {{ max_pixels }}. + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Tỉ lệ video quá lớn ({{ ratio }}). Tỉ lệ tối đa được phép là {{ max_ratio }}. + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Tỉ lệ video quá nhỏ ({{ ratio }}). Tỉ lệ tối thiểu dự kiến là {{ min_ratio }}. + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + Video có dạng hình vuông ({{ width }}x{{ height }}px). Không cho phép video hình vuông. + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + Video có hướng ngang ({{ width }}x{{ height }} px). Không cho phép video ngang. + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + Video có hướng dọc ({{ width }}x{{ height }}px). Không cho phép video hướng dọc. + + + The video file is corrupted. + Tệp video bị hỏng. + + + The video contains multiple streams. Only one stream is allowed. + Video chứa nhiều luồng. Chỉ cho phép một luồng. + + + Unsupported video codec "{{ codec }}". + Bộ mã hóa video không được hỗ trợ "{{ codec }}". + + + Unsupported video container "{{ container }}". + Bộ chứa video không được hỗ trợ "{{ container }}". + + + The image file is corrupted. + Tệp hình ảnh bị hỏng. + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + Hình ảnh có quá ít điểm ảnh ({{ pixels }}). Số lượng tối thiểu dự kiến là {{ min_pixels }}. + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + Hình ảnh có quá nhiều điểm ảnh ({{ pixels }}). Lượng tối đa dự kiến là {{ max_pixels }}. + + + This filename does not match the expected charset. + Tên tệp này không khớp với bộ ký tự mong đợi. + diff --git a/Resources/translations/validators.zh_CN.xlf b/Resources/translations/validators.zh_CN.xlf index c570d936f..15f7d289a 100644 --- a/Resources/translations/validators.zh_CN.xlf +++ b/Resources/translations/validators.zh_CN.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. 此值不是有效的 Twig 模板。 + + This file is not a valid video. + 此文件不是有效的视频。 + + + The size of the video could not be detected. + 无法检测到视频的大小。 + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + 视频宽度过大({{ width }}px)。允许的最大宽度为 {{ max_width }}px。 + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + 视频宽度太小({{ width }}px)。预期的最小宽度为 {{ min_width }} 像素。 + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + 视频高度过大({{ height }}px)。允许的最大高度为 {{ max_height }}px。 + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + 视频高度太小({{ height }}px)。期望的最小高度为 {{ min_height }}px。 + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + 该视频像素过少 ({{ pixels }}). 期望的最小值为 {{ min_pixels }}。 + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + 该视频的像素过多({{ pixels }})。预期的最大数量为 {{ max_pixels }}。 + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + 视频纵横比过大({{ ratio }})。允许的最大纵横比为 {{ max_ratio }}。 + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + 视频纵横比过小({{ ratio }})。预期的最低比例为 {{ min_ratio }}。 + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + 视频为正方形 ({{ width }}x{{ height }}px)。不允许正方形视频。 + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + 视频为横向({{ width }}x{{ height }} 像素)。不允许横向视频。 + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + 该视频为竖屏方向({{ width }}x{{ height }}px)。不允许竖屏视频。 + + + The video file is corrupted. + 视频文件已损坏。 + + + The video contains multiple streams. Only one stream is allowed. + 该视频包含多个流。只允许一个流。 + + + Unsupported video codec "{{ codec }}". + 不支持的视频编解码器“{{ codec }}”。 + + + Unsupported video container "{{ container }}". + 不支持的视频容器 "{{ container }}". + + + The image file is corrupted. + 图像文件已损坏。 + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + 图像的像素太少({{ pixels }})。预期的最小数量为 {{ min_pixels }}。 + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + 图像的像素过多 ({{ pixels }}). 预期的最大数量为 {{ max_pixels }}. + + + This filename does not match the expected charset. + 该文件名与预期的字符集不匹配。 + diff --git a/Resources/translations/validators.zh_TW.xlf b/Resources/translations/validators.zh_TW.xlf index a60283b28..9398fe4dc 100644 --- a/Resources/translations/validators.zh_TW.xlf +++ b/Resources/translations/validators.zh_TW.xlf @@ -470,6 +470,90 @@ This value is not a valid Twig template. 這個數值不是有效的 Twig 模板。 + + This file is not a valid video. + 此檔案不是有效的影片。 + + + The size of the video could not be detected. + 無法偵測到視訊的大小。 + + + The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + 影片寬度過大({{ width }}px)。允許的最大寬度為 {{ max_width }}px。 + + + The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + 視訊寬度太小({{ width }}px)。預期的最小寬度為 {{ min_width }} 像素。 + + + The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + 影片高度過大({{ height }}px)。允許的最大高度為 {{ max_height }}px。 + + + The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + 影片高度太小({{ height }}px)。預期的最小高度為 {{ min_height }}px。 + + + The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + 此影片的像素過少 ({{ pixels }}). 預期的最小值為 {{ min_pixels }}。 + + + The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + 此影片的像素過多({{ pixels }})。預期的最大數量為 {{ max_pixels }}。 + + + The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + 視訊長寬比過大({{ ratio }})。允許的最大長寬比為 {{ max_ratio }}。 + + + The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + 視訊長寬比過小({{ ratio }})。預期的最低比例為 {{ min_ratio }}。 + + + The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. + 影片為正方形 ({{ width }}x{{ height }}px)。不允許正方形影片。 + + + The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. + 影片為橫向({{ width }}x{{ height }} 像素)。不允許橫向影片。 + + + The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. + 此影片為直向({{ width }}x{{ height }}px)。不允許直向影片。 + + + The video file is corrupted. + 視訊檔案已損壞。 + + + The video contains multiple streams. Only one stream is allowed. + 此影片包含多個串流。只允許一個串流。 + + + Unsupported video codec "{{ codec }}". + 不支援的視訊編解碼器「{{ codec }}」。 + + + Unsupported video container "{{ container }}". + 不支援的影片容器 "{{ container }}". + + + The image file is corrupted. + 圖像檔案已損壞。 + + + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. + 影像的像素太少({{ pixels }})。預期的最小數量為 {{ min_pixels }}。 + + + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. + 影像的像素過多 ({{ pixels }}). 預期的最大數量為 {{ max_pixels }}. + + + This filename does not match the expected charset. + 此檔名與預期的字元集不相符。 + From b6849300baaf0ef2dc58ebb3b865bd2783ee94d6 Mon Sep 17 00:00:00 2001 From: epcgrs Date: Tue, 2 Sep 2025 20:30:49 -0300 Subject: [PATCH 39/74] fix Resources translations validators.pt.xlf --- Resources/translations/validators.pt.xlf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/translations/validators.pt.xlf b/Resources/translations/validators.pt.xlf index b6562dbfe..a2c79aff9 100644 --- a/Resources/translations/validators.pt.xlf +++ b/Resources/translations/validators.pt.xlf @@ -468,7 +468,7 @@ This value is not a valid Twig template. - Este valor não é um modelo Twig válido. + Este valor não é um modelo Twig válido. From 3a2b27af72e459ff548eaa1f945d0c48062186af Mon Sep 17 00:00:00 2001 From: siganushka Date: Tue, 2 Sep 2025 11:25:52 +0800 Subject: [PATCH 40/74] refactor: Unify & more humane translation message --- Resources/translations/validators.zh_CN.xlf | 126 ++++++++++---------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/Resources/translations/validators.zh_CN.xlf b/Resources/translations/validators.zh_CN.xlf index c570d936f..c396a9b67 100644 --- a/Resources/translations/validators.zh_CN.xlf +++ b/Resources/translations/validators.zh_CN.xlf @@ -4,23 +4,23 @@ This value should be false. - 该变量的值应为 false 。 + 该值应为 false 。 This value should be true. - 该变量的值应为 true 。 + 该值应为 true 。 This value should be of type {{ type }}. - 该变量的类型应为 {{ type }} 。 + 该值的类型应为 {{ type }} 。 This value should be blank. - 该变量值应为空。 + 该值应为空。 The value you selected is not a valid choice. - 选定变量的值不是有效的选项。 + 该值不是有效的选项。 You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. @@ -36,11 +36,11 @@ This field was not expected. - 此字段是多余的。 + 该字段是多余的。 This field is missing. - 此字段缺失。 + 该字段缺失。 This value is not a valid date. @@ -64,43 +64,43 @@ The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. - 文件太大 ({{ size }} {{ suffix }})。文件大小不可以超过 {{ limit }} {{ suffix }} 。 + 文件太大 ({{ size }} {{ suffix }}),文件大小不应超过 {{ limit }} {{ suffix }} 。 The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - 无效的文件类型 ({{ type }}) 。允许的文件类型有 {{ types }} 。 + 无效的文件类型 ({{ type }}) ,允许的文件类型有 {{ types }} 。 This value should be {{ limit }} or less. - 这个变量的值应该小于或等于 {{ limit }}。 + 该值应小于或等于 {{ limit }} 。 This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. - 字符串太长,长度不可超过 {{ limit }} 个字符。 + 该值太长,长度不应超过 {{ limit }} 个字符。 This value should be {{ limit }} or more. - 该变量的值应该大于或等于 {{ limit }}。 + 该值应大于或等于 {{ limit }} 。 This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. - 字符串太短,长度不可少于 {{ limit }} 个字符。 + 该值太短,长度不应少于 {{ limit }} 个字符。 This value should not be blank. - 该变量不应为空。 + 该值不应为空。 This value should not be null. - 该变量不应为 null 。 + 该值不应为 null 。 This value should be null. - 该变量应为空 null 。 + 该值应为 null 。 This value is not valid. - 该变量值无效 。 + 该值无效。 This value is not a valid time. @@ -112,11 +112,11 @@ The two values should be equal. - 这两个变量的值应该相等。 + 该两个变量值应相等。 The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. - 文件太大,文件大小不可以超过 {{ limit }} {{ suffix }}。 + 文件太大,文件大小不可以超过 {{ limit }} {{ suffix }} 。 The file is too large. @@ -128,7 +128,7 @@ This value should be a valid number. - 该值应该为有效的数字。 + 该值应为有效的数字。 This file is not a valid image. @@ -136,19 +136,19 @@ This value is not a valid IP address. - 该值不是有效的IP地址。 + 该值不是有效的 IP 地址。 This value is not a valid language. - 该值不是有效的语言名。 + 该值不是有效的语言名称(language)。 This value is not a valid locale. - 该值不是有效的区域值(locale)。 + 该值不是有效的区域名称(locale)。 This value is not a valid country. - 该值不是有效的国家名。 + 该值不是有效的国家名称(country)。 This value is already used. @@ -176,15 +176,15 @@ This value should be the user's current password. - 该变量的值应为用户当前的密码。 + 该值应为用户当前的密码。 This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - 该变量应为 {{ limit }} 个字符。 + 该值应为 {{ limit }} 个字符。 The file was only partially uploaded. - 该文件的上传不完整。 + 文件的上传不完整。 No file was uploaded. @@ -204,15 +204,15 @@ This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - 该集合最少应包含 {{ limit }} 个元素。 + 该集合不应少于 {{ limit }} 个元素。 This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. - 该集合最多包含 {{ limit }} 个元素。 + 该集合不应超过 {{ limit }} 个元素。 This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. - 该集合应包含 {{ limit }} 个元素 element 。 + 该集合应为 {{ limit }} 个元素。 Invalid card number. @@ -228,11 +228,11 @@ This value is not a valid ISBN-10. - 该值不是有效的10位国际标准书号(ISBN-10)。 + 该值不是有效的 10 位国际标准书号(ISBN-10)。 This value is not a valid ISBN-13. - 该值不是有效的13位国际标准书号(ISBN-13)。 + 该值不是有效的 13 位国际标准书号(ISBN-13)。 This value is neither a valid ISBN-10 nor a valid ISBN-13. @@ -244,7 +244,7 @@ This value is not a valid currency. - 该值不是有效的货币名(currency)。 + 该值不是有效的货币名称(currency)。 This value should be equal to {{ compared_value }}. @@ -272,7 +272,7 @@ This value should not be equal to {{ compared_value }}. - 该值不应先等于 {{ compared_value }} 。 + 该值不应等于 {{ compared_value }} 。 This value should not be identical to {{ compared_value_type }} {{ compared_value }}. @@ -280,11 +280,11 @@ The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - 图片宽高比太大 ({{ ratio }})。允许的最大宽高比为 {{ max_ratio }}。 + 图片宽高比太大 ({{ ratio }})。允许的最大宽高比为 {{ max_ratio }} 。 The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - 图片宽高比太小 ({{ ratio }})。允许的最大宽高比为 {{ min_ratio }}。 + 图片宽高比太小 ({{ ratio }})。允许的最大宽高比为 {{ min_ratio }} 。 The image is square ({{ width }}x{{ height }}px). Square images are not allowed. @@ -320,43 +320,43 @@ This value is not a valid UUID. - 该值不是有效的UUID。 + 该值不是有效的 UUID 。 This value should be a multiple of {{ compared_value }}. - 此值应为 {{ compared_value }} 的倍数。 + 该值应为 {{ compared_value }} 的倍数。 This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - 此业务标识符代码(BIC)与IBAN {{ iban }} 无关。 + 该业务标识符代码(BIC)与 IBAN {{ iban }} 无关。 This value should be valid JSON. - 该值应该是有效的JSON。 + 该值应为有效的 JSON 。 This collection should contain only unique elements. - 该集合应仅包含独一无二的元素。 + 该集合不能包含重复项。 This value should be positive. - 数值应为正数。 + 该值应为正数。 This value should be either positive or zero. - 数值应是正数,或为零。 + 该值应为正数或零。 This value should be negative. - 数值应为负数。 + 该值应为负数。 This value should be either negative or zero. - 数值应是负数,或为零。 + 该值应为负数或零。 This value is not a valid timezone. - 无效时区。 + 该值不是有效的时区。 This password has been leaked in a data breach, it must not be used. Please use another password. @@ -364,7 +364,7 @@ This value should be between {{ min }} and {{ max }}. - 该数值应在 {{ min }} 和 {{ max }} 之间。 + 该值应在 {{ min }} 和 {{ max }} 之间。 This value is not a valid hostname. @@ -372,31 +372,31 @@ The number of elements in this collection should be a multiple of {{ compared_value }}. - 该集合内的元素数量得是 {{ compared_value }} 的倍数。 + 该集合的元素数量应为 {{ compared_value }} 的倍数。 This value should satisfy at least one of the following constraints: - 该值需符合以下其中一个约束: + 该值应符合以下其中一个约束: Each element of this collection should satisfy its own set of constraints. - 该集合内的每个元素需符合元素本身规定的约束。 + 该集合的每个元素应符合元素本身规定的约束。 This value is not a valid International Securities Identification Number (ISIN). - 该值不是有效的国际证券识别码 (ISIN)。 + 该值不是有效的国际证券识别码(ISIN)。 This value should be a valid expression. - 该值需为一个有效的表达式。 + 该值应为一个有效的表达式。 This value is not a valid CSS color. - 该值不是有效的CSS颜色。 + 该值不是有效的 CSS 颜色。 This value is not a valid CIDR notation. - 该值不是一个有效的CIDR表示。 + 该值不是一个有效的 CIDR 表示。 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. - 该文件名过长,最长不应超过{{ filename_max_length }} 个字符。 + 文件名过长,最长不应超过{{ filename_max_length }} 个字符。 The password strength is too low. Please use a stronger password. - 该密码强度太低。请使用更复杂的密码。 + 密码强度太低。请使用更复杂的密码。 This value contains characters that are not allowed by the current restriction-level. @@ -428,27 +428,27 @@ The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}. - 文件的扩展名无效 ({{ extension }})。允许的扩展名为 {{ extensions }}。 + 文件的扩展名无效 ({{ extension }})。允许的扩展名为 {{ extensions }} 。 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. - 此URL缺少顶级域名。 + 该 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. - 该值太短,应该至少包含一个词。|该值太短,应该至少包含 {{ min }} 个词。 + 该值太短,应至少包含一个词。|该值太短,应至少包含 {{ min }} 个词。 This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. - 该值太长,应该只包含一个词。|该值太长,应该只包含 {{ max }} 个或更少个词。 + 该值太长,应只包含一个词。|该值太长,应只包含 {{ max }} 个或更少个词。 This value does not represent a valid week in the ISO 8601 format. @@ -468,7 +468,7 @@ This value is not a valid Twig template. - 此值不是有效的 Twig 模板。 + 该值不是有效的 Twig 模板。 From 7dd22de924d7f7cb0ba6975afa9414b94140c1b2 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 3 Sep 2025 16:08:24 +0200 Subject: [PATCH 41/74] fall back to legacy options handling if configured named arguments do not match --- Mapping/Loader/AbstractLoader.php | 10 +++++++++- Tests/Mapping/Loader/XmlFileLoaderTest.php | 20 +++++++++++++++++++ .../constraint-mapping-exactly-value.xml | 17 ++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 Tests/Mapping/Loader/constraint-mapping-exactly-value.xml diff --git a/Mapping/Loader/AbstractLoader.php b/Mapping/Loader/AbstractLoader.php index 67b7b2010..ebff64fd5 100644 --- a/Mapping/Loader/AbstractLoader.php +++ b/Mapping/Loader/AbstractLoader.php @@ -101,7 +101,15 @@ protected function newConstraint(string $name, mixed $options = null): Constrain return new $className($options); } - return new $className(...$options); + try { + return new $className(...$options); + } catch (\Error $e) { + if (str_starts_with($e->getMessage(), 'Unknown named parameter ')) { + return new $className($options); + } + + throw $e; + } } if ($options) { diff --git a/Tests/Mapping/Loader/XmlFileLoaderTest.php b/Tests/Mapping/Loader/XmlFileLoaderTest.php index 08a4bb862..03757720c 100644 --- a/Tests/Mapping/Loader/XmlFileLoaderTest.php +++ b/Tests/Mapping/Loader/XmlFileLoaderTest.php @@ -18,6 +18,7 @@ use Symfony\Component\Validator\Constraints\Choice; use Symfony\Component\Validator\Constraints\Collection; use Symfony\Component\Validator\Constraints\IsTrue; +use Symfony\Component\Validator\Constraints\Length; use Symfony\Component\Validator\Constraints\NotNull; use Symfony\Component\Validator\Constraints\Range; use Symfony\Component\Validator\Constraints\Regex; @@ -188,4 +189,23 @@ public function testLoadConstraintWithoutNamedArgumentsSupport() $loader->loadClassMetadata($metadata); } + + /** + * @group legacy + */ + public function testLengthConstraintValueOptionTriggersDeprecation() + { + $loader = new XmlFileLoader(__DIR__.'/constraint-mapping-exactly-value.xml'); + $metadata = new ClassMetadata(Entity_81::class); + + $this->expectUserDeprecationMessage(\sprintf('Since symfony/validator 7.3: Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', Length::class)); + + $loader->loadClassMetadata($metadata); + $constraints = $metadata->getPropertyMetadata('title')[0]->constraints; + + self::assertCount(1, $constraints); + self::assertInstanceOf(Length::class, $constraints[0]); + self::assertSame(6, $constraints[0]->min); + self::assertSame(6, $constraints[0]->max); + } } diff --git a/Tests/Mapping/Loader/constraint-mapping-exactly-value.xml b/Tests/Mapping/Loader/constraint-mapping-exactly-value.xml new file mode 100644 index 000000000..40e04f3a3 --- /dev/null +++ b/Tests/Mapping/Loader/constraint-mapping-exactly-value.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + From 3d0cbdf125c3f5d7bbb86ef29ef9797fef6ce3fd Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 3 Sep 2025 11:47:42 +0200 Subject: [PATCH 42/74] review the German translations --- Resources/translations/validators.de.xlf | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Resources/translations/validators.de.xlf b/Resources/translations/validators.de.xlf index dd54a9233..36463f3c0 100644 --- a/Resources/translations/validators.de.xlf +++ b/Resources/translations/validators.de.xlf @@ -472,87 +472,87 @@ This file is not a valid video. - Diese Datei ist kein gültiges Video. + Diese Datei ist kein gültiges Video. The size of the video could not be detected. - Die Größe des Videos konnte nicht ermittelt werden. + Die Größe des Videos konnte nicht ermittelt werden. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Die Videobreite ist zu groß ({{ width }}px). Zulässige maximale Breite ist {{ max_width }}px. + Das Video ist zu breit ({{ width }}px). Die zulässige maximale Breite ist {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Die Videobreite ist zu klein ({{ width }}px). Erwartete Mindestbreite ist {{ min_width }}px. + Das Video ist nicht breit genug ({{ width }}px). Die erwartete Mindestbreite ist {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Die Videohöhe ist zu groß ({{ height }}px). Zulässige maximale Höhe ist {{ max_height }}px. + Die Videohöhe ist zu hoch ({{ height }}px). Die zulässige maximale Höhe ist {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Die Videohöhe ist zu klein ({{ height }}px). Erwartete Mindesthöhe ist {{ min_height }}px. + Die Videohöhe ist zu klein ({{ height }}px). Die erwartete Mindesthöhe ist {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Das Video hat zu wenige Pixel ({{ pixels }}). Erwartete Mindestmenge ist {{ min_pixels }}. + Das Video hat zu wenige Pixel ({{ pixels }}). Die erwartete Mindestanzahl ist {{ min_pixels }}. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Das Video hat zu viele Pixel ({{ pixels }}). Die erwartete Höchstanzahl ist {{ max_pixels }}. + Das Video hat zu viele Pixel ({{ pixels }}). Die erwartete Höchstanzahl ist {{ max_pixels }}. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Das Videoverhältnis ist zu groß ({{ ratio }}). Zulässiges maximales Verhältnis ist {{ max_ratio }}. + Das Video-Seitenverhältnis ist zu hoch ({{ ratio }}). Das zulässige maximale Verhältnis ist {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Das Video-Seitenverhältnis ist zu klein ({{ ratio }}). Erwartetes Mindestverhältnis ist {{ min_ratio }}. + Das Video-Seitenverhältnis ist zu klein ({{ ratio }}). Das erwartete Mindestverhältnis ist {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Das Video ist quadratisch ({{ width }}x{{ height }}px). Quadratische Videos sind nicht erlaubt. + Das Video ist quadratisch ({{ width }}x{{ height }}px). Quadratische Videos sind nicht erlaubt. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Das Video ist im Querformat ({{ width }}x{{ height }} px). Querformat-Videos sind nicht erlaubt. + Das Video ist im Querformat ({{ width }}x{{ height }} px). Querformat-Videos sind nicht erlaubt. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Das Video ist hochkant ausgerichtet ({{ width }}x{{ height }}px). Hochkant-Videos sind nicht erlaubt. + Das Video ist hochkant ausgerichtet ({{ width }}x{{ height }}px). Hochkant-Videos sind nicht erlaubt. The video file is corrupted. - Die Videodatei ist beschädigt. + Die Videodatei ist beschädigt. The video contains multiple streams. Only one stream is allowed. - Das Video enthält mehrere Streams. Es ist nur ein Stream erlaubt. + Das Video enthält mehrere Streams. Es ist nur ein Stream erlaubt. Unsupported video codec "{{ codec }}". - Nicht unterstützter Videocodec „{{ codec }}“. + Nicht unterstützter Videocodec "{{ codec }}". Unsupported video container "{{ container }}". - Nicht unterstützter Videocontainer "{{ container }}". + Nicht unterstützter Videocontainer "{{ container }}". The image file is corrupted. - Die Bilddatei ist beschädigt. + Die Bilddatei ist beschädigt. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Das Bild hat zu wenige Pixel ({{ pixels }}). Erwartete Mindestmenge ist {{ min_pixels }}. + Das Bild hat zu wenige Pixel ({{ pixels }}). Erwartete Mindestanzahl ist {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Das Bild hat zu viele Pixel ({{ pixels }}). Erwartete Höchstmenge ist {{ max_pixels }}. + Das Bild hat zu viele Pixel ({{ pixels }}). Erwartete Höchstanzahl ist {{ max_pixels }}. This filename does not match the expected charset. - Dieser Dateiname entspricht nicht dem erwarteten Zeichensatz. + Dieser Dateiname entspricht nicht dem erwarteten Zeichensatz. From 5cd61d85df2df631dcccf9c42542b9d884265dd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Thu, 4 Sep 2025 11:04:09 +0200 Subject: [PATCH 43/74] [Validator] review the French translations --- Resources/translations/validators.fr.xlf | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Resources/translations/validators.fr.xlf b/Resources/translations/validators.fr.xlf index 3d44ec38e..e682e16a4 100644 --- a/Resources/translations/validators.fr.xlf +++ b/Resources/translations/validators.fr.xlf @@ -472,87 +472,87 @@ This file is not a valid video. - Ce fichier n’est pas une vidéo valide. + Ce fichier n’est pas une vidéo valide. The size of the video could not be detected. - La taille de la vidéo n’a pas pu être détectée. + La taille de la vidéo n’a pas pu être détectée. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - La largeur de la vidéo est trop grande ({{ width }}px). La largeur maximale autorisée est de {{ max_width }}px. + La largeur de la vidéo est trop grande ({{ width }}px). La largeur maximale autorisée est de {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - La largeur de la vidéo est trop petite ({{ width }}px). La largeur minimale attendue est de {{ min_width }} px. + La largeur de la vidéo est trop petite ({{ width }}px). La largeur minimale attendue est de {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - La hauteur de la vidéo est trop grande ({{ height }}px). La hauteur maximale autorisée est de {{ max_height }}px. + La hauteur de la vidéo est trop grande ({{ height }}px). La hauteur maximale autorisée est de {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - La hauteur de la vidéo est trop petite ({{ height }}px). La hauteur minimale attendue est de {{ min_height }}px. + La hauteur de la vidéo est trop petite ({{ height }}px). La hauteur minimale attendue est de {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - La vidéo a trop peu de pixels ({{ pixels }}). La quantité minimale attendue est {{ min_pixels }}. + La vidéo a trop peu de pixels ({{ pixels }}). La quantité minimale attendue est de {{ min_pixels }} pixels. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - La vidéo contient trop de pixels ({{ pixels }}). La quantité maximale attendue est {{ max_pixels }}. + La vidéo contient trop de pixels ({{ pixels }}). La quantité maximale attendue est de {{ max_pixels }} pixels. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Le ratio de la vidéo est trop élevé ({{ ratio }}). Le ratio maximal autorisé est {{ max_ratio }}. + Le ratio de la vidéo est trop élevé ({{ ratio }}). Le ratio maximal autorisé est de {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Le ratio de la vidéo est trop petit ({{ ratio }}). Le ratio minimum attendu est {{ min_ratio }}. + Le ratio de la vidéo est trop petit ({{ ratio }}). Le ratio minimum attendu est de {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - La vidéo est carrée ({{ width }}x{{ height }}px). Les vidéos carrées ne sont pas autorisées. + La vidéo est carrée ({{ width }}x{{ height }}px). Les vidéos carrées ne sont pas autorisées. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - La vidéo est au format paysage ({{ width }}x{{ height }} px). Les vidéos au format paysage ne sont pas autorisées. + La vidéo est au format paysage ({{ width }}x{{ height }} px). Les vidéos au format paysage ne sont pas autorisées. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - La vidéo est orientée en portrait ({{ width }}x{{ height }} px). Les vidéos en orientation portrait ne sont pas autorisées. + La vidéo est orientée en portrait ({{ width }}x{{ height }} px). Les vidéos en orientation portrait ne sont pas autorisées. The video file is corrupted. - Le fichier vidéo est corrompu. + Le fichier vidéo est corrompu. The video contains multiple streams. Only one stream is allowed. - La vidéo contient plusieurs flux. Un seul flux est autorisé. + La vidéo contient plusieurs flux. Un seul flux est autorisé. Unsupported video codec "{{ codec }}". - Codec vidéo non pris en charge « {{ codec }} ». + Le codec vidéo «{{ codec }}» est non pris en charge. Unsupported video container "{{ container }}". - Conteneur vidéo non pris en charge "{{ container }}". + Le conteneur vidéo «{{ container }}» est non pris en charge. The image file is corrupted. - Le fichier image est corrompu. + Le fichier image est corrompu. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - L’image comporte trop peu de pixels ({{ pixels }}). La quantité minimale attendue est {{ min_pixels }}. + L’image comporte trop peu de pixels ({{ pixels }}). La quantité minimale attendue est de {{ min_pixels }} pixels. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - L’image contient trop de pixels ({{ pixels }}). La quantité maximale attendue est {{ max_pixels }}. + L’image contient trop de pixels ({{ pixels }}). La quantité maximale attendue est de {{ max_pixels }} pixels. This filename does not match the expected charset. - Ce nom de fichier ne correspond pas au jeu de caractères attendu. + Le nom de fichier ne correspond pas au jeu de caractères attendu. From 2a40cd1aa7e32652c488dc2563451c4827f8490a Mon Sep 17 00:00:00 2001 From: Siebe Vanden Eynden Date: Thu, 4 Sep 2025 13:52:53 +0200 Subject: [PATCH 44/74] [Validator] updated Dutch translations --- Resources/translations/validators.nl.xlf | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Resources/translations/validators.nl.xlf b/Resources/translations/validators.nl.xlf index b2123142c..74bea6f48 100644 --- a/Resources/translations/validators.nl.xlf +++ b/Resources/translations/validators.nl.xlf @@ -472,87 +472,87 @@ This file is not a valid video. - Dit bestand is geen geldige video. + Dit bestand is geen geldige video. The size of the video could not be detected. - De grootte van de video kon niet worden gedetecteerd. + De grootte van de video kon niet worden gedetecteerd. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - De videobreedte is te groot ({{ width }}px). Toegestane maximale breedte is {{ max_width }}px. + De videobreedte is te groot ({{ width }}px). Toegestane maximale breedte is {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - De videobreedte is te klein ({{ width }}px). Verwachte minimum breedte is {{ min_width }}px. + De videobreedte is te klein ({{ width }}px). Verwachte minimum breedte is {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - De videohogte is te groot ({{ height }}px). Toegestane maximale hoogte is {{ max_height }}px. + De videohoogte is te groot ({{ height }}px). Toegestane maximale hoogte is {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - De videohoogte is te klein ({{ height }}px). Verwachte minimale hoogte is {{ min_height }}px. + De videohoogte is te klein ({{ height }}px). Verwachte minimale hoogte is {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - De video heeft te weinig pixels ({{ pixels }}). Verwachte minimumaantal is {{ min_pixels }}. + De video heeft te weinig pixels ({{ pixels }}). Verwachte minimumaantal is {{ min_pixels }}. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - De video heeft te veel pixels ({{ pixels }}). Het verwachte maximum is {{ max_pixels }}. + De video heeft te veel pixels ({{ pixels }}). Het verwachte maximum is {{ max_pixels }}. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - De videoratio is te groot ({{ ratio }}). Toegestane maximale ratio is {{ max_ratio }}. + De videoratio is te groot ({{ ratio }}). Toegestane maximale ratio is {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - De videoratio is te klein ({{ ratio }}). Verwachte minimumverhouding is {{ min_ratio }}. + De videoratio is te klein ({{ ratio }}). Verwachte minimumverhouding is {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - De video is vierkant ({{ width }}x{{ height }}px). Vierkante video's zijn niet toegestaan. + De video is vierkant ({{ width }}x{{ height }}px). Vierkante video's zijn niet toegestaan. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - De video is in liggende oriëntatie ({{ width }}x{{ height }} px). Liggende video's zijn niet toegestaan. + De video is in liggende oriëntatie ({{ width }}x{{ height }} px). Liggende video's zijn niet toegestaan. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - De video is in portretstand ({{ width }}x{{ height }}px). Video's in portretstand zijn niet toegestaan. + De video is in portretstand ({{ width }}x{{ height }}px). Video's in portretstand zijn niet toegestaan. The video file is corrupted. - Het videobestand is beschadigd. + Het videobestand is beschadigd. The video contains multiple streams. Only one stream is allowed. - De video bevat meerdere streams. Slechts één stream is toegestaan. + De video bevat meerdere streams. Slechts één stream is toegestaan. Unsupported video codec "{{ codec }}". - Niet-ondersteunde videocodec ‘{{ codec }}’. + Niet-ondersteunde videocodec ‘{{ codec }}’. Unsupported video container "{{ container }}". - Niet-ondersteunde videocontainer "{{ container }}". + Niet-ondersteunde videocontainer "{{ container }}". The image file is corrupted. - Het afbeeldingsbestand is beschadigd. + Het afbeeldingsbestand is beschadigd. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - De afbeelding heeft te weinig pixels ({{ pixels }}). Verwachte minimumhoeveelheid is {{ min_pixels }}. + De afbeelding heeft te weinig pixels ({{ pixels }}). Verwachte minimumhoeveelheid is {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - De afbeelding heeft te veel pixels ({{ pixels }}). Het verwachte maximum is {{ max_pixels }}. + De afbeelding heeft te veel pixels ({{ pixels }}). Het verwachte maximum is {{ max_pixels }}. This filename does not match the expected charset. - Deze bestandsnaam komt niet overeen met de verwachte tekenset. + Deze bestandsnaam komt niet overeen met de verwachte tekencodering. From 3141b6c5d262517a43b1555566b8061a5d74fadb Mon Sep 17 00:00:00 2001 From: Link1515 Date: Fri, 5 Sep 2025 22:19:47 +0800 Subject: [PATCH 45/74] Review translations for Chinese (zh_TW) --- Resources/translations/validators.zh_TW.xlf | 64 ++++++++++----------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/Resources/translations/validators.zh_TW.xlf b/Resources/translations/validators.zh_TW.xlf index 9398fe4dc..63103187c 100644 --- a/Resources/translations/validators.zh_TW.xlf +++ b/Resources/translations/validators.zh_TW.xlf @@ -132,7 +132,7 @@ This file is not a valid image. - 這個檔案不是有效的影像。 + 這個檔案不是有效的圖片。 This value is not a valid IP address. @@ -156,23 +156,23 @@ The size of the image could not be detected. - 無法偵測這個影像的大小。 + 無法偵測到圖片的大小。 The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - 影像過寬({{ width }}px)。允許的寬度上限是 {{ max_width }}px。 + 圖片寬度過大 ({{ width }}px)。允許的最大寬度為 {{ max_width }}px。 The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - 影像過窄({{ width }}px)。允許的寬度下限是 {{ max_width }}px。 + 圖片寬度過小 ({{ width }}px)。允許的最小寬度為 {{ max_width }}px。 The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - 影像過長({{ height }}px)。允許的長度上限是 {{ max_height }}px。 + 圖片高度過大 ({{ height }}px)。允許的最大長度為 {{ max_height }}px。 The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - 影像過短({{ height }}px)。允許的長度下限是 {{ max_height }}px。 + 圖片高度過小 ({{ height }}px)。允許的最小高度為 {{ max_height }}px。 This value should be the user's current password. @@ -280,23 +280,23 @@ The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - 影像的比例過大({{ ratio }})。允許的最大比例是 {{ max_ratio }}。 + 圖片的比例過大 ({{ ratio }})。允許的最大比例為 {{ max_ratio }}。 The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - 影像的比例過小({{ ratio }})。允許的最小比例是 {{ min_ratio }}。 + 圖片的比例過小 ({{ ratio }})。允許的最小比例為 {{ min_ratio }}。 The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - 影像為正方形({{ width }}x{{ height }}px)。不允許使用正方形影像。 + 圖片為正方形 ({{ width }}x{{ height }}px)。不允許使用正方形圖片。 The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - 影像為橫向({{ width }}x{{ height }}px)。不允許使用橫向影像。 + 圖片為橫向 ({{ width }}x{{ height }}px)。不允許使用橫向圖片。 The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - 影像為縱向({{ width }}x{{ height }}px)。不允許使用縱向影像。 + 圖片為縱向 ({{ width }}x{{ height }}px)。不允許使用縱向圖片。 An empty file is not allowed. @@ -472,87 +472,87 @@ This file is not a valid video. - 此檔案不是有效的影片。 + 這個檔案不是有效的影片。 The size of the video could not be detected. - 無法偵測到視訊的大小。 + 無法偵測到影片的大小。 The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - 影片寬度過大({{ width }}px)。允許的最大寬度為 {{ max_width }}px。 + 影片寬度過大 ({{ width }}px)。允許的最大寬度為 {{ max_width }}px。 The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - 視訊寬度太小({{ width }}px)。預期的最小寬度為 {{ min_width }} 像素。 + 影片寬度過小 ({{ width }}p)。允許的最小寬度為 {{ min_width }}px。 The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - 影片高度過大({{ height }}px)。允許的最大高度為 {{ max_height }}px。 + 影片高度過大 ({{ height }}px)。允許的最大高度為 {{ max_height }}px。 The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - 影片高度太小({{ height }}px)。預期的最小高度為 {{ min_height }}px。 + 影片高度過小 ({{ height }}px)。允許的最小高度為 {{ min_height }}px。 The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - 此影片的像素過少 ({{ pixels }}). 預期的最小值為 {{ min_pixels }}。 + 影片的像素過少 ({{ pixels }} 像素). 允許的最小值為 {{ min_pixels }} 像素。 The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - 此影片的像素過多({{ pixels }})。預期的最大數量為 {{ max_pixels }}。 + 影片的像素過多 ({{ pixels }} 像素)。允許的最大值為 {{ max_pixels }} 像素。 The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - 視訊長寬比過大({{ ratio }})。允許的最大長寬比為 {{ max_ratio }}。 + 影片的比例過大 ({{ ratio }})。允許的最大比例為 {{ max_ratio }}。 The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - 視訊長寬比過小({{ ratio }})。預期的最低比例為 {{ min_ratio }}。 + 影片的比例過小 ({{ ratio }})。允許的最小比例為 {{ min_ratio }}。 The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - 影片為正方形 ({{ width }}x{{ height }}px)。不允許正方形影片。 + 影片為正方形 ({{ width }}x{{ height }}px)。不允許使用正方形影片。 The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - 影片為橫向({{ width }}x{{ height }} 像素)。不允許橫向影片。 + 影片為橫向 ({{ width }}x{{ height }}px)。不允許使用橫向影片。 The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - 此影片為直向({{ width }}x{{ height }}px)。不允許直向影片。 + 影片為縱向 ({{ width }}x{{ height }}px)。不允許使用縱向影片。 The video file is corrupted. - 視訊檔案已損壞。 + 影片檔案已損壞。 The video contains multiple streams. Only one stream is allowed. - 此影片包含多個串流。只允許一個串流。 + 影片包含多個串流。只允許單個串流。 Unsupported video codec "{{ codec }}". - 不支援的視訊編解碼器「{{ codec }}」。 + 不支援的影片編解碼器: {{ codec }}。 Unsupported video container "{{ container }}". - 不支援的影片容器 "{{ container }}". + 不支援的影片容器格式: {{ container }}。 The image file is corrupted. - 圖像檔案已損壞。 + 圖片檔案已損壞。 The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - 影像的像素太少({{ pixels }})。預期的最小數量為 {{ min_pixels }}。 + 圖片的像素過少 ({{ pixels }} 像素)。允許的最小值為 {{ min_pixels }} 像素。 The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - 影像的像素過多 ({{ pixels }}). 預期的最大數量為 {{ max_pixels }}. + 圖片的像素過多 ({{ pixels }} 像素)。允許的最大值為 {{ max_pixels }} 像素。 This filename does not match the expected charset. - 此檔名與預期的字元集不相符。 + 這個檔名與預期的字元集不相符。 From 080c3327118255628db19b2b8c1cf33f0edac1c7 Mon Sep 17 00:00:00 2001 From: Marcin Twardowski Date: Fri, 5 Sep 2025 20:26:41 +0200 Subject: [PATCH 46/74] [Validator] Review translations for Polish (pl) --- Resources/translations/validators.pl.xlf | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Resources/translations/validators.pl.xlf b/Resources/translations/validators.pl.xlf index 19d11497d..7cffa5f72 100644 --- a/Resources/translations/validators.pl.xlf +++ b/Resources/translations/validators.pl.xlf @@ -472,87 +472,87 @@ This file is not a valid video. - Ten plik nie jest prawidłowym plikiem wideo. + Ten plik nie jest prawidłowym plikiem wideo. The size of the video could not be detected. - Nie można było wykryć rozmiaru wideo. + Nie można wykryć rozmiaru wideo. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Szerokość wideo jest zbyt duża ({{ width }}px). Dozwolona maksymalna szerokość to {{ max_width }}px. + Szerokość wideo jest zbyt duża ({{ width }}px). Maksymalna dopuszczalna szerokość to {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Szerokość wideo jest zbyt mała ({{ width }}px). Minimalna oczekiwana szerokość to {{ min_width }}px. + Szerokość wideo jest zbyt mała ({{ width }}px). Oczekiwana minimalna szerokość to {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Wysokość wideo jest zbyt duża ({{ height }}px). Dozwolona maksymalna wysokość to {{ max_height }}px. + Wysokość wideo jest zbyt duża ({{ height }}px). Maksymalna dopuszczalna wysokość to {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Wysokość wideo jest zbyt mała ({{ height }}px). Oczekiwana minimalna wysokość to {{ min_height }}px. + Wysokość wideo jest zbyt mała ({{ height }}px). Oczekiwana minimalna wysokość to {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Wideo ma za mało pikseli ({{ pixels }}). Oczekiwana minimalna ilość to {{ min_pixels }}. + Wideo ma zbyt mało ({{ pixels }} pikseli). Oczekiwana minimalna liczba to {{ min_pixels }} pikseli. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Wideo ma zbyt wiele pikseli ({{ pixels }}). Oczekiwana maksymalna liczba to {{ max_pixels }}. + Wideo ma zbyt wiele ({{ pixels }} pikseli). Oczekiwana maksymalna liczba to {{ max_pixels }} pikseli. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Współczynnik wideo jest zbyt duży ({{ ratio }}). Dozwolony maksymalny współczynnik to {{ max_ratio }}. + Współczynnik proporcji wideo jest zbyt duży ({{ ratio }}). Maksymalny dopuszczalny współczynnik to {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Proporcje wideo są zbyt małe ({{ ratio }}). Oczekiwany minimalny współczynnik to {{ min_ratio }}. + Współczynnik proporcji wideo jest zbyt mały ({{ ratio }}). Oczekiwany minimalny współczynnik to {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Wideo ma kształt kwadratu ({{ width }}x{{ height }}px). Kwadratowe filmy są niedozwolone. + Wideo jest w formacie kwadratowym ({{ width }}x{{ height }}px). Filmy w tym formacie są niedozwolone. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Wideo ma orientację poziomą ({{ width }}x{{ height }} px). Filmy w orientacji poziomej są niedozwolone. + Wideo ma orientację poziomą ({{ width }}x{{ height }}px). Filmy w orientacji poziomej są niedozwolone. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Wideo ma orientację pionową ({{ width }}x{{ height }}px). Filmy w orientacji pionowej są niedozwolone. + Wideo ma orientację pionową ({{ width }}x{{ height }}px). Filmy w orientacji pionowej są niedozwolone. The video file is corrupted. - Plik wideo jest uszkodzony. + Plik wideo jest uszkodzony. The video contains multiple streams. Only one stream is allowed. - Wideo zawiera wiele strumieni. Dozwolony jest tylko jeden strumień. + Wideo zawiera wiele strumieni. Dozwolony jest tylko jeden strumień. Unsupported video codec "{{ codec }}". - Nieobsługiwany kodek wideo „{{ codec }}”. + Nieobsługiwany kodek wideo "{{ codec }}". Unsupported video container "{{ container }}". - Nieobsługiwany kontener wideo "{{ container }}". + Nieobsługiwany kontener wideo "{{ container }}". The image file is corrupted. - Plik obrazu jest uszkodzony. + Plik obrazu jest uszkodzony. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Obraz ma zbyt mało pikseli ({{ pixels }}). Oczekiwana minimalna liczba to {{ min_pixels }}. + Obraz ma zbyt mało ({{ pixels }} pikseli). Oczekiwana minimalna liczba to {{ min_pixels }} pikseli. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Obraz ma zbyt wiele pikseli ({{ pixels }}). Oczekiwana maksymalna liczba to {{ max_pixels }}. + Obraz ma zbyt wiele ({{ pixels }} pikseli). Oczekiwana maksymalna liczba to {{ max_pixels }} pikseli. This filename does not match the expected charset. - Ta nazwa pliku nie odpowiada oczekiwanemu zestawowi znaków. + Ta nazwa pliku nie odpowiada oczekiwanemu zestawowi znaków. From 9cd0ac3e7b5831351bddb6fa57f38a316849f1e2 Mon Sep 17 00:00:00 2001 From: HypeMC Date: Sat, 6 Sep 2025 23:09:20 +0200 Subject: [PATCH 47/74] [Validator] Review Croatian translations --- Resources/translations/validators.hr.xlf | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Resources/translations/validators.hr.xlf b/Resources/translations/validators.hr.xlf index dfdcc297f..2be0ff60c 100644 --- a/Resources/translations/validators.hr.xlf +++ b/Resources/translations/validators.hr.xlf @@ -472,87 +472,87 @@ This file is not a valid video. - Ova datoteka nije valjani videozapis. + Ova datoteka nije valjani videozapis. The size of the video could not be detected. - Veličina videozapisa nije mogla biti određena. + Veličina videozapisa nije mogla biti određena. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Širina videozapisa je prevelika ({{ width }}px). Dopuštenа maksimalna širina je {{ max_width }}px. + Širina videozapisa je prevelika ({{ width }}px). Dopuštenа maksimalna širina je {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Širina videozapisa je premala ({{ width }}px). Očekivana minimalna širina je {{ min_width }}px. + Širina videozapisa je premala ({{ width }}px). Očekivana minimalna širina je {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Visina videozapisa je prevelika ({{ height }}px). Dopuštena maksimalna visina je {{ max_height }}px. + Visina videozapisa je prevelika ({{ height }}px). Dopuštena maksimalna visina je {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Visina videozapisa je premala ({{ height }}px). Očekivana minimalna visina je {{ min_height }}px. + Visina videozapisa je premala ({{ height }}px). Očekivana minimalna visina je {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Video ima premalo piksela ({{ pixels }}). Očekivana minimalna količina je {{ min_pixels }}. + Video ima premalo piksela ({{ pixels }}). Očekivani minimalni broj je {{ min_pixels }}. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Video ima previše piksela ({{ pixels }}). Očekivana maksimalna količina je {{ max_pixels }}. + Video ima previše piksela ({{ pixels }}). Očekivani maksimalni broj je {{ max_pixels }}. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Omjer videa je prevelik ({{ ratio }}). Dopušteni maksimalni omjer je {{ max_ratio }}. + Omjer videa je prevelik ({{ ratio }}). Dopušteni maksimalni omjer je {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Omjer videa je premalen ({{ ratio }}). Minimalni očekivani omjer je {{ min_ratio }}. + Omjer videa je premalen ({{ ratio }}). Minimalni očekivani omjer je {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Video je kvadratan ({{ width }}x{{ height }}px). Kvadratni videozapisi nisu dopušteni. + Video je kvadratan ({{ width }}x{{ height }}px). Kvadratni videozapisi nisu dopušteni. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Video je vodoravne orijentacije ({{ width }}x{{ height }} px). Vodoravni videozapisi nisu dopušteni. + Video je vodoravne orijentacije ({{ width }}x{{ height }} px). Vodoravni videozapisi nisu dopušteni. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Video je okomitog usmjerenja ({{ width }}x{{ height }} px). Videozapisi okomite orijentacije nisu dopušteni. + Video je okomite orijentacije ({{ width }}x{{ height }} px). Videozapisi okomite orijentacije nisu dopušteni. The video file is corrupted. - Videodatoteka je oštećena. + Videodatoteka je oštećena. The video contains multiple streams. Only one stream is allowed. - Video sadrži više tokova. Dopušten je samo jedan tok. + Video sadrži više tokova. Dopušten je samo jedan tok. Unsupported video codec "{{ codec }}". - Nepodržani video kodek „{{ codec }}“. + Nepodržani video kodek "{{ codec }}". Unsupported video container "{{ container }}". - Nepodržani video kontejner "{{ container }}". + Nepodržani video spremnik "{{ container }}". The image file is corrupted. - Datoteka slike je oštećena. + Datoteka slike je oštećena. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Slika ima premalo piksela ({{ pixels }}). Očekivana minimalna količina je {{ min_pixels }}. + Slika ima premalo piksela ({{ pixels }}). Očekivani minimalni broj je {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Slika ima previše piksela ({{ pixels }}). Očekivana maksimalna količina je {{ max_pixels }}. + Slika ima previše piksela ({{ pixels }}). Očekivani maksimalni broj je {{ max_pixels }}. This filename does not match the expected charset. - Naziv ove datoteke ne odgovara očekivanom skupu znakova. + Naziv ove datoteke ne odgovara očekivanom skupu znakova. From 5444218dea5a410c2162fa502bee762cc31103b6 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 7 Sep 2025 00:47:22 +0300 Subject: [PATCH 48/74] [Validator] Review Turkish translations --- Resources/translations/validators.tr.xlf | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Resources/translations/validators.tr.xlf b/Resources/translations/validators.tr.xlf index b936290aa..95c1bbbea 100644 --- a/Resources/translations/validators.tr.xlf +++ b/Resources/translations/validators.tr.xlf @@ -472,87 +472,87 @@ This file is not a valid video. - Bu dosya geçerli bir video değil. + Bu dosya geçerli bir video dosyası değil. The size of the video could not be detected. - Videonun boyutu tespit edilemedi. + Videonun boyutu tespit edilemedi. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Video genişliği çok büyük ({{ width }}px). İzin verilen maksimum genişlik {{ max_width }}px. + Video genişliği çok büyük ({{ width }}px). İzin verilen maksimum genişlik {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Video genişliği çok küçük ({{ width }}px). Beklenen minimum genişlik {{ min_width }}px. + Video genişliği çok küçük ({{ width }}px). Beklenen minimum genişlik {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Video yüksekliği çok büyük ({{ height }}px). İzin verilen azami yükseklik {{ max_height }}px'tir. + Video yüksekliği çok büyük ({{ height }}px). İzin verilen maksimum yükseklik {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Video yüksekliği çok küçük ({{ height }}px). Beklenen minimum yükseklik {{ min_height }}px. + Video yüksekliği çok küçük ({{ height }}px). Beklenen minimum yükseklik {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Videoda piksel sayısı çok az ({{ pixels }}). Beklenen asgari miktar {{ min_pixels }}. + Videodaki piksel sayısı çok az ({{ pixels }} piksel). Beklenen minimum miktar {{ min_pixels }} pikseldir. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Videoda çok fazla piksel var ({{ pixels }}). Beklenen azami miktar {{ max_pixels }}. + Videodaki piksel sayısı çok fazla ({{ pixels }} piksel). Beklenen maksimum miktar {{ max_pixels }} pikseldir. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Video oranı çok büyük ({{ ratio }}). İzin verilen azami oran {{ max_ratio }}. + Video oranı çok büyük ({{ ratio }}). İzin verilen maksimum oran {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Video oranı çok küçük ({{ ratio }}). Beklenen minimum oran {{ min_ratio }}. + Video oranı çok küçük ({{ ratio }}). Beklenen minimum oran {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Video kare biçiminde ({{ width }}x{{ height }}px). Kare videolara izin verilmez. + Video kare biçimde ({{ width }}x{{ height }}px). Kare videolara izin verilmez. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Video yatay yönde ({{ width }}x{{ height }} px). Yatay videolara izin verilmiyor. + Video yatay biçimde ({{ width }}x{{ height }}px). Yatay videolara izin verilmez. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Video dikey yönde ({{ width }}x{{ height }}px). Dikey yönlendirilmiş videolara izin verilmez. + Video dikey biçimde ({{ width }}x{{ height }}px). Dikey videolara izin verilmez. The video file is corrupted. - Video dosyası bozuk. + Video dosyası bozuk. The video contains multiple streams. Only one stream is allowed. - Video birden fazla akış içeriyor. Yalnızca bir akışa izin verilir. + Video birden fazla akış içeriyor. Yalnızca tek akışa izin verilir. Unsupported video codec "{{ codec }}". - Desteklenmeyen video codec'i "{{ codec }}". + Desteklenmeyen video codec'i "{{ codec }}". Unsupported video container "{{ container }}". - Desteklenmeyen video kapsayıcısı "{{ container }}". + Desteklenmeyen video kapsayıcısı "{{ container }}". The image file is corrupted. - Görüntü dosyası bozulmuş. + Görüntü dosyası bozulmuş. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Görüntüde piksel sayısı çok az ({{ pixels }}). Beklenen asgari miktar {{ min_pixels }}. + Görüntüdeki piksel sayısı çok az ({{ pixels }}). Beklenen minimum miktar {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Görüntüde çok fazla piksel var ({{ pixels }}). Beklenen maksimum miktar {{ max_pixels }}. + Görüntüdeki piksel sayısı çok fazla ({{ pixels }}). Beklenen maksimum miktar {{ max_pixels }}. This filename does not match the expected charset. - Bu dosya adı beklenen karakter kümesiyle eşleşmiyor. + Bu dosya adı beklenen karakter kümesiyle eşleşmiyor. From aa10d0275f6437906bf133e6a5e0ff875cce024a Mon Sep 17 00:00:00 2001 From: gazi04 Date: Sun, 7 Sep 2025 18:27:41 +0200 Subject: [PATCH 49/74] [Validator] Review Albanian translations --- Resources/translations/validators.sq.xlf | 80 ++++++++++++------------ 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/Resources/translations/validators.sq.xlf b/Resources/translations/validators.sq.xlf index 514dd0fd0..efc280f6a 100644 --- a/Resources/translations/validators.sq.xlf +++ b/Resources/translations/validators.sq.xlf @@ -61,23 +61,23 @@ This value is not a valid email address. - Kjo vlerë nuk është adresë email-i e vlefshme. + Kjo vlerë nuk është email adresë e vlefshme. The file could not be found. - Skeda nuk u gjet. + Fajli nuk u gjet. The file is not readable. - Skeda nuk është e lexueshme. + Fajli nuk është e lexueshme. The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. - Skeda është shumë e madhe ({{ size }} {{ suffix }}). Madhësia maksimale e lejuar është {{ limit }} {{ suffix }}. + Fajli është shumë e madhe ({{ size }} {{ suffix }}). Madhësia maksimale e lejuar është {{ limit }} {{ suffix }}. The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - Lloji “mime” i skedës është i pavlefshëm ({{ type }}). Llojet “mime” të lejuara janë {{ types }}. + Lloji “mime” i fajlit është i pavlefshëm ({{ type }}). Llojet “mime” të lejuara janë {{ types }}. This value should be {{ limit }} or less. @@ -125,15 +125,15 @@ The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. - Kjo skedë është shumë e madhe. Madhësia maksimale e lejuar është {{ limit }} {{ suffix }}. + Ky fajl është shumë i madhë. Madhësia maksimale e lejuar është {{ limit }} {{ suffix }}. The file is too large. - Kjo skedë është shumë e madhe. + Ky fajl është shumë i madhë. The file could not be uploaded. - Kjo skedë nuk mund të ngarkohet. + Ky fajl nuk mund të ngarkohet. This value should be a valid number. @@ -141,7 +141,7 @@ This file is not a valid image. - Kjo skedë nuk është një imazh i vlefshëm. + Ky fajl nuk është një imazh i vlefshëm. This value is not a valid IP address. @@ -193,19 +193,19 @@ The file was only partially uploaded. - Kjo skedë është ngarkuar pjesërisht. + Ky fajl është ngarkuar pjesërisht. No file was uploaded. - Nuk është ngarkuar ndonjë skedë. + Nuk është ngarkuar ndonjë fajl. No temporary folder was configured in php.ini, or the configured folder does not exist. - Nuk është konfiguruar asnjë skedar i përkohshëm në php.ini, ose skedari i konfiguruar nuk ekziston. + Nuk është konfiguruar asnjë dosje e përkohshëm në php.ini, ose dosja e konfiguruar nuk ekziston. Cannot write temporary file to disk. - Nuk mund të shkruhet skeda e përkohshme në disk. + Nuk mund të shkruhet fajli e përkohshme në disk. A PHP extension caused the upload to fail. @@ -229,7 +229,7 @@ Unsupported card type or invalid card number. - Lloj karte i papranuar ose numër karte i pavlefshëm. + Lloji i kartës i papërkrahur ose numër kartës i pavlefshëm. This value is not a valid International Bank Account Number (IBAN). @@ -309,7 +309,7 @@ An empty file is not allowed. - Një skedë e zbrazët nuk lejohet. + Një fajl i zbrazët nuk lejohet. The host could not be resolved. @@ -413,7 +413,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. - Emri i skedës është shumë i gjatë. Duhet të ketë maksimumi {{ filename_max_length }} karakter ose më pak.|Emri i skedës është shumë i gjatë. Duhet të ketë maksimumi {{ filename_max_length }} karaktere ose më pak. + Emri i fajlit është shumë i gjatë. Duhet të ketë maksimumi {{ filename_max_length }} karakter ose më pak.|Emri i fajlit është shumë i gjatë. Duhet të ketë maksimumi {{ filename_max_length }} karaktere ose më pak. The password strength is too low. Please use a stronger password. @@ -437,7 +437,7 @@ The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}. - Shtesa e skedarit është e pavlefshme ({{ extension }}). Shtesat e lejuara janë {{ extensions }}. + Shtesa e fajlit është e pavlefshme ({{ extension }}). Shtesat e lejuara janë {{ extensions }}. The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. @@ -481,87 +481,87 @@ This file is not a valid video. - Ky skedar nuk është video e vlefshme. + Ky fajl nuk është video e vlefshme. The size of the video could not be detected. - Nuk u zbulua dot madhësia e videos. + Madhësia e videos nuk mund të zbulohej. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Gjerësia e videos është shumë e madhe ({{ width }}px). Gjerësia maksimale e lejuar është {{ max_width }}px. + Gjerësia e videos është shumë e madhe ({{ width }}px). Gjerësia maksimale e lejuar është {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Gjerësia e videos është shumë e vogël ({{ width }}px). Gjerësia minimale e pritur është {{ min_width }}px. + Gjerësia e videos është shumë e vogël ({{ width }}px). Gjerësia minimale e pritur është {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Lartësia e videos është shumë e madhe ({{ height }}px). Lartësia maksimale e lejuar është {{ max_height }}px. + Lartësia e videos është shumë e madhe ({{ height }}px). Lartësia maksimale e lejuar është {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Lartësia e videos është shumë e vogël ({{ height }}px). Lartësia minimale e pritshme është {{ min_height }}px. + Lartësia e videos është shumë e vogël ({{ height }}px). Lartësia minimale e pritur është {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Video ka shumë pak pikselë ({{ pixels }}). Sasia minimale e pritur është {{ min_pixels }}. + Video ka shumë pak pikselë ({{ pixels }}). Sasia minimale e pritur është {{ min_pixels }}px. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Videoja ka tepër piksele ({{ pixels }}). Sasia maksimale e pritur është {{ max_pixels }}. + Videoja ka tepër piksele ({{ pixels }}). Sasia maksimale e pritur është {{ max_pixels }}px. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Raporti i videos është shumë i madh ({{ ratio }}). Raporti maksimal i lejuar është {{ max_ratio }}. + Raporti i videos është shumë i madh ({{ ratio }}). Raporti maksimal i lejuar është {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Raporti i videos është shumë i vogël ({{ ratio }}). Raporti minimal i pritshëm është {{ min_ratio }}. + Raporti i videos është shumë i vogël ({{ ratio }}). Raporti minimal i pritur është {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Videoja është katrore ({{ width }}x{{ height }}px). Videot katrore nuk lejohen. + Videoja është katrore ({{ width }}x{{ height }}px). Videot katrore nuk lejohen. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Videoja është me orientim horizontal ({{ width }}x{{ height }} px). Videot horizontale nuk lejohen. + Videoja është me orientim horizontal ({{ width }}x{{ height }}px). Videot horizontale nuk lejohen. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Videoja është me orientim portret ({{ width }}x{{ height }}px). Videot me orientim portret nuk lejohen. + Videoja është me orientim portret ({{ width }}x{{ height }}px). Videot me orientim portret nuk lejohen. The video file is corrupted. - Skedari i videos është i korruptuar. + Fajli i videos është i korruptuar. The video contains multiple streams. Only one stream is allowed. - Videoja përmban disa rrjedha. Lejohet vetëm një rrjedhë. + Videoja përmban disa rrjedha. Lejohet vetëm një rrjedhë. Unsupported video codec "{{ codec }}". - Kodek video i pambështetur „{{ codec }}“. + Kodeku videos është i pambështetur „{{ codec }}“. Unsupported video container "{{ container }}". - Konteiner video i pambështetur "{{ container }}". + Kontejneri videos është i pambështetur "{{ container }}". The image file is corrupted. - Skedari i imazhit është i dëmtuar. + Fajli i imazhit është korruptuar. - The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Imazhi ka shumë pak pikselë ({{ pixels }}). Sasia minimale e pritur është {{ min_pixels }}. + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }}px. + Imazhi ka shumë pak pikselë ({{ pixels }}). Sasia minimale e pritur është {{ min_pixels }}px. - The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Imazhi ka shumë pikselë ({{ pixels }}). Shuma maksimale e pritur është {{ max_pixels }}. + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }}px. + Imazhi ka shumë pikselë ({{ pixels }}). Shuma maksimale e pritur është {{ max_pixels }}px. This filename does not match the expected charset. - Ky emër skedari nuk përputhet me grupin e pritur të karaktereve. + Ky emër fajlit nuk përputhet me grupin e pritur të karaktereve. From 873ca3d01948d218d5b01c0ea80e8b5984341c95 Mon Sep 17 00:00:00 2001 From: Orban Florin Date: Tue, 9 Sep 2025 11:31:46 +0300 Subject: [PATCH 50/74] [Validator] Review Romanian translations --- Resources/translations/validators.ro.xlf | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Resources/translations/validators.ro.xlf b/Resources/translations/validators.ro.xlf index 724368fdb..e4e27570a 100644 --- a/Resources/translations/validators.ro.xlf +++ b/Resources/translations/validators.ro.xlf @@ -472,87 +472,87 @@ This file is not a valid video. - Acest fișier nu este un videoclip valid. + Acest fișier nu este un videoclip valid. The size of the video could not be detected. - Dimensiunea videoclipului nu a putut fi detectată. + Dimensiunea videoclipului nu a putut fi detectată. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Lățimea videoclipului este prea mare ({{ width }}px). Lățimea maximă permisă este {{ max_width }}px. + Lățimea videoclipului este prea mare ({{ width }}px). Lățimea maximă permisă este {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Lățimea videoclipului este prea mică ({{ width }}px). Lățimea minimă așteptată este {{ min_width }}px. + Lățimea videoclipului este prea mică ({{ width }}px). Lățimea minimă așteptată este {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Înălțimea videoclipului este prea mare ({{ height }}px). Înălțimea maximă permisă este {{ max_height }}px. + Înălțimea videoclipului este prea mare ({{ height }}px). Înălțimea maximă permisă este {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Înălțimea videoclipului este prea mică ({{ height }}px). Înălțimea minimă așteptată este {{ min_height }}px. + Înălțimea videoclipului este prea mică ({{ height }}px). Înălțimea minimă așteptată este {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Videoclipul are prea puțini pixeli ({{ pixels }}). Cantitatea minimă așteptată este {{ min_pixels }}. + Videoclipul are prea puțini pixeli ({{ pixels }}). Cantitatea minimă așteptată este {{ min_pixels }}. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Videoclipul are prea mulți pixeli ({{ pixels }}). Cantitatea maximă așteptată este {{ max_pixels }}. + Videoclipul are prea mulți pixeli ({{ pixels }}). Cantitatea maximă așteptată este {{ max_pixels }}. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Raportul video este prea mare ({{ ratio }}). Raportul maxim permis este {{ max_ratio }}. + Raportul video este prea mare ({{ ratio }}). Raportul maxim permis este {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Raportul video este prea mic ({{ ratio }}). Raportul minim așteptat este {{ min_ratio }}. + Raportul video este prea mic ({{ ratio }}). Raportul minim așteptat este {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Videoclipul este pătrat ({{ width }}x{{ height }}px). Videoclipurile pătrate nu sunt permise. + Videoclipul este pătrat ({{ width }}x{{ height }}px). Videoclipurile pătrate nu sunt permise. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Videoclipul are orientare peisaj ({{ width }}x{{ height }} px). Videoclipurile în orientare peisaj nu sunt permise. + Videoclipul are orientare peisaj ({{ width }}x{{ height }} px). Videoclipurile în orientare peisaj nu sunt permise. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Videoclipul este în orientare portret ({{ width }}x{{ height }}px). Videoclipurile cu orientare portret nu sunt permise. + Videoclipul este în orientare portret ({{ width }}x{{ height }}px). Videoclipurile cu orientare portret nu sunt permise. The video file is corrupted. - Fișierul video este corupt. + Fișierul video este corupt. The video contains multiple streams. Only one stream is allowed. - Videoclipul conține mai multe fluxuri. Doar un singur flux este permis. + Videoclipul conține mai multe fluxuri. Doar un singur flux este permis. Unsupported video codec "{{ codec }}". - Codec video neacceptat „{{ codec }}”. + Codec video nesuportat „{{ codec }}”. Unsupported video container "{{ container }}". - Container video nesuportat "{{ container }}". + Container video nesuportat "{{ container }}". The image file is corrupted. - Fișierul imagine este deteriorat. + Fișierul imagine este corupt. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Imaginea are prea puțini pixeli ({{ pixels }}). Cantitatea minimă așteptată este {{ min_pixels }}. + Imaginea are prea puțini pixeli ({{ pixels }}). Cantitatea minimă așteptată este {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Imaginea are prea mulți pixeli ({{ pixels }}). Cantitatea maximă așteptată este {{ max_pixels }}. + Imaginea are prea mulți pixeli ({{ pixels }}). Cantitatea maximă așteptată este {{ max_pixels }}. This filename does not match the expected charset. - Acest nume de fișier nu corespunde setului de caractere așteptat. + Acest nume de fișier nu corespunde setului de caractere așteptat. From f264292c122d7cded8c9e3e57dc912dfbe6bf50b Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 9 Sep 2025 11:27:00 +0200 Subject: [PATCH 51/74] restore translation source entries --- Resources/translations/validators.sq.xlf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/translations/validators.sq.xlf b/Resources/translations/validators.sq.xlf index efc280f6a..0561705a6 100644 --- a/Resources/translations/validators.sq.xlf +++ b/Resources/translations/validators.sq.xlf @@ -552,11 +552,11 @@ Fajli i imazhit është korruptuar. - The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }}px. + The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. Imazhi ka shumë pak pikselë ({{ pixels }}). Sasia minimale e pritur është {{ min_pixels }}px. - The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }}px. + The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. Imazhi ka shumë pikselë ({{ pixels }}). Shuma maksimale e pritur është {{ max_pixels }}px. From dcd100eeda23afbeca9ba3228865d8d66e8bfc46 Mon Sep 17 00:00:00 2001 From: fbuchlak <30214087+fbuchlak@users.noreply.github.com> Date: Tue, 9 Sep 2025 14:48:32 +0200 Subject: [PATCH 52/74] [Validator] Review Slovak translations --- Resources/translations/validators.sk.xlf | 46 ++++++++++++------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Resources/translations/validators.sk.xlf b/Resources/translations/validators.sk.xlf index dd86c1ddd..e79521321 100644 --- a/Resources/translations/validators.sk.xlf +++ b/Resources/translations/validators.sk.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - Táto hodnota nie je platná IP adresa. + Táto hodnota nie je platná IP adresa. This value is not a valid language. @@ -468,91 +468,91 @@ This value is not a valid Twig template. - Táto hodnota nie je platná šablóna Twig. + Táto hodnota nie je platnou Twig šablónou. This file is not a valid video. - Tento súbor nie je platné video. + Tento súbor nie je platné video. The size of the video could not be detected. - Veľkosť videa sa nepodarilo zistiť. + Veľkosť videa sa nepodarilo zistiť. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Šírka videa je príliš veľká ({{ width }}px). Povolená maximálna šírka je {{ max_width }}px. + Šírka videa je príliš veľká ({{ width }}px). Povolená maximálna šírka je {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Šírka videa je príliš malá ({{ width }}px). Očakávaná minimálna šírka je {{ min_width }} px. + Šírka videa je príliš malá ({{ width }}px). Očakávaná minimálna šírka je {{ min_width }} px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Výška videa je príliš veľká ({{ height }}px). Povolená maximálna výška je {{ max_height }}px. + Výška videa je príliš veľká ({{ height }}px). Povolená maximálna výška je {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Výška videa je príliš malá ({{ height }}px). Očakávaná minimálna výška je {{ min_height }}px. + Výška videa je príliš malá ({{ height }}px). Očakávaná minimálna výška je {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Video má príliš málo pixelov ({{ pixels }}). Očakávané minimálne množstvo je {{ min_pixels }}. + Video má príliš málo pixelov ({{ pixels }}). Očakávané minimálne množstvo je {{ min_pixels }}. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Video má príliš veľa pixelov ({{ pixels }}). Očakávané maximum je {{ max_pixels }}. + Video má príliš veľa pixelov ({{ pixels }}). Očakávané maximálne množstvo je {{ max_pixels }}. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Pomer videa je príliš veľký ({{ ratio }}). Povolený maximálny pomer je {{ max_ratio }}. + Pomer strán videa je príliš veľký ({{ ratio }}). Povolený maximálny pomer strán je {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Pomer videa je príliš malý ({{ ratio }}). Očakávaný minimálny pomer je {{ min_ratio }}. + Pomer strán videa je príliš malý ({{ ratio }}). Očakávaný minimálny pomer strán je {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Video je štvorcové ({{ width }}x{{ height }}px). Štvorcové videá nie sú povolené. + Video je štvorcové ({{ width }}x{{ height }}px). Štvorcové videá nie sú povolené. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Video je na šírku ({{ width }}x{{ height }} px). Videá na šírku nie sú povolené. + Video je orientované na šírku ({{ width }}x{{ height }} px). Videá orientované na šírku nie sú povolené. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Video je orientované na výšku ({{ width }}x{{ height }}px). Videá s orientáciou na výšku nie sú povolené. + Video je orientované na výšku ({{ width }}x{{ height }}px). Videá orientované na výšku nie sú povolené. The video file is corrupted. - Videosúbor je poškodený. + Videosúbor je poškodený. The video contains multiple streams. Only one stream is allowed. - Video obsahuje viacero tokov. Povolený je len jeden tok. + Video obsahuje viacero tokov. Povolený je len jeden tok. Unsupported video codec "{{ codec }}". - Nepodporovaný videokodek „{{ codec }}“. + Nepodporovaný videokodek "{{ codec }}". Unsupported video container "{{ container }}". - Nepodporovaný kontajner videa "{{ container }}". + Nepodporovaný kontajner videa "{{ container }}". The image file is corrupted. - Súbor obrázka je poškodený. + Súbor obrázka je poškodený. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Obrázok má príliš málo pixelov ({{ pixels }}). Očakávané minimum je {{ min_pixels }}. + Obrázok má príliš málo pixelov ({{ pixels }}). Očakávané minimálne množstvo je {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Obrázok má príliš veľa pixelov ({{ pixels }}). Očakávané maximum je {{ max_pixels }}. + Obrázok má príliš veľa pixelov ({{ pixels }}). Očakávané maximálne množstvo je {{ max_pixels }}. This filename does not match the expected charset. - Tento názov súboru nezodpovedá očakávanej znakovej sade. + Tento názov súboru nezodpovedá očakávanej znakovej sade. From 38bca4692f27dc5377ced2a71758999e719b2c72 Mon Sep 17 00:00:00 2001 From: Ahmed Soliman Date: Wed, 17 Sep 2025 23:28:46 +0200 Subject: [PATCH 53/74] Update Arabic translations for video and image validation messages, native translations --- Resources/translations/validators.ar.xlf | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Resources/translations/validators.ar.xlf b/Resources/translations/validators.ar.xlf index 99c5dde9c..783f63dd7 100644 --- a/Resources/translations/validators.ar.xlf +++ b/Resources/translations/validators.ar.xlf @@ -472,87 +472,87 @@ This file is not a valid video. - هذا الملف ليس فيديو صالحًا. + هذا الملف غير صالح كفيديو. The size of the video could not be detected. - تعذّر اكتشاف حجم الفيديو. + تعذّر تحديد حجم الفيديو. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - عرض الفيديو كبير جدًا ({{ width }}px). الحد الأقصى المسموح للعرض هو {{ max_width }}px. + عرض الفيديو كبير جدًا ({{ width }}px). الحد الأقصى المسموح للعرض هو {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - عرض الفيديو صغير جدًا ({{ width }}px). العرض الأدنى المتوقع هو {{ min_width }} بكسل. + عرض الفيديو صغير جدًا ({{ width }}px). العرض الأدنى المتوقع هو {{ min_width }} بكسل. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - ارتفاع الفيديو كبير جدًا ({{ height }}px). الحد الأقصى المسموح للارتفاع هو {{ max_height }}px. + ارتفاع الفيديو كبير جدًا ({{ height }}px). الحد الأقصى المسموح للارتفاع هو {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - ارتفاع الفيديو صغير جدًا ({{ height }} بكسل). الارتفاع الأدنى المتوقع هو {{ min_height }} بكسل. + ارتفاع الفيديو صغير جدًا ({{ height }} بكسل). الارتفاع الأدنى المتوقع هو {{ min_height }} بكسل. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - الفيديو يحتوي على عدد قليل جدًا من البكسلات ({{ pixels }}). الحد الأدنى المتوقع هو {{ min_pixels }}. + الفيديو منخفض الجودة جداً ({{ pixels }} بكسل). الحد الأدنى المتوقع هو {{ min_pixels }} بكسل. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - الفيديو يحتوي على عدد كبير جدًا من البكسلات ({{ pixels }}). الحد الأقصى المتوقع هو {{ max_pixels }}. + دقة الفيديو مرتفعة جداً ({{ pixels }} بكسل). الحد الأقصى المتوقع هو {{ max_pixels }} بكسل. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - نسبة الفيديو كبيرة جدًا ({{ ratio }}). الحد الأقصى المسموح للنسبة هو {{ max_ratio }}. + نسبة أبعاد الفيديو كبيرة جدًا ({{ ratio }}). أعلى نسبة متوقعة هي {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - نسبة الفيديو صغيرة جدًا ({{ ratio }}). النسبة الدنيا المتوقعة هي {{ min_ratio }}. + نسبة أبعاد الفيديو صغيرة جدًا ({{ ratio }}). أقل نسبة متوقعة هي {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - الفيديو مربع ({{ width }}x{{ height }}px). مقاطع الفيديو المربعة غير مسموح بها. + الفيديو مربع ({{ width }}x{{ height }}px). مقاطع الفيديو ذات الشكل المربع غير مسموح بها. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - الفيديو بوضعية أفقية ({{ width }}x{{ height }} بكسل). مقاطع الفيديو الأفقية غير مسموح بها. + الفيديو بوضعية أفقية ({{ width }}x{{ height }} بكسل). مقاطع الفيديو الأفقية غير مسموح بها. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - الفيديو ذو اتجاه عمودي ({{ width }}x{{ height }} بكسل). مقاطع الفيديو ذات الاتجاه العمودي غير مسموح بها. + الفيديو ذو اتجاه عمودي ({{ width }}x{{ height }} بكسل). مقاطع الفيديو ذات الاتجاه العمودي غير مسموح بها. The video file is corrupted. - ملف الفيديو تالف. + ملف الفيديو تالف. The video contains multiple streams. Only one stream is allowed. - يحتوي الفيديو على عدة تدفقات. يُسمح بتدفق واحد فقط. + الفيديو يحتوي على عدة مسارات (صوت أو صورة)، ومسموح بمسار واحد فقط. Unsupported video codec "{{ codec }}". - برنامج ترميز فيديو غير مدعوم "{{ codec }}". + الترميز المستخدم في الفيديو غير مدعوم. "{{ codec }}". Unsupported video container "{{ container }}". - حاوية فيديو غير مدعومة "{{ container }}". + ملف الفيديو بصيغة غير مدعومة "{{ container }}". The image file is corrupted. - ملف الصورة تالف. + ملف الصورة تالف. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - تحتوي الصورة على عدد قليل جدًا من البكسلات ({{ pixels }}). الحد الأدنى المتوقع هو {{ min_pixels }}. + الصورة منخفضة الجودة جدًا ({{ pixels }} بكسل)، و الحد الأدنى المتوقع: {{ min_pixels }} بكسل. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - تحتوي الصورة على عدد كبير جدا من البكسلات ({{ pixels }}). العدد الأقصى المتوقع هو {{ max_pixels }}. + جودة الصورة مرتفعة جدًا ({{ pixels }} بكسل). العدد الأقصى المتوقع هو {{ max_pixels }} بكسل. This filename does not match the expected charset. - اسم الملف هذا لا يطابق مجموعة المحارف المتوقعة. + اسم الملف يحتوي على أحرف غير مسموح بها. From 986931185f0a8e1a28131bf80f02cfc507c623fd Mon Sep 17 00:00:00 2001 From: Alexander Kim Date: Fri, 19 Sep 2025 12:13:33 -0400 Subject: [PATCH 54/74] [Validator] Expression constraint docblock incorrectly states default value for negate --- Constraints/Expression.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Constraints/Expression.php b/Constraints/Expression.php index 750c6f8fc..f40577d7b 100644 --- a/Constraints/Expression.php +++ b/Constraints/Expression.php @@ -44,7 +44,7 @@ class Expression extends Constraint * @param array|null $values The values of the custom variables used in the expression (defaults to an empty array) * @param string[]|null $groups * @param array|null $options - * @param bool|null $negate Whether to fail if the expression evaluates to true (defaults to false) + * @param bool|null $negate When set to true, if the expression returns true, the validation will pass (defaults to true) */ #[HasNamedArguments] public function __construct( From 418d2a0650ac7a4bf0e0cc694e72e53ed1764168 Mon Sep 17 00:00:00 2001 From: Dmytro Liashko Date: Tue, 23 Sep 2025 21:21:57 +0200 Subject: [PATCH 55/74] =?UTF-8?q?[Validator]=20Reviewed=20and=20corrected?= =?UTF-8?q?=20Ukrainian=20translations=20for=20the=20Val=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Resources/translations/validators.uk.xlf | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Resources/translations/validators.uk.xlf b/Resources/translations/validators.uk.xlf index 96813fd23..587301575 100644 --- a/Resources/translations/validators.uk.xlf +++ b/Resources/translations/validators.uk.xlf @@ -472,87 +472,87 @@ This file is not a valid video. - Цей файл не є дійсним відео. + Цей файл не є допустимим відеофайлом. The size of the video could not be detected. - Не вдалося визначити розмір відео. + Не вдалося визначити розмір відеофайлу. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Ширина відео занадто велика ({{ width }}px). Допустима максимальна ширина — {{ max_width }}px. + Ширина відеофайлу занадто велика ({{ width }}px). Максимально допустима ширина {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Ширина відео занадто мала ({{ width }}px). Очікувана мінімальна ширина — {{ min_width }}px. + Ширина відеофайлу занадто мала ({{ width }}px). Мінімально допустима ширина {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Висота відео занадто велика ({{ height }}px). Дозволена максимальна висота — {{ max_height }}px. + Висота відеофайлу занадто велика ({{ height }}px). Максимально допустима висота {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Висота відео занадто мала ({{ height }}px). Очікувана мінімальна висота — {{ min_height }}px. + Висота відеофайлу занадто мала ({{ height }}px). Мінімально допустима висота {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - У відео занадто мало пікселів ({{ pixels }}). Очікувана мінімальна кількість — {{ min_pixels }}. + Кількість пікселів у відеофайлі занадто мала ({{ pixels }} пікселів). Мінімально допустима кількість {{ min_pixels }} пікселів. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - У відео забагато пікселів ({{ pixels }}). Очікувана максимальна кількість — {{ max_pixels }}. + Кількість пікселів у відеофайлі занадто велика ({{ pixels }} пікселів). Максимально допустима кількість {{ max_pixels }} пікселів. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Співвідношення сторін відео занадто велике ({{ ratio }}). Допустиме максимальне співвідношення — {{ max_ratio }}. + Співвідношення сторін відеофайлу занадто велике ({{ ratio }}). Максимально допустиме співвідношення сторін {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Співвідношення сторін відео надто мале ({{ ratio }}). Очікуване мінімальне співвідношення — {{ min_ratio }}. + Співвідношення сторін відеофайлу занадто мале ({{ ratio }}). Мінімально допустиме співвідношення сторін {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Відео квадратне ({{ width }}x{{ height }}px). Квадратні відео не дозволені. + Відеофайл має квадратні пропорції ({{ width }}x{{ height }}px). Квадратні відеофайли не дозволені. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Відео в альбомній орієнтації ({{ width }}x{{ height }} px). Відео в альбомній орієнтації заборонені. + Відеофайл в альбомній орієнтації ({{ width }}x{{ height }}px). Відеофайли в альбомній орієнтації не дозволені. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Відео має портретну орієнтацію ({{ width }}x{{ height }}px). Відео з портретною орієнтацією не дозволені. + Відеофайл у портретній орієнтації ({{ width }}x{{ height }}px). Відеофайли у портретній орієнтації не дозволені. The video file is corrupted. - Відеофайл пошкоджено. + Відеофайл пошкоджено. The video contains multiple streams. Only one stream is allowed. - Відео містить кілька потоків. Дозволено лише один потік. + Відеофайл містить кілька потоків. Дозволено лише один потік. Unsupported video codec "{{ codec }}". - Непідтримуваний відеокодек «{{ codec }}». + Непідтримуваний відеокодек «{{ codec }}». Unsupported video container "{{ container }}". - Непідтримуваний відеоконтейнер "{{ container }}". + Непідтримуваний відеоконтейнер "{{ container }}". The image file is corrupted. - Файл зображення пошкоджений. + Файл зображення пошкоджено. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Зображення має надто мало пікселів ({{ pixels }}). Очікувана мінімальна кількість — {{ min_pixels }}. + Кількість пікселів у зображенні занадто мала ({{ pixels }} пікселів). Мінімально допустима кількість {{ min_pixels }} пікселів. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Зображення має надто багато пікселів ({{ pixels }}). Очікувана максимальна кількість — {{ max_pixels }}. + Кількість пікселів у зображенні занадто велика ({{ pixels }} пікселів). Максимально допустима кількість {{ max_pixels }} пікселів. This filename does not match the expected charset. - Ця назва файлу не відповідає очікуваному набору символів. + Назва файлу не відповідає очікуваному набору символів. From 3ed456b3cd04e61fc7ed2601805fee3c1130663a Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 25 Sep 2025 17:28:13 +0200 Subject: [PATCH 56/74] do not coerce NAN to other types --- ConstraintValidator.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ConstraintValidator.php b/ConstraintValidator.php index 3c4167be3..60808258c 100644 --- a/ConstraintValidator.php +++ b/ConstraintValidator.php @@ -127,6 +127,10 @@ protected function formatValue(mixed $value, int $format = 0): string return 'true'; } + if (is_nan($value)) { + return 'NAN'; + } + return (string) $value; } From e5a1c0db7bafb9401fd6d1b0938afa02a80f4f2c Mon Sep 17 00:00:00 2001 From: Jan Dobrovodsky Date: Tue, 30 Sep 2025 14:58:28 +0200 Subject: [PATCH 57/74] [Validator] Review and fix Czech translation - review and fix strings marked for review - fix several discrepancies in related strings to bring them in line with rest of translation --- Resources/translations/validators.cs.xlf | 56 ++++++++++++------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/Resources/translations/validators.cs.xlf b/Resources/translations/validators.cs.xlf index c75e33c45..11a8cbab8 100644 --- a/Resources/translations/validators.cs.xlf +++ b/Resources/translations/validators.cs.xlf @@ -160,19 +160,19 @@ The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Obrázek je příliš široký ({{ width }}px). Maximální povolená šířka obrázku je {{ max_width }}px. + Obrázek je příliš široký ({{ width }}px). Maximální povolená šířka je {{ max_width }}px. The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Obrázek je příliš úzký ({{ width }}px). Minimální šířka musí být {{ min_width }}px. + Obrázek je příliš úzký ({{ width }}px). Minimální očekávaná šířka je {{ min_width }}px. The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Obrázek je příliš vysoký ({{ height }}px). Maximální povolená výška obrázku je {{ max_height }}px. + Obrázek je příliš vysoký ({{ height }}px). Maximální povolená výška je {{ max_height }}px. The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Obrázek je příliš nízký ({{ height }}px). Minimální výška obrázku musí být {{ min_height }}px. + Obrázek je příliš nízký ({{ height }}px). Minimální očekávaná výška je {{ min_height }}px. This value should be the user's current password. @@ -280,15 +280,15 @@ The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Poměr stran obrázku je příliš velký ({{ ratio }}). Maximální povolený poměr stran obrázku je {{ max_ratio }}. + Poměr stran obrázku je příliš velký ({{ ratio }}). Maximální povolený poměr stran je {{ max_ratio }}. The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Poměr stran obrázku je příliš malý ({{ ratio }}). Minimální povolený poměr stran obrázku je {{ min_ratio }}. + Poměr stran obrázku je příliš malý ({{ ratio }}). Minimální očekávaný poměr stran je {{ min_ratio }}. The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Strany obrázku jsou čtvercové ({{ width }}x{{ height }}px). Čtvercové obrázky nejsou povolené. + Obrázek je čtvercový ({{ width }}x{{ height }}px). Čtvercové obrázky nejsou povolené. The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. @@ -472,87 +472,87 @@ This file is not a valid video. - Tento soubor není platné video. + Tento soubor není video. The size of the video could not be detected. - Velikost videa se nepodařilo zjistit. + Nepodařily se zjistit rozměry videa. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Šířka videa je příliš velká ({{ width }}px). Povolená maximální šířka je {{ max_width }}px. + Video je příliš široké ({{ width }}px). Maximální povolená šířka je {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Šířka videa je příliš malá ({{ width }}px). Minimální očekávaná šířka je {{ min_width }} px. + Video je příliš úzké ({{ width }}px). Minimální očekávaná šířka je {{ min_width }} px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Výška videa je příliš velká ({{ height }}px). Povolená maximální výška je {{ max_height }}px. + Video je příliš vysoké ({{ height }}px). Maximální povolená výška je {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Výška videa je příliš malá ({{ height }}px). Očekávaná minimální výška je {{ min_height }}px. + Video je příliš nízké ({{ height }}px). Minimální očekávaná výška je {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Video má příliš málo pixelů ({{ pixels }}). Očekávané minimální množství je {{ min_pixels }}. + Video má příliš málo pixelů ({{ pixels }} pixelů). Minimální očekávané množství je {{ min_pixels }} pixelů. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Video má příliš mnoho pixelů ({{ pixels }}). Očekávané maximum je {{ max_pixels }}. + Video má příliš mnoho pixelů ({{ pixels }} pixelů). Maximální očekávané množství je {{ max_pixels }} pixelů. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Poměr videa je příliš velký ({{ ratio }}). Povolený maximální poměr je {{ max_ratio }}. + Poměr stran videa je příliš velký ({{ ratio }}). Maximální povolený poměr stran je {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Poměr videa je příliš malý ({{ ratio }}). Minimální očekávaný poměr je {{ min_ratio }}. + Poměr stran videa je příliš malý ({{ ratio }}). Minimální očekávaný poměr stran je {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Video je čtvercové ({{ width }}x{{ height }}px). Čtvercová videa nejsou povolena. + Video je čtvercové ({{ width }}x{{ height }}px). Čtvercová videa nejsou povolená. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Video je na šířku ({{ width }}x{{ height }} px). Videa na šířku nejsou povolena. + Video je orientované na šířku ({{ width }}x{{ height }} px). Videa orientovaná na šířku nejsou povolená. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Video je orientován na výšku ({{ width }}x{{ height }} px). Videa na výšku nejsou povolena. + Video je orientované na výšku ({{ width }}x{{ height }} px). Videa orientovaná na výšku nejsou povolená. The video file is corrupted. - Videosoubor je poškozen. + Soubor videa je poškozený. The video contains multiple streams. Only one stream is allowed. - Video obsahuje více streamů. Povolen je pouze jeden stream. + Video obsahuje více proudů. Povolen je pouze jeden proud. Unsupported video codec "{{ codec }}". - Nepodporovaný video kodek „{{ codec }}“. + Nepodporovaný kodek videa "{{ codec }}". Unsupported video container "{{ container }}". - Nepodporovaný videokontejner "{{ container }}". + Nepodporovaný kontejner videa "{{ container }}". The image file is corrupted. - Soubor obrázku je poškozen. + Soubor obrázku je poškozený. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Obrázek má příliš málo pixelů ({{ pixels }}). Očekávané minimum je {{ min_pixels }}. + Obrázek má příliš málo pixelů ({{ pixels }} pixelů). Minimální očekávané množství je {{ min_pixels }} pixelů. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Obrázek má příliš mnoho pixelů ({{ pixels }}). Očekávané maximum je {{ max_pixels }}. + Obrázek má příliš mnoho pixelů ({{ pixels }} pixelů). Maximální očekávané množství je {{ max_pixels }} pixelů. This filename does not match the expected charset. - Název tohoto souboru neodpovídá očekávané znakové sadě. + Tento název souboru neodpovídá očekávané znakové sadě. From 865d5e5e5b87da453f486e165039f879229d4d42 Mon Sep 17 00:00:00 2001 From: czachor Date: Tue, 30 Sep 2025 21:05:50 +0200 Subject: [PATCH 58/74] [Validator] Fix Polish translation for word count validation message Fixed the Polish translation for word count validation message by adding all three required plural forms (instead of two). --- Resources/translations/validators.pl.xlf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/translations/validators.pl.xlf b/Resources/translations/validators.pl.xlf index 7cffa5f72..8f329dcd4 100644 --- a/Resources/translations/validators.pl.xlf +++ b/Resources/translations/validators.pl.xlf @@ -448,7 +448,7 @@ This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. - Ta wartość jest zbyt długa. Powinna zawierać jedno słowo.|Ta wartość jest zbyt długa. Powinna zawierać {{ max }} słów lub mniej. + Ta wartość jest zbyt długa. Powinna zawierać jedno słowo.|Ta wartość jest zbyt długa. Powinna zawierać {{ max }} słowa lub mniej.|Ta 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. From c78e691e2de8afd00ce7aa0985d8baecd6fc1811 Mon Sep 17 00:00:00 2001 From: GK-302 <143247656+GK-302@users.noreply.github.com> Date: Sun, 28 Sep 2025 20:33:07 +0900 Subject: [PATCH 59/74] [Validator] Improve and complete Japanese translations --- Resources/translations/validators.ja.xlf | 174 +++++++++++------------ 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/Resources/translations/validators.ja.xlf b/Resources/translations/validators.ja.xlf index 860696d2c..419b77e09 100644 --- a/Resources/translations/validators.ja.xlf +++ b/Resources/translations/validators.ja.xlf @@ -4,19 +4,19 @@ This value should be false. - falseである必要があります。 + この値はfalseでなければなりません。 This value should be true. - trueである必要があります。 + この値はtrueでなければなりません。 This value should be of type {{ type }}. - {{ type }}型でなければなりません。 + この値は{{ type }}型でなければなりません。 This value should be blank. - 空でなければなりません。 + この値は空でなければなりません。 The value you selected is not a valid choice. @@ -28,7 +28,7 @@ You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. - {{ limit }}個以内で選択してください。 + {{ limit }}個以下で選択してください。 One or more of the given values is invalid. @@ -44,15 +44,15 @@ This value is not a valid date. - 無効な日付です。 + 有効な日付ではありません。 This value is not a valid datetime. - 無効な日時です。 + 有効な日時ではありません。 This value is not a valid email address. - 無効なメールアドレスです。 + 有効なメールアドレスではありません。 The file could not be found. @@ -64,35 +64,35 @@ The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. - ファイルのサイズが大きすぎます({{ size }} {{ suffix }})。ファイルサイズは{{ limit }} {{ suffix }}以下にしてください。 + ファイルのサイズが大きすぎます({{ size }} {{ suffix }})。{{ limit }} {{ suffix }}以下にしてください。 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. - {{ limit }}以下でなければなりません。 + この値は{{ limit }}以下でなければなりません。 This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. - この値は、{{ limit }}文字以内で入力してください。 + 長すぎます。この値は{{ limit }}文字以下で入力してください。 This value should be {{ limit }} or more. - {{ limit }}以上でなければなりません。 + この値は{{ limit }}以上でなければなりません。 This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. - この値は、{{ limit }}文字以上で入力してください。 + 短すぎます。この値は{{ limit }}文字以上で入力してください。 This value should not be blank. - 入力してください。 + この値は空にできません。 This value should not be null. - 入力してください。 + 値を入力してください。 This value should be null. @@ -100,23 +100,23 @@ This value is not valid. - 無効な値です。 + 有効な値ではありません。 This value is not a valid time. - 無効な時刻です。 + 有効な時刻ではありません。 This value is not a valid URL. - 無効なURLです。 + 有効なURLではありません。 The two values should be equal. - 2つの値が同じでなければなりません。 + 2つの値は同じでなければなりません。 The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. - ファイルのサイズが大きすぎます。有効な最大サイズは{{ limit }} {{ suffix }}です。 + ファイルのサイズが大きすぎます。許可されている最大サイズは{{ limit }} {{ suffix }}です。 The file is too large. @@ -128,19 +128,19 @@ This value should be a valid number. - 有効な数値ではありません。 + この値は有効な数値でなければなりません。 This file is not a valid image. - ファイルが画像ではありません。 + 選択されたファイルは有効な画像ではありません。 This value is not a valid IP address. - 無効なIPアドレスです。 + 有効なIPアドレスではありません。 This value is not a valid language. - 無効な言語名です。 + 有効な言語名ではありません。 This value is not a valid locale. @@ -160,19 +160,19 @@ The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - 画像の幅が大きすぎます({{ width }}ピクセル)。{{ max_width }}ピクセル以下にしてください。 + 画像の幅が大きすぎます({{ width }}px)。{{ max_width }}px以下にしてください。 The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - 画像の幅が小さすぎます({{ width }}ピクセル)。{{ min_width }}ピクセル以上にしてください。 + 画像の幅が小さすぎます({{ width }}px)。{{ min_width }}px以上にしてください。 The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - 画像の高さが大きすぎます({{ height }}ピクセル)。{{ max_height }}ピクセル以下にしてください。 + 画像の高さが大きすぎます({{ height }}px)。{{ max_height }}px以下にしてください。 The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - 画像の高さが小さすぎます({{ height }}ピクセル)。{{ min_height }}ピクセル以上にしてください。 + 画像の高さが小さすぎます({{ height }}px)。{{ min_height }}px以上にしてください。 This value should be the user's current password. @@ -180,11 +180,11 @@ This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - {{ limit }}文字ちょうどで入力してください。 + この値は{{ limit }}文字ちょうどで入力してください。 The file was only partially uploaded. - ファイルのアップロードに失敗しました。 + ファイルのアップロードが完了しませんでした。 No file was uploaded. @@ -204,11 +204,11 @@ This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - 少なくとも{{ limit }}個の要素を含む必要があります。 + 要素は{{ limit }}個以上でなければなりません。 This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. - {{ limit }}個以下の要素を含む必要があります。 + 要素は{{ limit }}個以下でなければなりません。 This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. @@ -220,7 +220,7 @@ Unsupported card type or invalid card number. - 未対応のカード種類または無効なカード番号です。 + 対応していないカードまたは無効なカード番号です。 This value is not a valid International Bank Account Number (IBAN). @@ -248,59 +248,59 @@ This value should be equal to {{ compared_value }}. - {{ compared_value }}と同じ値でなければなりません。 + この値は{{ compared_value }}と同じ値でなければなりません。 This value should be greater than {{ compared_value }}. - {{ compared_value }}より大きくなければなりません。 + この値は{{ compared_value }}より大きくなければなりません。 This value should be greater than or equal to {{ compared_value }}. - {{ compared_value }}以上でなければなりません。 + この値は{{ compared_value }}以上でなければなりません。 This value should be identical to {{ compared_value_type }} {{ compared_value }}. - この値は{{ compared_value_type }} {{ compared_value }}と同じでなければなりません。 + この値は{{ compared_value_type }}型の{{ compared_value }}と同じでなければなりません。 This value should be less than {{ compared_value }}. - {{ compared_value }}未満でなければなりません。 + この値は{{ compared_value }}未満でなければなりません。 This value should be less than or equal to {{ compared_value }}. - {{ compared_value }}以下でなければなりません。 + この値は{{ compared_value }}以下でなければなりません。 This value should not be equal to {{ compared_value }}. - {{ compared_value }}と等しくてはいけません。 + この値は{{ compared_value }}と等しくてはいけません。 This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - この値は{{ compared_value_type }}の{{ compared_value }}と異なる値にしてください。 + この値は{{ compared_value_type }}型の{{ compared_value }}と異なる値にしてください。 The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - 画像のアスペクト比が大きすぎます({{ ratio }})。{{ max_ratio }}までにしてください。 + 画像のアスペクト比が大きすぎます({{ ratio }})。{{ max_ratio }}までにしてください。 The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - 画像のアスペクト比が小さすぎます({{ ratio }})。{{ min_ratio }}以上にしてください。 + 画像のアスペクト比が小さすぎます({{ ratio }})。{{ min_ratio }}以上にしてください。 The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - 画像が正方形になっています({{ width }}x{{ height }}ピクセル)。正方形の画像は許可されていません。 + 画像が正方形になっています({{ width }}x{{ height }}px)。正方形の画像は許可されていません。 The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - 画像が横向きになっています({{ width }}x{{ height }}ピクセル)。横向きの画像は許可されていません。 + 画像が横向きになっています({{ width }}x{{ height }}px)。横向きの画像は許可されていません。 The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - 画像が縦向きになっています({{ width }}x{{ height }}ピクセル)。縦向きの画像は許可されていません。 + 画像が縦向きになっています({{ width }}x{{ height }}px)。縦向きの画像は許可されていません。 An empty file is not allowed. - 空のファイルは無効です。 + 空のファイルは許可されていません。 The host could not be resolved. @@ -308,11 +308,11 @@ This value does not match the expected {{ charset }} charset. - 文字コードが{{ charset }}と一致しません。 + この値の文字コードが期待される{{ charset }}と一致しません。 This value is not a valid Business Identifier Code (BIC). - 有効なSWIFTコードではありません。 + 有効な事業者識別コード(BIC)ではありません。 Error @@ -324,7 +324,7 @@ This value should be a multiple of {{ compared_value }}. - {{ compared_value }}の倍数でなければなりません。 + この値は{{ compared_value }}の倍数でなければなりません。 This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. @@ -332,7 +332,7 @@ This value should be valid JSON. - 有効なJSONでなければなりません。 + この値は有効なJSONでなければなりません。 This collection should contain only unique elements. @@ -340,19 +340,19 @@ This value should be positive. - 正の数でなければなりません。 + この値は正の数でなければなりません。 This value should be either positive or zero. - 正の数、または0でなければなりません。 + この値は正の数、または0でなければなりません。 This value should be negative. - 負の数でなければなりません。 + この値は負の数でなければなりません。 This value should be either negative or zero. - 負の数、または0でなければなりません。 + この値は負の数、または0でなければなりません。 This value is not a valid timezone. @@ -364,7 +364,7 @@ This value should be between {{ min }} and {{ max }}. - {{ min }}以上{{ max }}以下でなければなりません。 + この値は{{ min }}以上{{ max }}以下でなければなりません。 This value is not a valid hostname. @@ -376,11 +376,11 @@ This value should satisfy at least one of the following constraints: - 以下の制約のうち少なくとも1つを満たす必要があります: + 以下の制約のうち少なくとも1つを満たさなければなりません。 Each element of this collection should satisfy its own set of constraints. - コレクションの各要素は、それぞれの制約を満たす必要があります。 + コレクションの各要素は、それぞれの制約を満たさなければなりません。 This value is not a valid International Securities Identification Number (ISIN). @@ -388,7 +388,7 @@ This value should be a valid expression. - 有効な式でなければなりません。 + この値は有効な式形式でなければなりません。 This value is not a valid CSS color. @@ -400,7 +400,7 @@ The value of the netmask should be between {{ min }} and {{ max }}. - ネットマスクは{{ min }}から{{ max }}の範囲で入力してください。 + サブネットマスクは{{ min }}から{{ max }}の範囲で入力してください。 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. @@ -428,11 +428,11 @@ The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}. - ファイルの拡張子が無効です({{ extension }})。有効な拡張子は{{ extensions }}です。 + ファイルの拡張子が無効です({{ extension }})。有効な拡張子は{{ extensions }}です。 The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. - 検出された文字コードは無効です({{ detected }})。有効な文字コードは{{ encodings }}です。 + 検出された文字コードは無効です({{ detected }})。有効な文字コードは{{ encodings }}です。 This value is not a valid MAC address. @@ -444,11 +444,11 @@ 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 }}単語以上にする必要があります。 + 短すぎます。この値は{{ min }}単語以上にする必要があります。 This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. - 長すぎます。{{ max }}単語以下にする必要があります。 + 長すぎます。この値は{{ max }}単語以下にする必要があります。 This value does not represent a valid week in the ISO 8601 format. @@ -456,7 +456,7 @@ This value is not a valid week. - 無効な週形式です。 + 有効な週形式ではありません。 This value should not be before week "{{ min }}". @@ -472,87 +472,87 @@ This file is not a valid video. - このファイルは有効な動画ではありません。 + 選択されたファイルは有効な動画ではありません。 The size of the video could not be detected. - 動画のサイズを検出できませんでした。 + 動画のファイルサイズを検出できませんでした。 The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - 動画の幅が大きすぎます({{ width }}px)。許可されている最大幅は {{ max_width }}px です。 + 動画の幅が大きすぎます({{ width }}px)。許可されている最大の幅は {{ max_width }}px です。 The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - 動画の幅が小さすぎます({{ width }}px)。想定される最小幅は {{ min_width }}px です。 + 動画の幅が小さすぎます({{ width }}px)。許可されている最小の幅は {{ min_width }}px です。 The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - 動画の高さが大きすぎます ({{ height }}px)。許可されている最大の高さは {{ max_height }}px です。 + 動画の高さが大きすぎます ({{ height }}px)。許可されている最大の高さは {{ max_height }}px です。 The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - ビデオの高さが小さすぎます ({{ height }}px)。想定される最小高さは {{ min_height }}px です。 + 動画の高さが小さすぎます ({{ height }}px)。許可されている最小の高さは {{ min_height }}px です。 The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - この動画のピクセル数が少なすぎます ({{ pixels }}). 期待される最小量は {{ min_pixels }} です。 + この動画のピクセル数が少なすぎます ({{ pixels }})。許可されている最小ピクセル数は {{ min_pixels }} です。 The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - この動画のピクセル数が多すぎます ({{ pixels }})。想定される最大値は {{ max_pixels }} です。 + この動画のピクセル数が多すぎます ({{ pixels }})。許可されている最大ピクセル数は {{ max_pixels }} です。 The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - 動画の比率が大きすぎます ({{ ratio }})。許可されている最大比率は {{ max_ratio }} です。 + 動画のアスペクト比が大きすぎます ({{ ratio }})。許可されている最大比率は {{ max_ratio }} です。 The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - ビデオのアスペクト比が小さすぎます ({{ ratio }})。想定される最小比率は {{ min_ratio }} です。 + 動画のアスペクト比が小さすぎます ({{ ratio }})。許可されている最小比率は {{ min_ratio }} です。 The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - 動画は正方形です ({{ width }}x{{ height }}px)。正方形の動画は許可されていません。 + 動画は正方形です ({{ width }}x{{ height }}px)。正方形の動画は許可されていません。 The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - 動画は横向きです({{ width }}x{{ height }}px)。横向きの動画は許可されていません。 + 動画は横向きです({{ width }}x{{ height }}px)。横向きの動画は許可されていません。 The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - 動画は縦向きです({{ width }}x{{ height }}px)。縦向きの動画は許可されていません。 + 動画は縦向きです({{ width }}x{{ height }}px)。縦向きの動画は許可されていません。 The video file is corrupted. - ビデオファイルが破損しています。 + 動画ファイルが破損しています。 The video contains multiple streams. Only one stream is allowed. - この動画には複数のストリームが含まれています。許可されるのは1つのストリームのみです。 + この動画には複数のストリームが含まれています。許可されるのは1つのストリームのみです。 Unsupported video codec "{{ codec }}". - サポートされていないビデオコーデック「{{ codec }}」。 + サポートされていないビデオコーデック「{{ codec }}」です。 Unsupported video container "{{ container }}". - サポートされていない動画コンテナ "{{ container }}". + サポートされていない動画コンテナ「{{ container }}」です。 The image file is corrupted. - 画像ファイルが破損しています。 + 画像ファイルが破損しています。 The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - 画像のピクセル数が少なすぎます({{ pixels }})。想定される最小数は {{ min_pixels }} です。 + 画像のピクセル数が少なすぎます({{ pixels }})。許可されている最小ピクセル数は {{ min_pixels }} です。 The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - 画像のピクセル数が多すぎます ({{ pixels }}). 想定される最大値は {{ max_pixels }} です. + 画像のピクセル数が多すぎます({{ pixels }})。許可されている最大ピクセル数は {{ max_pixels }} です。 This filename does not match the expected charset. - このファイル名は期待される文字セットと一致しません。 + このファイル名は期待される文字セットと一致しません。 From dadd0f87788a88962b06451da6f14857fc0821f9 Mon Sep 17 00:00:00 2001 From: Danish Translation Contributor Date: Thu, 2 Oct 2025 17:42:19 +0200 Subject: [PATCH 60/74] [Translation] Update Danish (da) translations - Remove needs-review-translation state from validated translations in security.da.xlf and validators.da.xlf --- Resources/translations/validators.da.xlf | 70 ++++++++++++------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/Resources/translations/validators.da.xlf b/Resources/translations/validators.da.xlf index b94d0785f..ee93fae92 100644 --- a/Resources/translations/validators.da.xlf +++ b/Resources/translations/validators.da.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - Denne værdi er ikke en gyldig IP-adresse. + Denne værdi er ikke en gyldig IP-adresse. 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. - Der blev ikke konfigureret en midlertidig mappe i php.ini, eller den konfigurerede mappe eksisterer ikke. + Der blev ikke konfigureret en midlertidig mappe i php.ini, eller den konfigurerede mappe eksisterer ikke. Cannot write temporary file to disk. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Denne værdi er ikke et gyldigt internationalt bankkontonummer (IBAN). + Denne værdi er ikke et gyldigt internationalt bankkontonummer (IBAN). This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Denne værdi er ikke en gyldig forretningsidentifikationskode (BIC). + Denne værdi er ikke en gyldig forretningsidentifikationskode (BIC). Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Denne værdi er ikke en gyldig UUID. + Denne værdi er ikke en gyldig UUID. This value should be a multiple of {{ compared_value }}. @@ -436,123 +436,123 @@ This value is not a valid MAC address. - Denne værdi er ikke en gyldig MAC-adresse. + Denne værdi er ikke en gyldig MAC-adresse. This URL is missing a top-level domain. - Denne URL mangler et topdomæne. + 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. - Denne værdi er for kort. Den skal indeholde mindst ét ord.|Denne værdi er for kort. Den skal indeholde mindst {{ min }} ord. + Denne værdi er for kort. Den skal indeholde mindst ét ord.|Denne værdi er for kort. Den skal indeholde mindst {{ min }} ord. This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. - Denne værdi er for lang. Den skal indeholde ét ord.|Denne værdi er for lang. Den skal indeholde {{ max }} ord eller færre. + Denne værdi er for lang. Den skal indeholde ét ord.|Denne værdi er for lang. Den skal indeholde {{ max }} ord eller færre. This value does not represent a valid week in the ISO 8601 format. - Denne værdi repræsenterer ikke en gyldig uge i ISO 8601-formatet. + Denne værdi repræsenterer ikke en gyldig uge i ISO 8601-formatet. This value is not a valid week. - Denne værdi er ikke en gyldig uge. + Denne værdi er ikke en gyldig uge. This value should not be before week "{{ min }}". - Denne værdi bør ikke være før uge "{{ min }}". + Denne værdi bør ikke være før uge "{{ min }}". This value should not be after week "{{ max }}". - Denne værdi bør ikke være efter uge "{{ max }}". + Denne værdi bør ikke være efter uge "{{ max }}". This value is not a valid Twig template. - Denne værdi er ikke en gyldig Twig-skabelon. + Denne værdi er ikke en gyldig Twig-skabelon. This file is not a valid video. - Denne fil er ikke en gyldig video. + Denne fil er ikke en gyldig video. The size of the video could not be detected. - Videostørrelsen kunne ikke registreres. + Videostørrelsen kunne ikke registreres. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Videobredden er for stor ({{ width }}px). Tilladt maksimal bredde er {{ max_width }}px. + Videobredden er for stor ({{ width }}px). Tilladt maksimal bredde er {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Videobredden er for lille ({{ width }}px). Mindste forventede bredde er {{ min_width }}px. + Videobredden er for lille ({{ width }}px). Mindste forventede bredde er {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Videoens højde er for stor ({{ height }}px). Tilladt maksimal højde er {{ max_height }}px. + Videoens højde er for stor ({{ height }}px). Tilladt maksimal højde er {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Videoens højde er for lille ({{ height }}px). Forventet minimumshøjde er {{ min_height }}px. + Videoens højde er for lille ({{ height }}px). Forventet minimumshøjde er {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Videoen har for få pixels ({{ pixels }}). Forventet minimum er {{ min_pixels }}. + Videoen har for få pixels ({{ pixels }}). Forventet minimum er {{ min_pixels }}. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Videoen har for mange pixels ({{ pixels }}). Forventet maksimummængde er {{ max_pixels }}. + Videoen har for mange pixels ({{ pixels }}). Forventet maksimummængde er {{ max_pixels }}. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Videoforholdet er for stort ({{ ratio }}). Tilladt maksimalforhold er {{ max_ratio }}. + Videoforholdet er for stort ({{ ratio }}). Tilladt maksimalforhold er {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Videoforholdet er for lille ({{ ratio }}). Forventet minimumsforhold er {{ min_ratio }}. + Videoforholdet er for lille ({{ ratio }}). Forventet minimumsforhold er {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Videoen er kvadratisk ({{ width }}x{{ height }}px). Kvadratiske videoer er ikke tilladt. + Videoen er kvadratisk ({{ width }}x{{ height }}px). Kvadratiske videoer er ikke tilladt. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Videoen er i liggende format ({{ width }}x{{ height }} px). Liggende videoer er ikke tilladt. + Videoen er i liggende format ({{ width }}x{{ height }} px). Liggende videoer er ikke tilladt. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Videoen er i portrætformat ({{ width }}x{{ height }}px). Portrætvideoer er ikke tilladt. + Videoen er i portrætformat ({{ width }}x{{ height }}px). Portrætvideoer er ikke tilladt. The video file is corrupted. - Videofilen er beskadiget. + Videofilen er beskadiget. The video contains multiple streams. Only one stream is allowed. - Videoen indeholder flere streams. Kun én stream er tilladt. + Videoen indeholder flere streams. Kun én stream er tilladt. Unsupported video codec "{{ codec }}". - Ikke-understøttet videokodek "{{ codec }}". + Ikke-understøttet videokodek "{{ codec }}". Unsupported video container "{{ container }}". - Ikke-understøttet videocontainer "{{ container }}". + Ikke-understøttet videocontainer "{{ container }}". The image file is corrupted. - Billedfilen er beskadiget. + Billedfilen er beskadiget. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Billedet har for få pixels ({{ pixels }}). Forventet minimum er {{ min_pixels }}. + Billedet har for få pixels ({{ pixels }}). Forventet minimum er {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Billedet har for mange pixels ({{ pixels }}). Forventet maksimalt antal er {{ max_pixels }}. + Billedet har for mange pixels ({{ pixels }}). Forventet maksimalt antal er {{ max_pixels }}. This filename does not match the expected charset. - Dette filnavn matcher ikke det forventede tegnsæt. + Dette filnavn matcher ikke det forventede tegnsæt. From f09087f9151dba08363b630d420b5dac3cd7ab4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20S=C3=A1nchez=20Taboada?= Date: Tue, 7 Oct 2025 18:18:07 +0200 Subject: [PATCH 61/74] Issue #51941 galician translation --- Resources/translations/validators.gl.xlf | 84 ++++++++++++------------ 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/Resources/translations/validators.gl.xlf b/Resources/translations/validators.gl.xlf index 33bdc3c7f..489457d54 100644 --- a/Resources/translations/validators.gl.xlf +++ b/Resources/translations/validators.gl.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - Este valor non é un enderezo IP válido. + Este valor non é un enderezo IP válido. This value is not a valid language. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Este valor non é un Número de Conta Bancaria Internacional (IBAN) válido. + Este valor non é un Número de Conta Bancaria Internacional (IBAN) válido. This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Este valor non é un Código de Identificación de Negocios (BIC) válido. + Este valor non é un Código de Identificación de Negocios (BIC) válido. Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Este valor non é un UUID válido. + Este valor non é un UUID válido. This value should be a multiple of {{ compared_value }}. @@ -404,155 +404,155 @@ 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. - O nome do ficheiro é demasiado longo. Debe ter {{ filename_max_length }} caracteres ou menos. + O nome do ficheiro é demasiado longo. Debe ter {{ filename_max_length }} caracteres ou menos. The password strength is too low. Please use a stronger password. - A forza do contrasinal é demasiado baixa. Utilice un contrasinal máis forte. + O contrasinal é demasiado débil. Utilice un contrasinal máis seguro. This value contains characters that are not allowed by the current restriction-level. - Este valor contén caracteres que non están permitidos polo nivel de restrición actual. + Este valor contén caracteres que non están permitidos polo nivel de restrición actual. Using invisible characters is not allowed. - Non se permite usar caracteres invisibles. + Non se permite usar caracteres invisíbeis. Mixing numbers from different scripts is not allowed. - Non se permite mesturar números de diferentes scripts. + Non se permite mesturar números de diferentes scripts. Using hidden overlay characters is not allowed. - Non se permite usar caracteres de superposición ocultos. + Non se permite usar caracteres de superposición ocultos. The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}. - A extensión do ficheiro non é válida ({{ extension }}). As extensións permitidas son {{ extensions }}. + A extensión do ficheiro non é válida ({{ extension }}). As extensións permitidas son {{ extensions }}. The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. - A codificación de caracteres detectada non é válida ({{ detected }}). As codificacións permitidas son {{ encodings }}. + A codificación de caracteres detectada non é válida ({{ detected }}). As codificacións permitidas son {{ encodings }}. This value is not a valid MAC address. - Este valor non é un enderezo MAC válido. + 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. + A esta URL fáltalle 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. - Este valor é demasiado curto. Debe conter polo menos unha palabra.|Este valor é demasiado curto. Debe conter polo menos {{ min }} palabras. + Este valor é curto de máis. Debe conter polo menos unha palabra.|Este valor é curto de máis. Debe conter polo 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 é demasiado longo. Debe conter só unha palabra.|Este valor é demasiado longo. Debe conter {{ max }} palabras ou menos. + Este valor é longo de máis. Debe conter só unha palabra.|Este valor é longo de máis. Debe conter {{ max }} palabras ou menos. This value does not represent a valid week in the ISO 8601 format. - Este valor non representa unha semana válida no formato ISO 8601. + Este valor non representa unha semana válida no formato ISO 8601. This value is not a valid week. - Este valor non é unha semana válida. + Este valor non é unha semana válida. This value should not be before week "{{ min }}". - Este valor non debe ser anterior á semana "{{ min }}". + Este valor non debe ser anterior á semana "{{ min }}". This value should not be after week "{{ max }}". - Este valor non debe estar despois da semana "{{ max }}". + Este valor non debe estar despois da semana "{{ max }}". This value is not a valid Twig template. - Este valor non é un modelo Twig válido. + Este valor non é un modelo Twig válido. This file is not a valid video. - Este ficheiro non é un vídeo válido. + Este ficheiro non é un vídeo válido. The size of the video could not be detected. - Non se puido detectar o tamaño do vídeo. + Non se puido detectar o tamaño do vídeo. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - A largura do vídeo é demasiado grande ({{ width }}px). A largura máxima permitida é {{ max_width }}px. + A anchura do vídeo é demasiado grande ({{ width }}px). A anchura máxima permitida é {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - A largura do vídeo é demasiado pequena ({{ width }}px). A largura mínima agardada é {{ min_width }}px. + A anchura do vídeo é demasiado pequena ({{ width }}px). A anchura mínima agardada é {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - A altura do vídeo é demasiado grande ({{ height }}px). A altura máxima permitida é {{ max_height }}px. + A altura do vídeo é demasiado grande ({{ height }}px). A altura máxima permitida é {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - A altura do vídeo é demasiado pequena ({{ height }}px). A altura mínima agardada é {{ min_height }}px. + A altura do vídeo é demasiado pequena ({{ height }}px). A altura mínima agardada é {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - O vídeo ten moi poucos píxeles ({{ pixels }}). A cantidade mínima agardada é {{ min_pixels }}. + O vídeo ten moi poucos píxeles ({{ pixels }}). A cantidade mínima agardada é {{ min_pixels }}. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - O vídeo ten demasiados píxeles ({{ pixels }}). A cantidade máxima agardada é {{ max_pixels }}. + O vídeo ten demasiados píxeles ({{ pixels }}). A cantidade máxima agardada é {{ max_pixels }}. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - A relación do vídeo é demasiado grande ({{ ratio }}). A relación máxima permitida é {{ max_ratio }}. + A relación do vídeo é demasiado grande ({{ ratio }}). A relación máxima permitida é {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - A relación do vídeo é demasiado pequena ({{ ratio }}). A relación mínima agardada é {{ min_ratio }}. + A relación do vídeo é demasiado pequena ({{ ratio }}). A relación mínima agardada é {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - O vídeo é cadrado ({{ width }}x{{ height }}px). Non se permiten vídeos cadrados. + O vídeo é cadrado ({{ width }}x{{ height }}px). Non se permiten vídeos cadrados. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - O vídeo está en orientación horizontal ({{ width }}x{{ height }} px). Non se permiten vídeos en horizontal. + O vídeo está en orientación horizontal ({{ width }}x{{ height }} px). Non se permiten vídeos en horizontal. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - O vídeo está en orientación vertical ({{ width }}x{{ height }} px). Non se permiten vídeos en orientación vertical. + O vídeo está en orientación vertical ({{ width }}x{{ height }} px). Non se permiten vídeos en orientación vertical. The video file is corrupted. - O ficheiro de vídeo está danado. + O ficheiro de vídeo está danado. The video contains multiple streams. Only one stream is allowed. - O vídeo contén múltiples fluxos. Só se permite un fluxo. + O vídeo contén múltiples fluxos. Só se permite un fluxo. Unsupported video codec "{{ codec }}". - Códec de vídeo non compatible «{{ codec }}». + Códec de vídeo non compatible «{{ codec }}». Unsupported video container "{{ container }}". - Contedor de vídeo non compatible "{{ container }}". + Contedor de vídeo non compatible "{{ container }}". The image file is corrupted. - O ficheiro de imaxe está danado. + O ficheiro de imaxe está danado. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - A imaxe ten moi poucos píxeles ({{ pixels }}). A cantidade mínima esperada é {{ min_pixels }}. + A imaxe ten moi poucos píxeles ({{ pixels }}). A cantidade mínima esperada é {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - A imaxe ten demasiados píxeles ({{ pixels }}). A cantidade máxima esperada é {{ max_pixels }}. + A imaxe ten demasiados píxeles ({{ pixels }}). A cantidade máxima esperada é {{ max_pixels }}. This filename does not match the expected charset. - Este nome de ficheiro non coincide co conxunto de caracteres agardado. + Este nome de ficheiro non coincide co charset agardado. From 763b936214fa5685c31a742d30b7b544ed9878b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20S=C3=A1nchez=20Taboada?= Date: Wed, 8 Oct 2025 18:25:17 +0200 Subject: [PATCH 62/74] issue fix #59412 catalan translation --- Resources/translations/validators.ca.xlf | 44 ++++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Resources/translations/validators.ca.xlf b/Resources/translations/validators.ca.xlf index 6b9b2cd73..e78fd8724 100644 --- a/Resources/translations/validators.ca.xlf +++ b/Resources/translations/validators.ca.xlf @@ -468,91 +468,91 @@ This value is not a valid Twig template. - Aquest valor no és una plantilla Twig vàlida. + Aquest valor no és una plantilla Twig vàlida. This file is not a valid video. - Aquest fitxer no és un vídeo vàlid. + Aquest fitxer no és un vídeo vàlid. The size of the video could not be detected. - No s'ha pogut detectar la mida del vídeo. + No s'ha pogut detectar la mida del vídeo. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - L'amplada del vídeo és massa gran ({{ width }}px). L'amplada màxima permesa és {{ max_width }}px. + L'amplada del vídeo és massa gran ({{ width }}px). L'amplada màxima permesa és {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - L’amplada del vídeo és massa petita ({{ width }}px). L’amplada mínima esperada és {{ min_width }}px. + L'amplada del vídeo és massa petita ({{ width }}px). L'amplada mínima esperada és {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - L'alçada del vídeo és massa gran ({{ height }}px). L'alçada màxima permesa és {{ max_height }}px. + L'altura del vídeo és massa gran ({{ height }}px). L'altura màxima permesa és {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - L'alçada del vídeo és massa petita ({{ height }}px). L'alçada mínima esperada és {{ min_height }}px. + L'altura del vídeo és massa petita ({{ height }}px). L'altura mínima esperada és {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - El vídeo té massa pocs píxels ({{ pixels }}). La quantitat mínima esperada és {{ min_pixels }}. + El vídeo no té suficients píxels ({{ pixels }}). La quantitat mínima esperada és {{ min_pixels }}. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - El vídeo té massa píxels ({{ pixels }}). La quantitat màxima prevista és {{ max_pixels }}. + El vídeo té massa píxels ({{ pixels }}). La quantitat màxima prevista és {{ max_pixels }}. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - La relació del vídeo és massa gran ({{ ratio }}). La relació màxima permesa és {{ max_ratio }}. + La relació del vídeo és massa gran ({{ ratio }}). La relació màxima permesa és {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - La relació del vídeo és massa petita ({{ ratio }}). La relació mínima esperada és {{ min_ratio }}. + La relació del vídeo és massa petita ({{ ratio }}). La relació mínima esperada és {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - El vídeo és quadrat ({{ width }}x{{ height }}px). No es permeten vídeos quadrats. + El vídeo és quadrat ({{ width }}x{{ height }}px). No es permeten vídeos quadrats. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - El vídeo té orientació horitzontal ({{ width }}x{{ height }} px). No es permeten vídeos horitzontals. + El vídeo té orientació horitzontal ({{ width }}x{{ height }} px). No es permeten vídeos horitzontals. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - El vídeo és en orientació vertical ({{ width }}x{{ height }} px). No es permeten vídeos en orientació vertical. + El vídeo és en orientació vertical ({{ width }}x{{ height }} px). No es permeten vídeos en orientació vertical. The video file is corrupted. - El fitxer de vídeo està corrupte. + El fitxer de vídeo està espatllat. The video contains multiple streams. Only one stream is allowed. - El vídeo conté diversos fluxos. Només es permet un sol flux. + El vídeo conté diversos fluxos. Només es permet un sol flux. Unsupported video codec "{{ codec }}". - Còdec de vídeo no compatible «{{ codec }}». + Còdec de vídeo incompatible «{{ codec }}». Unsupported video container "{{ container }}". - Contenidor de vídeo no compatible "{{ container }}". + Contenidor de vídeo incompatible "{{ container }}". The image file is corrupted. - El fitxer d'imatge està malmès. + El fitxer d'imatge està espatllat. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - La imatge té massa pocs píxels ({{ pixels }}). La quantitat mínima esperada és {{ min_pixels }}. + La imatge no té suficients píxels ({{ pixels }}). La quantitat mínima esperada és {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - La imatge té massa píxels ({{ pixels }}). El nombre màxim esperat és {{ max_pixels }}. + La imatge té massa píxels ({{ pixels }}). El nombre màxim esperat és {{ max_pixels }}. This filename does not match the expected charset. - Aquest nom de fitxer no coincideix amb el joc de caràcters esperat. + Aquest nom de fitxer no coincideix amb el charset esperat. From 4d6b10bbbdcdbc4332d31fe0d5917d5bd1373df6 Mon Sep 17 00:00:00 2001 From: Billy Scheufler Date: Thu, 9 Oct 2025 17:52:33 +0200 Subject: [PATCH 63/74] [Translation][sv] Remove needs-review on Swedish strings; align phrasing and punctuation --- Resources/translations/validators.sv.xlf | 58 ++++++++++++------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/Resources/translations/validators.sv.xlf b/Resources/translations/validators.sv.xlf index 675c0de22..1c18cf108 100644 --- a/Resources/translations/validators.sv.xlf +++ b/Resources/translations/validators.sv.xlf @@ -440,119 +440,119 @@ This URL is missing a top-level domain. - Denna URL saknar en toppdomän. + 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. - Det här värdet är för kort. Det ska innehålla minst ett ord.|Det här värdet är för kort. Det ska innehålla minst {{ min }} ord. + Det här värdet är för kort. Det ska innehålla minst ett ord.|Det här värdet är för kort. Det ska innehålla minst {{ min }} ord. This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. - Det här värdet är för långt. Det ska innehålla endast ett ord.|Det här värdet är för långt. Det ska innehålla {{ max }} ord eller färre. + Det här värdet är för långt. Det ska innehålla endast ett ord.|Det här värdet är för långt. Det ska innehålla {{ max }} ord eller färre. This value does not represent a valid week in the ISO 8601 format. - Det här värdet representerar inte en giltig vecka i ISO 8601-formatet. + Det här värdet representerar inte en giltig vecka i ISO 8601-formatet. This value is not a valid week. - Det här värdet är inte en giltig vecka. + Det här värdet är inte en giltig vecka. This value should not be before week "{{ min }}". - Det här värdet bör inte vara före vecka "{{ min }}". + Det här värdet bör inte vara före vecka "{{ min }}". This value should not be after week "{{ max }}". - Det här värdet bör inte vara efter vecka "{{ max }}". + Det här värdet bör inte vara efter vecka "{{ max }}". This value is not a valid Twig template. - Det här värdet är inte en giltig Twig-mall. + Det här värdet är inte en giltig Twig-mall. This file is not a valid video. - Den här filen är inte en giltig video. + Den här filen är inte en giltig video. The size of the video could not be detected. - Videons storlek kunde inte upptäckas. + Videons storlek kunde inte upptäckas. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Videobredden är för stor ({{ width }}px). Tillåten maximal bredd är {{ max_width }}px. + Videobredden är för stor ({{ width }}px). Tillåten maximal bredd är {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Videobredden är för liten ({{ width }}px). Förväntad minsta bredd är {{ min_width }}px. + Videobredden är för liten ({{ width }}px). Förväntad minsta bredd är {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Videons höjd är för stor ({{ height }}px). Tillåten maximal höjd är {{ max_height }}px. + Videons höjd är för stor ({{ height }}px). Tillåten maximal höjd är {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Videohöjden är för liten ({{ height }}px). Förväntad minimihöjd är {{ min_height }}px. + Videohöjden är för liten ({{ height }}px). Förväntad minimihöjd är {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Videon har för få pixlar ({{ pixels }}). Förväntad miniminivå är {{ min_pixels }}. + Videon har för få pixlar ({{ pixels }}). Förväntad miniminivå är {{ min_pixels }}. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Videon har för många pixlar ({{ pixels }}). Förväntat maxantal är {{ max_pixels }}. + Videon har för många pixlar ({{ pixels }}). Förväntat maxantal är {{ max_pixels }}. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Videons förhållande är för stort ({{ ratio }}). Tillåtet maxförhållande är {{ max_ratio }}. + Videons förhållande är för stort ({{ ratio }}). Tillåtet maxförhållande är {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Videoförhållandet är för litet ({{ ratio }}). Förväntat minimiförhållande är {{ min_ratio }}. + Videoförhållandet är för litet ({{ ratio }}). Förväntat minimiförhållande är {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Videon är kvadratisk ({{ width }}x{{ height }}px). Kvadratiska videor är inte tillåtna. + Videon är kvadratisk ({{ width }}x{{ height }}px). Kvadratiska videor är inte tillåtna. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Videon är i liggande läge ({{ width }}x{{ height }} px). Liggande videor är inte tillåtna. + Videon är i liggande läge ({{ width }}x{{ height }}px). Liggande videor är inte tillåtna. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Videon är i porträttläge ({{ width }}x{{ height }}px). Videor i porträttläge är inte tillåtna. + Videon är i porträttläge ({{ width }}x{{ height }}px). Videor i porträttläge är inte tillåtna. The video file is corrupted. - Videofilen är skadad. + Videofilen är skadad. The video contains multiple streams. Only one stream is allowed. - Videon innehåller flera strömmar. Endast en ström är tillåten. + Videon innehåller flera strömmar. Endast en ström är tillåten. Unsupported video codec "{{ codec }}". - Videokodek stöds inte ”{{ codec }}”. + Videokodek stöds inte "{{ codec }}". Unsupported video container "{{ container }}". - Videokontainer stöds inte "{{ container }}". + Videokontainer stöds inte "{{ container }}". The image file is corrupted. - Bildfilen är skadad. + Bildfilen är skadad. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Bilden har för få pixlar ({{ pixels }}). Förväntat minimiantal är {{ min_pixels }}. + Bilden har för få pixlar ({{ pixels }}). Förväntat minimiantal är {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Bilden har för många pixlar ({{ pixels }}). Förväntat maxantal är {{ max_pixels }}. + Bilden har för många pixlar ({{ pixels }}). Förväntat maxantal är {{ max_pixels }}. This filename does not match the expected charset. - Detta filnamn stämmer inte med förväntad teckenuppsättning. + Detta filnamn stämmer inte med förväntad teckenuppsättning. From 9c323882360b20ea1e9fd3b5d091bb35019a545d Mon Sep 17 00:00:00 2001 From: Patricia Wagner Date: Thu, 9 Oct 2025 17:55:10 +0200 Subject: [PATCH 64/74] [Validator] it: approve video/image/Twig translations and fix spacing (refs #60464) --- Resources/translations/validators.it.xlf | 44 ++++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Resources/translations/validators.it.xlf b/Resources/translations/validators.it.xlf index 67cddc393..e22713e8d 100644 --- a/Resources/translations/validators.it.xlf +++ b/Resources/translations/validators.it.xlf @@ -468,91 +468,91 @@ This value is not a valid Twig template. - Questo valore non è un template Twig valido. + Questo valore non è un template Twig valido. This file is not a valid video. - Questo file non è un video valido. + Questo file non è un video valido. The size of the video could not be detected. - Non è stato possibile rilevare la dimensione del video. + Non è stato possibile rilevare la dimensione del video. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - La larghezza del video è troppo grande ({{ width }}px). La larghezza massima consentita è {{ max_width }}px. + La larghezza del video è troppo grande ({{ width }}px). La larghezza massima consentita è {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - La larghezza del video è troppo piccola ({{ width }}px). La larghezza minima prevista è {{ min_width }}px. + La larghezza del video è troppo piccola ({{ width }}px). La larghezza minima prevista è {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - L'altezza del video è troppo grande ({{ height }}px). L'altezza massima consentita è {{ max_height }}px. + L'altezza del video è troppo grande ({{ height }}px). L'altezza massima consentita è {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - L'altezza del video è troppo piccola ({{ height }}px). L'altezza minima prevista è {{ min_height }}px. + L'altezza del video è troppo piccola ({{ height }}px). L'altezza minima prevista è {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Il video ha troppo pochi pixel ({{ pixels }}). La quantità minima prevista è {{ min_pixels }}. + Il video ha troppo pochi pixel ({{ pixels }}). La quantità minima prevista è {{ min_pixels }}. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Il video ha troppi pixel ({{ pixels }}). La quantità massima prevista è {{ max_pixels }}. + Il video ha troppi pixel ({{ pixels }}). La quantità massima prevista è {{ max_pixels }}. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Il rapporto del video è troppo alto ({{ ratio }}). Il rapporto massimo consentito è {{ max_ratio }}. + Il rapporto del video è troppo alto ({{ ratio }}). Il rapporto massimo consentito è {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Il rapporto del video è troppo piccolo ({{ ratio }}). Il rapporto minimo previsto è {{ min_ratio }}. + Il rapporto del video è troppo piccolo ({{ ratio }}). Il rapporto minimo previsto è {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Il video è quadrato ({{ width }}x{{ height }}px). I video quadrati non sono consentiti. + Il video è quadrato ({{ width }}x{{ height }}px). I video quadrati non sono consentiti. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Il video è in orientamento orizzontale ({{ width }}x{{ height }} px). I video orizzontali non sono consentiti. + Il video è in orientamento orizzontale ({{ width }}x{{ height }}px). I video orizzontali non sono consentiti. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Il video è in orientamento verticale ({{ width }}x{{ height }}px). I video in orientamento verticale non sono consentiti. + Il video è in orientamento verticale ({{ width }}x{{ height }}px). I video in orientamento verticale non sono consentiti. The video file is corrupted. - Il file video è danneggiato. + Il file video è danneggiato. The video contains multiple streams. Only one stream is allowed. - Il video contiene più flussi. È consentito un solo flusso. + Il video contiene più flussi. È consentito un solo flusso. Unsupported video codec "{{ codec }}". - Codec video non supportato «{{ codec }}». + Codec video non supportato «{{ codec }}». Unsupported video container "{{ container }}". - Container video non supportato "{{ container }}". + Container video non supportato "{{ container }}". The image file is corrupted. - Il file immagine è danneggiato. + Il file immagine è danneggiato. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - L’immagine ha troppo pochi pixel ({{ pixels }}). La quantità minima prevista è {{ min_pixels }}. + L’immagine ha troppo pochi pixel ({{ pixels }}). La quantità minima prevista è {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - L’immagine ha troppi pixel ({{ pixels }}). La quantità massima prevista è {{ max_pixels }}. + L’immagine ha troppi pixel ({{ pixels }}). La quantità massima prevista è {{ max_pixels }}. This filename does not match the expected charset. - Questo nome file non corrisponde al set di caratteri previsto. + Questo nome file non corrisponde al set di caratteri previsto. From 800b6fccf2fc5bb7cc65946e4e7917ed563d5d8d Mon Sep 17 00:00:00 2001 From: Michel Krenz Date: Thu, 9 Oct 2025 17:42:20 +0200 Subject: [PATCH 65/74] Improve Russian translations for video and image validators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Standardize terminology across all video and image validation messages - Use consistent 'корректный' instead of mixing 'допустимый' and 'корректный' - Improve grammar and naturalness for native Russian speakers - Fix spacing issues and use proper Russian quotation marks - Standardize 'not allowed' phrasing to 'не разрешены' - Use 'кодировка' instead of 'набор символов' for charset - Ensure consistency with existing translation style Fixes translation IDs 122-142 in validators.ru.xlf --- Resources/translations/validators.ru.xlf | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Resources/translations/validators.ru.xlf b/Resources/translations/validators.ru.xlf index 482595c23..5392515de 100644 --- a/Resources/translations/validators.ru.xlf +++ b/Resources/translations/validators.ru.xlf @@ -472,87 +472,87 @@ This file is not a valid video. - Этот файл не является допустимым видео. + Этот файл не является корректным видео. The size of the video could not be detected. - Не удалось определить размер видео. + Не удалось определить размер видео. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Ширина видео слишком велика ({{ width }}px). Допустимая максимальная ширина — {{ max_width }}px. + Ширина видео слишком велика ({{ width }}px). Максимально допустимая ширина {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Ширина видео слишком мала ({{ width }}px). Ожидаемая минимальная ширина — {{ min_width }}px. + Ширина видео слишком мала ({{ width }}px). Минимально допустимая ширина {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Высота видео слишком большая ({{ height }}px). Допустимая максимальная высота — {{ max_height }}px. + Высота видео слишком велика ({{ height }}px). Максимально допустимая высота {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Высота видео слишком мала ({{ height }}px). Ожидаемая минимальная высота — {{ min_height }}px. + Высота видео слишком мала ({{ height }}px). Минимально допустимая высота {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - В видео слишком мало пикселей ({{ pixels }}). Ожидаемое минимальное количество {{ min_pixels }}. + В видео слишком мало пикселей ({{ pixels }} пикселей). Минимально допустимое количество {{ min_pixels }} пикселей. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - В видео слишком много пикселей ({{ pixels }}). Ожидаемое максимальное количество — {{ max_pixels }}. + В видео слишком много пикселей ({{ pixels }} пикселей). Максимально допустимое количество {{ max_pixels }} пикселей. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Соотношение сторон видео слишком велико ({{ ratio }}). Допустимое максимальное соотношение — {{ max_ratio }}. + Соотношение сторон видео слишком велико ({{ ratio }}). Максимально допустимое соотношение {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Соотношение сторон видео слишком маленькое ({{ ratio }}). Ожидаемое минимальное соотношение — {{ min_ratio }}. + Соотношение сторон видео слишком мало ({{ ratio }}). Минимально допустимое соотношение {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Видео квадратное ({{ width }}x{{ height }}px). Квадратные видео не допускаются. + Видео квадратное ({{ width }}x{{ height }}px). Квадратные видео не разрешены. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Видео в альбомной ориентации ({{ width }}x{{ height }} px). Видео в альбомной ориентации не допускаются. + Видео в альбомной ориентации ({{ width }}x{{ height }}px). Видео в альбомной ориентации не разрешены. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Видео имеет портретную ориентацию ({{ width }}x{{ height }}px). Видео с портретной ориентацией не допускаются. + Видео в портретной ориентации ({{ width }}x{{ height }}px). Видео в портретной ориентации не разрешены. The video file is corrupted. - Видеофайл повреждён. + Видеофайл повреждён. The video contains multiple streams. Only one stream is allowed. - Видео содержит несколько потоков. Разрешён только один поток. + Видео содержит несколько потоков. Разрешён только один поток. Unsupported video codec "{{ codec }}". - Неподдерживаемый видеокодек «{{ codec }}». + Неподдерживаемый видеокодек «{{ codec }}». Unsupported video container "{{ container }}". - Неподдерживаемый видеоконтейнер "{{ container }}". + Неподдерживаемый видеоконтейнер «{{ container }}». The image file is corrupted. - Файл изображения повреждён. + Файл изображения повреждён. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - В изображении слишком мало пикселей ({{ pixels }}). Ожидаемое минимальное количество — {{ min_pixels }}. + В изображении слишком мало пикселей ({{ pixels }} пикселей). Минимально допустимое количество {{ min_pixels }} пикселей. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Изображение содержит слишком много пикселей ({{ pixels }}). Ожидаемое максимальное количество — {{ max_pixels }}. + В изображении слишком много пикселей ({{ pixels }} пикселей). Максимально допустимое количество {{ max_pixels }} пикселей. This filename does not match the expected charset. - Это имя файла не соответствует ожидаемому набору символов. + Это имя файла не соответствует ожидаемой кодировке. From 3d89c389433e42c19bdacc388ac60c91f806ac72 Mon Sep 17 00:00:00 2001 From: "anna-lena.waltinger" Date: Thu, 9 Oct 2025 18:02:32 +0200 Subject: [PATCH 66/74] Update Luxembourgish translations by removing 'needs-review-translation' state from multiple entries in security and validator files. --- Resources/translations/validators.lb.xlf | 68 ++++++++++++------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/Resources/translations/validators.lb.xlf b/Resources/translations/validators.lb.xlf index 122886199..dd4ac75a1 100644 --- a/Resources/translations/validators.lb.xlf +++ b/Resources/translations/validators.lb.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - Dëse Wäert ass keng gülteg IP-Adress. + Dëse Wäert ass keng gülteg IP-Adress. This value is not a valid language. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Dëse Wäert ass keng gülteg International Bankkontonummer (IBAN). + Dëse Wäert ass keng gülteg International Bankkontonummer (IBAN). This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Dëse Wäert ass kee gültege Business Identifier Code (BIC). + Dëse Wäert ass kee gültege Business Identifier Code (BIC). Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Dëse Wäert ass keng gülteg UUID. + Dëse Wäert ass keng gülteg UUID. This value should be a multiple of {{ compared_value }}. @@ -436,123 +436,123 @@ This value is not a valid MAC address. - Dëse Wäert ass keng gülteg MAC-Adress. + 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. + 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. - Dëse Wäert ass ze kuerz. Et sollt op d'mannst ee Wuert enthalen.|Dëse Wäert ass ze kuerz. Et sollt op d'mannst {{ min }} Wierder enthalen. + Dëse Wäert ass ze kuerz. Et sollt op d'mannst ee Wuert enthalen.|Dëse Wäert ass ze kuerz. Et sollt op d'mannst {{ min }} Wierder enthalen. This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. - Dëse Wäert ass ze laang. Et sollt nëmmen ee Wuert enthalen.|Dëse Wäert ass ze laang. Et sollt {{ max }} Wierder oder manner enthalen. + Dëse Wäert ass ze laang. Et sollt nëmmen ee Wuert enthalen.|Dëse Wäert ass ze laang. Et sollt {{ max }} Wierder oder manner enthalen. This value does not represent a valid week in the ISO 8601 format. - Dëse Wäert stellt keng valabel Woch am ISO 8601-Format duer. + Dëse Wäert stellt keng valabel Woch am ISO 8601-Format duer. This value is not a valid week. - Dëse Wäert ass keng valabel Woch. + Dëse Wäert ass keng valabel Woch. This value should not be before week "{{ min }}". - Dëse Wäert sollt net virun der Woch "{{ min }}" sinn. + Dëse Wäert sollt net virun der Woch "{{ min }}" sinn. This value should not be after week "{{ max }}". - Dëse Wäert sollt net no Woch "{{ max }}" sinn. + Dëse Wäert sollt net no Woch "{{ max }}" sinn. This value is not a valid Twig template. - Dëse Wäert ass kee valabelen Twig-Template. + Dëse Wäert ass kee valabelen Twig-Template. This file is not a valid video. - Dës Datei ass kee gëltegen Video. + Dës Datei ass kee gëltegen Video. The size of the video could not be detected. - D’Gréisst vum Video konnt net erkannt ginn. + D'Gréisst vum Video konnt net erkannt ginn. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - D'Videobreed ass ze grouss ({{ width }}px). Erlaabt maximal Breed ass {{ max_width }}px. + D'Videobreed ass ze grouss ({{ width }}px). Erlaabt maximal Breed ass {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - D’Videobreed ass ze kleng ({{ width }}px). Minimal erwaart Breed ass {{ min_width }}px. + D'Videobreed ass ze kleng ({{ width }}px). Minimal erwaart Breed ass {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - D'Videohéicht ass ze grouss ({{ height }}px). Erlaabt maximal Héicht ass {{ max_height }}px. + D'Videohéicht ass ze grouss ({{ height }}px). Erlaabt maximal Héicht ass {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - D'Videohéicht ass ze kleng ({{ height }}px). Erwaart Mindesthéicht ass {{ min_height }}px. + D'Videohéicht ass ze kleng ({{ height }}px). Erwaart Mindesthéicht ass {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - De Video huet ze wéineg Pixel ({{ pixels }}). Erwaart Minimum ass {{ min_pixels }}. + De Video huet ze wéineg Pixel ({{ pixels }}). Erwaart Minimum ass {{ min_pixels }}. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - De Video huet ze vill Pixel ({{ pixels }}). Déi erwaart maximal Zuel ass {{ max_pixels }}. + De Video huet ze vill Pixel ({{ pixels }}). Déi erwaart maximal Zuel ass {{ max_pixels }}. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - D’Videoproportioun ass ze grouss ({{ ratio }}). Erlaabt maximal Proportioun ass {{ max_ratio }}. + D'Videoproportioun ass ze grouss ({{ ratio }}). Erlaabt maximal Proportioun ass {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - D'Videoratio ass ze kleng ({{ ratio }}). Minimal erwaart Ratio ass {{ min_ratio }}. + D'Videoratio ass ze kleng ({{ ratio }}). Minimal erwaart Ratio ass {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - De Video ass quadratesch ({{ width }}x{{ height }}px). Quadratesch Videoe sinn net erlaabt. + De Video ass quadratesch ({{ width }}x{{ height }}px). Quadratesch Videoe sinn net erlaabt. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - De Video ass am Landschaftsformat ({{ width }}x{{ height }} px). Landschafts-Videoe sinn net erlaabt. + De Video ass am Landschaftsformat ({{ width }}x{{ height }} px). Landschafts-Videoe sinn net erlaabt. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - De Video ass am Portraitformat ({{ width }}x{{ height }}px). Portrait-Videoe sinn net erlaabt. + De Video ass am Portraitformat ({{ width }}x{{ height }}px). Portrait-Videoe sinn net erlaabt. The video file is corrupted. - D'Videodatei ass beschiedegt. + D'Videodatei ass beschiedegt. The video contains multiple streams. Only one stream is allowed. - De Video enthält verschidde Stréimen. Nëmmen ee Stroum ass erlaabt. + De Video enthält verschidde Stréimen. Nëmmen ee Stroum ass erlaabt. Unsupported video codec "{{ codec }}". - Net ënnerstëtzte Videocodec „{{ codec }}“. + Net ënnerstëtzte Videocodec „{{ codec }}“. Unsupported video container "{{ container }}". - Net ënnerstëtzte Video-Container "{{ container }}". + Net ënnerstëtzte Video-Container "{{ container }}". The image file is corrupted. - D'Bilddatei ass beschiedegt. + D'Bilddatei ass beschiedegt. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - D’Bild huet ze wéineg Pixel ({{ pixels }}). Déi erwaart Mindestzuel ass {{ min_pixels }}. + D'Bild huet ze wéineg Pixel ({{ pixels }}). Déi erwaart Mindestzuel ass {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - D’Bild huet ze vill Pixel ({{ pixels }}). Déi erwaart maximal Zuel ass {{ max_pixels }}. + D'Bild huet ze vill Pixel ({{ pixels }}). Déi erwaart maximal Zuel ass {{ max_pixels }}. This filename does not match the expected charset. - Dësen Dateinumm entsprécht net dem erwaarten Zeechesaz. + Dësen Dateinumm entsprécht net dem erwaarten Zeechesaz. From ef0e5faa03f76a007ea085c3f59b0863aeb9b327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20Teutschl=C3=A4nder?= Date: Thu, 9 Oct 2025 18:35:36 +0200 Subject: [PATCH 67/74] Fix Norwegian translations - remove needs-review-translation status - Remove state="needs-review-translation" from all Norwegian translation entries - Complete translations for Form, Security, and Validator components - All translations are now finalized and ready for use Fixes #51900 --- Resources/translations/validators.no.xlf | 86 ++++++++++++------------ 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/Resources/translations/validators.no.xlf b/Resources/translations/validators.no.xlf index a81565455..11ce9777b 100644 --- a/Resources/translations/validators.no.xlf +++ b/Resources/translations/validators.no.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - Denne verdien er ikke en gyldig IP-adresse. + Denne verdien er ikke en gyldig IP-adresse. 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. - Ingen midlertidig mappe ble konfigurert i php.ini, eller den konfigurerte mappen eksisterer ikke. + Ingen midlertidig mappe ble konfigurert i php.ini, eller den konfigurerte mappen eksisterer ikke. Cannot write temporary file to disk. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Denne verdien er ikke et gyldig internasjonalt bankkontonummer (IBAN). + Denne verdien er ikke et gyldig internasjonalt bankkontonummer (IBAN). This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Denne verdien er ikke en gyldig forretningsidentifikasjonskode (BIC). + Denne verdien er ikke en gyldig forretningsidentifikasjonskode (BIC). Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Denne verdien er ikke en gyldig UUID. + Denne verdien er ikke en gyldig UUID. This value should be a multiple of {{ compared_value }}. @@ -404,155 +404,155 @@ 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. - Filnavnet er for langt. Det bør ha {{ filename_max_length }} tegn eller mindre.|Filnavnet er for langt. Det bør ha {{ filename_max_length }} tegn eller mindre. + Filnavnet er for langt. Det bør ha {{ filename_max_length }} tegn eller mindre.|Filnavnet er for langt. Det bør ha {{ filename_max_length }} tegn eller mindre. The password strength is too low. Please use a stronger password. - Passordstyrken er for lav. Vennligst bruk et sterkere passord. + Passordstyrken er for lav. Vennligst bruk et sterkere passord. This value contains characters that are not allowed by the current restriction-level. - Denne verdien inneholder tegn som ikke er tillatt av gjeldende restriksjonsnivå. + Denne verdien inneholder tegn som ikke er tillatt av gjeldende restriksjonsnivå. Using invisible characters is not allowed. - Det er ikke tillatt å bruke usynlige tegn. + Det er ikke tillatt å bruke usynlige tegn. Mixing numbers from different scripts is not allowed. - Det er ikke tillatt å blande tall fra forskjellige skript. + Det er ikke tillatt å blande tall fra forskjellige skript. Using hidden overlay characters is not allowed. - Det er ikke tillatt å bruke skjulte overleggskarakterer. + Det er ikke tillatt å bruke skjulte overleggskarakterer. The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}. - Filutvidelsen er ugyldig ({{ extension }}). Tillatte utvidelser er {{ extensions }}. + Filutvidelsen er ugyldig ({{ extension }}). Tillatte utvidelser er {{ extensions }}. The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. - Den oppdagede tegnkodingen er ugyldig ({{ detected }}). Tillatte kodinger er {{ encodings }}. + Den oppdagede tegnkodingen er ugyldig ({{ detected }}). Tillatte kodinger er {{ encodings }}. This value is not a valid MAC address. - Denne verdien er ikke en gyldig MAC-adresse. + Denne verdien er ikke en gyldig MAC-adresse. This URL is missing a top-level domain. - Denne URL-en mangler et toppnivådomene. + 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. - Denne verdien er for kort. Den bør inneholde minst ett ord.|Denne verdien er for kort. Den bør inneholde minst {{ min }} ord. + Denne verdien er for kort. Den bør inneholde minst ett ord.|Denne verdien er for kort. Den bør inneholde minst {{ min }} ord. This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. - Denne verdien er for lang. Den bør inneholde kun ett ord.|Denne verdien er for lang. Den bør inneholde {{ max }} ord eller færre. + Denne verdien er for lang. Den bør inneholde kun ett ord.|Denne verdien er for lang. Den bør inneholde {{ max }} ord eller færre. This value does not represent a valid week in the ISO 8601 format. - Denne verdien representerer ikke en gyldig uke i ISO 8601-formatet. + Denne verdien representerer ikke en gyldig uke i ISO 8601-formatet. This value is not a valid week. - Denne verdien er ikke en gyldig uke. + Denne verdien er ikke en gyldig uke. This value should not be before week "{{ min }}". - Denne verdien bør ikke være før uke "{{ min }}". + Denne verdien bør ikke være før uke "{{ min }}". This value should not be after week "{{ max }}". - Denne verdien bør ikke være etter uke "{{ max }}". + Denne verdien bør ikke være etter uke "{{ max }}". This value is not a valid Twig template. - Denne verdien er ikke en gyldig Twig-mal. + Denne verdien er ikke en gyldig Twig-mal. This file is not a valid video. - Denne filen er ikke en gyldig video. + Denne filen er ikke en gyldig video. The size of the video could not be detected. - Videostørrelsen kunne ikke oppdages. + Videostørrelsen kunne ikke oppdages. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Videobredden er for stor ({{ width }}px). Tillatt maksimal bredde er {{ max_width }}px. + Videobredden er for stor ({{ width }}px). Tillatt maksimal bredde er {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Videobredden er for liten ({{ width }}px). Forventet minimumsbredde er {{ min_width }}px. + Videobredden er for liten ({{ width }}px). Forventet minimumsbredde er {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Videohøyden er for stor ({{ height }}px). Tillatt maksimal høyde er {{ max_height }}px. + Videohøyden er for stor ({{ height }}px). Tillatt maksimal høyde er {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Videoens høyde er for liten ({{ height }}px). Forventet minstehøyde er {{ min_height }}px. + Videoens høyde er for liten ({{ height }}px). Forventet minstehøyde er {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Videoen har for få piksler ({{ pixels }}). Forventet minimum er {{ min_pixels }}. + Videoen har for få piksler ({{ pixels }}). Forventet minimum er {{ min_pixels }}. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Videoen har for mange piksler ({{ pixels }}). Forventet maksimalt antall er {{ max_pixels }}. + Videoen har for mange piksler ({{ pixels }}). Forventet maksimalt antall er {{ max_pixels }}. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Video-forholdet er for stort ({{ ratio }}). Tillatt maksimalt forhold er {{ max_ratio }}. + Video-forholdet er for stort ({{ ratio }}). Tillatt maksimalt forhold er {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Videoforholdet er for lite ({{ ratio }}). Forventet minimumsforhold er {{ min_ratio }}. + Videoforholdet er for lite ({{ ratio }}). Forventet minimumsforhold er {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Videoen er kvadratisk ({{ width }}x{{ height }}px). Kvadratiske videoer er ikke tillatt. + Videoen er kvadratisk ({{ width }}x{{ height }}px). Kvadratiske videoer er ikke tillatt. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Videoen er i liggende format ({{ width }}x{{ height }} px). Liggende videoer er ikke tillatt. + Videoen er i liggende format ({{ width }}x{{ height }} px). Liggende videoer er ikke tillatt. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Videoen er i portrettformat ({{ width }}x{{ height }}px). Portrettvideoer er ikke tillatt. + Videoen er i portrettformat ({{ width }}x{{ height }}px). Portrettvideoer er ikke tillatt. The video file is corrupted. - Videofilen er ødelagt. + Videofilen er ødelagt. The video contains multiple streams. Only one stream is allowed. - Videoen inneholder flere strømmer. Kun én strøm er tillatt. + Videoen inneholder flere strømmer. Kun én strøm er tillatt. Unsupported video codec "{{ codec }}". - Ikke støttet videokodek «{{ codec }}». + Ikke støttet videokodek «{{ codec }}». Unsupported video container "{{ container }}". - Ikke-støttet videokontainer "{{ container }}". + Ikke-støttet videokontainer "{{ container }}". The image file is corrupted. - Bildefilen er ødelagt. + Bildefilen er ødelagt. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Bildet har for få piksler ({{ pixels }}). Forventet minimum er {{ min_pixels }}. + Bildet har for få piksler ({{ pixels }}). Forventet minimum er {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Bildet har for mange piksler ({{ pixels }}). Forventet maksimalt antall er {{ max_pixels }}. + Bildet har for mange piksler ({{ pixels }}). Forventet maksimalt antall er {{ max_pixels }}. This filename does not match the expected charset. - Dette filnavnet samsvarer ikke med forventet tegnsett. + Dette filnavnet samsvarer ikke med forventet tegnsett. From 448b992321e79605eda7741741b8309cf3aa74af Mon Sep 17 00:00:00 2001 From: Patricia Date: Thu, 9 Oct 2025 20:25:56 +0200 Subject: [PATCH 68/74] fix: added new indonesian translations --- Resources/translations/validators.id.xlf | 44 ++++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Resources/translations/validators.id.xlf b/Resources/translations/validators.id.xlf index d2ae0328e..b303d50e1 100644 --- a/Resources/translations/validators.id.xlf +++ b/Resources/translations/validators.id.xlf @@ -468,91 +468,91 @@ This value is not a valid Twig template. - Nilai ini bukan templat Twig yang valid. + Nilai ini bukan templat Twig yang valid. This file is not a valid video. - Berkas ini bukan video yang valid. + Berkas ini bukan video yang valid. The size of the video could not be detected. - Ukuran video tidak dapat dideteksi. + Ukuran video tidak dapat dideteksi. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Lebar video terlalu besar ({{ width }}px). Lebar maksimum yang diizinkan adalah {{ max_width }}px. + Lebar video terlalu besar ({{ width }}px). Lebar maksimum yang diizinkan adalah {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Lebar video terlalu kecil ({{ width }}px). Lebar minimum yang diharapkan adalah {{ min_width }}px. + Lebar video terlalu kecil ({{ width }}px). Lebar minimum yang diharapkan adalah {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Tinggi video terlalu besar ({{ height }}px). Tinggi maksimum yang diizinkan adalah {{ max_height }}px. + Tinggi video terlalu besar ({{ height }}px). Tinggi maksimum yang diizinkan adalah {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Tinggi video terlalu kecil ({{ height }}px). Tinggi minimum yang diharapkan adalah {{ min_height }}px. + Tinggi video terlalu kecil ({{ height }}px). Tinggi minimum yang diharapkan adalah {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Video memiliki terlalu sedikit piksel ({{ pixels }}). Jumlah minimum yang diharapkan adalah {{ min_pixels }}. + Video memiliki terlalu sedikit piksel ({{ pixels }}). Jumlah minimum yang diharapkan adalah {{ min_pixels }}. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Video memiliki terlalu banyak piksel ({{ pixels }}). Jumlah maksimum yang diharapkan adalah {{ max_pixels }}. + Video memiliki terlalu banyak piksel ({{ pixels }}). Jumlah maksimum yang diharapkan adalah {{ max_pixels }}. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Rasio video terlalu besar ({{ ratio }}). Rasio maksimum yang diizinkan adalah {{ max_ratio }}. + Rasio video terlalu besar ({{ ratio }}). Rasio maksimum yang diizinkan adalah {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Rasio video terlalu kecil ({{ ratio }}). Rasio minimum yang diharapkan adalah {{ min_ratio }}. + Rasio video terlalu kecil ({{ ratio }}). Rasio minimum yang diharapkan adalah {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Video berbentuk persegi ({{ width }}x{{ height }}px). Video persegi tidak diizinkan. + Video berbentuk persegi ({{ width }}x{{ height }}px). Video persegi tidak diizinkan. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Video berorientasi lanskap ({{ width }}x{{ height }} px). Video berorientasi lanskap tidak diizinkan. + Video berorientasi lanskap ({{ width }}x{{ height }}px). Video berorientasi lanskap tidak diizinkan. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Video berorientasi potret ({{ width }}x{{ height }}px). Video berorientasi potret tidak diizinkan. + Video berorientasi potret ({{ width }}x{{ height }}px). Video berorientasi potret tidak diizinkan. The video file is corrupted. - Berkas video rusak. + Berkas video rusak. The video contains multiple streams. Only one stream is allowed. - Video berisi beberapa aliran. Hanya satu aliran yang diizinkan. + Video berisi beberapa aliran. Hanya satu aliran yang diizinkan. Unsupported video codec "{{ codec }}". - Kodek video tidak didukung "{{ codec }}". + Kodek video tidak didukung "{{ codec }}". Unsupported video container "{{ container }}". - Kontainer video tidak didukung "{{ container }}". + Kontainer video tidak didukung "{{ container }}". The image file is corrupted. - File gambar rusak. + Berkas gambar rusak. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Gambar memiliki terlalu sedikit piksel ({{ pixels }}). Jumlah minimum yang diharapkan adalah {{ min_pixels }}. + Gambar memiliki terlalu sedikit piksel ({{ pixels }}). Jumlah minimum yang diharapkan adalah {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Gambar memiliki terlalu banyak piksel ({{ pixels }}). Jumlah maksimum yang diharapkan adalah {{ max_pixels }}. + Gambar memiliki terlalu banyak piksel ({{ pixels }}). Jumlah maksimum yang diharapkan adalah {{ max_pixels }}. This filename does not match the expected charset. - Nama berkas ini tidak sesuai dengan set karakter yang diharapkan. + Nama berkas ini tidak sesuai dengan set karakter yang diharapkan. From 157e9ee04449e66d7a2f007b143e7d17e17ffb19 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 10 Oct 2025 11:07:29 +0200 Subject: [PATCH 69/74] sync nb translations with no translations --- Resources/translations/validators.nb.xlf | 86 ++++++++++++------------ 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/Resources/translations/validators.nb.xlf b/Resources/translations/validators.nb.xlf index a81565455..11ce9777b 100644 --- a/Resources/translations/validators.nb.xlf +++ b/Resources/translations/validators.nb.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - Denne verdien er ikke en gyldig IP-adresse. + Denne verdien er ikke en gyldig IP-adresse. 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. - Ingen midlertidig mappe ble konfigurert i php.ini, eller den konfigurerte mappen eksisterer ikke. + Ingen midlertidig mappe ble konfigurert i php.ini, eller den konfigurerte mappen eksisterer ikke. Cannot write temporary file to disk. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Denne verdien er ikke et gyldig internasjonalt bankkontonummer (IBAN). + Denne verdien er ikke et gyldig internasjonalt bankkontonummer (IBAN). This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Denne verdien er ikke en gyldig forretningsidentifikasjonskode (BIC). + Denne verdien er ikke en gyldig forretningsidentifikasjonskode (BIC). Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Denne verdien er ikke en gyldig UUID. + Denne verdien er ikke en gyldig UUID. This value should be a multiple of {{ compared_value }}. @@ -404,155 +404,155 @@ 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. - Filnavnet er for langt. Det bør ha {{ filename_max_length }} tegn eller mindre.|Filnavnet er for langt. Det bør ha {{ filename_max_length }} tegn eller mindre. + Filnavnet er for langt. Det bør ha {{ filename_max_length }} tegn eller mindre.|Filnavnet er for langt. Det bør ha {{ filename_max_length }} tegn eller mindre. The password strength is too low. Please use a stronger password. - Passordstyrken er for lav. Vennligst bruk et sterkere passord. + Passordstyrken er for lav. Vennligst bruk et sterkere passord. This value contains characters that are not allowed by the current restriction-level. - Denne verdien inneholder tegn som ikke er tillatt av gjeldende restriksjonsnivå. + Denne verdien inneholder tegn som ikke er tillatt av gjeldende restriksjonsnivå. Using invisible characters is not allowed. - Det er ikke tillatt å bruke usynlige tegn. + Det er ikke tillatt å bruke usynlige tegn. Mixing numbers from different scripts is not allowed. - Det er ikke tillatt å blande tall fra forskjellige skript. + Det er ikke tillatt å blande tall fra forskjellige skript. Using hidden overlay characters is not allowed. - Det er ikke tillatt å bruke skjulte overleggskarakterer. + Det er ikke tillatt å bruke skjulte overleggskarakterer. The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}. - Filutvidelsen er ugyldig ({{ extension }}). Tillatte utvidelser er {{ extensions }}. + Filutvidelsen er ugyldig ({{ extension }}). Tillatte utvidelser er {{ extensions }}. The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. - Den oppdagede tegnkodingen er ugyldig ({{ detected }}). Tillatte kodinger er {{ encodings }}. + Den oppdagede tegnkodingen er ugyldig ({{ detected }}). Tillatte kodinger er {{ encodings }}. This value is not a valid MAC address. - Denne verdien er ikke en gyldig MAC-adresse. + Denne verdien er ikke en gyldig MAC-adresse. This URL is missing a top-level domain. - Denne URL-en mangler et toppnivådomene. + 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. - Denne verdien er for kort. Den bør inneholde minst ett ord.|Denne verdien er for kort. Den bør inneholde minst {{ min }} ord. + Denne verdien er for kort. Den bør inneholde minst ett ord.|Denne verdien er for kort. Den bør inneholde minst {{ min }} ord. This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. - Denne verdien er for lang. Den bør inneholde kun ett ord.|Denne verdien er for lang. Den bør inneholde {{ max }} ord eller færre. + Denne verdien er for lang. Den bør inneholde kun ett ord.|Denne verdien er for lang. Den bør inneholde {{ max }} ord eller færre. This value does not represent a valid week in the ISO 8601 format. - Denne verdien representerer ikke en gyldig uke i ISO 8601-formatet. + Denne verdien representerer ikke en gyldig uke i ISO 8601-formatet. This value is not a valid week. - Denne verdien er ikke en gyldig uke. + Denne verdien er ikke en gyldig uke. This value should not be before week "{{ min }}". - Denne verdien bør ikke være før uke "{{ min }}". + Denne verdien bør ikke være før uke "{{ min }}". This value should not be after week "{{ max }}". - Denne verdien bør ikke være etter uke "{{ max }}". + Denne verdien bør ikke være etter uke "{{ max }}". This value is not a valid Twig template. - Denne verdien er ikke en gyldig Twig-mal. + Denne verdien er ikke en gyldig Twig-mal. This file is not a valid video. - Denne filen er ikke en gyldig video. + Denne filen er ikke en gyldig video. The size of the video could not be detected. - Videostørrelsen kunne ikke oppdages. + Videostørrelsen kunne ikke oppdages. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Videobredden er for stor ({{ width }}px). Tillatt maksimal bredde er {{ max_width }}px. + Videobredden er for stor ({{ width }}px). Tillatt maksimal bredde er {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Videobredden er for liten ({{ width }}px). Forventet minimumsbredde er {{ min_width }}px. + Videobredden er for liten ({{ width }}px). Forventet minimumsbredde er {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Videohøyden er for stor ({{ height }}px). Tillatt maksimal høyde er {{ max_height }}px. + Videohøyden er for stor ({{ height }}px). Tillatt maksimal høyde er {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Videoens høyde er for liten ({{ height }}px). Forventet minstehøyde er {{ min_height }}px. + Videoens høyde er for liten ({{ height }}px). Forventet minstehøyde er {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Videoen har for få piksler ({{ pixels }}). Forventet minimum er {{ min_pixels }}. + Videoen har for få piksler ({{ pixels }}). Forventet minimum er {{ min_pixels }}. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Videoen har for mange piksler ({{ pixels }}). Forventet maksimalt antall er {{ max_pixels }}. + Videoen har for mange piksler ({{ pixels }}). Forventet maksimalt antall er {{ max_pixels }}. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Video-forholdet er for stort ({{ ratio }}). Tillatt maksimalt forhold er {{ max_ratio }}. + Video-forholdet er for stort ({{ ratio }}). Tillatt maksimalt forhold er {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Videoforholdet er for lite ({{ ratio }}). Forventet minimumsforhold er {{ min_ratio }}. + Videoforholdet er for lite ({{ ratio }}). Forventet minimumsforhold er {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Videoen er kvadratisk ({{ width }}x{{ height }}px). Kvadratiske videoer er ikke tillatt. + Videoen er kvadratisk ({{ width }}x{{ height }}px). Kvadratiske videoer er ikke tillatt. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Videoen er i liggende format ({{ width }}x{{ height }} px). Liggende videoer er ikke tillatt. + Videoen er i liggende format ({{ width }}x{{ height }} px). Liggende videoer er ikke tillatt. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Videoen er i portrettformat ({{ width }}x{{ height }}px). Portrettvideoer er ikke tillatt. + Videoen er i portrettformat ({{ width }}x{{ height }}px). Portrettvideoer er ikke tillatt. The video file is corrupted. - Videofilen er ødelagt. + Videofilen er ødelagt. The video contains multiple streams. Only one stream is allowed. - Videoen inneholder flere strømmer. Kun én strøm er tillatt. + Videoen inneholder flere strømmer. Kun én strøm er tillatt. Unsupported video codec "{{ codec }}". - Ikke støttet videokodek «{{ codec }}». + Ikke støttet videokodek «{{ codec }}». Unsupported video container "{{ container }}". - Ikke-støttet videokontainer "{{ container }}". + Ikke-støttet videokontainer "{{ container }}". The image file is corrupted. - Bildefilen er ødelagt. + Bildefilen er ødelagt. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Bildet har for få piksler ({{ pixels }}). Forventet minimum er {{ min_pixels }}. + Bildet har for få piksler ({{ pixels }}). Forventet minimum er {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Bildet har for mange piksler ({{ pixels }}). Forventet maksimalt antall er {{ max_pixels }}. + Bildet har for mange piksler ({{ pixels }}). Forventet maksimalt antall er {{ max_pixels }}. This filename does not match the expected charset. - Dette filnavnet samsvarer ikke med forventet tegnsett. + Dette filnavnet samsvarer ikke med forventet tegnsett. From 8e351c458fba1d9c96dce6071d0fe1e4cac50763 Mon Sep 17 00:00:00 2001 From: Marcus Jaschen Date: Fri, 10 Oct 2025 07:40:49 +0200 Subject: [PATCH 70/74] Update regular expression in URL validator To achieve better compatibility with RFC 3986, the regular expression which validates URLs now allows more characters in the userinfo part. Add test cases; update change log. --- Constraints/UrlValidator.php | 28 ++++++++++++++------------ Tests/Constraints/UrlValidatorTest.php | 2 ++ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Constraints/UrlValidator.php b/Constraints/UrlValidator.php index ba8208da7..55a545e8b 100644 --- a/Constraints/UrlValidator.php +++ b/Constraints/UrlValidator.php @@ -21,34 +21,36 @@ */ class UrlValidator extends ConstraintValidator { - public const PATTERN = '~^ + public const PATTERN = <<<'REGEX' + {^ (%s):// # protocol - (((?:[\_\.\pL\pN-]|%%[0-9A-Fa-f]{2})+:)?((?:[\_\.\pL\pN-]|%%[0-9A-Fa-f]{2})+)@)? # basic auth + ((?:[\pL\pN\-._~!$&'()*+,;=]|%%[0-9A-Fa-f]{2})++(?::(?:[:\pL\pN\-._~!$&'()*+,;=]|%%[0-9A-Fa-f]{2})*+)?@)? # basic auth ( (?: (?: (?:[\pL\pN\pS\pM\-\_]++\.)+ (?: - (?:xn--[a-z0-9-]++) # punycode in tld + (?:xn--[a-z0-9-]++) # punycode in tld | - (?:[\pL\pN\pM]++) # no punycode in tld + (?:[\pL\pN\pM]++) # no punycode in tld ) - ) # a multi-level domain name + ) # a multi-level domain name | - [a-z0-9\-\_]++ # a single-level domain name + [a-z0-9\-\_]++ # a single-level domain name )\.? - | # or - \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # an IP address - | # or + | # or + \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # an IP address + | # or \[ (?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,1}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,2}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,3}(?:(?:[0-9a-f]{1,4})))?::(?:(?:[0-9a-f]{1,4})):)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,4}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::)))) \] # an IPv6 address ) (:[0-9]+)? # a port (optional) - (?:/ (?:[\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) - $~ixuD'; + (?:/ (?:[\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) + $}ixuD + REGEX; /** * @return void diff --git a/Tests/Constraints/UrlValidatorTest.php b/Tests/Constraints/UrlValidatorTest.php index 27866b021..6fe8c67c7 100644 --- a/Tests/Constraints/UrlValidatorTest.php +++ b/Tests/Constraints/UrlValidatorTest.php @@ -209,6 +209,8 @@ public static function getValidUrls() ['http://xn--94bcy3esc8fb.xn--54b7fta0cc/'], ['http://www.example.com/%E0%B8%84%E0%B8%99%E0%B9%81%E0%B8%8B%E0%B9%88%E0%B8%A5%E0%B8%B5%E0%B9%89/'], ['http://www.example.com/%E3%81%8B/'], + ['https://l.o_g~i!n$u/'s(e)r*n+a,m;e=:p.a_s~s!w$o\'r(d)*+,;=secret@ftp.example.com/path/file.tar.gz'], + ['https://l(o)g%40in:pa$+word%20secret@ftp.example.com/path/file.tar.gz'], ]; } From 60dd71e219cd3d76fde906eb6b6c1271db628f5b Mon Sep 17 00:00:00 2001 From: Minna N <44906587+minna-xD@users.noreply.github.com> Date: Thu, 23 Oct 2025 22:49:35 +0300 Subject: [PATCH 71/74] Reviewed translations --- Resources/translations/validators.fi.xlf | 68 ++++++++++++------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/Resources/translations/validators.fi.xlf b/Resources/translations/validators.fi.xlf index d7d88d8b7..04d99cf57 100644 --- a/Resources/translations/validators.fi.xlf +++ b/Resources/translations/validators.fi.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - Tämä arvo ei ole kelvollinen IP-osoite. + Tämä arvo ei ole kelvollinen IP-osoite. 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. - Väliaikaista kansiota ei ole määritetty php.ini:ssä, tai määritetty kansio ei ole olemassa. + Väliaikaista kansiota ei ole määritetty php.ini:ssä, tai määritetty kansio ei ole olemassa. Cannot write temporary file to disk. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Tämä arvo ei ole kelvollinen kansainvälinen pankkitilinumero (IBAN). + Tämä arvo ei ole kelvollinen kansainvälinen pankkitilinumero (IBAN). This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Tämä arvo ei ole kelvollinen liiketoiminnan tunnistekoodi (BIC). + Tämä arvo ei ole kelvollinen liiketoiminnan tunnistekoodi (BIC). Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Tämä arvo ei ole kelvollinen UUID. + Tämä arvo ei ole kelvollinen UUID. This value should be a multiple of {{ compared_value }}. @@ -440,119 +440,119 @@ This URL is missing a top-level domain. - Tästä URL-osoitteesta puuttuu ylätason verkkotunnus. + 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. - Tämä arvo on liian lyhyt. Sen pitäisi sisältää vähintään yksi sana.|Tämä arvo on liian lyhyt. Sen pitäisi sisältää vähintään {{ min }} sanaa. + Tämä arvo on liian lyhyt. Sen pitäisi sisältää vähintään yksi sana.|Tämä arvo on liian lyhyt. Sen pitäisi sisältää vähintään {{ min }} sanaa. This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. - Tämä arvo on liian pitkä. Sen pitäisi sisältää vain yksi sana.|Tämä arvo on liian pitkä. Sen pitäisi sisältää {{ max }} sanaa tai vähemmän. + Tämä arvo on liian pitkä. Sen pitäisi sisältää vain yksi sana.|Tämä arvo on liian pitkä. Sen pitäisi sisältää {{ max }} sanaa tai vähemmän. This value does not represent a valid week in the ISO 8601 format. - Tämä arvo ei esitä kelvollista viikkoa ISO 8601 -muodossa. + Tämä arvo ei esitä kelvollista viikkoa ISO 8601 -muodossa. This value is not a valid week. - Tämä arvo ei ole kelvollinen viikko. + Tämä arvo ei ole kelvollinen viikko. This value should not be before week "{{ min }}". - Tämän arvon ei pitäisi olla ennen viikkoa "{{ min }}". + Tämän arvon ei pitäisi olla ennen viikkoa "{{ min }}". This value should not be after week "{{ max }}". - Tämän arvon ei pitäisi olla viikon "{{ max }}" jälkeen. + Tämän arvon ei pitäisi olla viikon "{{ max }}" jälkeen. This value is not a valid Twig template. - Tämä arvo ei ole kelvollinen Twig-malli. + Tämä arvo ei ole kelvollinen Twig-malli. This file is not a valid video. - Tämä tiedosto ei ole kelvollinen video. + Tämä tiedosto ei ole kelvollinen video. The size of the video could not be detected. - Videon kokoa ei voitu tunnistaa. + Videon kokoa ei voitu tunnistaa. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Videon leveys on liian suuri ({{ width }}px). Sallittu enimmäisleveys on {{ max_width }}px. + Videon leveys on liian suuri ({{ width }} px). Leveyden tulee olla enintään {{ max_width }} px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Videon leveys on liian pieni ({{ width }}px). Odotettu vähimmäisleveys on {{ min_width }} px. + Videon leveys on liian pieni ({{ width }} px). Leveyden tulee olla vähintään {{ min_width }} px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Videon korkeus on liian suuri ({{ height }}px). Sallittu enimmäiskorkeus on {{ max_height }}px. + Videon korkeus on liian suuri ({{ height }} px). Korkeuden tulee olla enintään {{ max_height }} px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Videon korkeus on liian pieni ({{ height }}px). Odotettu vähimmäiskorkeus on {{ min_height }}px. + Videon korkeus on liian pieni ({{ height }} px). Korkeuden tulee olla vähintään {{ min_height }} px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Videossa on liian vähän pikseleitä ({{ pixels }}). Odotettu vähimmäismäärä on {{ min_pixels }}. + Videossa on liian vähän pikseleitä ({{ pixels }}). Pikseleitä tulee olla vähintään {{ min_pixels }}. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Videossa on liikaa pikseleitä ({{ pixels }}). Odotettu enimmäismäärä on {{ max_pixels }}. + Videossa on liikaa pikseleitä ({{ pixels }}). Pikseleitä tulee olla enintään {{ max_pixels }}. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Videon suhde on liian suuri ({{ ratio }}). Sallittu enimmäissuhde on {{ max_ratio }}. + Videon kuvasuhde on liian suuri ({{ ratio }}). Suurin sallittu suhde on {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Videon kuvasuhde on liian pieni ({{ ratio }}). Odotettu vähimmäissuhde on {{ min_ratio }}. + Videon kuvasuhde on liian pieni ({{ ratio }}). Pienin sallittu suhde on {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Video on neliömäinen ({{ width }}x{{ height }}px). Neliövideot eivät ole sallittuja. + Video on neliön muotoinen ({{ width }}x{{ height }}px). Neliönmuotoiset videot eivät ole sallittuja. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Video on vaakanäytössä ({{ width }}x{{ height }} px). Vaaka-asentoiset videot eivät ole sallittuja. + Video on vaakasuuntainen ({{ width }}x{{ height }} px). Vaakasuuntaiset videot eivät ole sallittuja. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Video on pystysuunnassa ({{ width }}x{{ height }} px). Pystyvideot eivät ole sallittuja. + Video on pystysuuntainen ({{ width }}x{{ height }} px). Pystysuuntaiset videot eivät ole sallittuja. The video file is corrupted. - Videotiedosto on vioittunut. + Videotiedosto on vioittunut. The video contains multiple streams. Only one stream is allowed. - Videossa on useita virtoja. Vain yksi virta on sallittu. + Videossa on useita virtoja. Vain yksi virta on sallittu. Unsupported video codec "{{ codec }}". - Ei-tuettu videokoodekki ”{{ codec }}”. + Videokoodekkia ei tueta ({{ codec }}). Unsupported video container "{{ container }}". - Ei-tuettu videokontti "{{ container }}". + Videon säiliömuotoa ei tueta ({{ container }}). The image file is corrupted. - Kuvatiedosto on vioittunut. + Kuvatiedosto on vioittunut. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Kuvassa on liian vähän pikseleitä ({{ pixels }}). Odotettu vähimmäismäärä on {{ min_pixels }}. + Kuvassa on liian vähän pikseleitä ({{ pixels }}). Pikseleitä tulee olla vähintään {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Kuvassa on liikaa pikseleitä ({{ pixels }}). Odotettu enimmäismäärä on {{ max_pixels }}. + Kuvassa on liikaa pikseleitä ({{ pixels }}). Pikseleitä tulee olla enintään {{ max_pixels }}. This filename does not match the expected charset. - Tämän tiedostonimi ei vastaa odotettua merkistöä. + Tämä tiedostonimi ei vastaa odotettua merkistöä. From 5a2904dc351c7bd1fb402dfc4faccccd6f55ce01 Mon Sep 17 00:00:00 2001 From: Younes ENNAJI Date: Wed, 29 Oct 2025 01:43:49 +0100 Subject: [PATCH 72/74] [Validator] Fix call to undefined getParser() in YamlValidator --- Constraints/YamlValidator.php | 8 ++-- Tests/Constraints/YamlValidatorTest.php | 51 +++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 3 deletions(-) diff --git a/Constraints/YamlValidator.php b/Constraints/YamlValidator.php index 2675ed9aa..165e3fad8 100644 --- a/Constraints/YamlValidator.php +++ b/Constraints/YamlValidator.php @@ -39,17 +39,19 @@ public function validate(mixed $value, Constraint $constraint): void $value = (string) $value; + $parser = new Parser(); + /** @see \Symfony\Component\Yaml\Command\LintCommand::validate() */ - $prevErrorHandler = set_error_handler(function ($level, $message, $file, $line) use (&$prevErrorHandler) { + $prevErrorHandler = set_error_handler(static function ($level, $message, $file, $line) use (&$prevErrorHandler, $parser) { if (\E_USER_DEPRECATED === $level) { - throw new ParseException($message, $this->getParser()->getRealCurrentLineNb() + 1); + throw new ParseException($message, $parser->getRealCurrentLineNb() + 1); } return $prevErrorHandler ? $prevErrorHandler($level, $message, $file, $line) : false; }); try { - (new Parser())->parse($value, $constraint->flags); + $parser->parse($value, $constraint->flags); } catch (ParseException $e) { $this->context->buildViolation($constraint->message) ->setParameter('{{ error }}', $e->getMessage()) diff --git a/Tests/Constraints/YamlValidatorTest.php b/Tests/Constraints/YamlValidatorTest.php index a31892667..5a90ccf03 100644 --- a/Tests/Constraints/YamlValidatorTest.php +++ b/Tests/Constraints/YamlValidatorTest.php @@ -71,6 +71,27 @@ public function testInvalidFlags() ->assertRaised(); } + /** + * @dataProvider getDeprecationOnLinesData + */ + public function testDeprecationTriggersParseException(int $yamlLine, string $yamlValue) + { + $lines = explode("\n", $yamlValue); + $errorLine = end($lines); + $expectedError = 'This is a simulated deprecation at line '.$yamlLine.' (near "'.$errorLine.'")'; + + $constraint = new Yaml( + message: 'myMessageTest', + flags: YamlParser::PARSE_OBJECT, + ); + $this->validator->validate($yamlValue, $constraint); + $this->buildViolation('myMessageTest') + ->setParameter('{{ error }}', $expectedError) + ->setParameter('{{ line }}', $yamlLine) + ->setCode(Yaml::INVALID_YAML_ERROR) + ->assertRaised(); + } + public static function getValidValues() { return [ @@ -94,4 +115,34 @@ public static function getInvalidValues(): array ["key:\nvalue", 'Unable to parse at line 2 (near "value").', 2], ]; } + + /** + * @return array + */ + public static function getDeprecationOnLinesData(): array + { + $serialized = serialize(new DeprecatedObjectFixture()); + + return [ + 'deprecation at line 1' => [1, "object: !php/object '".$serialized."'"], + 'deprecation at line 2' => [2, "valid: yaml\nobject: !php/object '".$serialized."'"], + 'deprecation at line 5' => [5, "line1: value\nline2: value\nline3: value\nline4: value\nobject: !php/object '".$serialized."'"], + ]; + } +} + +/** + * Fixture class for triggering deprecation during unserialize. + */ +class DeprecatedObjectFixture +{ + public function __serialize(): array + { + return []; + } + + public function __unserialize(array $data): void + { + @trigger_error('This is a simulated deprecation', \E_USER_DEPRECATED); + } } From 99df8a769e64e399f510166141ea74f450e8dd1d Mon Sep 17 00:00:00 2001 From: Alexandr Samuilov Date: Thu, 6 Nov 2025 22:26:06 +0200 Subject: [PATCH 73/74] [Validator] Reviewed and corrected Belarussian translations for the Validator component in the validators.be.xlf file --- Resources/translations/validators.be.xlf | 96 ++++++++++++------------ 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/Resources/translations/validators.be.xlf b/Resources/translations/validators.be.xlf index d7060b5e0..13c6d43a2 100644 --- a/Resources/translations/validators.be.xlf +++ b/Resources/translations/validators.be.xlf @@ -20,7 +20,7 @@ The value you selected is not a valid choice. - Абранае вамі значэнне не сапраўднае. + Выбранае вамі значэнне не з’яўляецца сапраўдным. You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. @@ -32,7 +32,7 @@ One or more of the given values is invalid. - Адзін або некалькі пазначаных значэнняў з'яўляецца несапраўдным. + Адно або некалькі з зададзеных значэнняў не з’яўляюцца сапраўднымі. This field was not expected. @@ -76,15 +76,15 @@ This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. - Значэнне занадта доўгае. Яно павінна мець {{ limit }} сімвал або менш.|Значэнне занадта доўгае. Яно павінна мець {{ limit }} сімвалаў або менш. + Значэнне занадта доўгае. Яно павінна мець не больш за {{ limit }} сімвал.|Значэнне занадта доўгае. Яно павінна мець не больш за {{ limit }} сімвалаў. This value should be {{ limit }} or more. - Значэнне павінна быць {{ limit }} або больш. + Значэнне павінна быць не менш за {{ limit }}. This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. - Значэнне занадта кароткае. Яно павінна мець прынамсі {{ limit }} сімвал.|Значэнне занадта кароткае. Яно павінна мець прынамсі {{ limit }} сімвалаў. + Значэнне занадта кароткае. Яно павінна мець не менш за {{ limit }} сімвал.|Значэнне занадта кароткае. Яно павінна мець не менш за {{ limit }} сімвалаў. This value should not be blank. @@ -100,7 +100,7 @@ This value is not valid. - Значэнне з'яўляецца не сапраўдным. + Значэнне не з'яўляецца сапраўдным. This value is not a valid time. @@ -112,7 +112,7 @@ The two values should be equal. - Абодва значэнні павінны быць аднолькавымі. + Абодва значэнні павінны супадаць. The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. @@ -140,7 +140,7 @@ This value is not a valid language. - Значэнне не з'яўляецца сапраўдным мовай. + Значэнне не з'яўляецца сапраўднай мовай. This value is not a valid locale. @@ -168,11 +168,11 @@ The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Гэты выява занадта вялікая ({{ width }}px). Дазваляецца максімальная вышыня {{ max_width }}px. + Гэтая выява занадта высокая ({{ height }}px). Дазваляецца максімальная вышыня — {{ max_height }}px. The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Гэта выява занадта маленькая ({{ width }}px). Дазваляецца мінімальная вышыня {{ min_width }}px. + Гэтая выява занадта нізкая ({{ height }}px). Дазваляецца мінімальная вышыня — {{ min_height }}px. This value should be the user's current password. @@ -204,11 +204,11 @@ This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - Калекцыя павінна змяшчаць прынамсі {{ limit }} элемент.|Калекцыя павінна змяшчаць прынамсі {{ limit }} элементаў. + Калекцыя павінна змяшчаць не менш за {{ limit }} элемент.|Калекцыя павінна змяшчаць не менш за {{ limit }} элементаў. This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. - Калекцыя павінна змяшчаць {{ limit }} або менш элемент.|Калекцыя павінна змяшчаць {{ limit }} або менш элементаў. + Калекцыя павінна змяшчаць не больш за {{ limit }} элемент.|Калекцыя павінна змяшчаць не больш за {{ limit }} элементаў. This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. @@ -236,7 +236,7 @@ This value is neither a valid ISBN-10 nor a valid ISBN-13. - Гэта значэнне не з'яўляецца сапраўдным ISBN-10 або ISBN-13. + Гэта значэнне не з'яўляецца ні сапраўдным ISBN-10, ні сапраўдным ISBN-13. This value is not a valid ISSN. @@ -252,11 +252,11 @@ This value should be greater than {{ compared_value }}. - Значэнне павінна быць больш чым {{ compared_value }}. + Значэнне павінна быць больш за {{ compared_value }}. This value should be greater than or equal to {{ compared_value }}. - Значэнне павінна быць больш чым або раўняцца {{ compared_value }}. + Значэнне павінна быць больш за або роўнае {{ compared_value }}. This value should be identical to {{ compared_value_type }} {{ compared_value }}. @@ -264,11 +264,11 @@ This value should be less than {{ compared_value }}. - Значэнне павінна быць менш чым {{ compared_value }}. + Значэнне павінна быць менш за {{ compared_value }}. This value should be less than or equal to {{ compared_value }}. - Значэнне павінна быць менш чым або раўняцца {{ compared_value }}. + Значэнне павінна быць менш за або роўнае {{ compared_value }}. This value should not be equal to {{ compared_value }}. @@ -280,11 +280,11 @@ The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Суадносіны бакоў выявы з'яўляецца занадта вялікім ({{ ratio }}). Дазваляецца максімальныя суадносіны {{max_ratio}} . + Суадносіны бакоў выявы занадта вялікія ({{ ratio }}). Дазваляецца максімальныя суадносіны {{max_ratio}} . The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Суадносіны бакоў выявы з'яўляецца занадта маленькімі ({{ ratio }}). Дазваляецца мінімальныя суадносіны {{ min_ratio }}. + Суадносіны бакоў выявы занадта малыя ({{ ratio }}). Дазваляецца мінімальныя суадносіны {{ min_ratio }}. The image is square ({{ width }}x{{ height }}px). Square images are not allowed. @@ -304,7 +304,7 @@ The host could not be resolved. - Не магчыма знайсці імя хоста. + Не магчыма вызначыць імя хоста. This value does not match the expected {{ charset }} charset. @@ -344,7 +344,7 @@ This value should be either positive or zero. - Значэнне павінна быць дадатным ці нуль. + Значэнне павінна быць або дадатным, або роўным нулю. This value should be negative. @@ -352,7 +352,7 @@ This value should be either negative or zero. - Значэнне павінна быць адмоўным ці нуль. + Значэнне павінна быць або адмоўным, або роўным нулю. This value is not a valid timezone. @@ -368,11 +368,11 @@ This value is not a valid hostname. - Значэнне не з'яўляецца карэктным імем хаста. + Значэнне не з'яўляецца сапраўднай/карэктнай назвай хоста. The number of elements in this collection should be a multiple of {{ compared_value }}. - Колькасць элементаў у гэтай калекцыі павінна быць кратным {{compared_value}}. + Колькасць элементаў у гэтай калекцыі павінна быць кратнай {{compared_value}}. This value should satisfy at least one of the following constraints: @@ -388,7 +388,7 @@ This value should be a valid expression. - Значэнне не з'яўляецца сапраўдным выразам. + Значэнне павінна быць сапраўдным выразам. This value is not a valid CSS color. @@ -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. - Назва файла занадта доўгая. Ён павінен мець {{ filename_max_length }} сімвал або менш.|Назва файла занадта доўгая. Ён павінен мець {{ filename_max_length }} сімвалы або менш.|Назва файла занадта доўгая. Ён павінен мець {{ filename_max_length }} сімвалаў або менш. + Назва файла занадта доўгая. Яна павинна мець {{ filename_max_length }} сімвал або менш.|Назва файла занадта доўгая. Яна павінна мець {{ filename_max_length }} сімвалы або менш.|Назва файла занадта доўгая. Яна павінна мець {{ filename_max_length }} сімвалаў або менш. The password strength is too low. Please use a stronger password. @@ -420,7 +420,7 @@ Mixing numbers from different scripts is not allowed. - Змешванне лікаў з розных алфавітаў не дапускаецца. + Змешванне лічбаў з розных алфавітаў не дапускаецца. Using hidden overlay characters is not allowed. @@ -440,7 +440,7 @@ This URL is missing a top-level domain. - Гэтаму URL бракуе дамен верхняга ўзроўню. + У гэтым 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. @@ -472,83 +472,83 @@ This file is not a valid video. - Гэты файл не з'яўляецца сапраўдным відэа. + Гэты файл не з'яўляецца сапраўдным відэа. The size of the video could not be detected. - Не ўдалося вызначыць памер відэа. + Не ўдалося вызначыць памер відэа. The video width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Шырыня відэа занадта вялікая ({{ width }}px). Дапушчальная максімальная шырыня — {{ max_width }}px. + Шырыня відэа занадта вялікая ({{ width }}px). Дапушчальная максімальная шырыня — {{ max_width }}px. The video width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Шырыня відэа занадта малая ({{ width }}px). Мінімальная чаканая шырыня — {{ min_width }}px. + Шырыня відэа занадта малая ({{ width }}px). Мінімальная чаканая шырыня — {{ min_width }}px. The video height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Вышыня відэа занадта вялікая ({{ height }}px). Дазволеная максімальная вышыня — {{ max_height }}px. + Вышыня відэа занадта вялікая ({{ height }}px). Дазволеная максімальная вышыня — {{ max_height }}px. The video height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Вышыня відэа занадта малая ({{ height }}px). Чаканая мінімальная вышыня — {{ min_height }}px. + Вышыня відэа занадта малая ({{ height }}px). Чаканая мінімальная вышыня — {{ min_height }}px. The video has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - Відэа мае занадта мала пікселяў ({{ pixels }}). Мінімальная колькасць чакаецца {{ min_pixels }}. + Відэа мае занадта мала пікселяў ({{ pixels }}). Мінімальная колькасць чакаецца {{ min_pixels }}. The video has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Відэа мае занадта шмат пікселяў ({{ pixels }}). Максімальна дапушчальная колькасць — {{ max_pixels }}. + Відэа мае занадта шмат пікселяў ({{ pixels }}). Максімальна дапушчальная колькасць — {{ max_pixels }}. The video ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Суадносіны відэа занадта вялікія ({{ ratio }}). Дапушчальна максімальнае суадносіны — {{ max_ratio }}. + Суадносіны відэа занадта вялікія ({{ ratio }}). Дапушчальнае максімальнае суадносіна — {{ max_ratio }}. The video ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Суадносіны відэа занадта малыя ({{ ratio }}). Мінімальнае чаканае суадносіны — {{ min_ratio }}. + Суадносіны відэа занадта малыя ({{ ratio }}). Мінімальнае чаканае суадносіна — {{ min_ratio }}. The video is square ({{ width }}x{{ height }}px). Square videos are not allowed. - Відэа квадратнае ({{ width }}x{{ height }}px). Квадратныя відэа не дазволены. + Відэа квадратнае ({{ width }}x{{ height }}px). Квадратныя відэа не дазваляюцца. The video is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented videos are not allowed. - Відэа ў ландшафтнай арыентацыі ({{ width }}x{{ height }} пікс.). Ландшафтныя відэа не дазваляюцца. + Відэа ў ландшафтнай арыентацыі ({{ width }}x{{ height }} px). Ландшафтныя відэа не дазваляюцца. The video is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented videos are not allowed. - Відэа ў партрэтнай арыентацыі ({{ width }}x{{ height }}px). Відэа ў партрэтнай арыентацыі не дазваляюцца. + Відэа ў партрэтнай арыентацыі ({{ width }}x{{ height }}px). Відэа ў партрэтнай арыентацыі не дазваляюцца. The video file is corrupted. - Відэафайл пашкоджаны. + Відэафайл пашкоджаны. The video contains multiple streams. Only one stream is allowed. - Відэа змяшчае некалькі патокаў. Дазволены толькі адзін паток. + Відэа змяшчае некалькі патокаў. Дазволены толькі адзін паток. Unsupported video codec "{{ codec }}". - Непадтрымліваемы відэакодэк «{{ codec }}». + Непадтрымліваемы відэакодэк «{{ codec }}». Unsupported video container "{{ container }}". - Непадтрымліваемы кантэйнер відэа "{{ container }}". + Непадтрымліваемы кантэйнер відэа "{{ container }}". The image file is corrupted. - Файл выявы пашкоджаны. + Файл выявы пашкоджаны. The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels. - У выяве занадта мала пікселяў ({{ pixels }}). Чакаемы мінімум — {{ min_pixels }}. + У выяве занадта мала пікселяў ({{ pixels }}). Мінімальная колькасць — {{ min_pixels }}. The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Малюнак мае занадта шмат пікселяў ({{ pixels }}). Чаканая максімальная колькасць {{ max_pixels }}. + Малюнак мае занадта шмат пікселяў ({{ pixels }}). Максімальная дапушчальная колькасць {{ max_pixels }}. This filename does not match the expected charset. From d0c0316ca2d2f099eabe5dc3b311d1b5cad1e326 Mon Sep 17 00:00:00 2001 From: dogedede <167682813+dogedede@users.noreply.github.com> Date: Sun, 9 Nov 2025 20:05:08 +0800 Subject: [PATCH 74/74] Remove review state for Belarusian translations (entries 141 and 142) --- Resources/translations/validators.be.xlf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/translations/validators.be.xlf b/Resources/translations/validators.be.xlf index 13c6d43a2..448a2e9e4 100644 --- a/Resources/translations/validators.be.xlf +++ b/Resources/translations/validators.be.xlf @@ -548,11 +548,11 @@ The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels. - Малюнак мае занадта шмат пікселяў ({{ pixels }}). Максімальная дапушчальная колькасць {{ max_pixels }}. + Малюнак мае занадта шмат пікселяў ({{ pixels }}). Максімальная дапушчальная колькасць {{ max_pixels }}. This filename does not match the expected charset. - Гэта назва файла не адпавядае чаканаму набору знакаў. + Гэта назва файла не адпавядае чаканаму набору знакаў.