Skip to content

Commit a48cfc1

Browse files
committed
minor #6011 Fixed formatting issues (javiereguiluz)
This PR was squashed before being merged into the 2.3 branch (closes #6011). Discussion ---------- Fixed formatting issues | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | - This is how these issues are displayed on symfony.com right now: ![issue1](https://cloud.githubusercontent.com/assets/73419/11779238/2ff1cf62-a25a-11e5-81a6-d446a3d7f499.png) --- ![issue2](https://cloud.githubusercontent.com/assets/73419/11779241/31dcc912-a25a-11e5-80de-67741d7318da.png) --- ![issue3](https://cloud.githubusercontent.com/assets/73419/11779243/337e8eae-a25a-11e5-867b-d388b4f15f94.png) --- ![issue4](https://cloud.githubusercontent.com/assets/73419/11779248/358e0a26-a25a-11e5-9764-3b26892dd363.png) --- ![issue5](https://cloud.githubusercontent.com/assets/73419/11779250/375762e4-a25a-11e5-93b9-a00684fb0f7c.png) Commits ------- c7e78db Fixed formatting issues
2 parents 39e132b + c7e78db commit a48cfc1

File tree

5 files changed

+87
-87
lines changed

5 files changed

+87
-87
lines changed

book/controller.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ and then redirects. The message key (``notice`` in this example) can be anything
638638
you'll use this key to retrieve the message.
639639

640640
In the template of the next page (or even better, in your base layout template),
641-
read any flash messages from the session::
641+
read any flash messages from the session:
642642

643643
.. configuration-block::
644644

cookbook/controller/service.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,7 @@ controller:
277277
in the :class:`Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface`.
278278

279279
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::getDoctrine` (service: ``doctrine``)
280-
281-
*Simply inject doctrine instead of fetching it from the container*
280+
*Simply inject doctrine instead of fetching it from the container.*
282281

283282
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::getUser` (service: ``security.context``)
284283
.. code-block:: php

cookbook/security/custom_provider.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,9 @@ options, the password may be encoded multiple times and encoded to base64.
324324
before comparing it to your encoded password. If ``getSalt()`` returns
325325
nothing, then the submitted password is simply encoded using the algorithm
326326
you specify in ``security.yml``. If a salt *is* specified, then the following
327-
value is created and *then* hashed via the algorithm:
327+
value is created and *then* hashed via the algorithm::
328328

329-
``$password.'{'.$salt.'}';``
329+
$password.'{'.$salt.'}'
330330

331331
If your external users have their passwords salted via a different method,
332332
then you'll need to do a bit more work so that Symfony properly encodes

cookbook/upgrade/_update_dep_errors.rst.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Dependency Errors
44
If you get a dependency error, it may simply mean that you need to upgrade
55
other Symfony dependencies too. In that case, try the following command:
66

7+
.. code-block:: bash
8+
79
$ composer update symfony/symfony --with-dependencies
810

911
This updates ``symfony/symfony`` and *all* packages that it depends on, which will

reference/constraints/Callback.rst

Lines changed: 81 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -132,112 +132,111 @@ methods
132132
This is an array of the methods that should be executed during the validation
133133
process. Each method can be one of the following formats:
134134

135-
1) **String method name**
135+
1) String method name
136+
.....................
136137

137-
If the name of a method is a simple string (e.g. ``isAuthorValid``),
138-
that method will be called on the same object that's being validated
139-
and the ``ExecutionContextInterface`` will be the only argument (see
140-
the above example).
138+
If the name of a method is a simple string (e.g. ``isAuthorValid``), that method
139+
will be called on the same object that's being validated and the
140+
``ExecutionContextInterface`` will be the only argument (see the above example).
141141

142142
2) **Static array callback**
143+
............................
143144

144-
Each method can also be specified as a standard array callback:
145+
Each method can also be specified as a standard array callback:
145146

146-
.. configuration-block::
147+
.. configuration-block::
147148

148-
.. code-block:: php-annotations
149+
.. code-block:: php-annotations
149150
150-
// src/AppBundle/Entity/Author.php
151-
use Symfony\Component\Validator\Constraints as Assert;
151+
// src/AppBundle/Entity/Author.php
152+
use Symfony\Component\Validator\Constraints as Assert;
152153
153-
/**
154-
* @Assert\Callback(methods={
155-
* { "AppBundle\MyStaticValidatorClass", "isAuthorValid" }
156-
* })
157-
*/
158-
class Author
159-
{
160-
}
154+
/**
155+
* @Assert\Callback(methods={
156+
* { "AppBundle\MyStaticValidatorClass", "isAuthorValid" }
157+
* })
158+
*/
159+
class Author
160+
{
161+
}
161162
162-
.. code-block:: yaml
163+
.. code-block:: yaml
163164
164-
# src/AppBundle/Resources/config/validation.yml
165-
AppBundle\Entity\Author:
166-
constraints:
167-
- Callback:
168-
methods:
169-
- [AppBundle\MyStaticValidatorClass, isAuthorValid]
165+
# src/AppBundle/Resources/config/validation.yml
166+
AppBundle\Entity\Author:
167+
constraints:
168+
- Callback:
169+
methods:
170+
- [AppBundle\MyStaticValidatorClass, isAuthorValid]
170171
171-
.. code-block:: xml
172+
.. code-block:: xml
172173
173-
<!-- src/AppBundle/Resources/config/validation.xml -->
174-
<?xml version="1.0" encoding="UTF-8" ?>
175-
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping"
176-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
177-
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
174+
<!-- src/AppBundle/Resources/config/validation.xml -->
175+
<?xml version="1.0" encoding="UTF-8" ?>
176+
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping"
177+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
178+
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
178179
179-
<class name="AppBundle\Entity\Author">
180-
<constraint name="Callback">
181-
<option name="methods">
182-
<value>
183-
<value>AppBundle\MyStaticValidatorClass</value>
184-
<value>isAuthorValid</value>
185-
</value>
186-
</option>
187-
</constraint>
188-
</class>
189-
</constraint-mapping>
180+
<class name="AppBundle\Entity\Author">
181+
<constraint name="Callback">
182+
<option name="methods">
183+
<value>
184+
<value>AppBundle\MyStaticValidatorClass</value>
185+
<value>isAuthorValid</value>
186+
</value>
187+
</option>
188+
</constraint>
189+
</class>
190+
</constraint-mapping>
190191
191-
.. code-block:: php
192+
.. code-block:: php
192193
193-
// src/AppBundle/Entity/Author.php
194+
// src/AppBundle/Entity/Author.php
194195
195-
use Symfony\Component\Validator\Mapping\ClassMetadata;
196-
use Symfony\Component\Validator\Constraints\Callback;
196+
use Symfony\Component\Validator\Mapping\ClassMetadata;
197+
use Symfony\Component\Validator\Constraints\Callback;
197198
198-
class Author
199+
class Author
200+
{
201+
public $name;
202+
203+
public static function loadValidatorMetadata(ClassMetadata $metadata)
199204
{
200-
public $name;
201-
202-
public static function loadValidatorMetadata(ClassMetadata $metadata)
203-
{
204-
$metadata->addConstraint(new Callback(array(
205-
'methods' => array(
206-
array(
207-
'AppBundle\MyStaticValidatorClass',
208-
'isAuthorValid',
209-
),
205+
$metadata->addConstraint(new Callback(array(
206+
'methods' => array(
207+
array(
208+
'AppBundle\MyStaticValidatorClass',
209+
'isAuthorValid',
210210
),
211-
)));
212-
}
211+
),
212+
)));
213213
}
214+
}
214215
215-
In this case, the static method ``isAuthorValid`` will be called on
216-
the ``AppBundle\MyStaticValidatorClass`` class. It's passed both
217-
the original object being validated (e.g. ``Author``) as well as the
218-
``ExecutionContextInterface``::
216+
In this case, the static method ``isAuthorValid`` will be called on the
217+
``AppBundle\MyStaticValidatorClass`` class. It's passed both the original object
218+
being validated (e.g. ``Author``) as well as the ``ExecutionContextInterface``::
219219

220-
namespace AppBundle;
220+
namespace AppBundle;
221221

222-
use Symfony\Component\Validator\ExecutionContextInterface;
223-
use AppBundle\Entity\Author;
222+
use Symfony\Component\Validator\ExecutionContextInterface;
223+
use AppBundle\Entity\Author;
224224

225-
class MyStaticValidatorClass
226-
{
227-
public static function isAuthorValid(
228-
Author $author,
229-
ExecutionContextInterface $context
230-
) {
231-
// ...
232-
}
225+
class MyStaticValidatorClass
226+
{
227+
public static function isAuthorValid(
228+
Author $author,
229+
ExecutionContextInterface $context
230+
) {
231+
// ...
233232
}
233+
}
234234

235-
.. tip::
235+
.. tip::
236236

237-
If you specify your ``Callback`` constraint via PHP, then you also
238-
have the option to make your callback either a PHP closure or a
239-
non-static callback. It is *not* currently possible, however, to
240-
specify a :term:`service` as a constraint. To validate using a service,
241-
you should :doc:`create a custom validation constraint
242-
</cookbook/validation/custom_constraint>` and add that new constraint
243-
to your class.
237+
If you specify your ``Callback`` constraint via PHP, then you also have the
238+
option to make your callback either a PHP closure or a non-static callback.
239+
It is *not* currently possible, however, to specify a :term:`service` as a
240+
constraint. To validate using a service, you should :doc:`create a custom
241+
validation constraint </cookbook/validation/custom_constraint>` and add that
242+
new constraint to your class.

0 commit comments

Comments
 (0)