-
Notifications
You must be signed in to change notification settings - Fork 518
Update coding standard regarding function definitions using $options arrays as parameters #1488
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?
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 updates the Moodle coding standards documentation to discourage the use of $options arrays as function parameters, as per MDL-80349. The guidance promotes explicit, typed parameters over loosely-typed array parameters for better type safety and documentation.
Key Changes:
- Added new section "Using arrays for options as arguments" discouraging the practice
- Provided both invalid and valid examples showing the preferred approach with explicit, typed parameters
- Clarified that while arrays could be used in exceptional cases, explicit and typed parameters are strongly encouraged
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
andrewnicols
left a comment
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.
Thanks Travis.
I've got a few suggestions too. When you're happy with this, can you please squash the commits together too.
Cheers
Added guidelines for using arrays as function arguments, emphasizing explicit parameter listing and type definition.
81c619b to
a6b8bf8
Compare
As per MDL-80349, updating the devdocs appropriately