moodle-cs
moodle-cs copied to clipboard
Moodle Coding Style
Moodle coding style rules say: 1. A method MUST have a PHP doc comment ... 2. Unless it is an overridden method, in which case it SHOULD NOT have a...
At the moment the warnings/errors all use the identifier `Missing`. These should include the type that is missing, for example: - `moodle.Commenting.MissingDocblock.File` - `moodle.Commenting.MissingDocblock.Class` - `moodle.Commenting.MissingDocblock.Method` - `moodle.Commenting.MissingDocblock.Function` - `moodle.Commenting.MissingDocblock.Constant`...
Moodle's coding style does not _actively_ state anything regarding the location of the opening brace when there are multiple implemnts but we previously conventioned the following: ```php class after_user_passed_mfa implements...
Incorrect: ```php /** @var string $example An example string */ protected $example; ``` Correct: ```php /** @var string An example string */ protected $example; ``` The name of the var...
This is a replacement for the old Moodle PHPdoc check (moodlecheck) checks relating to PHPDoc types. It's a port of https://github.com/moodlehq/moodle-local_moodlecheck/pull/120 . It's a significant improvement over the old checks...
While working on a new release of the `moodle-plugin-ci` including the latest version of `moodle-cs`, it has been detected that there is a small discordance between the `TodoComment` sniff (and...
While writing the v3.4.3 release notes, it has been noticed that there is some inconsistency with sniffs using the `DocBlock` (vs `Docblock`) "word" as part of their names. This is...
On running phpcbf on this code with either the moodle or moodle-extra standards, the property is renamed but the property access is not, breaking the code: ```php class test {...
I've included a fix, but I don't know whether we should or not really.
I think we can probably migrate most of our custom-written phpdoc checks into this standard. There are several, but (un)helpfully phpcs sucks at documenting the rules available. Here's a summary...