Skip to content

Commit 403ad61

Browse files
committed
Minor tweaks
1 parent 48b5da1 commit 403ad61

File tree

1 file changed

+36
-39
lines changed

1 file changed

+36
-39
lines changed

components/phpunit_bridge.rst

Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -192,55 +192,53 @@ Making Tests Fail
192192
By default, any non-legacy-tagged or any non-`@-silenced`_ deprecation
193193
notices will make tests fail. Alternatively, you can configure an
194194
arbitrary threshold by setting ``SYMFONY_DEPRECATIONS_HELPER`` to
195-
``max[total]=320`` for instance. It will make the tests fails only if a
195+
``max[total]=320`` for instance. It will make the tests fails only if a
196196
higher number of deprecation notices is reached (``0`` is the default
197197
value).
198198

199199
You can have even finer-grained control by using other keys of the ``max``
200200
array, which are ``self``, ``direct``, and ``indirect``. The
201-
``SYMFONY_DEPRECATIONS_HELPER`` environment variable accept a
202-
url-encoded string, meaning you can combine thresholds and any other
203-
configuration setting, like this:
204-
``SYMFONY_DEPRECATIONS_HELPER=max[total]=42&max[self]=0&verbose=0``
201+
``SYMFONY_DEPRECATIONS_HELPER`` environment variable accepts an URL-encoded
202+
string, meaning you can combine thresholds and any other configuration setting,
203+
like this: ``SYMFONY_DEPRECATIONS_HELPER=max[total]=42&max[self]=0&verbose=0``
205204

206205
Internal deprecations
207206
.....................
208207

209-
When you maintain a library, having the test suite fail as soon as a
210-
dependency introduces a new deprecation is not desirable, because it
211-
shifts the burden of fixing that deprecation to any contributor that
212-
happens to submit a pull request shortly after a new vendor release is
213-
made with that deprecation. To mitigate this, you can either use tighter
214-
requirements, in the hope that dependencies will not introduce
215-
deprecations in a patch version, or even commit the ``composer.lock`` file,
216-
which would create another class of issues. Libraries will often use
217-
``SYMFONY_DEPRECATIONS_HELPER=max[total]=999999`` because of this. This
218-
has the drawback of allowing contributions that introduce deprecations
219-
but:
208+
When you maintain a library, having the test suite fail as soon as a dependency
209+
introduces a new deprecation is not desirable, because it shifts the burden of
210+
fixing that deprecation to any contributor that happens to submit a pull request
211+
shortly after a new vendor release is made with that deprecation.
212+
213+
To mitigate this, you can either use tighter requirements, in the hope that
214+
dependencies will not introduce deprecations in a patch version, or even commit
215+
the ``composer.lock`` file, which would create another class of issues.
216+
Libraries will often use ``SYMFONY_DEPRECATIONS_HELPER=max[total]=999999``
217+
because of this. This has the drawback of allowing contributions that introduce
218+
deprecations but:
220219

221220
* forget to fix the deprecated calls if there are any;
222221
* forget to mark appropriate tests with the ``@group legacy`` annotations.
223222

224-
By using ``SYMFONY_DEPRECATIONS_HELPER=max[self]=0``,
225-
deprecations that are triggered outside the ``vendors`` directory will
226-
be accounted for seperately, while deprecations triggered from a library
227-
inside it will not (unless you reach 999999 of these), giving you
228-
the best of both worlds.
223+
By using ``SYMFONY_DEPRECATIONS_HELPER=max[self]=0``, deprecations that are
224+
triggered outside the ``vendors`` directory will be accounted for seperately,
225+
while deprecations triggered from a library inside it will not (unless you reach
226+
999999 of these), giving you the best of both worlds.
229227

230228
Direct and Indirect Deprecations
231229
................................
232230

233-
When working on a project, you might be more interested in
234-
``max[direct]``. Let's say you want to fix deprecations as soon as
235-
they appear. A problem many people experience is that some dependencies
236-
they have tend to lag behind their own dependencies, meaning they do not
237-
fix deprecations as soon as possible, which means you should create a pull
238-
request on the outdated vendor, and ignore these deprecations until your
239-
pull request is merged. This key allows you to put a threshold on direct
240-
deprecations only,allowing you to notice when *your code* is using
241-
deprecated APIs, and to keep up with the changes. You can of course
242-
still use ``max[indirect]`` if you want to keep indirect deprecations
243-
under a given threshold.
231+
When working on a project, you might be more interested in ``max[direct]``.
232+
Let's say you want to fix deprecations as soon as they appear. A problem many
233+
developers experience is that some dependencies they have tend to lag behind
234+
their own dependencies, meaning they do not fix deprecations as soon as
235+
possible, which means you should create a pull request on the outdated vendor,
236+
and ignore these deprecations until your pull request is merged.
237+
238+
The ``max[direct]`` config allows you to put a threshold on direct deprecations
239+
only, allowing you to notice when *your code* is using deprecated APIs, and to
240+
keep up with the changes. You can still use ``max[indirect]`` if you want to
241+
keep indirect deprecations under a given threshold.
244242

245243
Here is a summary that should help you pick the right configuration:
246244

@@ -262,17 +260,16 @@ Disabling the Verbose Output
262260
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
263261

264262
By default, the bridge will display a detailed output with the number of
265-
deprecations and where they arise. If this is too much for you, you can
266-
use ``SYMFONY_DEPRECATIONS_HELPER=verbose=0`` to turn the verbose output
267-
off.
263+
deprecations and where they arise. If this is too much for you, you can use
264+
``SYMFONY_DEPRECATIONS_HELPER=verbose=0`` to turn the verbose output off.
268265

269266
Disabling the Deprecation Helper
270267
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
271268

272-
Set the ``SYMFONY_DEPRECATIONS_HELPER`` environment variable to
273-
``disabled=1`` to completely disable the deprecation helper. This is
274-
useful to make use of the rest of features provided by this component
275-
without getting errors or messages related to deprecations.
269+
Set the ``SYMFONY_DEPRECATIONS_HELPER`` environment variable to ``disabled=1``
270+
to completely disable the deprecation helper. This is useful to make use of the
271+
rest of features provided by this component without getting errors or messages
272+
related to deprecations.
276273

277274
.. _write-assertions-about-deprecations:
278275

0 commit comments

Comments
 (0)