Skip to content

Commit 7e4904f

Browse files
author
frne
committed
Merge remote-tracking branch 'upstream/2.3' into general-grammar-and-style-fixes
Conflicts: book/forms.rst
2 parents 1da061c + 9b4d747 commit 7e4904f

File tree

18 files changed

+277
-338
lines changed

18 files changed

+277
-338
lines changed

book/forms.rst

+16-13
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,19 @@ helper functions:
167167

168168
That's it! Just three lines are needed to render the complete form:
169169

170-
* ``form_start(form)`` - Renders the start tag of the form, including the
171-
correct enctype attribute when using file uploads;
170+
``form_start(form)``
171+
Renders the start tag of the form, including the correct enctype attribute
172+
when using file uploads.
172173

173-
* ``form_widget(form)`` - Renders all the fields, which includes the field
174-
element itself, a label and any validation error messages for the field;
174+
``form_widget(form)``
175+
Renders all the fields, which includes the field element itself, a label
176+
and any validation error messages for the field.
175177

176-
* ``form_end()`` - Renders the end tag of the form and any fields that have not
177-
yet been rendered, in case you rendered each field yourself. This is useful
178-
for rendering hidden fields and taking advantage of the automatic
179-
:ref:`CSRF Protection <forms-csrf>`.
178+
``form_end()``
179+
Renders the end tag of the form and any fields that have not
180+
yet been rendered, in case you rendered each field yourself. This is useful
181+
for rendering hidden fields and taking advantage of the automatic
182+
:ref:`CSRF Protection <forms-csrf>`.
180183

181184
.. seealso::
182185

@@ -262,7 +265,7 @@ possible paths:
262265
.. note::
263266

264267
You can use the method :method:`Symfony\\Component\\Form\\FormInterface::isSubmitted`
265-
to check whether a form was submitted, regardless of whether the
268+
to check whether a form was submitted, regardless of whether or not the
266269
submitted data is actually valid.
267270

268271
#. When the user submits the form with valid data, the submitted data is again
@@ -330,9 +333,9 @@ Form Validation
330333
In the previous section, you learned how a form can be submitted with valid
331334
or invalid data. In Symfony, validation is applied to the underlying object
332335
(e.g. ``Task``). In other words, the question isn't whether the "form" is
333-
valid, but whether the ``$task`` object is valid after the form has
336+
valid, but whether or not the ``$task`` object is valid after the form has
334337
applied the submitted data to it. Calling ``$form->isValid()`` is a shortcut
335-
that asks the ``$task`` object whether it has valid data.
338+
that asks the ``$task`` object whether or not it has valid data.
336339

337340
Validation is done by adding a set of rules (called constraints) to a class. To
338341
see this in action, add validation constraints so that the ``task`` field cannot
@@ -639,7 +642,7 @@ the documentation for each type.
639642
option on your field to ``false`` or
640643
:ref:`disable HTML5 validation <book-forms-html5-validation-disable>`.
641644

642-
Also, note that setting the ``required`` option to ``true`` will **not**
645+
Also note that setting the ``required`` option to ``true`` will **not**
643646
result in server-side validation to be applied. In other words, if a
644647
user submits a blank value for the field (either with an old browser
645648
or web service, for example), it will be accepted as a valid value unless
@@ -1486,7 +1489,7 @@ In Twig, every block needed is defined in a single template file (e.g.
14861489
file, you can see every block needed to render a form and every default field
14871490
type.
14881491

1489-
In PHP, the fragments are individual template files. By default, they are located in
1492+
In PHP, the fragments are individual template files. By default they are located in
14901493
the `Resources/views/Form` directory of the framework bundle (`view on GitHub`_).
14911494

14921495
Each fragment name follows the same basic pattern and is broken up into two pieces,

book/translation.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -394,13 +394,13 @@ Imagine that the user's locale is ``fr_FR`` and that you're translating the
394394
key ``Symfony is great``. To find the French translation, Symfony actually
395395
checks translation resources for several locales:
396396

397-
1. First, Symfony looks for the translation in a ``fr_FR`` translation resource
397+
#. First, Symfony looks for the translation in a ``fr_FR`` translation resource
398398
(e.g. ``messages.fr_FR.xliff``);
399399

400-
2. If it wasn't found, Symfony looks for the translation in a ``fr`` translation
400+
#. If it wasn't found, Symfony looks for the translation in a ``fr`` translation
401401
resource (e.g. ``messages.fr.xliff``);
402402

403-
3. If the translation still isn't found, Symfony uses the ``fallback`` configuration
403+
#. If the translation still isn't found, Symfony uses the ``fallback`` configuration
404404
parameter, which defaults to ``en`` (see `Configuration`_).
405405

406406
.. _book-translation-user-locale:

components/console/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ an ``Application`` and adds commands to it::
8888
<?php
8989
// application.php
9090

91+
require __DIR__.'/vendor/autoload.php';
92+
9193
use Acme\Console\Command\GreetCommand;
9294
use Symfony\Component\Console\Application;
9395

components/http_foundation/sessions.rst

+60-60
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ Session Attributes
107107
Returns true if the attribute exists.
108108

109109
:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::replace`
110-
Sets multiple attributes at once: takes a keyed array and sets each key => value pair;
110+
Sets multiple attributes at once: takes a keyed array and sets each key => value pair.
111111

112112
:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::remove`
113-
Deletes an attribute by key;
113+
Deletes an attribute by key.
114114

115115
:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::clear`
116116
Clear all attributes.
@@ -123,7 +123,7 @@ an array. A few methods exist for "Bag" management:
123123

124124
:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getBag`
125125
Gets a :class:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface` by
126-
bag name;
126+
bag name.
127127

128128
:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getFlashBag`
129129
Gets the :class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface`.
@@ -157,16 +157,16 @@ bag types if necessary.
157157
:class:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface` has
158158
the following API which is intended mainly for internal purposes:
159159

160-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::getStorageKey`:
161-
Returns the key which the bag will ultimately store its array under in ``$_SESSION``.
162-
Generally this value can be left at its default and is for internal use.
160+
:method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::getStorageKey`
161+
Returns the key which the bag will ultimately store its array under in ``$_SESSION``.
162+
Generally this value can be left at its default and is for internal use.
163163

164-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::initialize`:
165-
This is called internally by Symfony session storage classes to link bag data
166-
to the session.
164+
:method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::initialize`
165+
This is called internally by Symfony session storage classes to link bag data
166+
to the session.
167167

168-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::getName`:
169-
Returns the name of the session bag.
168+
:method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::getName`
169+
Returns the name of the session bag.
170170

171171
Attributes
172172
~~~~~~~~~~
@@ -175,11 +175,11 @@ The purpose of the bags implementing the :class:`Symfony\\Component\\HttpFoundat
175175
is to handle session attribute storage. This might include things like user ID,
176176
and remember me login settings or other user based state information.
177177

178-
* :class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBag`
179-
This is the standard default implementation.
178+
:class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBag`
179+
This is the standard default implementation.
180180

181-
* :class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\NamespacedAttributeBag`
182-
This implementation allows for attributes to be stored in a structured namespace.
181+
:class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\NamespacedAttributeBag`
182+
This implementation allows for attributes to be stored in a structured namespace.
183183

184184
Any plain key-value storage system is limited in the extent to which
185185
complex data can be stored since each key must be unique. You can achieve
@@ -210,29 +210,29 @@ This way you can easily access a key within the stored array directly and easily
210210
:class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface`
211211
has a simple API
212212

213-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::set`:
214-
Sets an attribute by key;
213+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::set`
214+
Sets an attribute by key.
215215

216-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::get`:
217-
Gets an attribute by key;
216+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::get`
217+
Gets an attribute by key.
218218

219-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::all`:
220-
Gets all attributes as an array of key => value;
219+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::all`
220+
Gets all attributes as an array of key => value.
221221

222-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::has`:
223-
Returns true if the attribute exists;
222+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::has`
223+
Returns true if the attribute exists.
224224

225-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::keys`:
226-
Returns an array of stored attribute keys;
225+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::keys`
226+
Returns an array of stored attribute keys.
227227

228-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::replace`:
229-
Sets multiple attributes at once: takes a keyed array and sets each key => value pair.
228+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::replace`
229+
Sets multiple attributes at once: takes a keyed array and sets each key => value pair.
230230

231-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::remove`:
232-
Deletes an attribute by key;
231+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::remove`
232+
Deletes an attribute by key.
233233

234-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::clear`:
235-
Clear the bag;
234+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::clear`
235+
Clear the bag.
236236

237237
Flash Messages
238238
~~~~~~~~~~~~~~
@@ -246,49 +246,49 @@ updated page or an error page. Flash messages set in the previous page request
246246
would be displayed immediately on the subsequent page load for that session.
247247
This is however just one application for flash messages.
248248

249-
* :class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\AutoExpireFlashBag`
250-
In this implementation, messages set in one page-load will
251-
be available for display only on the next page load. These messages will auto
252-
expire regardless of if they are retrieved or not.
249+
:class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\AutoExpireFlashBag`
250+
In this implementation, messages set in one page-load will
251+
be available for display only on the next page load. These messages will auto
252+
expire regardless of if they are retrieved or not.
253253

254-
* :class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBag`
255-
In this implementation, messages will remain in the session until
256-
they are explicitly retrieved or cleared. This makes it possible to use ESI
257-
caching.
254+
:class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBag`
255+
In this implementation, messages will remain in the session until
256+
they are explicitly retrieved or cleared. This makes it possible to use ESI
257+
caching.
258258

259259
:class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface`
260260
has a simple API
261261

262-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::add`:
263-
Adds a flash message to the stack of specified type;
262+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::add`
263+
Adds a flash message to the stack of specified type.
264264

265-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::set`:
266-
Sets flashes by type; This method conveniently takes both single messages as
267-
a ``string`` or multiple messages in an ``array``.
265+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::set`
266+
Sets flashes by type; This method conveniently takes both single messages as
267+
a ``string`` or multiple messages in an ``array``.
268268

269-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::get`:
270-
Gets flashes by type and clears those flashes from the bag;
269+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::get`
270+
Gets flashes by type and clears those flashes from the bag.
271271

272-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::setAll`:
273-
Sets all flashes, accepts a keyed array of arrays ``type => array(messages)``;
272+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::setAll`
273+
Sets all flashes, accepts a keyed array of arrays ``type => array(messages)``.
274274

275-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::all`:
276-
Gets all flashes (as a keyed array of arrays) and clears the flashes from the bag;
275+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::all`
276+
Gets all flashes (as a keyed array of arrays) and clears the flashes from the bag.
277277

278-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::peek`:
279-
Gets flashes by type (read only);
278+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::peek`
279+
Gets flashes by type (read only).
280280

281-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::peekAll`:
282-
Gets all flashes (read only) as keyed array of arrays;
281+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::peekAll`
282+
Gets all flashes (read only) as keyed array of arrays.
283283

284-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::has`:
285-
Returns true if the type exists, false if not;
284+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::has`
285+
Returns true if the type exists, false if not.
286286

287-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::keys`:
288-
Returns an array of the stored flash types;
287+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::keys`
288+
Returns an array of the stored flash types.
289289

290-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::clear`:
291-
Clears the bag;
290+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::clear`
291+
Clears the bag.
292292

293293
For simple applications it is usually sufficient to have one flash message per
294294
type, for example a confirmation notice after a form is submitted. However,

components/routing/introduction.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -72,25 +72,25 @@ Defining Routes
7272

7373
A full route definition can contain up to seven parts:
7474

75-
1. The URL path route. This is matched against the URL passed to the `RequestContext`,
75+
#. The URL path route. This is matched against the URL passed to the `RequestContext`,
7676
and can contain named wildcard placeholders (e.g. ``{placeholders}``)
7777
to match dynamic parts in the URL.
7878

79-
2. An array of default values. This contains an array of arbitrary values
79+
#. An array of default values. This contains an array of arbitrary values
8080
that will be returned when the request matches the route.
8181

82-
3. An array of requirements. These define constraints for the values of the
82+
#. An array of requirements. These define constraints for the values of the
8383
placeholders as regular expressions.
8484

85-
4. An array of options. These contain internal settings for the route and
85+
#. An array of options. These contain internal settings for the route and
8686
are the least commonly needed.
8787

88-
5. A host. This is matched against the host of the request. See
88+
#. A host. This is matched against the host of the request. See
8989
:doc:`/components/routing/hostname_pattern` for more details.
9090

91-
6. An array of schemes. These enforce a certain HTTP scheme (``http``, ``https``).
91+
#. An array of schemes. These enforce a certain HTTP scheme (``http``, ``https``).
9292

93-
7. An array of methods. These enforce a certain HTTP request method (``HEAD``,
93+
#. An array of methods. These enforce a certain HTTP request method (``HEAD``,
9494
``GET``, ``POST``, ...).
9595

9696
.. versionadded:: 2.2

components/security/authorization.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ itself depends on multiple voters, and makes a final verdict based on all
4040
the votes (either positive, negative or neutral) it has received. It
4141
recognizes several strategies:
4242

43-
* ``affirmative`` (default)
43+
``affirmative`` (default)
4444
grant access as soon as any voter returns an affirmative response;
4545

46-
* ``consensus``
46+
``consensus``
4747
grant access if there are more voters granting access than there are denying;
4848

49-
* ``unanimous``
49+
``unanimous``
5050
only grant access if none of the voters has denied access;
5151

5252
.. code-block:: php
@@ -85,14 +85,14 @@ of :class:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\VoterInterf
8585
which means they have to implement a few methods which allows the decision
8686
manager to use them:
8787

88-
* ``supportsAttribute($attribute)``
88+
``supportsAttribute($attribute)``
8989
will be used to check if the voter knows how to handle the given attribute;
9090

91-
* ``supportsClass($class)``
91+
``supportsClass($class)``
9292
will be used to check if the voter is able to grant or deny access for
9393
an object of the given class;
9494

95-
* ``vote(TokenInterface $token, $object, array $attributes)``
95+
``vote(TokenInterface $token, $object, array $attributes)``
9696
this method will do the actual voting and return a value equal to one
9797
of the class constants of :class:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\VoterInterface`,
9898
i.e. ``VoterInterface::ACCESS_GRANTED``, ``VoterInterface::ACCESS_DENIED``

components/serializer.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ of the ``Person`` class would be encoded in XML format::
144144
In this case, :method:`Symfony\\Component\\Serializer\\Serializer::deserialize`
145145
needs three parameters:
146146

147-
1. The information to be decoded
148-
2. The name of the class this information will be decoded to
149-
3. The encoder used to convert that information into an array
147+
#. The information to be decoded
148+
#. The name of the class this information will be decoded to
149+
#. The encoder used to convert that information into an array
150150

151151
Using Camelized Method Names for Underscored Attributes
152152
-------------------------------------------------------

components/translation/introduction.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,12 @@ If the message is not located in the catalog of the specific locale, the
159159
translator will look into the catalog of one or more fallback locales. For
160160
example, assume you're trying to translate into the ``fr_FR`` locale:
161161

162-
1. First, the translator looks for the translation in the ``fr_FR`` locale;
162+
#. First, the translator looks for the translation in the ``fr_FR`` locale;
163163

164-
2. If it wasn't found, the translator looks for the translation in the ``fr``
164+
#. If it wasn't found, the translator looks for the translation in the ``fr``
165165
locale;
166166

167-
3. If the translation still isn't found, the translator uses the one or more
167+
#. If the translation still isn't found, the translator uses the one or more
168168
fallback locales set explicitly on the translator.
169169

170170
For (3), the fallback locales can be set by calling

conf.py

-2
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,10 @@
101101
lexers['php-annotations'] = PhpLexer(startinline=True)
102102
lexers['php-standalone'] = PhpLexer(startinline=True)
103103
lexers['php-symfony'] = PhpLexer(startinline=True)
104-
lexers['varnish2'] = CLexer()
105104
lexers['varnish3'] = CLexer()
106105
lexers['varnish4'] = CLexer()
107106

108107
config_block = {
109-
'varnish2': 'Varnish 2',
110108
'varnish3': 'Varnish 3',
111109
'varnish4': 'Varnish 4'
112110
}

0 commit comments

Comments
 (0)