Skip to content

Conversation

@meirzamoodle
Copy link
Contributor

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

Copilot AI review requested due to automatic review settings January 19, 2026 04:36
@netlify
Copy link

netlify bot commented Jan 19, 2026

Deploy Preview for moodledevdocs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 453c7db
🔍 Latest deploy log https://app.netlify.com/projects/moodledevdocs/deploys/696dd464d65e280008221b52
😎 Deploy Preview https://deploy-preview-1504--moodledevdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a 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.

@meirzamoodle meirzamoodle force-pushed the class-properties-deprecation branch from 8e31c6c to f4a6ff1 Compare January 19, 2026 05:43
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
@meirzamoodle meirzamoodle force-pushed the class-properties-deprecation branch from f4a6ff1 to 453c7db Compare January 19, 2026 06:51
@meirzamoodle
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant