Skip to content

Commit 0b5d88c

Browse files
committed
minor #10535 review doc chapters for belittling words (dbu)
This PR was merged into the 4.1 branch. Discussion ---------- review doc chapters for belittling words and a rather hefty chunk of changes for symfony/diversity#9 i hope this one has not gotten too big. Commits ------- 84e6684 review doc chapter for belittling words
2 parents 208c0c8 + 84e6684 commit 0b5d88c

File tree

101 files changed

+205
-208
lines changed

Some content is hidden

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

101 files changed

+205
-208
lines changed

bundles/best_practices.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ vendor segment, followed by zero or more category segments, and it ends with the
2323
namespace short name, which must end with ``Bundle``.
2424

2525
A namespace becomes a bundle as soon as you add a bundle class to it. The
26-
bundle class name must follow these simple rules:
26+
bundle class name must follow these rules:
2727

2828
* Use only alphanumeric characters and underscores;
2929
* Use a StudlyCaps name (i.e. camelCase with the first letter uppercased);
@@ -467,8 +467,9 @@ Retrieve the configuration parameters in your code from the container::
467467

468468
$container->getParameter('acme_blog.author.email');
469469

470-
Even if this mechanism is simple enough, you should consider using the more
471-
advanced :doc:`semantic bundle configuration </bundles/configuration>`.
470+
While this mechanism requires the least effort, you should consider using the
471+
more advanced :doc:`semantic bundle configuration </bundles/configuration>` to
472+
make your configuration more robust.
472473

473474
Versioning
474475
----------

bundles/override.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ the routes from any bundle, then they must be manually imported from somewhere
6868
in your application (e.g. ``config/routes.yaml``).
6969

7070
The easiest way to "override" a bundle's routing is to never import it at
71-
all. Instead of importing a third-party bundle's routing, simply copy
71+
all. Instead of importing a third-party bundle's routing, copy
7272
that routing file into your application, modify it, and import it instead.
7373

7474
Controllers

configuration/configuration_organization.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ How to Organize Configuration Files
55
===================================
66

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

1111
In order to select the configuration file to load for each environment, Symfony
@@ -129,9 +129,9 @@ Global Configuration Files
129129

130130
Some system administrators may prefer to store sensitive parameters in files
131131
outside the project directory. Imagine that the database credentials for your
132-
website are stored in the ``/etc/sites/mysite.com/parameters.yaml`` file. Loading
133-
this file is as simple as indicating the full file path when importing it from
134-
any other configuration file:
132+
website are stored in the ``/etc/sites/mysite.com/parameters.yaml`` file. You
133+
can load files from outside the project folder by indicating the full file path
134+
when importing it from any other configuration file:
135135

136136
.. configuration-block::
137137

configuration/environments.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Creating a new Environment
199199
--------------------------
200200

201201
Since an environment is nothing more than a string that corresponds to a set of
202-
configuration, creating a new environment is quite easy.
202+
configuration, you can also create your own environments for specific purposes.
203203

204204
Suppose, for example, that before deployment, you need to benchmark your
205205
application. One way to benchmark the application is to use near-production
@@ -355,7 +355,7 @@ includes the following:
355355

356356
.. note::
357357

358-
You can easily change the directory location and name. For more information
358+
You can change the directory location and name. For more information
359359
read the article :doc:`/configuration/override_dir_structure`.
360360

361361
Going further

configuration/front_controllers_and_kernel.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ You can choose the front controller that's used by adding it in the URL, like:
5151
http://localhost/index.php/some/path/...
5252
5353
As you can see, this URL contains the PHP script to be used as the front
54-
controller. You can use that to easily switch to a custom made front controller
54+
controller. You can use that to switch to a custom made front controller
5555
that is located in the ``public/`` directory.
5656

5757
.. seealso::
@@ -123,7 +123,7 @@ controller to make use of the new kernel.
123123
The Environments
124124
----------------
125125

126-
As just mentioned, the ``Kernel`` has to implement another method -
126+
As mentioned above, the ``Kernel`` has to implement another method -
127127
:method:`Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait::configureContainer`.
128128
This method is responsible for loading the application's configuration from the
129129
right *environment*.

configuration/micro_kernel_trait.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ The default ``Kernel`` class included in Symfony applications uses a
55
:class:`Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait` to configure
66
the bundles, the routes and the service container in the same class.
77

8-
This micro-kernel approach is so flexible that let you control your application
9-
structure and features quite easily.
8+
This micro-kernel approach is flexible, allowing you to control your application
9+
structure and features.
1010

1111
A Single-File Symfony Application
1212
---------------------------------

configuration/multiple_kernels.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ According to the above code, this config will live in one or multiple files
124124
stored in ``config/api/`` and ``config/api/ENVIRONMENT_NAME/`` directories.
125125

126126
The new configuration files can be created from scratch when you load just a few
127-
bundles, because it will be very simple. Otherwise, duplicate the existing
127+
bundles, because it will be small. Otherwise, duplicate the existing
128128
config files in ``config/packages/`` or better, import them and override the
129129
needed options.
130130

configuration/override_dir_structure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ How to Override Symfony's default Directory Structure
55
=====================================================
66

77
Symfony automatically ships with a default directory structure. You can
8-
easily override this directory structure to create your own. The default
8+
override this directory structure to create your own. The default
99
directory structure is:
1010

1111
.. code-block:: text

console/input.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ to greet all your friends). Only the last argument can be a list::
7171
'Who do you want to greet (separate multiple names with a space)?'
7272
);
7373

74-
To use this, just specify as many names as you want:
74+
To use this, specify as many names as you want:
7575

7676
.. code-block:: terminal
7777

console/lazy_commands.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Built-in Command Loaders
4242
~~~~~~~~~~~~~~~~~~~~~~~~
4343

4444
The :class:`Symfony\\Component\\Console\\CommandLoader\\FactoryCommandLoader`
45-
class provides a simple way of getting commands lazily loaded as it takes an
45+
class provides a way of getting commands lazily loaded as it takes an
4646
array of ``Command`` factories as its only constructor argument::
4747

4848
use Symfony\Component\Console\CommandLoader\FactoryCommandLoader;

console/style.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ Defining your Own Styles
336336
------------------------
337337

338338
If you don't like the design of the commands that use the Symfony Style, you can
339-
define your own set of console styles. Just create a class that implements the
339+
define your own set of console styles. Create a class that implements the
340340
:class:`Symfony\\Component\\Console\\Style\\StyleInterface`::
341341

342342
namespace App\Console;

contributing/code/git.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Pull Requests
1010
Whenever a pull request is merged, all the information contained in the pull
1111
request (including comments) is saved in the repository.
1212

13-
You can easily spot pull request merges as the commit message always follows
13+
You can identify pull request merges as the commit message always follows
1414
this pattern:
1515

1616
.. code-block:: text

contributing/code/reproducer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ to a route definition. Then, after creating your project:
6363
#. Don't edit any of the default Symfony configuration options.
6464
#. Don't copy your original application code and don't use the same structure
6565
of controllers, actions, etc. as in your original application.
66-
#. Create a simple controller and add your routing definition that shows the bug.
66+
#. Create a small controller and add your routing definition that shows the bug.
6767
#. Don't create or modify any other file.
6868
#. Execute ``composer require symfony/web-server-bundle`` and use the ``server:run``
6969
command to browse to the new route and see if the bug appears or not.

contributing/community/review-comments.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ constructive, respectful and helpful reviews and replies.
2626
your ideas and opinions but helping you to better communicate,
2727
prevent possible confusion, and keeping the Symfony community a
2828
welcoming place for everyone. **You are free to disagree with
29-
someone's opinions, just don't be disrespectful.**
29+
someone's opinions, but don't be disrespectful.**
3030

3131
First of, accept that many programming decisions are opinions.
3232
Discuss trade offs, which you prefer, and reach a resolution quickly.

controller/error_pages.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exception in your code.
1111

1212
In the :doc:`development environment </configuration/environments>`,
1313
Symfony catches all the exceptions and displays a special **exception page**
14-
with lots of debug information to help you quickly discover the root problem:
14+
with lots of debug information to help you discover the root problem:
1515

1616
.. image:: /_images/controller/error_pages/exceptions-in-dev-environment.png
1717
:alt: A typical exception page in the development environment
@@ -198,7 +198,7 @@ If you need a little more flexibility beyond just overriding the template,
198198
then you can change the controller that renders the error page. For example,
199199
you might need to pass some additional variables into your template.
200200

201-
To do this, simply create a new controller anywhere in your application and set
201+
To do this, create a new controller anywhere in your application and set
202202
the :ref:`twig.exception_controller <config-twig-exception-controller>`
203203
configuration option to point to it:
204204

@@ -249,8 +249,8 @@ will be passed two parameters:
249249
A :class:`\\Symfony\\Component\\HttpKernel\\Log\\DebugLoggerInterface`
250250
instance which may be ``null`` in some circumstances.
251251

252-
Instead of creating a new exception controller from scratch you can, of course,
253-
also extend the default :class:`Symfony\\Bundle\\TwigBundle\\Controller\\ExceptionController`.
252+
Instead of creating a new exception controller from scratch you can also extend
253+
the default :class:`Symfony\\Bundle\\TwigBundle\\Controller\\ExceptionController`.
254254
In that case, you might want to override one or both of the ``showAction()`` and
255255
``findTemplate()`` methods. The latter one locates the template to be used.
256256

controller/service.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Invokable Controllers
7575
---------------------
7676

7777
If your controller implements the ``__invoke()`` method - popular with the
78-
Action-Domain-Response (ADR) pattern, you can simply refer to the service id
78+
Action-Domain-Response (ADR) pattern, you can refer to the service id
7979
without the method (``App\Controller\HelloController`` for example).
8080

8181
Alternatives to base Controller Methods

controller/soap_web_service.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
How to Create a SOAP Web Service in a Symfony Controller
77
========================================================
88

9-
Setting up a controller to act as a SOAP server is simple with a couple
10-
tools. You must, of course, have the `PHP SOAP`_ extension installed.
9+
Setting up a controller to act as a SOAP server is aided by a couple
10+
tools. Those tools expect you to have the `PHP SOAP`_ extension installed.
1111
As the PHP SOAP extension cannot currently generate a WSDL, you must either
1212
create one from scratch or use a 3rd party generator.
1313

create_framework/event_dispatcher.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ issue: the knowledge of the priorities is "hardcoded" in the front controller,
248248
instead of being in the listeners themselves. For each application, you have
249249
to remember to set the appropriate priorities. Moreover, the listener method
250250
names are also exposed here, which means that refactoring our listeners would
251-
mean changing all the applications that rely on those listeners. Of course,
252-
there is a solution: use subscribers instead of listeners::
251+
mean changing all the applications that rely on those listeners. The solution
252+
to this dilemma is to use subscribers instead of listeners::
253253

254254
$dispatcher = new EventDispatcher();
255255
$dispatcher->addSubscriber(new Simplex\ContentLengthListener());

create_framework/front_controller.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ which name is exposed to the end user via the URL
6161
(``http://127.0.0.1:4321/bye.php``): there is a direct mapping between the PHP
6262
script name and the client URL. This is because the dispatching of the request
6363
is done by the web server directly. It might be a good idea to move this
64-
dispatching to our code for better flexibility. This can be easily achieved by
64+
dispatching to our code for better flexibility. This can be achieved by
6565
routing all client requests to a single PHP script.
6666

6767
.. tip::

create_framework/http_foundation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ You can also simulate a request::
201201

202202
$request = Request::create('/index.php?name=Fabien');
203203

204-
With the ``Response`` class, you can easily tweak the response::
204+
With the ``Response`` class, you can tweak the response::
205205

206206
$response = new Response();
207207

create_framework/http_kernel_controller_resolver.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ correctly::
109109
public function index($request)
110110

111111
More interesting, ``getArguments()`` is also able to inject any Request
112-
attribute; the argument just needs to have the same name as the corresponding
112+
attribute; if the argument has the same name as the corresponding
113113
attribute::
114114

115115
public function index($year)
@@ -127,7 +127,7 @@ optional attribute of the Request::
127127

128128
public function index($year = 2012)
129129

130-
Let's just inject the ``$year`` request attribute for our controller::
130+
Let's inject the ``$year`` request attribute for our controller::
131131

132132
class LeapYearController
133133
{

create_framework/http_kernel_httpkernel_class.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ The error controller reads as follows::
104104
}
105105
}
106106

107-
Voilà! Clean and customizable error management without efforts. And of course,
108-
if your controller throws an exception, HttpKernel will handle it nicely.
107+
Voilà! Clean and customizable error management without efforts. And
108+
if your ``ErrorController`` throws an exception, HttpKernel will handle it nicely.
109109

110110
In chapter two, we talked about the ``Response::prepare()`` method, which
111111
ensures that a Response is compliant with the HTTP specification. It is
@@ -115,8 +115,7 @@ client; that's what the ``ResponseListener`` does::
115115
$dispatcher->addSubscriber(new HttpKernel\EventListener\ResponseListener('UTF-8'));
116116

117117
This one was easy too! Let's take another one: do you want out of the box
118-
support for streamed responses? Just subscribe to
119-
``StreamedResponseListener``::
118+
support for streamed responses? Subscribe to ``StreamedResponseListener``::
120119

121120
$dispatcher->addSubscriber(new HttpKernel\EventListener\StreamedResponseListener());
122121

create_framework/http_kernel_httpkernelinterface.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ to cache a response for 10 seconds, use the ``Response::setTtl()`` method::
9292

9393
If, like me, you are running your framework from the command line by
9494
simulating requests (``Request::create('/is_leap_year/2012')``), you can
95-
easily debug Response instances by dumping their string representation
95+
debug Response instances by dumping their string representation
9696
(``echo $response;``) as it displays all headers as well as the response
9797
content.
9898

@@ -113,9 +113,9 @@ expiration and the validation models of the HTTP specification. If you are not
113113
comfortable with these concepts, read the `HTTP caching`_ chapter of the
114114
Symfony documentation.
115115

116-
The Response class contains many other methods that let you configure the
117-
HTTP cache very easily. One of the most powerful is ``setCache()`` as it
118-
abstracts the most frequently used caching strategies into one simple array::
116+
The Response class contains methods that let you configure the
117+
HTTP cache. One of the most powerful is ``setCache()`` as it
118+
abstracts the most frequently used caching strategies into a single array::
119119

120120
$date = date_create_from_format('Y-m-d H:i:s', '2005-10-15 10:00:00');
121121

@@ -135,7 +135,7 @@ abstracts the most frequently used caching strategies into one simple array::
135135
$response->setSharedMaxAge(10);
136136

137137
When using the validation model, the ``isNotModified()`` method allows you to
138-
easily cut on the response time by short-circuiting the response generation as
138+
cut on the response time by short-circuiting the response generation as
139139
early as possible::
140140

141141
$response->setETag('whatever_you_compute_as_an_etag');

create_framework/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ you can use as is or as a start for your very own. It will start with a simple
3838
framework and more features will be added with time. Eventually, you will have
3939
a fully-featured full-stack web framework.
4040

41-
And of course, each step will be the occasion to learn more about some of the
41+
And each step will be the occasion to learn more about some of the
4242
Symfony Components.
4343

4444
Many modern web frameworks advertize themselves as being MVC frameworks. This

create_framework/routing.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ more flexible than the previous one. Enjoy!
189189
Using the Routing component has one big additional benefit: the ability to
190190
generate URLs based on Route definitions. When using both URL matching and URL
191191
generation in your code, changing the URL patterns should have no other
192-
impact. Want to know how to use the generator? Insanely easy::
192+
impact. Want to know how to use the generator? Calling the ``generate`` method
193+
is all it takes::
193194

194195
use Symfony\Component\Routing;
195196

create_framework/templating.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ the ``_controller`` route attribute::
6969
$response = new Response('An error occurred', 500);
7070
}
7171

72-
A route can now be associated with any controller and of course, within a
72+
A route can now be associated with any controller and within a
7373
controller, you can still use the ``render_template()`` to render a template::
7474

7575
$routes->add('hello', new Routing\Route('/hello/{name}', array(
@@ -138,7 +138,7 @@ application that needs some simple logic. Our application has one page that
138138
says whether a given year is a leap year or not. When calling
139139
``/is_leap_year``, you get the answer for the current year, but you can
140140
also specify a year like in ``/is_leap_year/2009``. Being generic, the
141-
framework does not need to be modified in any way, just create a new
141+
framework does not need to be modified in any way, create a new
142142
``app.php`` file::
143143

144144
// example.com/src/app.php
@@ -169,7 +169,7 @@ framework does not need to be modified in any way, just create a new
169169

170170
The ``is_leap_year()`` function returns ``true`` when the given year is a leap
171171
year, ``false`` otherwise. If the year is ``null``, the current year is
172-
tested. The controller is simple: it gets the year from the request
172+
tested. The controller does little: it gets the year from the request
173173
attributes, pass it to the ``is_leap_year()`` function, and according to the
174174
return value it creates a new Response object.
175175

create_framework/unit_testing.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ This test simulates a request that does not match any route. As such, the
121121
``match()`` method returns a ``ResourceNotFoundException`` exception and we
122122
are testing that our framework converts this exception to a 404 response.
123123

124-
Executing this test is as simple as running ``phpunit`` from the
125-
``example.com`` directory:
124+
Execute this test by running ``phpunit`` in the ``example.com`` directory:
126125

127126
.. code-block:: terminal
128127
@@ -136,7 +135,8 @@ Executing this test is as simple as running ``phpunit`` from the
136135
After the test ran, you should see a green bar. If not, you have a bug
137136
either in the test or in the framework code!
138137

139-
Adding a unit test for any exception thrown in a controller is just as easy::
138+
Adding a unit test for any exception thrown in a controller means expecting a
139+
response code of 500::
140140

141141
public function testErrorHandling()
142142
{
@@ -209,7 +209,7 @@ Alternatively you can output the result directly to the console:
209209
210210
$ phpunit --coverage-text
211211
212-
Thanks to the simple object-oriented code that we have written so far, we have
212+
Thanks to the clean object-oriented code that we have written so far, we have
213213
been able to write unit-tests to cover all possible use cases of our
214214
framework; test doubles ensured that we were actually testing our code and not
215215
Symfony code.

0 commit comments

Comments
 (0)