Skip to content

Commit f312787

Browse files
committed
Minor tweak
1 parent c86d3a0 commit f312787

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

validation.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,6 @@ order to be valid. These rules are usually defined using PHP code or
4747
attributes but they can also be defined as ``.yaml`` or ``.xml`` files inside
4848
the ``config/validator/`` directory.
4949

50-
.. tip::
51-
52-
Symfony provides a JSON schema for validation mapping files that enables
53-
autocompletion and validation in IDEs like PhpStorm. Add the following
54-
``$schema`` key at the beginning of your YAML files to enable this feature:
55-
56-
.. code-block:: yaml
57-
58-
# config/validator/validation.yaml
59-
'$schema': https://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.json
60-
App\Entity\Author:
61-
properties:
62-
# your IDE will now provide autocompletion here...
63-
64-
.. versionadded:: 7.4
65-
66-
The JSON schema for validation mapping files was introduced in Symfony 7.4.
67-
6850
For example, to indicate that the ``$name`` property must not be empty, add the
6951
following:
7052

@@ -137,6 +119,24 @@ be passed to the validator service to be checked.
137119
get the value of any property, so they can be public, private or protected
138120
(see :ref:`validator-constraint-targets`).
139121

122+
.. tip::
123+
124+
Symfony provides a JSON schema for validation mapping files that enables
125+
autocompletion and validation in IDEs like PhpStorm. Add the following
126+
``$schema`` key at the beginning of your YAML files to enable this feature:
127+
128+
.. code-block:: yaml
129+
130+
# config/validator/validation.yaml
131+
'$schema': https://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.json
132+
App\Entity\Author:
133+
properties:
134+
# your IDE will now provide autocompletion here...
135+
136+
.. versionadded:: 7.4
137+
138+
The JSON schema for validation mapping files was introduced in Symfony 7.4.
139+
140140
Using the Validator Service
141141
~~~~~~~~~~~~~~~~~~~~~~~~~~~
142142

0 commit comments

Comments
 (0)