8000 feature #7453 Document the weak_vendors value (greg0ire) · symfony/symfony-docs@cbb1208 · GitHub
[go: up one dir, main page]

Skip to content

Commit cbb1208

Browse files
committed
feature #7453 Document the weak_vendors value (greg0ire)
This PR was merged into the master branch. Discussion ---------- Document the weak_vendors value See symfony/symfony#21539 Commits ------- abe88c6 Document the weak_vendors value
2 parents 4e7ae43 + abe88c6 commit cbb1208

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

components/phpunit_bridge.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,24 @@ also set the value ``"weak"`` which will make the bridge ignore any deprecation
121121
notices. This is useful to projects that must use deprecated interfaces for
122122
backward compatibility reasons.
123123

124+
When you maintain a library, having the test suite fail as soon as a dependency
125+
introduces a new deprecation is not desirable, because it shifts the burden of
126+
fixing that deprecation to any contributor that happens to submit a pull
127+
request shortly after a new vendor release is made with that deprecation. To
128+
mitigate this, you can either use tighter requirements, in the hope that
129+
dependencies will not introduce deprecations in a patch version, or even commit
130+
the Composer lock file, which would create another class of issues. Libraries
131+
will often use ``SYMFONY_DEPRECATIONS_HELPER=weak`` because of this. This has
132+
the drawback of allowing contributions that introduce deprecations but:
133+
134+
* forget to fix the deprecated calls if there are any;
135+
* forget to mark appropriate tests with the ``@group legacy`` annotations.
136+
137+
By using the ``"weak_vendors"`` value, deprecations that are triggered outside
138+
the ``vendors`` directory will make the test suite fail, while deprecations
139+
triggered from a library inside it will not, giving you the best of both
140+
worlds.
141+
124142
Disabling the Deprecation Helper
125143
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
126144

0 commit comments

Comments
 (0)
0