-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[RFC] Allow #[\Deprecated]
on traits
#19045
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: master
Are you sure you want to change the base?
Conversation
Is this waiting for #18817? |
Yes, I was planning to have #18817 merged first |
b5c39e5
to
40eeb18
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.
Only superficial comments, looks correct to me otherwise.
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.
Mainly remarks about the test organization. For my attribute RFCs, I've tried to very carefully maintain the test infrastructure with regard to titles and filenames.
Zend/tests/attributes/constants/constant_listed_as_target-internal.phpt
Outdated
Show resolved
Hide resolved
@@ -2006,6 +2006,27 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_constant(const zend_consta | |||
zend_string_release(message_suffix); | |||
} | |||
|
|||
ZEND_API ZEND_COLD void zend_use_of_deprecated_trait( | |||
zend_class_entry *trait, |
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.
zend_class_entry *trait, | |
const zend_class_entry *trait, |
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.
Can't do that without more widespread changes, trait
gets passed to get_deprecation_suffix_from_attribute() which does not const
its parameter, because it gets passed to zend_get_attribute_object() where the parameter isn't const
, etc.
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 see, the rabbit hole goes deep. We should constify the scope
down the change as a follow-up / sibling PR then, similarly to #19156 which was found during clone-with.
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'm just having a look, and this rabbit hole goes very deep, as it requires adding const
qualifiers for various AST functions.
Note: I've seen the new review request, but am currently busy. I'll try to get to that early next week at the latest. |
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.
Okay, except for tests, but okay with doing that as a follow-up if necessary to make the cut for Beta 2.
Zend/tests/attributes/deprecated/traits/conflicts_render_unused.phpt
Outdated
Show resolved
Hide resolved
Important points are resolved. Soft-LGTM.
fa138aa
to
d9cc42f
Compare
https://wiki.php.net/rfc/deprecated_traits