Skip to content

[docs] Correct Hooks examples to use callable notation#1565

Open
andrewnicols wants to merge 1 commit intomoodle:mainfrom
andrewnicols:hookCallbackExampleUpdate
Open

[docs] Correct Hooks examples to use callable notation#1565
andrewnicols wants to merge 1 commit intomoodle:mainfrom
andrewnicols:hookCallbackExampleUpdate

Conversation

@andrewnicols
Copy link
Copy Markdown
Member

@andrewnicols andrewnicols commented Apr 14, 2026

This change updates the hook callback notation to use callback notation instead of string notation. This is the recommended approach.

Copilot AI review requested due to automatic review settings April 14, 2026 01:44
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 14, 2026

Deploy Preview for moodledevdocs ready!

Name Link
🔨 Latest commit 45b9818
🔍 Latest deploy log https://app.netlify.com/projects/moodledevdocs/deploys/69dd9c1ac9918f00081c06e5
😎 Deploy Preview https://deploy-preview-1565--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
Copy Markdown
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

Updates Moodle developer documentation examples to register hook callbacks using PHP callable array notation, aligning these pages with the hook registration style used elsewhere in the docs.

Changes:

  • Replace string-concatenated Class::class . '::method' callback examples with callable arrays ([Class::class, 'method']).
  • Apply the same change consistently across current docs and relevant versioned docs (4.5, 5.0, 5.1) where the examples exist.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
versioned_docs/version-5.1/apis/plugintypes/ai/provider.md Updates AI provider hook registration examples to callable array format.
versioned_docs/version-5.1/apis/core/di/index.md Updates DI hook registration example to callable array format.
versioned_docs/version-5.0/apis/plugintypes/ai/provider.md Updates AI provider hook registration examples to callable array format.
versioned_docs/version-5.0/apis/core/di/index.md Updates DI hook registration example to callable array format.
versioned_docs/version-4.5/apis/core/di/index.md Updates DI hook registration example to callable array format.
docs/apis/plugintypes/ai/provider.md Updates AI provider hook registration examples to callable array format.
docs/apis/core/di/index.md Updates DI hook registration example to callable array format.

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