Skip to content

Commit a5e77cd

Browse files
committed
Merge remote-tracking branch 'upstream/master' into 4.2
2 parents f06a0ec + 4af99e7 commit a5e77cd

Some content is hidden

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

58 files changed

+342
-237
lines changed

bundles/configuration.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ The ``Configuration`` class to handle the sample configuration looks like::
198198
}
199199

200200
.. versionadded:: 4.2
201+
201202
Not passing the root node name to ``TreeBuilder`` was deprecated in Symfony 4.2.
202203

203204
.. seealso::

components/asset.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,6 @@ document inside a template::
375375
Local Files and Other Protocols
376376
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
377377

378-
.. versionadded:: 4.2
379-
The support for other protocols was introduced in Symfony 4.2.
380-
381378
In addition to HTTP this component supports other protocols (such as ``file://``
382379
and ``ftp://``). This allows for example to serve local files in order to
383380
improve performance::

components/browser_kit.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ simulate the link click::
105105

106106
$crawler = $client->clickLink('Go elsewhere...');
107107

108-
.. versionadded:: 4.2
109-
The ``clickLink()`` method was introduced in Symfony 4.2.
110-
111108
If you need the :class:`Symfony\\Component\\DomCrawler\\Link` object that
112109
provides access to the link properties (e.g. ``$link->getMethod()``,
113110
``$link->getUri()``), use this other method:
@@ -151,9 +148,6 @@ field values, etc.) before submitting it::
151148
['HTTP_ACCEPT_LANGUAGE' => 'es']
152149
);
153150

154-
.. versionadded:: 4.2
155-
The ``submitForm()`` method was introduced in Symfony 4.2.
156-
157151
If you need the :class:`Symfony\\Component\\DomCrawler\\Form` object that
158152
provides access to the form properties (e.g. ``$form->getUri()``,
159153
``$form->getValues()``, ``$form->getFields()``), use this other method::

components/cache/adapters/pdo_doctrine_dbal_adapter.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ third, and forth parameters::
3131
$options = []
3232
);
3333

34-
.. versionadded:: 4.2
35-
Automatic table creation was introduced in Symfony 4.2.
36-
3734
The table where values are stored is created automatically on the first call to
3835
the :method:`Symfony\\Component\\Cache\\Adapter\\PdoAdapter::save` method.
3936
You can also create this table explicitly by calling the

components/config/definition.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ implements the :class:`Symfony\\Component\\Config\\Definition\\ConfigurationInte
6969
}
7070

7171
.. versionadded:: 4.2
72+
7273
Not passing the root node name to ``TreeBuilder`` was deprecated in Symfony 4.2.
7374

7475
Adding Node Definitions to the Tree

components/console/helpers/progressbar.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,33 @@ 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+
98125
Customizing the Progress Bar
99126
----------------------------
100127

components/console/helpers/table.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ You can optionally display titles at the top and the bottom of the table::
8888
| 80-902734-1-6 | And Then There Were None | Agatha Christie |
8989
+---------------+--------- Page 1/2 -------+------------------+
9090
91-
.. versionadded:: 4.2
92-
The ``setHeaderTitle()`` and ``setFooterTitle()`` methods were introduced
93-
in Symfony 4.2.
94-
9591
By default the width of the columns is calculated automatically based on their
9692
contents. Use the :method:`Symfony\\Component\\Console\\Helper\\Table::setColumnWidths`
9793
method to set the column widths explicitly::
@@ -154,9 +150,6 @@ The output of this command will be:
154150
| (the rest of rows...) |
155151
+-------+------------+--------------------------------+
156152
157-
.. versionadded:: 4.2
158-
The ``setColumnMaxWidth()`` method was introduced in Symfony 4.2.
159-
160153
The table style can be changed to any built-in styles via
161154
:method:`Symfony\\Component\\Console\\Helper\\Table::setStyle`::
162155

components/dom_crawler.rst

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,6 @@ Get all the direct child nodes matching a CSS selector::
186186

187187
$crawler->filter('body')->children('p.lorem');
188188

189-
.. versionadded:: 4.2
190-
The optional selector in ``children($selector)`` method was introduced in Symfony 4.2.
191-
192189
.. note::
193190

194191
All the traversal methods return a new :class:`Symfony\\Component\\DomCrawler\\Crawler`
@@ -204,8 +201,16 @@ Access the node name (HTML tag name) of the first node of the current selection
204201

205202
Access the value of the first node of the current selection::
206203

204+
// if the node does not exist, calling to text() will result in an exception
207205
$message = $crawler->filterXPath('//body/p')->text();
208206

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+
209214
Access the attribute value of the first node of the current selection::
210215

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

215220
$attributes = $crawler
216221
->filterXpath('//body/p')
217-
->extract(['_text', 'class'])
222+
->extract(['_name', '_text', 'class'])
218223
;
219224

220225
.. note::
221226

222-
Special attribute ``_text`` represents a node value.
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.
223233

224234
Call an anonymous function on each node of the list::
225235

@@ -296,8 +306,16 @@ and :phpclass:`DOMNode` objects::
296306
Or you can get the HTML of the first node using
297307
:method:`Symfony\\Component\\DomCrawler\\Crawler::html`::
298308

309+
// if the node does not exist, calling to html() will result in an exception
299310
$html = $crawler->html();
300311

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+
301319
Expression Evaluation
302320
~~~~~~~~~~~~~~~~~~~~~
303321

components/dotenv.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ The ``load()`` method never overwrites existing environment variables. Use the
6464
// ...
6565
$dotenv->overload(__DIR__.'/.env');
6666

67-
.. versionadded:: 4.2
68-
The ``Dotenv::overload()`` method was introduced in Symfony 4.2.
69-
7067
You should never store a ``.env`` file in your code repository as it might
7168
contain sensitive information; create a ``.env.dist`` file with sensible
7269
defaults instead.

components/finder.rst

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,6 @@ Sort the result by name or by type (directories first, then files)::
175175
as its argument to use PHP's `natural sort order`_ algorithm instead (e.g.
176176
``file1.txt``, ``file2.txt``, ``file10.txt``).
177177

178-
.. versionadded:: 4.2
179-
180-
The option to use the natural sort order was introduced in Symfony 4.2.
181-
182178
Sort the files and directories by the last accessed, changed or modified time::
183179

184180
$finder->sortByAccessedTime();
@@ -198,10 +194,6 @@ You can reverse any sorting by using the ``reverseSorting()`` method::
198194
// results will be sorted "Z to A" instead of the default "A to Z"
199195
$finder->sortByName()->reverseSorting();
200196

201-
.. versionadded:: 4.2
202-
203-
The ``reverseSorting()`` method was introduced in Symfony 4.2.
204-
205197
.. note::
206198

207199
Notice that the ``sort*`` methods need to get all matching elements to do
@@ -238,11 +230,6 @@ Multiple filenames can be excluded by chaining calls or passing an array::
238230
// same as above
239231
$finder->files()->notName(['*.rb', '*.py']);
240232

241-
.. versionadded:: 4.2
242-
243-
Support for passing arrays to ``name()`` and ``notName()`` was introduced
244-
in Symfony 4.2
245-
246233
File Contents
247234
~~~~~~~~~~~~~
248235

@@ -285,10 +272,6 @@ Multiple paths can be defined by chaining calls or passing an array::
285272
// same as above
286273
$finder->path(['data', 'foo/bar']);
287274

288-
.. versionadded:: 4.2
289-
290-
Support for passing arrays to ``path()`` was introduced in Symfony 4.2
291-
292275
Internally, strings are converted into regular expressions by escaping slashes
293276
and adding delimiters:
294277

@@ -328,10 +311,6 @@ Restrict by a size range by chaining calls or passing an array::
328311
// same as above
329312
$finder->files()->size(['>= 1K', '<= 2K']);
330313

331-
.. versionadded:: 4.2
332-
333-
Support for passing arrays to ``size()`` was introduced in Symfony 4.2
334-
335314
The comparison operator can be any of the following: ``>``, ``>=``, ``<``, ``<=``,
336315
``==``, ``!=``.
337316

@@ -354,10 +333,6 @@ Restrict by a date range by chaining calls or passing an array::
354333
// same as above
355334
$finder->date(['>= 2018-01-01', '<= 2018-12-31']);
356335

357-
.. versionadded:: 4.2
358-
359-
Support for passing arrays to ``date()`` was introduced in Symfony 4.2
360-
361336
The comparison operator can be any of the following: ``>``, ``>=``, ``<``, ``<=``,
362337
``==``. You can also use ``since`` or ``after`` as an alias for ``>``, and
363338
``until`` or ``before`` as an alias for ``<``.
@@ -380,10 +355,6 @@ Restrict by a depth range by chaining calls or passing an array::
380355
// same as above
381356
$finder->depth(['> 2', '< 5']);
382357

383-
.. versionadded:: 4.2
384-
385-
Support for passing arrays to ``depth()`` was introduced in Symfony 4.2
386-
387358
Custom Filtering
388359
~~~~~~~~~~~~~~~~
389360

components/form.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -759,9 +759,6 @@ method to access the list of errors. It returns a
759759
Clearing Form Errors
760760
~~~~~~~~~~~~~~~~~~~~
761761

762-
.. versionadded:: 4.2
763-
The ``clearErrors()`` method was introduced in Symfony 4.2.
764-
765762
Any errors can be manually cleared using the
766763
:method:`Symfony\\Component\\Form\\ClearableErrorsInterface::clearErrors`
767764
method. This is useful when you'd like to validate the form without showing

components/http_foundation.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,6 @@ abstracts the hard work behind a simple API::
551551

552552
$response->headers->set('Content-Disposition', $disposition);
553553

554-
.. versionadded:: 4.2
555-
The static ``HeaderUtils::makeDisposition()`` method was introduced in Symfony 4.2.
556-
557554
Alternatively, if you are serving a static file, you can use a
558555
:class:`Symfony\\Component\\HttpFoundation\\BinaryFileResponse`::
559556

components/ldap.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,4 @@ Possible operation types are ``LDAP_MODIFY_BATCH_ADD``, ``LDAP_MODIFY_BATCH_REMO
166166
``$values`` must be ``NULL`` when using ``LDAP_MODIFY_BATCH_REMOVE_ALL``
167167
operation type.
168168

169-
.. versionadded:: 4.2
170-
171-
The ``applyOperations()`` method was introduced in Symfony 4.2.
172-
173169
.. _Packagist: https://packagist.org/packages/symfony/ldap

components/lock.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,6 @@ support blocking, and expects a TTL to avoid stalled locks::
220220
PdoStore
221221
~~~~~~~~
222222

223-
.. versionadded:: 4.2
224-
The PdoStore was introduced Symfony 4.2.
225-
226223
The PdoStore saves locks in an SQL database. It requires a `PDO`_ connection, a
227224
`Doctrine DBAL Connection`_, or a `Data Source Name (DSN)`_. This store does not
228225
support blocking, and expects a TTL to avoid stalled locks::
@@ -326,9 +323,6 @@ the stores.
326323
ZookeeperStore
327324
~~~~~~~~~~~~~~
328325

329-
.. versionadded:: 4.2
330-
The ZookeeperStore was introduced in Symfony 4.2.
331-
332326
The ZookeeperStore saves locks on a `ZooKeeper`_ server. It requires a ZooKeeper
333327
connection implementing the ``\Zookeeper`` class. This store does not
334328
support blocking and expiration but the lock is automatically released when the

components/options_resolver.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -637,9 +637,6 @@ let you find out which options are defined::
637637
Nested Options
638638
~~~~~~~~~~~~~~
639639

640-
.. versionadded:: 4.2
641-
The support of nested options was introduced in Symfony 4.2.
642-
643640
Suppose you have an option named ``spool`` which has two sub-options ``type``
644641
and ``path``. Instead of defining it as a simple array of values, you can pass a
645642
closure as the default value of the ``spool`` option with a
@@ -732,9 +729,6 @@ In same way, parent options can access to the nested options as normal arrays::
732729
Deprecating the Option
733730
~~~~~~~~~~~~~~~~~~~~~~
734731

735-
.. versionadded:: 4.2
736-
The ``setDeprecated()`` method was introduced in Symfony 4.2.
737-
738732
Once an option is outdated or you decided not to maintain it anymore, you can
739733
deprecate it using the :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::setDeprecated`
740734
method::

components/phpunit_bridge.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,6 @@ class autoloading time. This can be disabled with the ``debug-class-loader`` opt
248248
</listener>
249249
</listeners>
250250
251-
.. versionadded:: 4.2
252-
The ``DebugClassLoader`` integration was introduced in Symfony 4.2.
253-
254251
Write Assertions about Deprecations
255252
-----------------------------------
256253

components/process.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ with a non-zero code)::
100100
Using Features From the OS Shell
101101
--------------------------------
102102

103-
.. versionadded:: 4.2
104-
105-
The ``fromShellCommandline()`` static method was introduced in Symfony 4.2.
106-
107103
Using array of arguments is the recommended way to define commands. This
108104
saves you from any escaping and allows sending signals seamlessly
109105
(e.g. to stop processes before completion)::
@@ -240,9 +236,6 @@ process and checks its output to wait until its fully initialized::
240236

241237
// ... do things after the process is ready
242238

243-
.. versionadded:: 4.2
244-
The ``waitUntil()`` method was introduced in Symfony 4.2.
245-
246239
Streaming to the Standard Input of a Process
247240
--------------------------------------------
248241

components/property_info.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ provide it with a set of information extractors.
7777
$class = YourAwesomeCoolClass::class;
7878
$properties = $propertyInfo->getProperties($class);
7979
80-
.. versionadded:: 4.2
81-
:class:`Symfony\\Component\\PropertyInfo\\PropertyInitializableExtractorInterface`
82-
was introduced in Symfony 4.2.
83-
8480
Extractor Ordering
8581
~~~~~~~~~~~~~~~~~~
8682

@@ -490,11 +486,6 @@ with the ``property_info`` service in the Symfony Framework.
490486
// Type information.
491487
$doctrineExtractor->getTypes($class, $property);
492488
493-
.. versionadded:: 4.2
494-
The option to pass Doctrine's EntityManager to ``DoctrineExtractor`` was
495-
introduced in Symfony 4.2. Previously you needed to pass the class metadata
496-
factory associated to the EntityManager.
497-
498489
.. _`components-property-information-extractors-creation`:
499490

500491
Creating Your Own Extractors

0 commit comments

Comments
 (0)