Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0fffa1c

Browse files
committed
Merge branch '2.7' into 2.8
2 parents 5a9865f + e3004b3 commit 0fffa1c

File tree

6 files changed

+37
-36
lines changed

6 files changed

+37
-36
lines changed

components/event_dispatcher.rst

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -440,14 +440,9 @@ EventDispatcher Aware Events and Listeners
440440
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
441441

442442
The ``EventDispatcher`` always passes the dispatched event, the event's
443-
name and a reference to itself to the listeners. This can be used in some
444-
advanced usages of the ``EventDispatcher`` like dispatching other events
445-
in listeners, event chaining or even lazy loading of more listeners into
446-
the dispatcher object as shown in the following examples.
447-
448-
This can lead to some advanced applications of the ``EventDispatcher``
449-
including dispatching other events inside listeners, chaining events or even
450-
lazy loading listeners into the dispatcher object.
443+
name and a reference to itself to the listeners. This can lead to some advanced
444+
applications of the ``EventDispatcher`` including dispatching other events inside
445+
listeners, chaining events or even lazy loading listeners into the dispatcher object.
451446

452447
.. index::
453448
single: EventDispatcher; Dispatcher shortcuts

console.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,21 +216,16 @@ console::
216216
namespace Tests\AppBundle\Command;
217217

218218
use AppBundle\Command\CreateUserCommand;
219-
use Symfony\Component\Console\Application;
220-
// use this if you're in the Symfony Framework
221-
//use Symfony\Bundle\FrameworkBundle\Console\Application;
219+
use Symfony\Bundle\FrameworkBundle\Console\Application;
220+
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
222221
use Symfony\Component\Console\Tester\CommandTester;
223222

224-
class CreateUserCommandTest extends \PHPUnit_Framework_TestCase
223+
class CreateUserCommandTest extends KernelTestCase
225224
{
226225
public function testExecute()
227226
{
228-
$application = new Application();
229-
230-
// if you're in the Symfony framework, do this instead
231-
// extend the KernelTestCase class
232-
// self::bootKernel();
233-
// $application = new Application(self::$kernel);
227+
self::bootKernel();
228+
$application = new Application(self::$kernel);
234229

235230
$application->add(new CreateUserCommand());
236231

@@ -259,6 +254,12 @@ console::
259254
You can also test a whole console application by using
260255
:class:`Symfony\\Component\\Console\\Tester\\ApplicationTester`.
261256

257+
.. note::
258+
259+
When using the Console component in a standalone project, use
260+
:class:`Symfony\\Component\\Console\\Application <Symfony\\Component\\Console\\Application>`
261+
and extend the normal ``\PHPUnit_Framework_TestCase``.
262+
262263
To be able to use the fully set up service container for your console tests
263264
you can extend your test from
264265
:class:`Symfony\\Bundle\\FrameworkBundle\\Test\\KernelTestCase`::

contributing/documentation/overview.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,10 @@ link displayed for Platform.sh service.
261261
Build the Documentation Locally
262262
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
263263

264-
Alternatively you can build the documentation in your own computer for testing
264+
Alternatively you can build the documentation on your own computer for testing
265265
purposes following these steps:
266266

267-
#. Install `pip`_ as explained in the `pip installation`_ article.
267+
#. Install `pip`_ as explained in the `pip installation`_ article;
268268

269269
#. Install `Sphinx`_ and `Sphinx Extensions for PHP and Symfony`_
270270
(depending on your system, you may need to execute this command as root user):

routing.rst

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,13 @@ expressions - see :doc:`/routing/requirements`.
256256
Giving {placeholders} a Default Value
257257
-------------------------------------
258258

259-
In the previous example, the ``blog_list`` has a path of ``/blog/{page}``. If the
260-
user goes to ``/blog/1``, it will match. But if the user goes to ``/blog``, it will
261-
**not** match. As soon as you add a ``{placeholder}`` to a route, it *must* have
262-
a value.
259+
In the previous example, the ``blog_list`` has a path of ``/blog/{page}``. If
260+
the user visits ``/blog/1``, it will match. But if they visit ``/blog``, it
261+
will **not** match. As soon as you add a ``{placeholder}`` to a route, it
262+
*must* have a value.
263263

264-
So how can we make ``/blog_list`` once again match when the user goes to ``/blog``?
265-
By adding a *default* value:
264+
So how can you make ``blog_list`` once again match when the user visits
265+
``/blog``? By adding a *default* value:
266266

267267
.. configuration-block::
268268

@@ -309,6 +309,7 @@ By adding a *default* value:
309309
<route id="blog_list" path="/blog/{page}">
310310
<default key="_controller">AppBundle:Blog:list</default>
311311
<default key="page">1</default>
312+
312313
<requirement key="page">\d+</requirement>
313314
</route>
314315
@@ -322,19 +323,23 @@ By adding a *default* value:
322323
use Symfony\Component\Routing\Route;
323324
324325
$collection = new RouteCollection();
325-
$collection->add('blog_list', new Route('/blog/{page}', array(
326-
'_controller' => 'AppBundle:Blog:list',
327-
'page' => 1,
328-
), array(
329-
'page' => '\d+'
330-
)));
326+
$collection->add('blog_list', new Route(
327+
'/blog/{page}',
328+
array(
329+
'_controller' => 'AppBundle:Blog:list',
330+
'page' => 1,
331+
),
332+
array(
333+
'page' => '\d+'
334+
)
335+
));
331336
332337
// ...
333338
334339
return $collection;
335340
336-
Now, when the user goes to ``/blog``, the ``blog_list`` route will match and ``$page``
337-
will default to a value of ``1``.
341+
Now, when the user visits ``/blog``, the ``blog_list`` route will match and
342+
``$page`` will default to a value of ``1``.
338343

339344
.. index::
340345
single: Routing; Advanced example

security/access_control.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Once Symfony has decided which ``access_control`` entry matches (if any),
131131
it then *enforces* access restrictions based on the ``roles``, ``allow_if`` and ``requires_channel``
132132
options:
133133

134-
* ``role`` If the user does not have the given role(s), then access is denied
134+
* ``roles`` If the user does not have the given role(s), then access is denied
135135
(internally, an :class:`Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException`
136136
is thrown);
137137

templating.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ with alternating ``odd``, ``even`` classes:
109109
.. code-block:: html+twig
110110

111111
{% for i in 1..10 %}
112-
<div class="{{ cycle(['odd', 'even'], i) }}">
112+
<div class="{{ cycle(['even', 'odd'], i) }}">
113113
<!-- some HTML here -->
114114
</div>
115115
{% endfor %}

0 commit comments

Comments
 (0)