Skip to content

Commit c9a475a

Browse files
committed
Merge branch '3.4' into 4.0
2 parents 1865baf + c71b040 commit c9a475a

26 files changed

+80
-100
lines changed

bundles/configuration.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ bundle configuration would look like:
110110
For parameter handling within a dependency injection container see
111111
:doc:`/configuration/using_parameters_in_dic`.
112112

113-
114113
Processing the ``$configs`` Array
115114
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116115

@@ -264,7 +263,6 @@ In your extension, you can load this and dynamically set its arguments::
264263
$def->replaceArgument(1, $config['twitter']['client_secret']);
265264
}
266265

267-
268266
.. tip::
269267

270268
Instead of calling ``processConfiguration()`` in your extension each time you

components/console/helpers/questionhelper.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ method::
256256
$name = $helper->ask($input, $output, $question);
257257
}
258258

259-
260259
.. caution::
261260

262261
The normalizer is called first and the returned value is used as the input

components/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ The Components
44
.. toctree::
55
:maxdepth: 1
66
:glob:
7-
7+
88
using_components
99
*

components/options_resolver.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ is thrown::
376376
For options with more complicated validation schemes, pass a closure which
377377
returns ``true`` for acceptable values and ``false`` for invalid values::
378378

379-
380379
// ...
381380
$resolver->setAllowedValues('transport', function ($value) {
382381
// return true or false

components/property_access.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,5 @@ Or you can pass parameters directly to the constructor (not the recommended way)
450450
// ...
451451
$accessor = new PropertyAccessor(true); // this enables handling of magic __call
452452

453-
454453
.. _Packagist: https://packagist.org/packages/symfony/property-access
455454
.. _The Inflector component: https://github.com/symfony/inflector

components/serializer.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ You can install the component in 2 different ways:
2929
* :doc:`Install it via Composer </components/using_components>` (``symfony/serializer`` on `Packagist`_);
3030
* Use the official Git repository (https://github.com/symfony/serializer).
3131

32-
3332
.. include:: /components/require_autoload.rst.inc
3433

3534
To use the ``ObjectNormalizer``, the :doc:`PropertyAccess component </components/property_access>`

components/validator/metadata.rst

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,72 @@
1-
.. index::
2-
single: Validator; Metadata
3-
4-
Metadata
5-
========
6-
7-
The :class:`Symfony\\Component\\Validator\\Mapping\\ClassMetadata` class
8-
represents and manages all the configured constraints on a given class.
9-
10-
Properties
11-
----------
12-
13-
The Validator component can validate public, protected or private properties.
14-
The following example shows how to validate that the ``$firstName`` property of
15-
the ``Author`` class has at least 3 characters::
16-
17-
// ...
18-
use Symfony\Component\Validator\Mapping\ClassMetadata;
19-
use Symfony\Component\Validator\Constraints as Assert;
20-
21-
class Author
22-
{
23-
private $firstName;
24-
25-
public static function loadValidatorMetadata(ClassMetadata $metadata)
26-
{
27-
$metadata->addPropertyConstraint('firstName', new Assert\NotBlank());
28-
$metadata->addPropertyConstraint(
29-
'firstName',
30-
new Assert\Length(array("min" => 3))
31-
);
32-
}
33-
}
34-
35-
Getters
36-
-------
37-
38-
Constraints can also be applied to the value returned by any public *getter*
39-
method, which are the methods whose names start with ``get``, ``has`` or ``is``.
40-
This feature allows to validate your objects dynamically.
41-
42-
Suppose that, for security reasons, you want to validate that a password field
43-
doesn't match the first name of the user. First, create a public method called
44-
``isPasswordSafe()`` to define this custom validation logic::
45-
46-
public function isPasswordSafe()
47-
{
48-
return $this->firstName !== $this->password;
49-
}
50-
51-
Then, add the Validator component configuration to the class::
52-
53-
// ...
54-
use Symfony\Component\Validator\Mapping\ClassMetadata;
55-
use Symfony\Component\Validator\Constraints as Assert;
56-
57-
class Author
58-
{
59-
public static function loadValidatorMetadata(ClassMetadata $metadata)
60-
{
61-
$metadata->addGetterConstraint('passwordSafe', new Assert\IsTrue(array(
62-
'message' => 'The password cannot match your first name',
63-
)));
64-
}
65-
}
66-
67-
Classes
68-
-------
69-
70-
Some constraints allow to validate the entire object. For example, the
71-
:doc:`Callback </reference/constraints/Callback>` constraint is a generic
72-
constraint that's applied to the class itself.
1+
.. index::
2+
single: Validator; Metadata
3+
4+
Metadata
5+
========
6+
7+
The :class:`Symfony\\Component\\Validator\\Mapping\\ClassMetadata` class
8+
represents and manages all the configured constraints on a given class.
9+
10+
Properties
11+
----------
12+
13+
The Validator component can validate public, protected or private properties.
14+
The following example shows how to validate that the ``$firstName`` property of
15+
the ``Author`` class has at least 3 characters::
16+
17+
// ...
18+
use Symfony\Component\Validator\Mapping\ClassMetadata;
19+
use Symfony\Component\Validator\Constraints as Assert;
20+
21+
class Author
22+
{
23+
private $firstName;
24+
25+
public static function loadValidatorMetadata(ClassMetadata $metadata)
26+
{
27+
$metadata->addPropertyConstraint('firstName', new Assert\NotBlank());
28+
$metadata->addPropertyConstraint(
29+
'firstName',
30+
new Assert\Length(array("min" => 3))
31+
);
32+
}
33+
}
34+
35+
Getters
36+
-------
37+
38+
Constraints can also be applied to the value returned by any public *getter*
39+
method, which are the methods whose names start with ``get``, ``has`` or ``is``.
40+
This feature allows to validate your objects dynamically.
41+
42+
Suppose that, for security reasons, you want to validate that a password field
43+
doesn't match the first name of the user. First, create a public method called
44+
``isPasswordSafe()`` to define this custom validation logic::
45+
46+
public function isPasswordSafe()
47+
{
48+
return $this->firstName !== $this->password;
49+
}
50+
51+
Then, add the Validator component configuration to the class::
52+
53+
// ...
54+
use Symfony\Component\Validator\Mapping\ClassMetadata;
55+
use Symfony\Component\Validator\Constraints as Assert;
56+
57+
class Author
58+
{
59+
public static function loadValidatorMetadata(ClassMetadata $metadata)
60+
{
61+
$metadata->addGetterConstraint('passwordSafe', new Assert\IsTrue(array(
62+
'message' => 'The password cannot match your first name',
63+
)));
64+
}
65+
}
66+
67+
Classes
68+
-------
69+
70+
Some constraints allow to validate the entire object. For example, the
71+
:doc:`Callback </reference/constraints/Callback>` constraint is a generic
72+
constraint that's applied to the class itself.

console/command_in_controller.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Run this command from inside your controller via::
5555

5656
// return the output, don't use if you used NullOutput()
5757
$content = $output->fetch();
58-
58+
5959
// return new Response(""), if you used NullOutput()
6060
return new Response($content);
6161
}

contributing/code/bugs.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ If your problem definitely looks like a bug, report it using the official bug
2626
* Describe the steps needed to reproduce the bug with short code examples
2727
(providing a unit test that illustrates the bug is best);
2828

29-
* If the bug you experienced is not obvious or affects more than one layer,
30-
providing a simple failing unit test may not be sufficient. In this case,
29+
* If the bug you experienced is not obvious or affects more than one layer,
30+
providing a simple failing unit test may not be sufficient. In this case,
3131
please :doc:`provide a reproducer </contributing/code/reproducer>`;
3232

3333
* Give as much detail as possible about your environment (OS, PHP version,

create_framework/front_controller.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ web root directory:
140140
141141
example.com
142142
├── composer.json
143-
├── composer.lock
143+
├── composer.lock
144144
├── src
145145
│ └── pages
146146
│ ├── hello.php

create_framework/http_kernel_httpkernel_class.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ attributes with route parameters.
6868
Our code is now much more concise and surprisingly more robust and more
6969
powerful than ever. For instance, use the built-in ``ExceptionListener`` to
7070
make your error management configurable::
71-
71+
7272
$errorHandler = function (Symfony\Component\Debug\Exception\FlattenException $exception) {
7373
$msg = 'Something went wrong! ('.$exception->getMessage().')';
7474

deployment.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ specifically tailored to the requirements of Symfony.
103103
`sf2debpkg`_
104104
Helps you build a native Debian package for your Symfony project.
105105

106-
107106
Basic scripting
108107
You can of course use shell, `Ant`_ or any other build tool to script
109108
the deploying of your project.

doctrine.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,6 @@ and save it!
328328
.. code-block:: php
329329
330330
// src/Controller/ProductController.php
331-
332331
namespace App\Controller;
333332
334333
// ...

form/dynamic_form_modification.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ creating that particular field is delegated to an event listener::
104104
// ...
105105
}
106106

107-
108107
The goal is to create a ``name`` field *only* if the underlying ``Product``
109108
object is new (e.g. hasn't been persisted to the database). Based on that,
110109
the event listener might look like the following::

form/form_customization.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,6 @@ fields (e.g. a whole form), and not just an individual field.
10051005
<?php endif ?>
10061006
<?php endif ?>
10071007

1008-
10091008
Customizing the "Form Row"
10101009
~~~~~~~~~~~~~~~~~~~~~~~~~~
10111010

introduction/from_flat_php_to_symfony2.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ the code that prepares the HTML "presentation"::
101101
// include the HTML presentation code
102102
require 'templates/list.php';
103103

104-
105104
The HTML code is now stored in a separate file ``templates/list.php``, which
106105
is primarily an HTML file that uses a template-like PHP syntax:
107106

page_creation.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,6 @@ Go Deeper with HTTP & Framework Fundamentals
329329

330330
routing
331331

332-
333332
.. toctree::
334333
:maxdepth: 1
335334
:glob:

reference/configuration/doctrine.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ Full Default Configuration
2323
class: App\DBAL\MyCustomType
2424
commented: true
2525
26-
2726
connections:
2827
# A collection of different named connections (e.g. default, conn2, etc)
2928
default:
@@ -301,7 +300,7 @@ The following block shows all possible configuration keys:
301300
password: secret
302301
driver: pdo_mysql
303302
# if the url option is specified, it will override the above config
304-
url: mysql://db_user:[email protected]:3306/db_name
303+
url: mysql://db_user:[email protected]:3306/db_name
305304
# the DBAL driverClass option
306305
driver_class: App\DBAL\MyDatabaseDriver
307306
# the DBAL driverOptions option

reference/constraints/Blank.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Validates that a value is blank - meaning equal to an empty string or ``null``::
1010
To force that a value strictly be equal to ``null``, see the
1111
:doc:`/reference/constraints/IsNull` constraint.
1212

13-
1413
To force that a value is *not* blank, see :doc:`/reference/constraints/NotBlank`.
1514
But be careful as ``NotBlank`` is *not* strictly the opposite of ``Blank``.
1615

reference/constraints/Isbn.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ on an object that will contain an ISBN.
5555
type: isbn10
5656
message: This value is not valid.
5757
58-
5958
.. code-block:: xml
6059
6160
<!-- config/validator/validation.xml -->

reference/constraints/Uuid.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ Basic Usage
7878
}
7979
}
8080
81-
8281
Options
8382
-------
8483

reference/forms/types/number.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ rounding_mode
5151
If a submitted number needs to be rounded (based on the `scale`_
5252
option), you have several configurable options for that rounding. Each
5353
option is a constant on the :class:`Symfony\\Component\\Form\\Extension\\Core\\DataTransformer\\NumberToLocalizedStringTransformer`:
54-
54+
5555
* ``NumberToLocalizedStringTransformer::ROUND_DOWN`` Round towards zero.
5656

5757
* ``NumberToLocalizedStringTransformer::ROUND_FLOOR`` Round towards negative

reference/forms/types/percent.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
PercentType Field
55
=================
66

7-
87
The ``PercentType`` renders an input text field and specializes in handling
98
percentage data. If your percentage data is stored as a decimal (e.g. ``.95``),
109
you can use this field out-of-the-box. If you store your data as a number

security/form_login_setup.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ Finally, create the template:
220220
<button type="submit">login</button>
221221
</form>
222222

223-
224223
.. tip::
225224

226225
The ``error`` variable passed into the template is an instance of

templating/PHP.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ below renders the ``index.html.php`` template::
107107
{# traditional template notation will also work #}
108108
{{ include('hello/index.html.twig') }}
109109
110-
111110
.. index::
112111
single: Templating; Layout
113112
single: Layout

translation/debug.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ you've already setup some translations for the ``fr`` locale:
6464
</file>
6565
</xliff>
6666
67-
6867
.. code-block:: yaml
6968
7069
# translations/messages.fr.yaml

0 commit comments

Comments
 (0)