Skip to content

MDL-89528 core: Document attribute-based injection and di::make() - #1682

Open
andrewnicols wants to merge 1 commit into
moodle:mainfrom
andrewnicols:MDL-89528-attribute-injection
Open

MDL-89528 core: Document attribute-based injection and di::make()#1682
andrewnicols wants to merge 1 commit into
moodle:mainfrom
andrewnicols:MDL-89528-attribute-injection

Conversation

@andrewnicols

Copy link
Copy Markdown
Member

No description provided.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 24, 2026 13:04
@netlify

netlify Bot commented Aug 24, 2026

Copy link
Copy Markdown

Deploy Preview for moodledevdocs ready!

Name Link
🔨 Latest commit b1f05ae
🔍 Latest deploy log https://app.netlify.com/projects/moodledevdocs/deploys/6a8c415d98d6cf00085dd49a
😎 Deploy Preview https://deploy-preview-1682--moodledevdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Moodle DevDocs Dependency Injection (DI) documentation to cover new DI capabilities landing in Moodle 5.3, specifically factory-style instantiation and PHP attribute-based property injection.

Changes:

  • Documented \core\di::make() for building a fresh instance on each call (factory-style usage), including parameter overrides.
  • Added documentation for PHP-DI attribute-based property injection via #[\DI\Attribute\Inject].
  • Updated page metadata tags to include “Attribute” for discoverability.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


<Since version="5.3" issueNumber="MDL-89528" />

As an alternative to constructor injection, dependencies can be injected directly onto a property using the PHP-DI `#[\DI\Attribute\Inject]` attribute:
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.

2 participants