Skip to content

Commit 33fdfd6

Browse files
committed
Merge branch '3.4' into 4.2
* 3.4: be keen to newcomers Uncomment some code in "Configuring Babel" Fix typo: if -> of
2 parents 9909560 + a58731c commit 33fdfd6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+98
-108
lines changed

best_practices/controllers.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Fetching Services
128128

129129
If you extend the base ``AbstractController`` class, you can't access services
130130
directly from the container via ``$this->container->get()`` or ``$this->get()``.
131-
Instead, you must use dependency injection to fetch services: most easily done by
131+
Instead, you must use dependency injection to fetch services by
132132
:ref:`type-hinting action method arguments <controller-accessing-services>`:
133133

134134
.. best-practice::
@@ -218,9 +218,9 @@ flexible::
218218
// ...
219219
}
220220

221-
The point is this: the ParamConverter shortcut is great for simple situations.
222-
But you shouldn't forget that querying for entities directly is still very
223-
easy.
221+
The point is this: the ParamConverter shortcut is great for most situations.
222+
However, there is nothing wrong with querying for entities directly if the
223+
ParamConverter would get complicated.
224224

225225
Pre and Post Hooks
226226
------------------

best_practices/security.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ The @Security Annotation
105105
------------------------
106106

107107
For controlling access on a controller-by-controller basis, use the ``@Security``
108-
annotation whenever possible. It's easy to read and is placed consistently
109-
above each action.
108+
annotation whenever possible. Placing it above each action makes it consistent and readable.
110109

111110
In our application, you need the ``ROLE_ADMIN`` in order to create a new post.
112111
Using ``@Security``, this looks like:
@@ -153,7 +152,7 @@ Notice that this requires the use of the `ParamConverter`_, which automatically
153152
queries for the ``Post`` object and puts it on the ``$post`` argument. This
154153
is what makes it possible to use the ``post`` variable in the expression.
155154

156-
This has one major drawback: an expression in an annotation cannot easily
155+
This has one major drawback: an expression in an annotation cannot
157156
be reused in other parts of the application. Imagine that you want to add
158157
a link in a template that will only be seen by authors. Right now you'll
159158
need to repeat the expression code using Twig syntax:
@@ -164,7 +163,7 @@ need to repeat the expression code using Twig syntax:
164163
<a href=""> ... </a>
165164
{% endif %}
166165

167-
The easiest solution - if your logic is simple enough - is to add a new method
166+
A good solution - if your logic is simple enough - can be to add a new method
168167
to the ``Post`` entity that checks if a given user is its author::
169168

170169
// src/Entity/Post.php

best_practices/templates.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ and ``edit_form.html.twig`` instead of ``EditForm.html.twig``).
4444
Use a prefixed underscore for partial templates in template names.
4545

4646
You often want to reuse template code using the ``include`` function to avoid
47-
redundant code. To determine those partials easily in the filesystem you should
47+
redundant code. To determine those partials in the filesystem you should
4848
prefix partials and any other template without HTML body or ``extends`` tag
4949
with a single underscore.
5050

bundles/best_practices.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
Best Practices for Reusable Bundles
55
===================================
66

7-
This article is all about how to structure your **reusable bundles** so that
8-
they're easy to configure and extend. Reusable bundles are those meant to be
9-
shared privately across many company projects or publicly so any Symfony project
10-
can install them.
7+
This article is all about how to structure your **reusable bundles** to be
8+
configurable and extendable. Reusable bundles are those meant to be shared
9+
privately across many company projects or publicly so any Symfony project can
10+
install them.
1111

1212
.. index::
1313
pair: Bundle; Naming conventions

configuration/external_parameters.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ How to Set external Parameters in the Service Container
77
In :doc:`/configuration`, you learned how to manage your application
88
configuration. At times, it may benefit your application to store certain
99
credentials outside of your project code. Database configuration is one such
10-
example. The flexibility of the Symfony service container allows you to easily
11-
do this.
10+
example. The flexibility of the Symfony service container allows you to do this.
1211

1312
.. _config-env-vars:
1413

configuration/front_controllers_and_kernel.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,8 @@ the ``configureContainer()`` method to decide which configuration files to load.
138138

139139
Symfony's default ``Kernel`` class implements this method by loading first the
140140
config files found on ``config/packages/*`` and then, the files found on
141-
``config/packages/ENVIRONMENT_NAME/``. You are, of course, free to implement
142-
this method differently if you need a more sophisticated way of loading your
143-
configuration.
141+
``config/packages/ENVIRONMENT_NAME/``. You are free to implement this method
142+
differently if you need a more sophisticated way of loading your configuration.
144143

145144
.. _front controller: https://en.wikipedia.org/wiki/Front_Controller_pattern
146145
.. _decorate: https://en.wikipedia.org/wiki/Decorator_pattern

configuration/override_dir_structure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Override the ``public`` Directory
185185

186186
If you need to rename or move your ``public`` directory, the only thing you need
187187
to guarantee is that the path to the ``var`` directory is still correct in your
188-
``index.php`` front controller. If you simply renamed the directory, you're
188+
``index.php`` front controller. If you renamed the directory, you're
189189
fine. But if you moved it in some way, you may need to modify these paths inside
190190
those files::
191191

console/style.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ User Input Methods
226226

227227
$io->ask('What is your name?');
228228

229-
You can pass the default value as the second argument so the user can simply
229+
You can pass the default value as the second argument so the user can
230230
hit the <Enter> key to select that value::
231231

232232
$io->ask('Where are you from?', 'United States');
@@ -262,7 +262,7 @@ User Input Methods
262262

263263
$io->confirm('Restart the web server?');
264264

265-
You can pass the default value as the second argument so the user can simply
265+
You can pass the default value as the second argument so the user can
266266
hit the <Enter> key to select that value::
267267

268268
$io->confirm('Restart the web server?', true);
@@ -273,7 +273,7 @@ User Input Methods
273273

274274
$io->choice('Select the queue to analyze', ['queue1', 'queue2', 'queue3']);
275275

276-
You can pass the default value as the third argument so the user can simply
276+
You can pass the default value as the third argument so the user can
277277
hit the <Enter> key to select that value::
278278

279279
$io->choice('Select the queue to analyze', ['queue1', 'queue2', 'queue3'], 'queue1');

create_framework/http_foundation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ As you can see for yourself, the simple code we had written first is not that
5252
simple anymore if we want to avoid PHP warnings/notices and make the code
5353
more secure.
5454

55-
Beyond security, this code is not even easily testable. Even if there is not
55+
Beyond security, this code can be complex to test. Even if there is not
5656
much to test, it strikes me that writing unit tests for the simplest possible
5757
snippet of PHP code is not natural and feels ugly. Here is a tentative PHPUnit
5858
unit test for the above code::
@@ -126,10 +126,10 @@ containing the new requirement.
126126
.. sidebar:: Class Autoloading
127127

128128
When installing a new dependency, Composer also generates a
129-
``vendor/autoload.php`` file that allows any class to be easily
130-
`autoloaded`_. Without autoloading, you would need to require the file
131-
where a class is defined before being able to use it. But thanks to
132-
`PSR-4`_, we can just let Composer and PHP do the hard work for us.
129+
``vendor/autoload.php`` file that allows any class to be `autoloaded`_.
130+
Without autoloading, you would need to require the file where a class
131+
is defined before being able to use it. But thanks to `PSR-4`_,
132+
we can just let Composer and PHP do the hard work for us.
133133

134134
Now, let's rewrite our application by using the ``Request`` and the
135135
``Response`` classes::

email/dev_environment.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ How to Work with Emails during Development
66

77
When developing an application which sends email, you will often
88
not want to actually send the email to the specified recipient during
9-
development. If you are using the default Symfony mailer, you
10-
can achieve this through configuration settings without having to
11-
make any changes to your application's code at all. There are two main
12-
choices when it comes to handling email during development: (a) disabling the
9+
development. If you are using the SwiftmailerBundle with Symfony, you
10+
can achieve this through configuration settings without having to make
11+
any changes to your application's code at all. There are two main choices
12+
when it comes to handling email during development: (a) disabling the
1313
sending of email altogether or (b) sending all email to a specific
1414
address (with optional exceptions).
1515

0 commit comments

Comments
 (0)