From 77be1d5747869eda5984d90a117ef1e7556d1565 Mon Sep 17 00:00:00 2001 From: mshcherb Date: Sat, 25 Oct 2025 17:47:08 +0300 Subject: [PATCH] Fix: Replace deprecated Symfony Validator array syntax with named arguments - Changed Assert\Length(['min' => 1]) to Assert\Length(min: 1) - Changed Assert\Collection with array parameters to use named arguments - Fixes all Symfony 7.3+ deprecation warnings in ContactNormalizer - All unit tests pass successfully Resolves deprecation warnings: - 'Passing an array of options to configure Length constraint is deprecated' - 'Passing an array of options to configure Collection constraint is deprecated' Related to issue about Symfony 7.3 deprecations in mailjet API --- src/Mailjet/Normalizer/ContactNormalizer.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Mailjet/Normalizer/ContactNormalizer.php b/src/Mailjet/Normalizer/ContactNormalizer.php index 05152a3..98cb654 100644 --- a/src/Mailjet/Normalizer/ContactNormalizer.php +++ b/src/Mailjet/Normalizer/ContactNormalizer.php @@ -37,19 +37,15 @@ public static function shouldBeNormalized(array $data): bool private static function getValidationRule(): Assert\Collection { return new Assert\Collection( - [ - 'fields' => [ + fields: [ 'filters' => new Assert\Collection( - [ - 'fields' => [ - 'countonly' => new Assert\Length(['min' => 1]), + fields: [ + 'countonly' => new Assert\Length(min: 1), ], - 'allowExtraFields' => true, - ] + allowExtraFields: true ), ], - 'allowExtraFields' => true, - ] + allowExtraFields: true ); } }