Skip to content

Commit f59dcc6

Browse files
committed
Remove Symfony 4.3 features from 4.2 docs
1 parent 95344ff commit f59dcc6

File tree

9 files changed

+2
-231
lines changed

9 files changed

+2
-231
lines changed

components/console/helpers/progressbar.rst

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -95,33 +95,6 @@ that the progress bar display is refreshed with a 100% completion.
9595
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::display`
9696
to show the progress bar again.
9797

98-
If the progress information is stored in an iterable variable (such as an array
99-
or a PHP generator) you can use the
100-
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::iterate` method,
101-
which starts, advances and finishes the progress bar automatically::
102-
103-
use Symfony\Component\Console\Helper\ProgressBar;
104-
105-
$progressBar = new ProgressBar($output);
106-
107-
// $iterable can be for example an array ([1, 2, 3, ...]) or a generator
108-
// $iterable = function () { yield 1; yield 2; ... };
109-
foreach ($progressBar->iterate($iterable) as $value) {
110-
// ... do some work
111-
}
112-
113-
If ``$iterable = [1, 2]``, the previous code will output the following:
114-
115-
.. code-block:: terminal
116-
117-
0/2 [>---------------------------] 0%
118-
1/2 [==============>-------------] 50%
119-
2/2 [============================] 100%
120-
121-
.. versionadded:: 4.3
122-
123-
The ``iterate()`` method was introduced in Symfony 4.3.
124-
12598
Customizing the Progress Bar
12699
----------------------------
127100

components/dom_crawler.rst

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,6 @@ Access the value of the first node of the current selection::
204204
// if the node does not exist, calling to text() will result in an exception
205205
$message = $crawler->filterXPath('//body/p')->text();
206206

207-
// avoid the exception passing an argument that text() returns when node does not exist
208-
$message = $crawler->filterXPath('//body/p')->text('Default text content');
209-
210-
.. versionadded:: 4.3
211-
212-
The default argument of ``text()`` was introduced in Symfony 4.3.
213-
214207
Access the attribute value of the first node of the current selection::
215208

216209
$class = $crawler->filterXPath('//body/p')->attr('class');
@@ -219,17 +212,12 @@ Extract attribute and/or node values from the list of nodes::
219212

220213
$attributes = $crawler
221214
->filterXpath('//body/p')
222-
->extract(['_name', '_text', 'class'])
215+
->extract(['_text', 'class'])
223216
;
224217

225218
.. note::
226219

227-
Special attribute ``_text`` represents a node value, while ``_name``
228-
represents the element name (the HTML tag name).
229-
230-
.. versionadded:: 4.3
231-
232-
The special attribute ``_name`` was introduced in Symfony 4.3.
220+
Special attribute ``_text`` represents a node value.
233221

234222
Call an anonymous function on each node of the list::
235223

@@ -309,13 +297,6 @@ and :phpclass:`DOMNode` objects::
309297
// if the node does not exist, calling to html() will result in an exception
310298
$html = $crawler->html();
311299

312-
// avoid the exception passing an argument that html() returns when node does not exist
313-
$html = $crawler->html('Default <strong>HTML</strong> content');
314-
315-
.. versionadded:: 4.3
316-
317-
The default argument of ``html()`` was introduced in Symfony 4.3.
318-
319300
Expression Evaluation
320301
~~~~~~~~~~~~~~~~~~~~~
321302

configuration/external_parameters.rst

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -446,15 +446,6 @@ Symfony provides the following env var processors:
446446
'auth' => '%env(file:AUTH_FILE)%',
447447
]);
448448
449-
``env(trim:FOO)``
450-
Trims the content of ``FOO`` env var, removing whitespaces from the beginning
451-
and end of the string. This is especially useful in combination with the
452-
``file`` processor, as it'll remove newlines at the end of a file.
453-
454-
.. versionadded:: 4.3
455-
456-
The ``trim`` processor was introduced in Symfony 4.3.
457-
458449
``env(key:FOO:BAR)``
459450
Retrieves the value associated with the key ``FOO`` from the array whose
460451
contents are stored in the ``BAR`` env var:
@@ -493,51 +484,6 @@ Symfony provides the following env var processors:
493484
$container->setParameter('env(SECRETS_FILE)', '/opt/application/.secrets.json');
494485
$container->setParameter('database_password', '%env(key:database_password:json:file:SECRETS_FILE)%');
495486
496-
``env(default:fallback_param:BAR)``
497-
Retrieves the value of the parameter ``fallback_param`` when the ``BAR`` env
498-
var is not available:
499-
500-
.. configuration-block::
501-
502-
.. code-block:: yaml
503-
504-
# config/services.yaml
505-
parameters:
506-
# if PRIVATE_KEY is not a valid file path, the content of raw_key is returned
507-
private_key: '%env(default:raw_key:file:PRIVATE_KEY)%'
508-
raw_key: '%env(PRIVATE_KEY)%'
509-
510-
.. code-block:: xml
511-
512-
<!-- config/services.xml -->
513-
<?xml version="1.0" encoding="UTF-8" ?>
514-
<container xmlns="http://symfony.com/schema/dic/services"
515-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
516-
xmlns:framework="http://symfony.com/schema/dic/symfony"
517-
xsi:schemaLocation="http://symfony.com/schema/dic/services
518-
http://symfony.com/schema/dic/services/services-1.0.xsd
519-
http://symfony.com/schema/dic/symfony
520-
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
521-
522-
<parameters>
523-
<!-- if PRIVATE_KEY is not a valid file path, the content of raw_key is returned -->
524-
<parameter key="private_key">%env(default:raw_key:file:PRIVATE_KEY)%</parameter>
525-
<parameter key="raw_key">%env(PRIVATE_KEY)%</parameter>
526-
</parameters>
527-
</container>
528-
529-
.. code-block:: php
530-
531-
// config/services.php
532-
533-
// if PRIVATE_KEY is not a valid file path, the content of raw_key is returned
534-
$container->setParameter('private_key', '%env(default:raw_key:file:PRIVATE_KEY)%');
535-
$container->setParameter('raw_key', '%env(PRIVATE_KEY)%');
536-
537-
.. versionadded:: 4.3
538-
539-
The ``default`` processor was introduced in Symfony 4.3.
540-
541487
It is also possible to combine any number of processors:
542488

543489
.. code-block:: yaml

console/coloring.rst

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -74,25 +74,8 @@ You can also set these colors and options directly inside the tag name::
7474
or use the :method:`Symfony\\Component\\Console\\Formatter\\OutputFormatter::escape`
7575
method to escape all the tags included in the given string.
7676

77-
Displaying Clickable Links
78-
~~~~~~~~~~~~~~~~~~~~~~~~~~
79-
80-
.. versionadded:: 4.3
81-
The feature to display clickable links was introduced in Symfony 4.3.
82-
83-
Commands can use the special ``<href>`` tag to display links similar to the
84-
``<a>`` elements of web pages::
85-
86-
$output->writeln('<href=https://symfony.com>Symfony Homepage</>');
87-
88-
If your terminal belongs to the `list of terminal emulators that support links`_
89-
you can click on the *"Symfony Homepage"* text to open its URL in your default
90-
browser. Otherwise, you'll see *"Symfony Homepage"* as regular text and the URL
91-
will be lost.
92-
9377
.. _Cmder: http://cmder.net/
9478
.. _ConEmu: https://conemu.github.io/
9579
.. _ANSICON: https://github.com/adoxa/ansicon/releases
9680
.. _Mintty: https://mintty.github.io/
9781
.. _Hyper: https://hyper.is/
98-
.. _`list of terminal emulators that support links`: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda

form/create_custom_field_type.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,6 @@ The goal of this field was to extend the choice type to enable selection of the
9999
shipping type. This is achieved by fixing the ``choices`` to a list of available
100100
shipping options.
101101

102-
.. tip::
103-
104-
If the purpose of this new form type was to customize the rendering of some
105-
fields only, skip this step and use ``block_name`` or ``block_prefix`` options
106-
instead to :ref:`define a custom form fragment name <form-fragment-custom-naming>`.
107-
108102
.. tip::
109103

110104
Run the following command to verify that the form type was successfully

form/form_themes.rst

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -275,32 +275,6 @@ form. You can also define this value explicitly with the ``block_name`` option::
275275
In this example, the fragment name will be ``_product_custom_name_widget``
276276
instead of the default ``_product_name_widget``.
277277

278-
.. _form-fragment-custom-naming:
279-
280-
Custom Fragment Naming for Individual Fields
281-
............................................
282-
283-
The ``block_prefix`` option allows form fields to define their own custom
284-
fragment name. This is mostly useful to customize some instances of the same
285-
field without having to :doc:`create a custom form type </form/create_custom_field_type>`::
286-
287-
use Symfony\Component\Form\Extension\Core\Type\TextType;
288-
use Symfony\Component\Form\FormBuilderInterface;
289-
290-
public function buildForm(FormBuilderInterface $builder, array $options)
291-
{
292-
$builder->add('name', TextType::class, array(
293-
'block_prefix' => 'wrapped_text',
294-
));
295-
}
296-
297-
.. versionadded:: 4.3
298-
299-
The ``block_prefix`` option was introduced in Symfony 4.3.
300-
301-
Now you can use ``wrapped_text_row``, ``wrapped_text_widget``, etc. as the block
302-
names.
303-
304278
.. _form-custom-prototype:
305279

306280
Fragment Naming for Collections

routing.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -511,14 +511,6 @@ So how can you make ``blog_list`` once again match when the user visits
511511
Now, when the user visits ``/blog``, the ``blog_list`` route will match and
512512
``$page`` will default to a value of ``1``.
513513

514-
If you want to always include some default value in the generated URL (for
515-
example to force the generation of ``/blog/1`` instead of ``/blog`` in the
516-
previous example) add the ``!`` character before the placeholder name: ``/blog/{!page}``
517-
518-
.. versionadded:: 4.3
519-
The feature to force the inclusion of default values in generated URLs was
520-
introduced in Symfony 4.3.
521-
522514
As it happens with requirements, default values can also be inlined in each
523515
placeholder using the syntax ``{placeholder_name?default_value}``. This feature
524516
is compatible with inlined requirements, so you can inline both in a single

security/csrf.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,6 @@ this can be customized on a form-by-form basis::
108108
// ...
109109
}
110110

111-
You can also customize the rendering of the CSRF form field creating a custom
112-
:doc:`form theme </form/form_themes>` and using ``csrf_token`` as the prefix of
113-
the field (e.g. define ``{% block csrf_token_widget %} ... {% endblock %}`` to
114-
customize the entire form field contents).
115-
116-
.. versionadded:: 4.3
117-
118-
The ``csrf_token`` form field prefix was introduced in Symfony 4.3.
119-
120111
CSRF Protection in Login Forms
121112
------------------------------
122113

service_container/alias_private.rst

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -146,69 +146,6 @@ This means that when using the container directly, you can access the
146146
# ...
147147
app.mailer: '@App\Mail\PhpMailer'
148148
149-
Deprecating Service Aliases
150-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
151-
152-
If you decide to deprecate the use of a service alias (because it is outdated
153-
or you decided not to maintain it anymore), you can deprecate its definition:
154-
155-
.. configuration-block::
156-
157-
.. code-block:: yaml
158-
159-
app.mailer:
160-
alias: '@AppBundle\Mail\PhpMailer'
161-
162-
# this will display a generic deprecation message...
163-
deprecated: true
164-
165-
# ...but you can also define a custom deprecation message
166-
deprecated: 'The "%alias_id%" alias is deprecated. Don\'t use it anymore.'
167-
168-
.. code-block:: xml
169-
170-
<?xml version="1.0" encoding="UTF-8" ?>
171-
<container xmlns="http://symfony.com/schema/dic/services"
172-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-Instance"
173-
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
174-
175-
<services>
176-
<service id="app.mailer" alias="App\Mail\PhpMailer">
177-
<!-- this will display a generic deprecation message... -->
178-
<deprecated />
179-
180-
<!-- ...but you can also define a custom deprecation message -->
181-
<deprecated>The "%alias_id%" service alias is deprecated. Don't use it anymore.</deprecated>
182-
</service>
183-
</services>
184-
</container>
185-
186-
.. code-block:: php
187-
188-
$container
189-
->setAlias('app.mailer', 'App\Mail\PhpMailer')
190-
191-
// this will display a generic deprecation message...
192-
->setDeprecated(true)
193-
194-
// ...but you can also define a custom deprecation message
195-
->setDeprecated(
196-
true,
197-
'The "%alias_id%" service alias is deprecated. Don\'t use it anymore.'
198-
)
199-
;
200-
201-
Now, every time this service alias is used, a deprecation warning is triggered,
202-
advising you to stop or to change your uses of that alias.
203-
204-
The message is actually a message template, which replaces occurrences of the
205-
``%alias_id%`` placeholder by the service alias id. You **must** have at least
206-
one occurrence of the ``%alias_id%`` placeholder in your template.
207-
208-
.. versionadded:: 4.3
209-
210-
The ``deprecated`` option for service aliases was introduced in Symfony 4.3.
211-
212149
Anonymous Services
213150
------------------
214151

0 commit comments

Comments
 (0)