Skip to content

Commit 797f364

Browse files
Fix doc about deprecations policy
1 parent 95de32a commit 797f364

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

Diff for: contributing/code/conventions.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,9 @@ A PHP ``E_USER_DEPRECATED`` error must also be triggered to help people with
103103
the migration starting one or two minor versions before the version where the
104104
feature will be removed (depending on the criticality of the removal)::
105105

106-
trigger_error('XXX() is deprecated since version 2.X and will be removed in 2.Y. Use XXX instead.', E_USER_DEPRECATED);
106+
@trigger_error('XXX() is deprecated since version 2.X and will be removed in 2.Y. Use XXX instead.', E_USER_DEPRECATED);
107+
108+
Without the @-silencing operator, users would need to opt-out from deprecation
109+
notices. Silencing swaps this behavior and allows users to opt-in when they are
110+
ready to cope with them (by adding a custom error handler like the one used by
111+
the Web Debug Toolbar or the PHPUnit bridge.)

Diff for: cookbook/upgrade/major_version.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ There are a couple of steps to upgrading a major version:
2626
During the lifecycle of a major release, new features are added and method
2727
signatures and public API usages are changed. However,
2828
:doc:`minor versions </cookbook/upgrade/minor_version>` should not contain any
29-
backwards compatibility changes. To accomplish this, the "old" (e.g. functions,
29+
backwards incompatible changes. To accomplish this, the "old" (e.g. functions,
3030
classes, etc) code still works, but is marked as *deprecated*, indicating that
3131
it will be removed/changed in the future and that you should stop using it.
3232

@@ -35,9 +35,9 @@ functionality are removed. So, as long as you've updated your code to stop
3535
using these deprecated features in the last version before the major (e.g.
3636
2.8.*), you should be able to upgrade without a problem.
3737

38-
To help you with this, the last minor releases will trigger deprecated notices.
39-
For example, 2.7 and 2.8 trigger deprecated notices. When visiting your
40-
application in the :doc:`dev environment </cookbook/configuration/environments>`
38+
To help you with this, deprecation notices are triggered whenever you end up
39+
using a deprecated feature. When visiting your application in the
40+
:doc:`dev environment </cookbook/configuration/environments>`
4141
in your browser, these notices are shown in the web dev toolbar:
4242

4343
.. image:: /images/cookbook/deprecations-in-profiler.png
@@ -52,7 +52,7 @@ To make sure this doesn't happen, you can install the PHPUnit bridge:
5252

5353
.. code-block:: bash
5454
55-
$ composer require symfony/phpunit-bridge
55+
$ composer require --dev symfony/phpunit-bridge
5656
5757
Now, your tests execute normally and a nice summary of the deprecation notices
5858
is displayed at the end of the test report:

0 commit comments

Comments
 (0)