-
Notifications
You must be signed in to change notification settings - Fork 539
[docs] Add class properties deprecation guidelines #1504
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: main
Are you sure you want to change the base?
[docs] Add class properties deprecation guidelines #1504
Conversation
✅ Deploy Preview for moodledevdocs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Pull request overview
This PR adds comprehensive documentation for deprecating class properties in Moodle, addressing the unique challenges that arise from PHP's lack of property access interception before version 8.4.
Changes:
- Added guidelines for determining when properties can be deprecated based on visibility (private, protected, public) and class extensibility
- Documented the deprecation process for properties that cannot be immediately removed, including PHPDoc tags, attributes, and migration strategies
- Provided examples for PHP 8.4 property hooks to enable proper deprecation warnings in future Moodle versions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8e31c6c to
f4a6ff1
Compare
Documents the process for deprecating class properties, which cannot emit runtime warnings in PHP < 8.4. Key points: - Private properties: remove immediately - Protected properties in non-extensible classes: can be removed - Public/protected properties in extensible classes: use @deprecated tags, attributes, and provide getter/setter methods with warnings - From Moodle 6.0 (PHP 8.4+): use property hooks for proper deprecation
f4a6ff1 to
453c7db
Compare
|
Hi, @andrewnicols The document covers everything you mentioned a couple of days ago. I added an example for setter and getter. Please review this PR. Thanks. |
Documents the process for deprecating class properties, which cannot emit runtime warnings in PHP < 8.4.
Key points: