Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 988badf

Browse files
Olena Kirichokjaviereguiluz
Olena Kirichok
authored andcommitted
fixup! Document changes in the deprecation error handler
1 parent 2a750ea commit 988badf

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

bundles/best_practices.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ of Symfony and the latest beta release:
197197
include:
198198
# Minimum supported dependencies with the latest and oldest PHP version
199199
- php: 7.2
200-
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="max[internal]=0"
200+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="max[self]=0"
201201
- php: 7.0
202-
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="max[internal]=0"
202+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="max[self]=0"
203203
204204
# Test the latest stable release
205205
- php: 7.0

components/phpunit_bridge.rst

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ arbitrary threshold by setting ``SYMFONY_DEPRECATIONS_HELPER`` to
196196
higher number of deprecation notices is reached (``0`` is the default
197197
value).
198198

199-
You can even finer-grained control by using other keys of the ``max``
200-
array, which are ``internal``, ``direct``, and ``indirect``. The
199+
You can have even finer-grained control by using other keys of the ``max``
200+
array, which are ``self``, ``direct``, and ``indirect``. The
201201
``SYMFONY_DEPRECATIONS_HELPER`` environment variable accept a
202202
url-encoded string, meaning you can combine thresholds and any other
203203
configuration setting, like this:
204-
``SYMFONY_DEPRECATIONS_HELPER=max[total]=42&max[internal]=0&verbose=0``
204+
``SYMFONY_DEPRECATIONS_HELPER=max[total]=42&max[self]=0&verbose=0``
205205

206206
Internal deprecations
207207
.....................
@@ -221,7 +221,7 @@ but:
221221
* forget to fix the deprecated calls if there are any;
222222
* forget to mark appropriate tests with the ``@group legacy`` annotations.
223223

224-
By using ``SYMFONY_DEPRECATIONS_HELPER=max[internal]=0``,
224+
By using ``SYMFONY_DEPRECATIONS_HELPER=max[self]=0``,
225225
deprecations that are triggered outside the ``vendors`` directory will
226226
be accounted for seperately, while deprecations triggered from a library
227227
inside it will not (unless you reach 999999 of these), giving you
@@ -234,33 +234,34 @@ When working on a project, you might be more interested in
234234
``max[direct]``. Let's say you want to fix deprecations as soon as
235235
they appear. A problem many people experience is that some dependencies
236236
they have tend to lag behind their own dependencies, meaning they do not
237-
fix deprecations as soon as possible, which means there is nothing you
238-
can do to fix those (apart from a pull request on the outdated vendor).
239-
This key allows you to put a threshold on direct deprecations only,
240-
allowing you to notice when *your code* is using deprecated APIs, and to
241-
keep up with the changes. You can of course still use ``max[indirect]``
242-
if you want to keep indirect deprecations under a given threshold.
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.
243244

244245
Here is a summary that should help you pick the right configuration:
245246

246247
+------------------------+-----------------------------------------------------+
247248
| Value | Recommended situation |
248249
+========================+=====================================================+
249250
| max[total]=0 | Recommended for actively maintained projects |
250-
| | with little to no dependencies |
251+
| | with robust/no dependencies |
251252
+------------------------+-----------------------------------------------------+
252253
| max[direct]=0 | Recommended for projects with dependencies |
253254
| | that fail to keep up with new deprecations. |
254255
+------------------------+-----------------------------------------------------+
255-
| max[internal]=0 | Recommended for libraries that use |
256+
| max[self]=0 | Recommended for libraries that use |
256257
| | the deprecation system themselves and |
257258
| | cannot afford to use one of the modes above. |
258259
+------------------------+-----------------------------------------------------+
259260

260261
Disabling the verbose output
261262
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
262263

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

0 commit comments

Comments
 (0)