Skip to content

Commit 86901d8

Browse files
committed
Merge branch '2.3' into 2.7
2 parents a23e753 + fe1d81f commit 86901d8

File tree

9 files changed

+51
-27
lines changed

9 files changed

+51
-27
lines changed

best_practices/forms.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,17 @@ form in its own PHP class::
4949
}
5050
}
5151

52+
.. best-practice::
53+
54+
Put the form type classes in the ``AppBundle\Form`` namespace, unless you
55+
use other custom form classes like data transformers.
56+
5257
To use the class, use ``createForm`` and instantiate the new class::
5358

54-
use AppBundle\Form\PostType;
5559
// ...
60+
use AppBundle\Form\PostType;
5661

62+
// ...
5763
public function newAction(Request $request)
5864
{
5965
$post = new Post();

book/validation.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ this method must return ``true``:
644644
AppBundle\Entity\Author:
645645
getters:
646646
passwordLegal:
647-
- 'True': { message: 'The password cannot match your first name' }
647+
- 'IsTrue': { message: 'The password cannot match your first name' }
648648
649649
.. code-block:: xml
650650
@@ -656,7 +656,7 @@ this method must return ``true``:
656656
657657
<class name="AppBundle\Entity\Author">
658658
<getter property="passwordLegal">
659-
<constraint name="True">
659+
<constraint name="IsTrue">
660660
<option name="message">The password cannot match your first name</option>
661661
</constraint>
662662
</getter>
@@ -954,7 +954,7 @@ username and the password are different only if all other validation passes
954954
- Strict
955955
getters:
956956
passwordLegal:
957-
- 'True':
957+
- 'IsTrue':
958958
message: 'The password cannot match your username'
959959
groups: [Strict]
960960
properties:
@@ -981,7 +981,7 @@ username and the password are different only if all other validation passes
981981
</property>
982982
983983
<getter property="passwordLegal">
984-
<constraint name="True">
984+
<constraint name="IsTrue">
985985
<option name="message">The password cannot match your username</option>
986986
<option name="groups">
987987
<value>Strict</value>

contributing/code/_api_tagging.rst.inc

Lines changed: 0 additions & 7 deletions
This file was deleted.

contributing/code/bc.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ backwards compatibility promise:
7474
| Add a default value to an argument | Yes |
7575
+-----------------------------------------------+-----------------------------+
7676

77-
.. include:: _api_tagging.rst.inc
78-
7977
Using our Classes
8078
~~~~~~~~~~~~~~~~~
8179

@@ -134,8 +132,6 @@ covered by our backwards compatibility promise:
134132
| Access a private property (via Reflection) | No |
135133
+-----------------------------------------------+-----------------------------+
136134

137-
.. include:: _api_tagging.rst.inc
138-
139135
Working on Symfony Code
140136
-----------------------
141137

contributing/code/standards.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ example containing most features described below:
5050
$this->fooBar = $this->transformText($dummy);
5151
}
5252
53+
/**
54+
* @return string
55+
*
56+
* @deprecated
57+
*/
58+
public function someDeprecatedMethod()
59+
{
60+
@trigger_error(sprintf('The %s() method is deprecated since version 2.8 and will be removed in 3.0. Use Acme\Baz::someMethod() instead.', __METHOD__), E_USER_DEPRECATED);
61+
62+
return Baz::someMethod();
63+
}
64+
5365
/**
5466
* Transforms the input given as first argument.
5567
*
@@ -151,7 +163,11 @@ Structure
151163
* Use parentheses when instantiating classes regardless of the number of
152164
arguments the constructor has;
153165

154-
* Exception message strings should be concatenated using :phpfunction:`sprintf`.
166+
* Exception and error message strings should be concatenated using :phpfunction:`sprintf`.
167+
168+
* Calls to :phpfunction:`trigger_error` with type ``E_USER_DEPRECATED`` should be
169+
switched to opt-in via ``@`` operator.
170+
Read more at :ref:`contributing-code-conventions-deprecations`;
155171

156172
Naming Conventions
157173
------------------

cookbook/email/spool.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,17 @@ swiftmailer with the memory option, use the following configuration:
5555
'spool' => array('type' => 'memory')
5656
));
5757
58-
Spool Using a File
58+
.. _spool-using-a-file:
59+
60+
Spool Using Files
5961
------------------
6062

61-
In order to use the spool with a file, use the following configuration:
63+
When you use the filesystem for spooling, Symfony creates a folder in the given
64+
path for each mail service (e.g. "default" for the default service). This folder
65+
will contain files for each email in the spool. So make sure this directory is
66+
writable by Symfony (or your webserver/php)!
67+
68+
In order to use the spool with files, use the following configuration:
6269

6370
.. configuration-block::
6471

@@ -69,7 +76,7 @@ In order to use the spool with a file, use the following configuration:
6976
# ...
7077
spool:
7178
type: file
72-
path: /path/to/spool
79+
path: /path/to/spooldir
7380
7481
.. code-block:: xml
7582
@@ -84,7 +91,7 @@ In order to use the spool with a file, use the following configuration:
8491
<swiftmailer:config>
8592
<swiftmailer:spool
8693
type="file"
87-
path="/path/to/spool"
94+
path="/path/to/spooldir"
8895
/>
8996
</swiftmailer:config>
9097
</container>
@@ -97,7 +104,7 @@ In order to use the spool with a file, use the following configuration:
97104
98105
'spool' => array(
99106
'type' => 'file',
100-
'path' => '/path/to/spool',
107+
'path' => '/path/to/spooldir',
101108
),
102109
));
103110

cookbook/form/form_customization.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ customize the ``name`` field only:
687687

688688
<!-- app/Resources/views/Form/_product_name_widget.html.php -->
689689
<div class="text_widget">
690-
echo $view['form']->block('form_widget_simple') ?>
690+
<?php echo $view['form']->block('form_widget_simple') ?>
691691
</div>
692692

693693
Here, the ``_product_name_widget`` fragment defines the template to use for the

cookbook/form/unit_testing.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ It often happens that you use some options that are added by
165165
:doc:`form extensions </cookbook/form/create_form_type_extension>`. One of the
166166
cases may be the ``ValidatorExtension`` with its ``invalid_message`` option.
167167
The ``TypeTestCase`` only loads the core form extension, which means an
168-
"Invalid option" exception will be raised if you try to test a class that
169-
depends on other extensions. The
170-
:method:`Symfony\\Component\\Form\\Test\\TypeTestCase::getExtensions` allows you to
171-
return a list of extensions to register::
168+
+:class:`Symfony\\Component\\OptionsResolver\\Exception\\InvalidOptionsException`
169+
+will be raised if you try to test a class that depends on other extensions.
170+
+The :method:`Symfony\\Component\\Form\\Test\\TypeTestCase::getExtensions` method
171+
+allows you to return a list of extensions to register::
172172

173173
// src/AppBundle/Tests/Form/Type/TestedTypeTests.php
174174
namespace AppBundle\Tests\Form\Type;

cookbook/frontend/bower.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ For more details, read the article `Checking in front-end dependencies`_.
135135
But, it's very possible that Bower will add a lock feature in the future
136136
(e.g. `bower/bower#1748`_).
137137

138+
If you don't care too much about having *exact* the same versions, you can only
139+
commit the ``bower.json`` file. Running ``bower install`` will give you the
140+
latest versions within the specified version range of each package in
141+
``bower.json``. Using strict version constraints (e.g. ``1.10.*``) is often
142+
enough to ensure only bringing in compatible versions.
143+
138144
.. _Bower: http://bower.io
139145
.. _`Node.js`: https://nodejs.org
140146
.. _BowerPHP: http://bowerphp.org/

0 commit comments

Comments
 (0)