From 8e777938dcd1712f57505141c3ef0f4584eb0152 Mon Sep 17 00:00:00 2001 From: JK Groupe Date: Thu, 19 Jun 2025 16:15:46 +0200 Subject: [PATCH] [Validator] Add missing HasNamedArguments to Image and AtLeastOneOf constraints --- src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php | 2 ++ src/Symfony/Component/Validator/Constraints/Image.php | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php b/src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php index b20ea0df0abe8..20d55f458b6b2 100644 --- a/src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php +++ b/src/Symfony/Component/Validator/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/src/Symfony/Component/Validator/Constraints/Image.php b/src/Symfony/Component/Validator/Constraints/Image.php index 5a4b3e12960e8..d9b7c8822e014 100644 --- a/src/Symfony/Component/Validator/Constraints/Image.php +++ b/src/Symfony/Component/Validator/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,