Skip to content

Commit 4056218

Browse files
committed
Merge branch '2.7'
* 2.7: Fix for symfony code standards Ref #3903 - Normalize methods listings drop varnish 2 example from varnish cookbook article Rewrite the varnish cookbook article Fixes and tweaks Change PHPUnit link to avoid redirect to homepage Harmonize PHPUnit version to 4.2 or above Remove redundant "default" connection. More tweaks and grammar fixes Rewordings and transformed a list into a definition list More grammar fixes Minor grammar fix Fixed some errors in the explanation Documented the console environment variables Changed the "new in Symfony 2.6" message for consistency Documented getProgress/setProgress methods update ordered list syntax Add missing autoload include in basic application example Added cache_busting to default asset config
2 parents 0906e0c + b45313a commit 4056218

File tree

20 files changed

+285
-337
lines changed

20 files changed

+285
-337
lines changed

Diff for: book/forms.rst

+13-10
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;
172-
173-
* ``form_widget(form)`` - Renders all of the fields, which includes the field
174-
element itself, a label and any validation error messages for the field;
175-
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>`.
170+
``form_start(form)``
171+
Renders the start tag of the form, including the correct enctype attribute
172+
when using file uploads.
173+
174+
``form_widget(form)``
175+
Renders all of the fields, which includes the field element itself, a label
176+
and any validation error messages for the field.
177+
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

Diff for: book/translation.rst

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

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

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

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

403403
.. versionadded:: 2.6

Diff for: components/console/helpers/progressbar.rst

+8-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ number of units, and advance the progress as the command executes::
4242
Instead of advancing the bar by a number of steps (with the
4343
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::advance` method),
4444
you can also set the current progress by calling the
45-
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::setCurrent` method.
45+
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::setProgress` method.
46+
47+
.. versionadded:: 2.6
48+
The ``setProgress()`` method was called ``setCurrent()`` prior to Symfony 2.6.
4649

4750
.. caution::
4851

@@ -300,10 +303,13 @@ that displays the number of remaining steps::
300303
ProgressBar::setPlaceholderFormatterDefinition(
301304
'remaining_steps',
302305
function (ProgressBar $bar, OutputInterface $output) {
303-
return $bar->getMaxSteps() - $bar->getStep();
306+
return $bar->getMaxSteps() - $bar->getProgress();
304307
}
305308
);
306309

310+
.. versionadded:: 2.6
311+
The ``getProgress()`` method was called ``getStep()`` prior to Symfony 2.6.
312+
307313
Custom Messages
308314
~~~~~~~~~~~~~~~
309315

Diff for: 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

Diff for: 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,

Diff for: 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
Take the following route, which combines several of these ideas::

Diff for: components/security/authorization.rst

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

48-
* ``affirmative`` (default)
48+
``affirmative`` (default)
4949
grant access as soon as any voter returns an affirmative response;
5050

51-
* ``consensus``
51+
``consensus``
5252
grant access if there are more voters granting access than there are denying;
5353

54-
* ``unanimous``
54+
``unanimous``
5555
only grant access if none of the voters has denied access;
5656

5757
.. code-block:: php
@@ -90,14 +90,14 @@ of :class:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\VoterInterf
9090
which means they have to implement a few methods which allows the decision
9191
manager to use them:
9292

93-
* ``supportsAttribute($attribute)``
93+
``supportsAttribute($attribute)``
9494
will be used to check if the voter knows how to handle the given attribute;
9595

96-
* ``supportsClass($class)``
96+
``supportsClass($class)``
9797
will be used to check if the voter is able to grant or deny access for
9898
an object of the given class;
9999

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

Diff for: components/serializer.rst

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

161-
1. The information to be decoded
162-
2. The name of the class this information will be decoded to
163-
3. The encoder used to convert that information into an array
161+
#. The information to be decoded
162+
#. The name of the class this information will be decoded to
163+
#. The encoder used to convert that information into an array
164164

165165
Using Camelized Method Names for Underscored Attributes
166166
-------------------------------------------------------

Diff for: components/translation/introduction.rst

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

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

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

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

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

Diff for: 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
}

Diff for: contributing/code/patches.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ software:
1515

1616
* Git;
1717
* PHP version 5.3.3 or above;
18-
* PHPUnit 3.6.4 or above.
18+
* `PHPUnit`_ 4.2 or above.
1919

2020
Configure Git
2121
~~~~~~~~~~~~~
@@ -415,3 +415,4 @@ messages of all the commits. When you are finished, execute the push command.
415415
.. _`fabbot`: http://fabbot.io
416416
.. _`PSR-1`: http://www.php-fig.org/psr/psr-1/
417417
.. _`PSR-2`: http://www.php-fig.org/psr/psr-2/
418+
.. _PHPUnit: https://phpunit.de/manual/current/en/installation.html

0 commit comments

Comments
 (0)