Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4956ac2

Browse filesBrowse files
committed
minor #10586 Review components chapter (dbu)
This PR was merged into the 4.1 branch. Discussion ---------- Review components chapter review for symfony/diversity#9 of components chapter Commits ------- f25b41b review components documentation for belittling words
2 parents 56b6d30 + f25b41b commit 4956ac2
Copy full SHA for 4956ac2

32 files changed

+77
-79
lines changed

‎components/asset.rst

Copy file name to clipboardExpand all lines: components/asset.rst
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ corresponding output file:
155155
"...": "..."
156156
}
157157
158-
In those cases, use the
158+
In those cases, use the
159159
:class:`Symfony\\Component\\Asset\\VersionStrategy\\JsonManifestVersionStrategy`::
160160

161161
use Symfony\Component\Asset\Package;
@@ -282,8 +282,8 @@ You can also pass a schema-agnostic URL::
282282
// result: //static.example.com/images/logo.png?v1
283283

284284
This is useful because assets will automatically be requested via HTTPS if
285-
a visitor is viewing your site in https. Just make sure that your CDN host
286-
supports https.
285+
a visitor is viewing your site in https. If you want to use this, make sure
286+
that your CDN host supports HTTPS.
287287

288288
In case you serve assets from more than one domain to improve application
289289
performance, pass an array of URLs as the first argument to the ``UrlPackage``

‎components/console/changing_default_command.rst

Copy file name to clipboardExpand all lines: components/console/changing_default_command.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Changing the Default Command
55
============================
66

77
The Console component will always run the ``ListCommand`` when no command name is
8-
passed. In order to change the default command you just need to pass the command
8+
passed. In order to change the default command you need to pass the command
99
name to the ``setDefaultCommand()`` method::
1010

1111
namespace Acme\Console\Command;

‎components/console/helpers/formatterhelper.rst

Copy file name to clipboardExpand all lines: components/console/helpers/formatterhelper.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ Custom Suffix
101101
~~~~~~~~~~~~~
102102

103103
By default, the ``...`` suffix is used. If you wish to use a different suffix,
104-
simply pass it as the third argument to the method.
104+
pass it as the third argument to the method.
105105
The suffix is always appended, unless truncate length is longer than a message
106106
and a suffix length.
107-
If you don't want to use suffix at all, just pass an empty string::
107+
If you don't want to use suffix at all, pass an empty string::
108108

109109
$truncatedMessage = $formatter->truncate($message, 7, '!!'); // result: This is!!
110110
$truncatedMessage = $formatter->truncate($message, 7, ''); // result: This is

‎components/console/helpers/progressbar.rst

Copy file name to clipboardExpand all lines: components/console/helpers/progressbar.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ value and then call the ``setMaxSteps()`` method to update it as needed::
6767
.. versionadded:: 4.1
6868
The ``setMaxSteps()`` method was introduced in Symfony 4.1.
6969

70-
Another solution is to just omit the steps argument when creating the
70+
Another solution is to omit the steps argument when creating the
7171
:class:`Symfony\\Component\\Console\\Helper\\ProgressBar` instance::
7272

7373
$progressBar = new ProgressBar($output);

‎components/console/single_command_tool.rst

Copy file name to clipboardExpand all lines: components/console/single_command_tool.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The method :method:`Symfony\\Component\\Console\\Application::setDefaultCommand`
3333
accepts a boolean as second parameter. If true, the command ``echo`` will then
3434
always be used, without having to pass its name.
3535

36-
Of course, you can still register a command as usual::
36+
You can still register a command as usual::
3737

3838
#!/usr/bin/env php
3939
<?php

‎components/console/usage.rst

Copy file name to clipboardExpand all lines: components/console/usage.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ commands, then you can run ``help`` like this:
139139
140140
$ php application.php h
141141
142-
If you have commands using ``:`` to namespace commands then you just have
142+
If you have commands using ``:`` to namespace commands then you only need
143143
to type the shortest unambiguous text for each part. If you have created the
144144
``demo:greet`` as shown in :doc:`/components/console` then you
145145
can run it with:

‎components/debug.rst

Copy file name to clipboardExpand all lines: components/debug.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Usage
2222
-----
2323

2424
The Debug component provides several tools to help you debug PHP code.
25-
Enabling them all is as easy as it can get::
25+
Enabling them all can be done by calling the static method ``Debug::enable()``::
2626

2727
use Symfony\Component\Debug\Debug;
2828

@@ -80,7 +80,7 @@ throw more helpful exceptions when a class isn't found by the registered
8080
autoloaders. All autoloaders that implement a ``findFile()`` method are replaced
8181
with a ``DebugClassLoader`` wrapper.
8282

83-
Using the ``DebugClassLoader`` is as easy as calling its static
83+
To activate the ``DebugClassLoader``, call its static
8484
:method:`Symfony\\Component\\Debug\\DebugClassLoader::enable` method::
8585

8686
use Symfony\Component\Debug\DebugClassLoader;

‎components/dependency_injection.rst

Copy file name to clipboardExpand all lines: components/dependency_injection.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Basic Usage
3232
independent component in any PHP application. Read the :doc:`/service_container`
3333
article to learn about how to use it in Symfony applications.
3434

35-
You might have a simple class like the following ``Mailer`` that
35+
You might have a class like the following ``Mailer`` that
3636
you want to make available as a service::
3737

3838
class Mailer

‎components/dependency_injection/compilation.rst

Copy file name to clipboardExpand all lines: components/dependency_injection/compilation.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ need to be parsed and the PHP configuration built from them. The compilation
449449
process makes the container more efficient but it takes time to run. You
450450
can have the best of both worlds though by using configuration files and
451451
then dumping and caching the resulting configuration. The ``PhpDumper``
452-
makes dumping the compiled container easy::
452+
serves at dumping the compiled container::
453453

454454
use Symfony\Component\DependencyInjection\ContainerBuilder;
455455
use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
@@ -534,7 +534,7 @@ You do not need to work out which files to cache as the container builder
534534
keeps track of all the resources used to configure it, not just the
535535
configuration files but the extension classes and compiler passes as well.
536536
This means that any changes to any of these files will invalidate the cache
537-
and trigger the container being rebuilt. You just need to ask the container
537+
and trigger the container being rebuilt. You need to ask the container
538538
for these resources and use them as metadata for the cache::
539539

540540
// ...

‎components/dom_crawler.rst

Copy file name to clipboardExpand all lines: components/dom_crawler.rst
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,16 @@ tree.
7575
Node Filtering
7676
~~~~~~~~~~~~~~
7777

78-
Using XPath expressions is really easy::
78+
Using XPath expressions, you can select specific nodes within the document::
7979

8080
$crawler = $crawler->filterXPath('descendant-or-self::body/p');
8181

8282
.. tip::
8383

8484
``DOMXPath::query`` is used internally to actually perform an XPath query.
8585

86-
Filtering is even easier if you have the CssSelector component installed.
87-
This allows you to use jQuery-like selectors to traverse::
86+
If you prefer CSS selectors over XPath, install the CssSelector component.
87+
It allows you to use jQuery-like selectors to traverse::
8888

8989
$crawler = $crawler->filter('body > p');
9090

‎components/event_dispatcher.rst

Copy file name to clipboardExpand all lines: components/event_dispatcher.rst
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The Symfony EventDispatcher component implements the `Mediator`_ and `Observer`_
2929
design patterns to make all these things possible and to make your projects
3030
truly extensible.
3131

32-
Take a simple example from :doc:`the HttpKernel component </components/http_kernel>`.
32+
Take an example from :doc:`the HttpKernel component </components/http_kernel>`.
3333
Once a ``Response`` object has been created, it may be useful to allow other
3434
elements in the system to modify it (e.g. add some cache headers) before
3535
it's actually used. To make this possible, the Symfony kernel throws an
@@ -84,7 +84,7 @@ object itself often contains data about the event being dispatched.
8484
Naming Conventions
8585
..................
8686

87-
The unique event name can be any string, but optionally follows a few simple
87+
The unique event name can be any string, but optionally follows a few
8888
naming conventions:
8989

9090
* Use only lowercase letters, numbers, dots (``.``) and underscores (``_``);
@@ -99,8 +99,7 @@ Event Names and Event Objects
9999
.............................
100100

101101
When the dispatcher notifies listeners, it passes an actual ``Event`` object
102-
to those listeners. The base ``Event`` class is very simple: it
103-
contains a method for stopping
102+
to those listeners. The base ``Event`` class contains a method for stopping
104103
:ref:`event propagation <event_dispatcher-event-propagation>`, but not much
105104
else.
106105

@@ -451,7 +450,7 @@ listeners, chaining events or even lazy loading listeners into the dispatcher ob
451450
Dispatcher Shortcuts
452451
~~~~~~~~~~~~~~~~~~~~
453452

454-
If you do not need a custom event object, you can simply rely on a plain
453+
If you do not need a custom event object, you can rely on a plain
455454
:class:`Symfony\\Component\\EventDispatcher\\Event` object. You do not even
456455
need to pass this to the dispatcher as it will create one by default unless you
457456
specifically pass one::

‎components/event_dispatcher/generic_event.rst

Copy file name to clipboardExpand all lines: components/event_dispatcher/generic_event.rst
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ box, because it follows the standard observer pattern where the event object
1616
encapsulates an event 'subject', but has the addition of optional extra
1717
arguments.
1818

19-
:class:`Symfony\\Component\\EventDispatcher\\GenericEvent` has a simple
20-
API in addition to the base class
19+
:class:`Symfony\\Component\\EventDispatcher\\GenericEvent` adds some more
20+
methods in addition to the base class
2121
:class:`Symfony\\Component\\EventDispatcher\\Event`
2222

2323
* :method:`Symfony\\Component\\EventDispatcher\\GenericEvent::__construct`:
@@ -48,7 +48,7 @@ the event subject.
4848
The following examples show use-cases to give a general idea of the flexibility.
4949
The examples assume event listeners have been added to the dispatcher.
5050

51-
Simply passing a subject::
51+
Passing a subject::
5252

5353
use Symfony\Component\EventDispatcher\GenericEvent;
5454

‎components/form.rst

Copy file name to clipboardExpand all lines: components/form.rst
+10-10Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
The Form Component
66
==================
77

8-
The Form component allows you to easily create, process and reuse forms.
8+
The Form component allows you to create, process and reuse forms.
99

1010
The Form component is a tool to help you solve the problem of allowing end-users
1111
to interact with the data and modify the data in your application. And though
@@ -34,7 +34,8 @@ Configuration
3434
about how to use it in Symfony applications.
3535

3636
In Symfony, forms are represented by objects and these objects are built
37-
by using a *form factory*. Building a form factory is simple::
37+
by using a *form factory*. Building a form factory is done with the factory
38+
method ``Forms::createFormFactory``::
3839

3940
use Symfony\Component\Form\Forms;
4041

@@ -158,7 +159,7 @@ Twig Templating
158159
~~~~~~~~~~~~~~~
159160

160161
If you're using the Form component to process HTML forms, you'll need a way
161-
to easily render your form as HTML form fields (complete with field values,
162+
to render your form as HTML form fields (complete with field values,
162163
errors, and labels). If you use `Twig`_ as your template engine, the Form
163164
component offers a rich integration.
164165

@@ -290,7 +291,7 @@ Validation
290291

291292
The Form component comes with tight (but optional) integration with Symfony's
292293
Validator component. If you're using a different solution for validation,
293-
no problem! Simply take the submitted/bound data of your form (which is an
294+
no problem! Take the submitted/bound data of your form (which is an
294295
array or object) and pass it through your own validation system.
295296

296297
To use the integration with Symfony's Validator component, first make sure
@@ -362,7 +363,7 @@ you need to. If your application uses global or static variables (not usually a
362363
good idea), then you can store the object on some static class or do something
363364
similar.
364365

365-
Regardless of how you architect your application, just remember that you
366+
Regardless of how you architect your application, remember that you
366367
should only have one form factory and that you'll need to be able to access
367368
it throughout your application.
368369

@@ -441,8 +442,7 @@ Setting default Values
441442
~~~~~~~~~~~~~~~~~~~~~~
442443

443444
If you need your form to load with some default values (or you're building
444-
an "edit" form), simply pass in the default data when creating your form
445-
builder:
445+
an "edit" form), pass in the default data when creating your form builder:
446446

447447
.. configuration-block::
448448

@@ -517,8 +517,8 @@ helper functions:
517517
:align: center
518518

519519
That's it! By printing ``form_widget(form)``, each field in the form is
520-
rendered, along with a label and error message (if there is one). As easy
521-
as this is, it's not very flexible (yet). Usually, you'll want to render each
520+
rendered, along with a label and error message (if there is one). While this is
521+
convenient, it's not very flexible (yet). Usually, you'll want to render each
522522
form field individually so you can control how the form looks. You'll learn how
523523
to do that in the ":doc:`/form/rendering`" section.
524524

@@ -651,7 +651,7 @@ Then:
651651
3) if the form is valid, perform some action and redirect.
652652

653653
Luckily, you don't need to decide whether or not a form has been submitted.
654-
Just pass the current request to the ``handleRequest()`` method. Then, the Form
654+
Pass the current request to the ``handleRequest()`` method. Then, the Form
655655
component will do all the necessary work for you.
656656

657657
.. _component-form-intro-validation:

‎components/http_foundation.rst

Copy file name to clipboardExpand all lines: components/http_foundation.rst
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ this complexity and defines some methods for the most common tasks::
284284
Accessing ``Accept-*`` Headers Data
285285
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
286286

287-
You can easily access basic data extracted from ``Accept-*`` headers
287+
You can access basic data extracted from ``Accept-*`` headers
288288
by using the following methods:
289289

290290
:method:`Symfony\\Component\\HttpFoundation\\Request::getAcceptableContentTypes`
@@ -415,7 +415,7 @@ incompatibility with the HTTP specification (e.g. a wrong ``Content-Type`` heade
415415

416416
$response->prepare($request);
417417

418-
Sending the response to the client is then as simple as calling
418+
Sending the response to the client is done by calling the method
419419
:method:`Symfony\\Component\\HttpFoundation\\Response::send`::
420420

421421
$response->send();
@@ -545,8 +545,8 @@ Serving Files
545545
~~~~~~~~~~~~~
546546

547547
When sending a file, you must add a ``Content-Disposition`` header to your
548-
response. While creating this header for basic file downloads is easy, using
549-
non-ASCII filenames is more involving. The
548+
response. While creating this header for basic file downloads is straightforward,
549+
using non-ASCII filenames is more involving. The
550550
:method:`Symfony\\Component\\HttpFoundation\\ResponseHeaderBag::makeDisposition`
551551
abstracts the hard work behind a simple API::
552552

‎components/http_foundation/session_configuration.rst

Copy file name to clipboardExpand all lines: components/http_foundation/session_configuration.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ handlers by providing six callback functions which PHP calls internally at
6969
various points in the session workflow.
7070

7171
The Symfony HttpFoundation component provides some by default and these can
72-
easily serve as examples if you wish to write your own.
72+
serve as examples if you wish to write your own.
7373

7474
* :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\PdoSessionHandler`
7575
* :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\MemcachedSessionHandler`

‎components/http_foundation/session_testing.rst

Copy file name to clipboardExpand all lines: components/http_foundation/session_testing.rst
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Testing with Sessions
66
=====================
77

88
Symfony is designed from the ground up with code-testability in mind. In order
9-
to make your code which utilizes session easily testable we provide two separate
9+
to make your code which utilizes session easily testable, we provide two separate
1010
mock storage mechanisms for both unit testing and functional testing.
1111

1212
Testing code using real sessions is tricky because PHP's workflow state is global
@@ -37,7 +37,7 @@ Unit Testing
3737
------------
3838

3939
For unit testing where it is not necessary to persist the session, you should
40-
simply swap out the default storage engine with
40+
swap out the default storage engine with
4141
:class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\MockArraySessionStorage`::
4242

4343
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
@@ -49,7 +49,7 @@ Functional Testing
4949
------------------
5050

5151
For functional testing where you may need to persist session data across
52-
separate PHP processes, simply change the storage engine to
52+
separate PHP processes, change the storage engine to
5353
:class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\MockFileSessionStorage`::
5454

5555
use Symfony\Component\HttpFoundation\Session\Session;

‎components/http_foundation/sessions.rst

Copy file name to clipboardExpand all lines: components/http_foundation/sessions.rst
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Session Management
66
==================
77

88
The Symfony HttpFoundation component has a very powerful and flexible session
9-
subsystem which is designed to provide session management through a simple
9+
subsystem which is designed to provide session management through a clear
1010
object-oriented interface using a variety of session storage drivers.
1111

12-
Sessions are used via the simple :class:`Symfony\\Component\\HttpFoundation\\Session\\Session`
12+
Sessions are used via the :class:`Symfony\\Component\\HttpFoundation\\Session\\Session`
1313
implementation of :class:`Symfony\\Component\\HttpFoundation\\Session\\SessionInterface` interface.
1414

1515
.. caution::
@@ -62,8 +62,8 @@ Session API
6262
The :class:`Symfony\\Component\\HttpFoundation\\Session\\Session` class implements
6363
:class:`Symfony\\Component\\HttpFoundation\\Session\\SessionInterface`.
6464

65-
The :class:`Symfony\\Component\\HttpFoundation\\Session\\Session` has a simple API
66-
as follows divided into a couple of groups.
65+
The :class:`Symfony\\Component\\HttpFoundation\\Session\\Session` has the
66+
following API, divided into a couple of groups.
6767

6868
Session Workflow
6969
................
@@ -167,7 +167,7 @@ and "Remember Me" login settings or other user based state information.
167167
This implementation allows for attributes to be stored in a structured namespace.
168168

169169
:class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface`
170-
has a simple API
170+
has the API
171171

172172
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::set`
173173
Sets an attribute by name (``set('name', 'value')``).
@@ -265,7 +265,7 @@ This is however just one application for flash messages.
265265
caching.
266266

267267
:class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface`
268-
has a simple API
268+
has the API
269269

270270
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::add`
271271
Adds a flash message to the stack of specified type.
@@ -321,7 +321,7 @@ Examples of setting multiple flashes::
321321

322322
Displaying the flash messages might look as follows.
323323

324-
Simple, display one type of message::
324+
Display one type of message::
325325

326326
// display warnings
327327
foreach ($session->getFlashBag()->get('warning', array()) as $message) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.