-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Config] Improve the deprecation features by handling package and version #35871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Config] Improve the deprecation features by handling package and version #35871
Conversation
edited by nicolas-grekas
Q | A |
---|---|
Branch? | master |
Bug fix? | no |
New feature? | yes |
Deprecations? | yes |
Tickets | https://github.com/orgs/symfony/projects/1#card-32681032 |
License | MIT |
Doc PR | TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need to keep some tests (marked as @group legacy
) covering the old API. Otherwise our BC layer is untested.
src/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php
Outdated
Show resolved
Hide resolved
97deb48
to
6f80928
Compare
603caa7
to
0c829a3
Compare
0c829a3
to
5999461
Compare
5999461
to
9ebe1a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(with minor comments)
src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php
Outdated
Show resolved
Hide resolved
99705c1
to
bb1e5bc
Compare
src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php
Outdated
Show resolved
Hide resolved
0fa3233
to
c8ddd80
Compare
src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php
Outdated
Show resolved
Hide resolved
@atailouloute can you please take my comment into account and rebase meanwhile? |
c8ddd80
to
bc42f71
Compare
@nicolas-grekas Done |
bc42f71
to
f4de76d
Compare
Thank you @atailouloute. |
* You can use %node% and %path% placeholders in your message to display, | ||
* respectively, the node name and its complete path. | ||
*/ | ||
public function setDeprecated(?string $message) | ||
public function setDeprecated(?string $package/*, string $version, string $message = 'The child node "%node%" at path "%path%" is deprecated.' */) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the parameters at the front makes it impossible to both support 5.1+ and <5.1 as a bundle.
If you use the intended 5.1+ way:
->setDeprecated("my/bundle", "1.0", "this node is deprecated, do sth else")
- in
5.1+
we will show the message"this node is deprecated, do sth else"
- in
<5.1
we will show the message"my/bundle"
Is there a (non-hacky) way to have the real message in both versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just created #37284 to track this