From b1f7b83fdc77954d822a638d4dbeefba4bb73f62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 16 Dec 2025 14:53:33 +0100 Subject: [PATCH] Replace `PhonenumberConstraint` with `PhoneNumber` constraint in user profile update. - Updated the `UpdateProfileCommand` to use `\Misd\PhoneNumberBundle\Validator\Constraints\PhoneNumber` instead of the deprecated `PhonenumberConstraint`. - Removed unused `PhonenumberConstraint` imports from relevant files. --- .../Action/User/UpdateProfile/UpdateProfileCommand.php | 3 +-- src/Bundle/ChillMainBundle/Entity/User.php | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Action/User/UpdateProfile/UpdateProfileCommand.php b/src/Bundle/ChillMainBundle/Action/User/UpdateProfile/UpdateProfileCommand.php index 061f8e55a..d0c8e4ac7 100644 --- a/src/Bundle/ChillMainBundle/Action/User/UpdateProfile/UpdateProfileCommand.php +++ b/src/Bundle/ChillMainBundle/Action/User/UpdateProfile/UpdateProfileCommand.php @@ -13,7 +13,6 @@ namespace Chill\MainBundle\Action\User\UpdateProfile; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Notification\NotificationFlagManager; -use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint; use libphonenumber\PhoneNumber; use Symfony\Component\Validator\Constraints as Assert; @@ -22,7 +21,7 @@ final class UpdateProfileCommand public array $notificationFlags = []; public function __construct( - #[PhonenumberConstraint] + #[\Misd\PhoneNumberBundle\Validator\Constraints\PhoneNumber] public ?PhoneNumber $phonenumber, #[Assert\Choice(choices: ['fr', 'nl'], message: 'Locale must be either "fr" or "nl"')] public string $locale = 'fr', diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index d1f2c4277..aca4134be 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -23,7 +23,6 @@ use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Serializer\Annotation as Serializer; use Symfony\Component\Validator\Context\ExecutionContextInterface; -use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint; use Symfony\Component\Validator\Constraints as Assert; /**