@@ -344,8 +344,8 @@ provides a sequence of groups to be validated:
344344 }
345345 }
346346
347- Advanced Group Sequence Provider
348- --------------------------------
347+ Advanced Validation Group Provider
348+ ----------------------------------
349349
350350In the previous section, you learned how to dynamically determine the
351351sequence of groups to apply based on the state of your entity. This
@@ -359,21 +359,21 @@ be cumbersome, and the implementation might not align with the entity
359359responsibilities.
360360
361361To address this, you can now configure the implementation of the
362- :class: `Symfony\\ Component\\ Validator\\ GroupSequenceProviderInterface `
363- outside of the entity, and even register the group sequence provider as a
362+ :class: `Symfony\\ Component\\ Validator\\ GroupProviderInterface `
363+ outside of the entity, and even register the group provider as a
364364service if necessary.
365365
366366Here's how you can achieve this:
367367
368- 1) **Define a Separate Group Sequence Provider Class: ** You can create a class that
369- implements the :class: `Symfony\\ Component\\ Validator\\ GroupSequenceProviderInterface `
368+ 1) **Define a Separate Group Provider Class: ** You can create a class that
369+ implements the :class: `Symfony\\ Component\\ Validator\\ GroupProviderInterface `
370370 and handles the dynamic group sequence logic.
371371 2) **Configure the User with the Provider: ** Use the ``class `` option within the
372372 :class: `Symfony\\ Component\\ Validator\\ Constraints\\ GroupSequenceProvider `
373373 attribute to link the entity with the provider class.
374374 3) **Autowiring or Manual Tagging: ** If autowiring is enabled, your custom provider
375375 will be automatically linked. Otherwise, you can manually tag your service with
376- ``validator.group_sequence_provider ``.
376+ ``validator.group_provider ``.
377377
378378.. configuration-block ::
379379
@@ -383,9 +383,9 @@ Here's how you can achieve this:
383383 namespace App\Entity;
384384
385385 // ...
386- use App\Validator\UserGroupSequenceProvider ;
386+ use App\Validator\UserGroupProvider ;
387387
388- #[Assert\GroupSequenceProvider(class: UserGroupSequenceProvider ::class)]
388+ #[Assert\GroupSequenceProvider(class: UserGroupProvider ::class)]
389389 class User
390390 {
391391 // ...
@@ -395,7 +395,7 @@ Here's how you can achieve this:
395395
396396 # config/validator/validation.yaml
397397 App\Entity\User :
398- group_sequence_provider : App\Validator\UserGroupSequenceProvider
398+ group_sequence_provider : App\Validator\UserGroupProvider
399399
400400 .. code-block :: xml
401401
@@ -408,7 +408,7 @@ Here's how you can achieve this:
408408
409409 <class name =" App\Entity\User" >
410410 <group-sequence-provider >
411- <value >App\Validator\UserGroupSequenceProvider </value >
411+ <value >App\Validator\UserGroupProvider </value >
412412 </group-sequence-provider >
413413 <!-- ... -->
414414 </class >
@@ -420,7 +420,7 @@ Here's how you can achieve this:
420420 namespace App\Entity;
421421
422422 // ...
423- use App\Validator\UserGroupSequenceProvider ;
423+ use App\Validator\UserGroupProvider ;
424424 use Symfony\Component\Validator\Mapping\ClassMetadata;
425425
426426 class User
@@ -429,7 +429,7 @@ Here's how you can achieve this:
429429
430430 public static function loadValidatorMetadata(ClassMetadata $metadata): void
431431 {
432- $metadata->setGroupSequenceProviderClass(UserGroupSequenceProvider ::class);
432+ $metadata->setGroupProviderClass(UserGroupProvider ::class);
433433 $metadata->setGroupSequenceProvider(true);
434434 // ...
435435 }
0 commit comments