Releases: moodlehq/moodle-cs
v3.4.10
Changed
- The
moodle.NamingConventions.ValidFunctionName
sniff will now ignore errors on methods employing the#[\Override]
attribute. - The
moodle.Commenting.MissingDocblock
sniff no longer warns about missing docs on non-global anonymous classes, for example those written as an instance class in a unit test.
Fixed
- Fixed an edge case leading to the file phpdoc block being incorrectly detected by various sniffs.
- Fixed a couple of problems with the
moodle.Files.BoilerplateComment
related to empty comment lines and to comments in the<?php
open tag line.
Take a look at the CHANGELOG for details about other releases.
v3.4.9
v3.4.8
Added
- The existing
moodle.PHPUnit.TestCaseCovers
sniff now detects multiple uses of the@coversDefaultClass
annotation. Only one is allowed by class. - The existing
moodle.Files.BoilerplateComment
sniff now performs more checks (spacing, placement, blank lines, ...) and is able to fix many of them.
Changed
- Made codes for
moodle.Commenting.MissingDocblock
more specific to the scenario (Fixes #154).
Take a look at the CHANGELOG for details about other releases.
v3.4.7
Added
- Add new
moodle.PHPUnit.ParentSetUpTearDown
sniff to verify, among other things, that all thesetUp()
,tearDown()
,setUpBeforeClass()
andtearDownAfterClass()
methods in unit tests are properly calling to their parent counterparts. Applies to Moodle 4.5 and up. - Add new
moodle.Commenting.ConstructorReturn
sniff to check that constructors do not document a return value.
Changed
- Update composer dependencies to current versions, notably
PHP_CodeSniffer
(3.10.1) andPHPCompatibility
(96072c30). - The
moodle.Commenting.MissingDocblock
sniff will now detect use of the Override attribute (Fixes #155).
Fixed
- Various fixes to own (GH workflow) integration tests.
Take a look at the CHANGELOG for details about other releases.
v3.4.6
Fixed
- Solved a problem where Windows file paths were not normalised leading to false positive results on some path-based sniffs.
- Solved a problem with fetching the name of an anonymous class, or closure.
v3.4.5
v3.4.4
v3.4.3
Added
- Add new
moodle.Commenting.DocblockDescription
sniff to check that all the artifacts (classes, interfaces, traits, ...) and functions PHPDoc blocks have some description.
Changed
- The
moodle.Commenting.MissingDocBlock
sniff now also checks that constants are documented.
Fixed
- Solved a problem with file-level PHPDoc blocks not controlling the required blank lines after it.
- Fixed the PHPDoc block detection when multi-line PHP 8 attributes are used in the middle.
v3.4.2
Added
-
Add new
moodle.Files.LangFilesOrdering
sniff to check that lang files are sorted by key. -
Add new
moodle.Commenting.MissingDocBlock
sniff to check that all the artifacts (classes, interfaces, traits, ...) and functions are documented. -
Add new
moodle.Commenting.VariableComment
sniff to check that the@var
tag and its types are used correctly. -
Add new
moodle.Commenting.ValidTag
sniff to check that only allowed tags are used. -
Add new
moodle.Commenting.FileExpectedTags
sniff to check that files or classes have the correct PHPDoc block with both@copyright
and@license
information.The expected contents of the
@license
tag can be controlled both by thepreferredLicenseRegex
property in ruleset files or by themoodleLicenseRegex
configuration option inphpcs.xml
files and CLI invocations. Setting them to empty string disables the Sniff completely. By default, the "https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later" content is checked.
Note that all the moodle.Commenting
sniffs above are part of the migration from moodle-local_moodlecheck
to moodle-cs
. You can find more information about the deprecation of the former and links to track the progress in the announcement in General developer forum.
Changed
- Various reorganisations of tests, fixtures and utils affecting a number of sniffs.
v3.4.1
Fixed
- Solved a problem with the
moodle.Commenting.Package
sniff when running against arbitrary (not Moodle based) directories.