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 cac3c6c

Browse filesBrowse files
committed
Merge remote-tracking branch 'origin/master' into di-3.3-changes
* origin/master: (36 commits) Use the short Yaml syntax for service definition [#7613] remove reference to AsseticBundle minor #7613 Twig Extensions Reference minor brush-up (mpdude) Fix service locator declaration Minor reword Update Title in controller.rst Update scheme.rst Update requirements.rst [3.3] Document FQCN named controllers Document FQCN named controllers Use the short tag syntax [#7845] minor tweaks Update translation_domain.rst.inc Update page_creation.rst to correct hidden colon Update forms.rst Rewords Fixed the form types of the buttons in the Form reference [#7832] use bin/console for Symfony 3.x Minor reword Update deployment.rst ...
2 parents 2229fd3 + a9f975b commit cac3c6c
Copy full SHA for cac3c6c

Some content is hidden

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

42 files changed

+702
-143
lines changed

‎best_practices/security.rst

Copy file name to clipboardExpand all lines: best_practices/security.rst
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,7 @@ To enable the security voter in the application, define a new service:
339339
class: AppBundle\Security\PostVoter
340340
arguments: ['@security.access.decision_manager']
341341
public: false
342-
tags:
343-
- { name: security.voter }
342+
tags: [security.voter]
344343
345344
Now, you can use the voter with the ``@Security`` annotation:
346345

‎best_practices/templates.rst

Copy file name to clipboardExpand all lines: best_practices/templates.rst
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ name is irrelevant because you never use it in your own code):
158158
class: AppBundle\Twig\AppExtension
159159
arguments: ['@app.markdown']
160160
public: false
161-
tags:
162-
- { name: twig.extension }
161+
tags: [twig.extension]
163162
164163
.. _`Twig`: http://twig.sensiolabs.org/
165164
.. _`Parsedown`: http://parsedown.org/

‎components/cache/cache_pools.rst

Copy file name to clipboardExpand all lines: components/cache/cache_pools.rst
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
single: PDO Cache, Doctrine DBAL Cache
1010
single: Redis Cache
1111

12+
.. _component-cache-cache-pools:
13+
1214
Cache Pools and Supported Adapters
1315
==================================
1416

‎components/phpunit_bridge.rst

Copy file name to clipboardExpand all lines: components/phpunit_bridge.rst
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ If you have this kind of time-related tests::
208208

209209
You used the :doc:`Symfony Stopwatch Component </components/stopwatch>` to
210210
calculate the duration time of your process, here 10 seconds. However, depending
211-
on the load of the server your the processes running on your local machine, the
211+
on the load of the server or the processes running on your local machine, the
212212
``$duration`` could for example be `10.000023s` instead of `10s`.
213213

214214
This kind of tests are called transient tests: they are failing randomly
@@ -390,7 +390,7 @@ Modified PHPUnit script
390390
-----------------------
391391

392392
.. versionadded:: 3.2
393-
The modified PHPUnit script script was introduced in the 3.2 version of
393+
This modified PHPUnit script was introduced in the 3.2 version of
394394
this component.
395395

396396
This bridge provides a modified version of PHPUnit that you can call by using
@@ -423,8 +423,8 @@ If you have installed the bridge through Composer, you can run it by calling e.g
423423

424424
.. tip::
425425

426-
Set the ``SYMFONY_PHPUNIT_REMOVE`` env var to ``symfony/yaml`` if you need
427-
``prophecy`` but not ``symfony/yaml``.
426+
If you still need to use ``prophecy`` (but not ``symfony/yaml``),
427+
then set the ``SYMFONY_PHPUNIT_REMOVE`` env var to ``symfony/yaml``.
428428

429429
.. _PHPUnit: https://phpunit.de
430430
.. _`PHPUnit event listener`: https://phpunit.de/manual/current/en/extending-phpunit.html#extending-phpunit.PHPUnit_Framework_TestListener

‎console.rst

Copy file name to clipboardExpand all lines: console.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ you can extend your test from
273273
{
274274
public function testExecute()
275275
{
276-
$kernel = $this->createKernel();
276+
$kernel = static::createKernel();
277277
$kernel->boot();
278278

279279
$application = new Application($kernel);

‎console/commands_as_services.rst

Copy file name to clipboardExpand all lines: console/commands_as_services.rst
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ with ``console.command``:
2929
services:
3030
app.command.my_command:
3131
class: AppBundle\Command\MyCommand
32-
tags:
33-
- { name: console.command }
32+
tags: [console.command]
3433
3534
.. code-block:: xml
3635
@@ -89,7 +88,7 @@ store the default value in some ``%command.default_name%`` parameter::
8988
public function __construct($defaultName)
9089
{
9190
$this->defaultName = $defaultName;
92-
91+
9392
parent::__construct();
9493
}
9594

@@ -135,8 +134,7 @@ inject the ``command.default_name`` parameter:
135134
app.command.my_command:
136135
class: AppBundle\Command\MyCommand
137136
arguments: ["%command.default_name%"]
138-
tags:
139-
- { name: console.command }
137+
tags: [console.command]
140138
141139
.. code-block:: xml
142140

‎contributing/code/tests.rst

Copy file name to clipboardExpand all lines: contributing/code/tests.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ what's going on and if the tests are broken because of the new code.
5555
to see colored test results.
5656

5757
.. _Cmder: http://cmder.net/
58-
.. _ConEmu: https://code.google.com/p/conemu-maximus5/
58+
.. _ConEmu: https://conemu.github.io/
5959
.. _ANSICON: https://github.com/adoxa/ansicon/releases
6060
.. _Mintty: https://mintty.github.io/

‎controller.rst

Copy file name to clipboardExpand all lines: controller.rst
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ The Symfony templating system and Twig are explained more in the
236236
single: Controller; Accessing services
237237

238238
.. _controller-accessing-services:
239+
.. _accessing-other-services:
239240

240241
Fetching Services as Arguments
241242
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

‎controller/service.rst

Copy file name to clipboardExpand all lines: controller/service.rst
+25-22Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -66,36 +66,36 @@ Then you can define it as a service as follows:
6666
6767
# app/config/services.yml
6868
services:
69-
app.hello_controller:
70-
class: AppBundle\Controller\HelloController
69+
AppBundle\Controller\HelloController: ~
7170
7271
.. code-block:: xml
7372
7473
<!-- app/config/services.xml -->
7574
<services>
76-
<service id="app.hello_controller" class="AppBundle\Controller\HelloController" />
75+
<service id="AppBundle\Controller\HelloController" />
7776
</services>
7877
7978
.. code-block:: php
8079
8180
// app/config/services.php
8281
use AppBundle\Controller\HelloController;
8382
84-
$container->register('app.hello_controller', HelloController::class);
83+
$container->register(HelloController::class);
8584
8685
Referring to the Service
8786
------------------------
8887

89-
To refer to a controller that's defined as a service, use the single colon (:)
90-
notation. For example, to forward to the ``indexAction()`` method of the service
91-
defined above with the id ``app.hello_controller``::
88+
If the service id is the fully-qualified class name (FQCN) of your controller,
89+
you can keep using the usual notation. For example, to forward to the
90+
``indexAction()`` method of the above ``AppBundle\Controller\HelloController``
91+
service::
9292

93-
$this->forward('app.hello_controller:indexAction', array('name' => $name));
93+
$this->forward('AppBundle:Hello:index', array('name' => $name));
9494

95-
.. note::
95+
Otherwise, use the single colon (``:``) notation. For example, to forward to the
96+
``indexAction()`` method of a service with the id ``app.hello_controller``::
9697

97-
You cannot drop the ``Action`` part of the method name when using this
98-
syntax.
98+
$this->forward('app.hello_controller:indexAction', array('name' => $name));
9999

100100
You can also route to the service by using the same notation when defining
101101
the route ``_controller`` value:
@@ -123,17 +123,24 @@ the route ``_controller`` value:
123123
'_controller' => 'app.hello_controller:indexAction',
124124
)));
125125
126+
.. note::
127+
128+
You cannot drop the ``Action`` part of the method name when using the
129+
single colon notation.
130+
126131
.. tip::
127132

128133
You can also use annotations to configure routing using a controller
129134
defined as a service. Make sure you specify the service ID in the
130-
``@Route`` annotation. See the `FrameworkExtraBundle documentation`_ for
131-
details.
135+
``@Route`` annotation if your service ID is not your controller
136+
fully-qualified class name (FQCN). See the
137+
`FrameworkExtraBundle documentation`_ for details.
132138

133139
.. tip::
134140

135141
If your controller implements the ``__invoke()`` method, you can simply
136-
refer to the service id (``app.hello_controller``).
142+
refer to the service id (``AppBundle\Controller\HelloController`` or
143+
``app.hello_controller`` for example).
137144

138145
Alternatives to base Controller Methods
139146
---------------------------------------
@@ -209,15 +216,14 @@ argument:
209216
210217
# app/config/services.yml
211218
services:
212-
app.hello_controller:
213-
class: AppBundle\Controller\HelloController
219+
AppBundle\Controller\HelloController:
214220
arguments: ['@templating']
215221
216222
.. code-block:: xml
217223
218224
<!-- app/config/services.xml -->
219225
<services>
220-
<service id="app.hello_controller" class="AppBundle\Controller\HelloController">
226+
<service id="AppBundle\Controller\HelloController">
221227
<argument type="service" id="templating"/>
222228
</service>
223229
</services>
@@ -226,13 +232,10 @@ argument:
226232
227233
// app/config/services.php
228234
use AppBundle\Controller\HelloController;
229-
use Symfony\Component\DependencyInjection\Definition;
230235
use Symfony\Component\DependencyInjection\Reference;
231236
232-
$container->setDefinition('app.hello_controller', new Definition(
233-
HelloController::class,
234-
array(new Reference('templating'))
235-
));
237+
$container->register(HelloController::class)
238+
->addArgument(new Reference('templating'));
236239
237240
Rather than fetching the ``templating`` service from the container, you can
238241
inject *only* the exact service(s) that you need directly into the controller.

‎deployment.rst

Copy file name to clipboardExpand all lines: deployment.rst
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ specifically tailored to the requirements of Symfony.
8080
`Capistrano`_ with `Symfony plugin`_
8181
`Capistrano`_ is a remote server automation and deployment tool written in Ruby.
8282
`Symfony plugin`_ is a plugin to ease Symfony related tasks, inspired by `Capifony`_
83-
(which works only with Capistrano 2 )
83+
(which works only with Capistrano 2).
8484

8585
`sf2debpkg`_
8686
Helps you build a native Debian package for your Symfony project.
@@ -182,12 +182,12 @@ setup:
182182
* Pushing assets to a CDN
183183
* ...
184184

185-
Application Lifecycle: Continuous Integration, QA, etc
186-
------------------------------------------------------
185+
Application Lifecycle: Continuous Integration, QA, etc.
186+
-------------------------------------------------------
187187

188188
While this entry covers the technical details of deploying, the full lifecycle
189-
of taking code from development up to production may have a lot more steps
190-
(think deploying to staging, QA (Quality Assurance), running tests, etc).
189+
of taking code from development up to production may have more steps:
190+
deploying to staging, QA (Quality Assurance), running tests, etc.
191191

192192
The use of staging, testing, QA, continuous integration, database migrations
193193
and the capability to roll back in case of failure are all strongly advised. There

‎form/create_custom_field_type.rst

Copy file name to clipboardExpand all lines: form/create_custom_field_type.rst
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,7 @@ the ``genders`` parameter value as the first argument to its to-be-created
309309
class: AppBundle\Form\Type\GenderType
310310
arguments:
311311
- '%genders%'
312-
tags:
313-
- { name: form.type }
312+
tags: [form.type]
314313
315314
.. code-block:: xml
316315

‎form/data_transformers.rst

Copy file name to clipboardExpand all lines: form/data_transformers.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,7 @@ Define the form type as a service in your configuration files.
300300
app.form.type.task:
301301
class: AppBundle\Form\Type\TaskType
302302
arguments: ["@doctrine.orm.entity_manager"]
303-
tags:
304-
- { name: form.type }
303+
tags: [form.type]
305304
306305
.. code-block:: xml
307306
@@ -434,8 +433,7 @@ it's recognized as a custom field type:
434433
app.type.issue_selector:
435434
class: AppBundle\Form\IssueSelectorType
436435
arguments: ['@doctrine.orm.entity_manager']
437-
tags:
438-
- { name: form.type }
436+
tags: [form.type]
439437
440438
441439
.. code-block:: xml

‎form/dynamic_form_modification.rst

Copy file name to clipboardExpand all lines: form/dynamic_form_modification.rst
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,7 @@ you need to register it as a service and tag it with :ref:`form.type <dic-tags-f
344344
app.form.friend_message:
345345
class: AppBundle\Form\Type\FriendMessageFormType
346346
arguments: ['@security.token_storage']
347-
tags:
348-
- { name: form.type }
347+
tags: [form.type]
349348
350349
.. code-block:: xml
351350

‎form/form_dependencies.rst

Copy file name to clipboardExpand all lines: form/form_dependencies.rst
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Suppose you need to access the ``doctrine.orm.entity_manager`` service so that y
7575
can make a query. First, add this as an argument to your form class::
7676

7777
// src/AppBundle/Form/TaskType.php
78-
78+
7979
use Doctrine\ORM\EntityManager;
8080
// ...
8181

@@ -102,8 +102,7 @@ Next, register this as a service and tag it with ``form.type``:
102102
app.form.type.task:
103103
class: AppBundle\Form\TaskType
104104
arguments: ['@doctrine.orm.entity_manager']
105-
tags:
106-
- { name: form.type }
105+
tags: [form.type]
107106
108107
.. code-block:: xml
109108

‎form/type_guesser.rst

Copy file name to clipboardExpand all lines: form/type_guesser.rst
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,7 @@ creating a service and tagging it as ``form.type_guesser``:
188188
189189
app.phpdoc_type_guesser:
190190
class: AppBundle\Form\TypeGuesser\PHPDocTypeGuesser
191-
tags:
192-
- { name: form.type_guesser }
191+
tags: [form.type_guesser]
193192
194193
.. code-block:: xml
195194

‎forms.rst

Copy file name to clipboardExpand all lines: forms.rst
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ to do with Symfony or any other library. It's quite simply a normal PHP object
6161
that directly solves a problem inside *your* application (i.e. the need to
6262
represent a task in your application). Of course, by the end of this article,
6363
you'll be able to submit data to a ``Task`` instance (via an HTML form), validate
64-
its data, and persist it to the database.
64+
its data and persist it to the database.
6565

6666
.. index::
6767
single: Forms; Create a form in a controller
@@ -114,7 +114,7 @@ from inside a controller::
114114

115115
Creating a form requires relatively little code because Symfony form objects
116116
are built with a "form builder". The form builder's purpose is to allow you
117-
to write simple form "recipes", and have it do all the heavy-lifting of actually
117+
to write simple form "recipes" and have it do all the heavy-lifting of actually
118118
building the form.
119119

120120
In this example, you've added two fields to your form - ``task`` and ``dueDate`` -
@@ -259,7 +259,7 @@ your controller::
259259
is called. Otherwise, changes done in the ``*_SUBMIT`` events aren't applied to the
260260
view (like validation errors).
261261

262-
This controller follows a common pattern for handling forms, and has three
262+
This controller follows a common pattern for handling forms and has three
263263
possible paths:
264264

265265
#. When initially loading the page in a browser, the form is created and

‎introduction/from_flat_php_to_symfony2.rst

Copy file name to clipboardExpand all lines: introduction/from_flat_php_to_symfony2.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ on the requested URI::
370370
echo '<html><body><h1>Page Not Found</h1></body></html>';
371371
}
372372

373-
For organization, both controllers (formerly ``index.php`` and ``show.php``)
373+
For organization, both controllers (formerly ``/index.php`` and ``/index.php/show``)
374374
are now PHP functions and each has been moved into a separate file named ``controllers.php``::
375375

376376
// controllers.php

‎page_creation.rst

Copy file name to clipboardExpand all lines: page_creation.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ to creating a page?
8484
in its own section, including how to make *variable* URLs;
8585

8686
#. *Create a controller*: The method below the route - ``numberAction()`` - is called
87-
the *controller*: this is a function where *you* build the page and ultimately
87+
the *controller*. This is a function where *you* build the page and ultimately
8888
return a ``Response`` object. You'll learn more about :doc:`controllers </controller>`
8989
in their own section, including how to return JSON responses.
9090

‎profiler/data_collector.rst

Copy file name to clipboardExpand all lines: profiler/data_collector.rst
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ To enable a data collector, define it as a regular service and tag it as
9494
app.request_collector:
9595
class: AppBundle\DataCollector\RequestCollector
9696
public: false
97-
tags:
98-
- { name: data_collector }
97+
tags: [data_collector]
9998
10099
.. code-block:: xml
101100

0 commit comments

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