Skip to content

Commit a8396f3

Browse files
committed
Tweaks
1 parent afd0f72 commit a8396f3

File tree

1 file changed

+10
-45
lines changed

1 file changed

+10
-45
lines changed

validation.rst

Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -719,16 +719,21 @@ constraint that's applied to the class itself. When that class is validated,
719719
methods specified by that constraint are simply executed so that each can
720720
provide more custom validation.
721721

722-
Debugging the constraints
722+
Debugging the Constraints
723723
-------------------------
724724

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:
726731

727732
.. code-block:: terminal
728733
729-
$ php bin/console debug:validator 'App\Entity\DummyClassOne'
734+
$ php bin/console debug:validator 'App\Entity\SomeClass'
730735
731-
App\Entity\DummyClassOne
736+
App\Entity\SomeClass
732737
-----------------------------------------------------
733738
734739
+---------------+--------------------------------------------------+---------+------------------------------------------------------------+
@@ -748,52 +753,12 @@ The ``debug:validator 'App\Entity\DummyClassOne'`` command lists validation cons
748753
| | | | ] |
749754
+---------------+--------------------------------------------------+---------+------------------------------------------------------------+
750755
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:
752757

753758
.. code-block:: terminal
754759
755760
$ php bin/console debug:validator src/Entity
756761
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-
797762
Final Thoughts
798763
--------------
799764

0 commit comments

Comments
 (0)