-
-
Notifications
You must be signed in to change notification settings - Fork 403
Change the deprecation message for null attribute values
#3307
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
base: 2.x
Are you sure you want to change the base?
Changes from 5 commits
68f43d0
8356039
dfd613f
00d04c7
ef4e4cf
3f59277
f74df6d
c24502f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,7 +61,7 @@ public function __toString(): string | |
| } | ||
|
|
||
| if (null === $value) { | ||
| trigger_deprecation('symfony/ux-twig-component', '2.8.0', 'Passing "null" as an attribute value is deprecated and will throw an exception in 3.0.'); | ||
| trigger_deprecation('symfony/ux-twig-component', '2.32.0', 'Passing null as value to set an attribute is deprecated, pass true instead. In 3.0, the null value will remove the attribute.', $key); | ||
mpdude marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| $value = true; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure we should precise the key... I mean maybe we should not suggest passing null is deprecated for that attribute only.
I think with the various changes we plan, we should avoid using "current" / "previous" / "next" or maintaining (or reading) the docs will become quickly really hard. What about something like "Use true to add the attribute, null or false to remove it"
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will try to reword that. My initial idea was that it might make it easier for users to understand which attribute to search for. But I also realized that people might be collecting and grouping deprecation messages by type, and so having a different message for each attribute might not be helpful to them either. Also, for example the XmlFileReader deprecated in Symfony 7.4 only says XML is deprecated but does not give the file name. So, omitting the attribute name will be in line with that.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now it's
|
||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.