Repository navigation
[docs] Document class constants in the coding style - #1748
Merged
Merged
Conversation
The Constants section only described global constants declared with define(). Document class constants as the preferred form, using UPPER_CASE with underscores in line with PSR-1, and discourage global and namespaced constants in new code. Fixes moodle#1666 See MDLSITE-7040
✅ Deploy Preview for moodledevdocs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
andrewnicols
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents class constants in the Coding Style and discourages global and
namespaced constants, following the architecture decision on MDLSITE-7040.
constants subsections, with valid and invalid examples. The naming rule
is unchanged (UPPER_CASE with underscores, per PSR-1).
Deliberately out of scope: adopting PER-3.0, and naming rules for enum
cases. Neither has a tracker decision yet.
Fixes #1666