Skip to content

Commit a80faef

Browse files
committed
Merge remote-tracking branch 'upstream/3.3' into 3.3
2 parents 450715e + 022e2cc commit a80faef

28 files changed

+153
-82
lines changed

best_practices/business-logic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Now you can use the custom slugger in any controller class, such as the
121121
// $slugger = $this->get('app.slugger');
122122
123123
if ($form->isSubmitted() && $form->isValid()) {
124-
$slug = $this->get('app.slugger')->slugify($post->getTitle());
124+
$slug = $slugger->slugify($post->getTitle());
125125
$post->setSlug($slug);
126126
127127
// ...

bundles/best_practices.rst

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Bundle Name
3131
A bundle is also a PHP namespace. The namespace must follow the `PSR-0`_ or
3232
`PSR-4`_ interoperability standards for PHP namespaces and class names: it starts
3333
with a vendor segment, followed by zero or more category segments, and it ends
34-
with the namespace short name, which must end with a ``Bundle`` suffix.
34+
with the namespace short name, which must end with ``Bundle``.
3535

3636
A namespace becomes a bundle as soon as you add a bundle class to it. The
3737
bundle class name must follow these simple rules:
@@ -48,8 +48,8 @@ Here are some valid bundle namespaces and class names:
4848
========================== ==================
4949
Namespace Bundle Class Name
5050
========================== ==================
51-
``Acme\Bundle\BlogBundle`` ``AcmeBlogBundle``
52-
``Acme\BlogBundle`` ``AcmeBlogBundle``
51+
``Acme\Bundle\BlogBundle`` AcmeBlogBundle
52+
``Acme\BlogBundle`` AcmeBlogBundle
5353
========================== ==================
5454

5555
By convention, the ``getName()`` method of the bundle class should return the
@@ -58,8 +58,7 @@ class name.
5858
.. note::
5959

6060
If you share your bundle publicly, you must use the bundle class name as
61-
the name of the repository (``AcmeBlogBundle`` and not ``BlogBundle``
62-
for instance).
61+
the name of the repository (AcmeBlogBundle and not BlogBundle for instance).
6362

6463
.. note::
6564

@@ -68,7 +67,7 @@ class name.
6867
:class:`Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle`.
6968

7069
Each bundle has an alias, which is the lower-cased short version of the bundle
71-
name using underscores (``acme_blog`` for ``AcmeBlogBundle``). This alias
70+
name using underscores (``acme_blog`` for AcmeBlogBundle). This alias
7271
is used to enforce uniqueness within a project and for defining bundle's
7372
configuration options (see below for some usage examples).
7473

@@ -105,8 +104,8 @@ that automated tools can rely on:
105104
bundles are published under the MIT license, but you can `choose any license`_;
106105
* ``Resources/doc/index.rst``: The root file for the Bundle documentation.
107106

108-
The depth of sub-directories should be kept to the minimum for most used
109-
classes and files (two levels maximum).
107+
The depth of subdirectories should be kept to a minimum for the most used
108+
classes and files. Two levels is the maximum.
110109

111110
The bundle directory is read-only. If you need to write temporary files, store
112111
them under the ``cache/`` or ``log/`` directory of the host application. Tools
@@ -138,9 +137,9 @@ Classes
138137
-------
139138

140139
The bundle directory structure is used as the namespace hierarchy. For
141-
instance, a ``ContentController`` controller is stored in
142-
``Acme/BlogBundle/Controller/ContentController.php`` and the fully qualified
143-
class name is ``Acme\BlogBundle\Controller\ContentController``.
140+
instance, a ``ContentController`` controller which is stored in
141+
``Acme/BlogBundle/Controller/ContentController.php`` would have the fully
142+
qualified class name of ``Acme\BlogBundle\Controller\ContentController``.
144143

145144
All classes and files must follow the :doc:`Symfony coding standards </contributing/code/standards>`.
146145

@@ -158,8 +157,8 @@ Vendors
158157
A bundle must not embed third-party PHP libraries. It should rely on the
159158
standard Symfony autoloading instead.
160159

161-
A bundle should not embed third-party libraries written in JavaScript, CSS or
162-
any other language.
160+
A bundle should also not embed third-party libraries written in JavaScript,
161+
CSS or any other language.
163162

164163
Tests
165164
-----
@@ -183,10 +182,13 @@ Documentation
183182

184183
All classes and functions must come with full PHPDoc.
185184

186-
Extensive documentation should also be provided in the
187-
:doc:`reStructuredText </contributing/documentation/format>` format, under
188-
the ``Resources/doc/`` directory; the ``Resources/doc/index.rst`` file is
189-
the only mandatory file and must be the entry point for the documentation.
185+
Extensive documentation should also be provided in the ``Resources/doc/``
186+
directory.
187+
The index file (for example ``Resources/doc/index.rst`` or
188+
``Resources/doc/index.md``) is the only mandatory file and must be the entry
189+
point for the documentation. The
190+
:doc:`reStructuredText (rST) </contributing/documentation/format>` is the format
191+
used to render the documentation on symfony.com.
190192

191193
Installation Instructions
192194
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -232,7 +234,6 @@ following standardized instructions in your ``README.md`` file.
232234
{
233235
$bundles = array(
234236
// ...
235-
236237
new <vendor>\<bundle-name>\<bundle-long-name>(),
237238
);
238239
@@ -406,9 +407,9 @@ The ``composer.json`` file should include at least the following metadata:
406407
``name``
407408
Consists of the vendor and the short bundle name. If you are releasing the
408409
bundle on your own instead of on behalf of a company, use your personal name
409-
(e.g. ``johnsmith/blog-bundle``). The bundle short name excludes the vendor
410-
name and separates each word with an hyphen. For example: ``AcmeBlogBundle``
411-
is transformed into ``blog-bundle`` and ``AcmeSocialConnectBundle`` is
410+
(e.g. ``johnsmith/blog-bundle``). Exclude the vendor name from the bundle
411+
short name and separate each word with an hyphen. For example: AcmeBlogBundle
412+
is transformed into ``blog-bundle`` and AcmeSocialConnectBundle is
412413
transformed into ``social-connect-bundle``.
413414

414415
``description``
@@ -418,8 +419,7 @@ The ``composer.json`` file should include at least the following metadata:
418419
Use the ``symfony-bundle`` value.
419420

420421
``license``
421-
``MIT`` is the preferred license for Symfony bundles, but you can use any
422-
other license.
422+
a string (or array of strings) with a `valid license identifier`_, such as ``MIT``.
423423

424424
``autoload``
425425
This information is used by Symfony to load the classes of the bundle. The
@@ -455,3 +455,4 @@ Learn more
455455
.. _`Semantic Versioning Standard`: http://semver.org/
456456
.. _`Packagist`: https://packagist.org/
457457
.. _`choose any license`: http://choosealicense.com/
458+
.. _`valid license identifier`: https://spdx.org/licenses/

components/http_foundation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,9 @@ UTF-8.
349349
Sending the Response
350350
~~~~~~~~~~~~~~~~~~~~
351351

352-
Before sending the Response, you can ensure that it is compliant with the HTTP
353-
specification by calling the
354-
:method:`Symfony\\Component\\HttpFoundation\\Response::prepare` method::
352+
Before sending the Response, you can optionally call the
353+
:method:`Symfony\\Component\\HttpFoundation\\Response::prepare` method to fix any
354+
incompatibility with the HTTP specification (e.g. a wrong ``Content-Type`` header)::
355355

356356
$response->prepare($request);
357357

components/yaml/yaml_format.rst

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@
44
The YAML Format
55
===============
66

7-
According to the official `YAML`_ website, YAML is "a human friendly data
8-
serialization standard for all programming languages".
9-
10-
Even if the YAML format can describe complex nested data structure, this
11-
article only describes the minimum set of features needed to use YAML as a
12-
configuration file format.
13-
14-
YAML is a simple language that describes data. As PHP, it has a syntax for
15-
simple types like strings, booleans, floats, or integers. But unlike PHP, it
16-
makes a difference between arrays (sequences) and hashes (mappings).
7+
According to the official `YAML website`_, YAML is "a human friendly data
8+
serialization standard for all programming languages". The Symfony Yaml
9+
component implements a subset of the `YAML specification`_. Specifically, it
10+
implements the minimum set of features needed to use YAML as a configuration
11+
file format.
1712

1813
Scalars
1914
-------
@@ -171,8 +166,8 @@ Collections
171166
-----------
172167

173168
A YAML file is rarely used to describe a simple scalar. Most of the time, it
174-
describes a collection. A collection can be a sequence or a mapping of
175-
elements. Both sequences and mappings are converted to PHP arrays.
169+
describes a collection. YAML collections can be a sequence (indexed arrays in PHP)
170+
or a mapping of elements (associative arrays in PHP).
176171

177172
Sequences use a dash followed by a space:
178173

@@ -318,4 +313,20 @@ The YAML specification defines some tags to set the type of any data explicitly:
318313
Pz7Y6OjuDg4J+fn5OTk6enp
319314
56enmleECcgggoBADs=
320315
321-
.. _YAML: http://yaml.org/
316+
Unsupported YAML Features
317+
-------------------------
318+
319+
The following YAML features are not supported by the Symfony Yaml component:
320+
321+
* Multi-documents (``---`` and ``...`` markers);
322+
* Complex mapping keys and complex values starting with ``?``;
323+
* Tagged values as keys;
324+
* The following tags and types: `!!set`, `!!omap`, `!!pairs`, `!!set`, `!!seq`,
325+
`!!bool`, `!!int`, `!!merge`, `!!null`, `!!timestamp`, `!!value`, `!!yaml`;
326+
* Tags (``TAG`` directive; example: ``%TAG ! tag:example.com,2000:app/``)
327+
and tag references (example: ``!<tag:example.com,2000:app/foo>``);
328+
* Using sequence-like syntax for mapping elements (example: ``{foo, bar}``; use
329+
``{foo: ~, bar: ~}`` instead).
330+
331+
.. _`YAML website`: http://yaml.org/
332+
.. _`YAML specification`: http://www.yaml.org/spec/1.2/spec.html

controller/upload_file.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,6 @@ Now, register this class as a Doctrine listener:
400400
<!-- ... -->
401401
402402
<service id="AppBundle\EventListener\BrochureUploaderListener">
403-
<argument type="service" id="app.brochure_uploader"/>
404-
405403
<tag name="doctrine.event_listener" event="prePersist"/>
406404
<tag name="doctrine.event_listener" event="preUpdate"/>
407405
</service>

deployment.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ Using Source Control
5252
~~~~~~~~~~~~~~~~~~~~
5353

5454
If you're using source control (e.g. Git or SVN), you can simplify by having
55-
your live installation also be a copy of your repository. When you're ready
56-
to upgrade it is as simple as fetching the latest updates from your source
57-
control system.
55+
your live installation also be a copy of your repository. When you're ready to
56+
upgrade it is as simple as fetching the latest updates from your source control
57+
system. When using Git, a common approach is to create a tag for each release
58+
and check out the appropriate tag on deployment (see `Git Tagging`_).
5859

5960
This makes updating your files *easier*, but you still need to worry about
6061
manually taking other steps (see `Common Post-Deployment Tasks`_).
@@ -207,6 +208,7 @@ Don't forget that deploying your application also involves updating any dependen
207208
(typically via Composer), migrating your database, clearing your cache and
208209
other potential things like pushing assets to a CDN (see `Common Post-Deployment Tasks`_).
209210

211+
.. _`Git Tagging`: https://git-scm.com/book/en/v2/Git-Basics-Tagging
210212
.. _`Capifony`: https://github.com/everzet/capifony
211213
.. _`Capistrano`: http://capistranorb.com/
212214
.. _`sf2debpkg`: https://github.com/liip/sf2debpkg

deployment/azure-website.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ application, configure it with the following content:
417417
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
418418
</rule>
419419
<rule name="RewriteAssetsToPublic" stopProcessing="true">
420-
<match url="^(.*)(\.css|\.js|\.jpg|\.png|\.gif)$" />
420+
<match url="^(.*)(\.css|\.js|\.jpg|\.png|\.gif|\.ico)$" />
421421
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
422422
</conditions>
423423
<action type="Rewrite" url="web/{R:0}" />

deployment/fortrabbit.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Make sure this file is imported into the main config file:
151151
<!-- .. -->
152152
<framework:config>
153153
<!-- .. -->
154-
<framework:session save-path="null" />
154+
<framework:session handler-id="null" />
155155
</framework:config>
156156
</container>
157157

deployment/platformsh.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Platform.sh how to deploy your application (read more about
4141
# The type of the application to build.
4242
type: php:5.6
4343
build:
44-
flavor: symfony
44+
flavor: composer
4545
4646
# The relationships of the application with services or other applications.
4747
# The left-hand side is the name of the relationship as it will be exposed

email/dev_environment.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ will not be sent when you run tests, but will continue to be sent in the
2828
2929
# app/config/config_test.yml
3030
swiftmailer:
31-
disable_delivery: true
31+
disable_delivery: true
3232
3333
.. code-block:: xml
3434
@@ -48,7 +48,7 @@ will not be sent when you run tests, but will continue to be sent in the
4848
4949
// app/config/config_test.php
5050
$container->loadFromExtension('swiftmailer', array(
51-
'disable_delivery' => "true",
51+
'disable_delivery' => "true",
5252
));
5353
5454
If you'd also like to disable deliver in the ``dev`` environment, simply
@@ -80,7 +80,8 @@ via the ``delivery_addresses`` option:
8080
xmlns:swiftmailer="http://symfony.com/schema/dic/swiftmailer"
8181
xsi:schemaLocation="http://symfony.com/schema/dic/services
8282
http://symfony.com/schema/dic/services/services-1.0.xsd
83-
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
83+
http://symfony.com/schema/dic/swiftmailer
84+
http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
8485
8586
<swiftmailer:config>
8687
<swiftmailer:delivery-address>dev@example.com</swiftmailer:delivery-address>
@@ -154,15 +155,14 @@ by adding the ``delivery_whitelist`` option:
154155
.. code-block:: xml
155156
156157
<!-- app/config/config_dev.xml -->
157-
158-
<?xml version="1.0" charset="UTF-8" ?>
159158
<?xml version="1.0" encoding="UTF-8" ?>
160159
<container xmlns="http://symfony.com/schema/dic/services"
161160
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
162161
xmlns:swiftmailer="http://symfony.com/schema/dic/swiftmailer"
163162
xsi:schemaLocation="http://symfony.com/schema/dic/services
164163
http://symfony.com/schema/dic/services/services-1.0.xsd
165-
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
164+
http://symfony.com/schema/dic/swiftmailer
165+
http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
166166
167167
<swiftmailer:config>
168168
<!-- all email addresses matching these regexes will be delivered
@@ -177,7 +177,7 @@ by adding the ``delivery_whitelist`` option:
177177
178178
// app/config/config_dev.php
179179
$container->loadFromExtension('swiftmailer', array(
180-
'delivery_addresses' => array("dev@example.com"),
180+
'delivery_addresses' => array("dev@example.com"),
181181
'delivery_whitelist' => array(
182182
// all email addresses matching these regexes will be delivered
183183
// like normal, as well as being sent to dev@example.com

0 commit comments

Comments
 (0)