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 b6e631e

Browse filesBrowse files
committed
Merge branch '2.3' into 2.4
* 2.3: document the mysterious abc part of the header Fixed a minor grammar mistake [Console] Fix Console component getHelperSet()->get() to getHelper() plug rules for static methods Move the section about collect: false to the cookbook entry Fixed a minor error Removed the old syntax and left just the "with" keyword syntax Fixed minor formatting issue Minor formatting improvement Added a note about customizing a form with more than one template
2 parents b32f9f2 + eae9ad0 commit b6e631e
Copy full SHA for b6e631e

File tree

Expand file treeCollapse file tree

9 files changed

+83
-55
lines changed
Filter options
Expand file treeCollapse file tree

9 files changed

+83
-55
lines changed

‎book/testing.rst

Copy file name to clipboardExpand all lines: book/testing.rst
-46Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -487,52 +487,6 @@ To get the Profiler for the last request, do the following::
487487
For specific details on using the profiler inside a test, see the
488488
:doc:`/cookbook/testing/profiling` cookbook entry.
489489

490-
To avoid collecting data in each test you can set the ``collect`` parameter
491-
in the configuration:
492-
493-
.. configuration-block::
494-
495-
.. code-block:: yaml
496-
497-
# app/config/config_test.yml
498-
499-
# ...
500-
framework:
501-
profiler:
502-
enabled: true
503-
collect: false
504-
505-
.. code-block:: xml
506-
507-
<!-- app/config/config.xml -->
508-
<?xml version="1.0" encoding="UTF-8" ?>
509-
<container xmlns="http://symfony.com/schema/dic/services"
510-
xmlns:framework="http://symfony.com/schema/dic/symfony"
511-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
512-
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
513-
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
514-
515-
<!-- ... -->
516-
517-
<framework:config>
518-
<framework:profiler enabled="true" collect="false" />
519-
</framework:config>
520-
</container>
521-
522-
.. code-block:: php
523-
524-
// app/config/config.php
525-
526-
// ...
527-
$container->loadFromExtension('framework', array(
528-
'profiler' => array(
529-
'enabled' => true,
530-
'collect' => false,
531-
),
532-
));
533-
534-
In this way only tests that call ``enableProfiler()`` will collect data.
535-
536490
Redirecting
537491
~~~~~~~~~~~
538492

‎components/console/helpers/dialoghelper.rst

Copy file name to clipboardExpand all lines: components/console/helpers/dialoghelper.rst
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ functions to ask the user for more information. It is included in the default
99
helper set, which you can get by calling
1010
:method:`Symfony\\Component\\Console\\Command\\Command::getHelperSet`::
1111

12-
$dialog = $this->getHelperSet()->get('dialog');
12+
$dialog = $this->getHelper('dialog');
1313

1414
All the methods inside the Dialog Helper have an
1515
:class:`Symfony\\Component\\Console\\Output\\OutputInterface` as the first
@@ -65,7 +65,7 @@ Autocompletion
6565
You can also specify an array of potential answers for a given question. These
6666
will be autocompleted as the user types::
6767

68-
$dialog = $this->getHelperSet()->get('dialog');
68+
$dialog = $this->getHelper('dialog');
6969
$bundleNames = array('AcmeDemoBundle', 'AcmeBlogBundle', 'AcmeStoreBundle');
7070
$name = $dialog->ask(
7171
$output,
@@ -83,7 +83,7 @@ Hiding the User's Response
8383
You can also ask a question and hide the response. This is particularly
8484
convenient for passwords::
8585

86-
$dialog = $this->getHelperSet()->get('dialog');
86+
$dialog = $this->getHelper('dialog');
8787
$password = $dialog->askHiddenResponse(
8888
$output,
8989
'What is the database password?',
@@ -154,7 +154,7 @@ Validating a Hidden Response
154154

155155
You can also ask and validate a hidden response::
156156

157-
$dialog = $this->getHelperSet()->get('dialog');
157+
$dialog = $this->getHelper('dialog');
158158

159159
$validator = function ($value) {
160160
if ('' === trim($value)) {
@@ -192,7 +192,7 @@ Instead, you can use the
192192
method, which makes sure that the user can only enter a valid string
193193
from a predefined list::
194194

195-
$dialog = $this->getHelperSet()->get('dialog');
195+
$dialog = $this->getHelper('dialog');
196196
$colors = array('red', 'blue', 'yellow');
197197

198198
$color = $dialog->select(

‎components/console/helpers/formatterhelper.rst

Copy file name to clipboardExpand all lines: components/console/helpers/formatterhelper.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The :class:`Symfony\\Component\\Console\\Helper\\FormatterHelper` is included
1212
in the default helper set, which you can get by calling
1313
:method:`Symfony\\Component\\Console\\Command\\Command::getHelperSet`::
1414

15-
$formatter = $this->getHelperSet()->get('formatter');
15+
$formatter = $this->getHelper('formatter');
1616

1717
The methods return a string, which you'll usually render to the console by
1818
passing it to the

‎components/console/helpers/progresshelper.rst

Copy file name to clipboardExpand all lines: components/console/helpers/progresshelper.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ information, which updates as your command runs:
2121
To display progress details, use the :class:`Symfony\\Component\\Console\\Helper\\ProgressHelper`,
2222
pass it a total number of units, and advance the progress as your command executes::
2323

24-
$progress = $this->getHelperSet()->get('progress');
24+
$progress = $this->getHelper('progress');
2525

2626
$progress->start($output, 50);
2727
$i = 0;

‎components/console/helpers/tablehelper.rst

Copy file name to clipboardExpand all lines: components/console/helpers/tablehelper.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ When building a console application it may be useful to display tabular data:
1414
To display a table, use the :class:`Symfony\\Component\\Console\\Helper\\TableHelper`,
1515
set headers, rows and render::
1616

17-
$table = $this->getHelperSet()->get('table');
17+
$table = $this->getHelper('table');
1818
$table
1919
->setHeaders(array('ISBN', 'Title', 'Author'))
2020
->setRows(array(

‎contributing/code/bc.rst

Copy file name to clipboardExpand all lines: contributing/code/bc.rst
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ your overridden method wouldn't match anymore and generate a fatal error.
138138
.. note::
139139

140140
As with interfaces, we limit ourselves to changes that can be upgraded
141-
easily. We will document the precise ugprade instructions in the UPGRADE
141+
easily. We will document the precise upgrade instructions in the UPGRADE
142142
file in Symfony's root directory.
143143

144144
In some cases, only specific properties and methods are tagged with the ``@api``
@@ -307,6 +307,9 @@ Add type hint to an argument Yes Yes
307307
Remove type hint of an argument Yes Yes
308308
Change argument type Yes Yes
309309
Change return type Yes Yes
310+
**Static Methods**
311+
Turn non static into static No No
312+
Turn static into non static No No
310313
================================================== ============== ==============
311314

312315
.. [1] Your code may be broken by changes in the Symfony code. Such changes will

‎cookbook/cache/varnish.rst

Copy file name to clipboardExpand all lines: cookbook/cache/varnish.rst
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ application:
3838
set req.http.Surrogate-Capability = "abc=ESI/1.0";
3939
}
4040
41+
.. note::
42+
43+
The ``abc`` part of the header isn't important unless you have multiple "surrogates"
44+
that need to advertise their capabilities. See `Surrogate-Capability Header`_ for details.
45+
4146
Then, optimize Varnish so that it only parses the Response contents when there
4247
is at least one ESI tag by checking the ``Surrogate-Control`` header that
4348
Symfony2 adds automatically:
@@ -217,3 +222,4 @@ absolute URLs:
217222
.. _`Varnish`: https://www.varnish-cache.org
218223
.. _`Edge Architecture`: http://www.w3.org/TR/edge-arch
219224
.. _`GZIP and Varnish`: https://www.varnish-cache.org/docs/3.0/phk/gzip.html
225+
.. _`Surrogate-Capability Header`: http://www.w3.org/TR/edge-arch

‎cookbook/form/form_customization.rst

Copy file name to clipboardExpand all lines: cookbook/form/form_customization.rst
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,22 @@ When the ``form.age`` widget is rendered, Symfony will use the ``integer_widget`
298298
block from the new template and the ``input`` tag will be wrapped in the
299299
``div`` element specified in the customized block.
300300

301+
Multiple Templates
302+
..................
303+
304+
A form can also be customized by applying several templates. To do this, pass the
305+
name of all the templates as an array using the ``with`` keyword:
306+
307+
.. code-block:: html+jinja
308+
309+
{% form_theme form with ['::common.html.twig', ':Form:fields.html.twig',
310+
'AcmeDemoBundle:Form:fields.html.twig'] %}
311+
312+
{# ... #}
313+
314+
The templates can be located at different bundles and they can even be stored
315+
at the global ``app/Resources/views/`` directory.
316+
301317
Child Forms
302318
...........
303319

‎cookbook/testing/profiling.rst

Copy file name to clipboardExpand all lines: cookbook/testing/profiling.rst
+49Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,52 @@ finish. It's easy to achieve if you embed the token in the error message::
7373

7474
Read the API for built-in :doc:`data collectors </cookbook/profiler/data_collector>`
7575
to learn more about their interfaces.
76+
77+
Speeding up Tests by not Collecting Profiler Data
78+
-------------------------------------------------
79+
80+
To avoid collecting data in each test you can set the ``collect`` parameter
81+
to false:
82+
83+
.. configuration-block::
84+
85+
.. code-block:: yaml
86+
87+
# app/config/config_test.yml
88+
89+
# ...
90+
framework:
91+
profiler:
92+
enabled: true
93+
collect: false
94+
95+
.. code-block:: xml
96+
97+
<!-- app/config/config.xml -->
98+
<?xml version="1.0" encoding="UTF-8" ?>
99+
<container xmlns="http://symfony.com/schema/dic/services"
100+
xmlns:framework="http://symfony.com/schema/dic/symfony"
101+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
102+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
103+
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
104+
105+
<!-- ... -->
106+
107+
<framework:config>
108+
<framework:profiler enabled="true" collect="false" />
109+
</framework:config>
110+
</container>
111+
112+
.. code-block:: php
113+
114+
// app/config/config.php
115+
116+
// ...
117+
$container->loadFromExtension('framework', array(
118+
'profiler' => array(
119+
'enabled' => true,
120+
'collect' => false,
121+
),
122+
));
123+
124+
In this way only tests that call ``$client->enableProfiler()`` will collect data.

0 commit comments

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