Skip to content

Commit a58731c

Browse files
committed
minor #11044 be keen to newcomers (OskarStark)
This PR was squashed before being merged into the 3.4 branch (closes #11044). Discussion ---------- be keen to newcomers Do not use **easy**, **easily** and **simply** This is a follow-up PR of #11036 Commits ------- 979274b be keen to newcomers
2 parents d7c27c4 + 979274b commit a58731c

Some content is hidden

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

62 files changed

+139
-153
lines changed

best_practices/business-logic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ This practice is cumbersome and completely unnecessary for your own services.
176176
Don't define parameters for the classes of your services.
177177

178178
This practice was wrongly adopted from third-party bundles. When Symfony
179-
introduced its service container, some developers used this technique to easily
179+
introduced its service container, some developers used this technique to
180180
allow overriding services. However, overriding a service by just changing its
181181
class name is a very rare use case because, frequently, the new service has
182182
different constructor arguments.

best_practices/controllers.rst

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

120120
If you extend the base ``Controller`` class, you can access services directly from
121121
the container via ``$this->container->get()`` or ``$this->get()``. But instead, you
122-
should use dependency injection to fetch services: most easily done by
122+
should use dependency injection to fetch services by
123123
:ref:`type-hinting action method arguments <controller-accessing-services>`:
124124

125125
.. best-practice::
@@ -208,9 +208,9 @@ flexible::
208208
// ...
209209
}
210210

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

215215
Pre and Post Hooks
216216
------------------

best_practices/security.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ The @Security Annotation
108108
------------------------
109109

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

114113
In our application, you need the ``ROLE_ADMIN`` in order to create a new post.
115114
Using ``@Security``, this looks like:
@@ -156,7 +155,7 @@ Notice that this requires the use of the `ParamConverter`_, which automatically
156155
queries for the ``Post`` object and puts it on the ``$post`` argument. This
157156
is what makes it possible to use the ``post`` variable in the expression.
158157

159-
This has one major drawback: an expression in an annotation cannot easily
158+
This has one major drawback: an expression in an annotation cannot
160159
be reused in other parts of the application. Imagine that you want to add
161160
a link in a template that will only be seen by authors. Right now you'll
162161
need to repeat the expression code using Twig syntax:
@@ -167,7 +166,7 @@ need to repeat the expression code using Twig syntax:
167166
<a href=""> ... </a>
168167
{% endif %}
169168

170-
The easiest solution - if your logic is simple enough - is to add a new method
169+
A good solution - if your logic is simple enough - can be to add a new method
171170
to the ``Post`` entity that checks if a given user is its author::
172171

173172
// src/AppBundle/Entity/Post.php

best_practices/templates.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ scattered through lots of bundles.
5858
Use a prefixed underscore for partial templates in template names.
5959

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

best_practices/web-assets.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ Using Assetic
3737

3838
.. include:: /assetic/_standard_edition_warning.rst.inc
3939

40-
These days, you probably can't simply create static CSS and JavaScript files
41-
and include them in your template. Instead, you'll probably want to combine
42-
and minify these to improve client-side performance. You may also want to
43-
use LESS or Sass (for example), which means you'll need some way to process
44-
these into CSS files.
40+
These days, you probably can't create static CSS and JavaScript files and
41+
include them in your template without much effort. Instead, you'll probably
42+
want to combine and minify these to improve client-side performance. You may
43+
also want to use LESS or Sass (for example), which means you'll need some way
44+
to process these into CSS files.
4545

4646
A lot of tools exist to solve these problems, including pure-frontend (non-PHP)
4747
tools like GruntJS.

bundles/best_practices.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ There are two types of bundles:
99
* Application-specific bundles: only used to build your application;
1010
* Reusable bundles: meant to be shared across many projects.
1111

12-
This article is all about how to structure your **reusable bundles** so that
13-
they're easy to configure and extend. Many of these recommendations do not
12+
This article is all about how to structure your **reusable bundles** to be
13+
configurable and extendable. Many of these recommendations do not
1414
apply to application bundles because you'll want to keep those as simple
1515
as possible. For application bundles, just follow the practices shown throughout
1616
the guides.

bundles/inheritance.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Then, register the third-party FOSUserBundle as the "parent" of your bundle::
3535
}
3636
}
3737

38-
By making this simple change, you can now override several parts of the FOSUserBundle
39-
simply by creating a file with the same name.
38+
By making this small change, you can now override several parts of the FOSUserBundle
39+
by creating a file with the same name.
4040

4141
.. note::
4242

@@ -82,8 +82,8 @@ original method, and change its functionality::
8282
Overriding Resources: Templates, Routing, etc
8383
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8484

85-
Most resources can also be overridden, simply by creating a file in the same
86-
location as your parent bundle.
85+
Most resources can also be overridden by creating a file in the same location
86+
as your parent bundle.
8787

8888
For example, it's very common to need to override the FOSUserBundle's
8989
``layout.html.twig`` template so that it uses your application's base layout.

configuration/configuration_organization.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ How to Organize Configuration Files
66

77
The default Symfony Standard Edition defines three
88
:doc:`execution environments </configuration/environments>` called
9-
``dev``, ``prod`` and ``test``. An environment simply represents a way to
9+
``dev``, ``prod`` and ``test``. An environment represents a way to
1010
execute the same codebase with different configurations.
1111

1212
In order to select the configuration file to load for each environment, Symfony

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 the article :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
Environment Variables
1413
---------------------

configuration/front_controllers_and_kernel.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The front controller can be chosen by requesting URLs like:
5555
http://localhost/app_dev.php/some/path/...
5656
5757
As you can see, this URL contains the PHP script to be used as the front
58-
controller. You can use that to easily switch the front controller or use
58+
controller. You can use that to switch the front controller or use
5959
a custom one by placing it in the ``web/`` directory (e.g. ``app_cache.php``).
6060

6161
When using Apache and the `RewriteRule shipped with the Symfony Standard Edition`_,
@@ -153,7 +153,7 @@ front controller to the ``AppKernel``'s constructor. This name can then be
153153
used in the :method:`Symfony\\Component\\HttpKernel\\KernelInterface::registerContainerConfiguration`
154154
method to decide which configuration files to load.
155155

156-
The Symfony Standard Edition's `AppKernel`_ class implements this method by simply
156+
The Symfony Standard Edition's `AppKernel`_ class implements this method by
157157
loading the ``app/config/config_*environment*.yml`` file. You are, of course,
158158
free to implement this method differently if you need a more sophisticated
159159
way of loading your configuration.

0 commit comments

Comments
 (0)