@@ -719,16 +719,21 @@ constraint that's applied to the class itself. When that class is validated,
719
719
methods specified by that constraint are simply executed so that each can
720
720
provide more custom validation.
721
721
722
- Debugging the constraints
722
+ Debugging the Constraints
723
723
-------------------------
724
724
725
- The ``debug:validator 'App\Entity\DummyClassOne' `` command lists validation constraints of ``App\Entity\DummyClassOne `` resource.
725
+ .. versionadded :: 5.2
726
+
727
+ The ``debug:validator `` command was introduced in Symfony 5.2.
728
+
729
+ Use the ``debug:validator `` command to list the validation constraints of a
730
+ given class:
726
731
727
732
.. code-block :: terminal
728
733
729
- $ php bin/console debug:validator 'App\Entity\DummyClassOne '
734
+ $ php bin/console debug:validator 'App\Entity\SomeClass '
730
735
731
- App\Entity\DummyClassOne
736
+ App\Entity\SomeClass
732
737
-----------------------------------------------------
733
738
734
739
+---------------+--------------------------------------------------+---------+------------------------------------------------------------+
@@ -748,52 +753,12 @@ The ``debug:validator 'App\Entity\DummyClassOne'`` command lists validation cons
748
753
| | | | ] |
749
754
+---------------+--------------------------------------------------+---------+------------------------------------------------------------+
750
755
751
- You can also list validation constraints for all resources of a path.
756
+ You can also validate all the classes stored in a given directory:
752
757
753
758
.. code-block :: terminal
754
759
755
760
$ php bin/console debug:validator src/Entity
756
761
757
- App\Entity\DummyClassOne
758
- ------------------------
759
-
760
- +---------------+--------------------------------------------------+---------+------------------------------------------------------------+
761
- | Property | Name | Groups | Options |
762
- +---------------+--------------------------------------------------+---------+------------------------------------------------------------+
763
- | firstArgument | Symfony\Component\Validator\Constraints\NotBlank | Default | [ |
764
- | | | | "message" => "This value should not be blank.", |
765
- | | | | "allowNull" => false, |
766
- | | | | "normalizer" => null, |
767
- | | | | "payload" => null |
768
- | | | | ] |
769
- | firstArgument | Symfony\Component\Validator\Constraints\Email | Default | [ |
770
- | | | | "message" => "This value is not a valid email address.", |
771
- | | | | "mode" => null, |
772
- | | | | "normalizer" => null, |
773
- | | | | "payload" => null |
774
- | | | | ] |
775
- +---------------+--------------------------------------------------+---------+------------------------------------------------------------+
776
-
777
- App\Entity\DummyClassTwo
778
- ------------------------
779
-
780
- +---------------+--------------------------------------------------+---------+------------------------------------------------------------+
781
- | Property | Name | Groups | Options |
782
- +---------------+--------------------------------------------------+---------+------------------------------------------------------------+
783
- | firstArgument | Symfony\Component\Validator\Constraints\NotBlank | Default | [ |
784
- | | | | "message" => "This value should not be blank.", |
785
- | | | | "allowNull" => false, |
786
- | | | | "normalizer" => null, |
787
- | | | | "payload" => null |
788
- | | | | ] |
789
- | firstArgument | Symfony\Component\Validator\Constraints\Email | Default | [ |
790
- | | | | "message" => "This value is not a valid email address.", |
791
- | | | | "mode" => null, |
792
- | | | | "normalizer" => null, |
793
- | | | | "payload" => null |
794
- | | | | ] |
795
- +---------------+--------------------------------------------------+---------+------------------------------------------------------------+
796
-
797
762
Final Thoughts
798
763
--------------
799
764
0 commit comments