Commenting/CoversTag: flag deprecated syntaxes, bug fix and various other improvements #330
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.
Commenting/CoversTag: add some extra tests
... for situations previously not (yet) covered by tests.
Commenting/CoversTag: minor tweaks
$data
is always available.explode()
.Commenting/CoversTag: make non-interface methods private
As the sniff class is now
final
(since PR #319), there is no need for anyprotected
methods, so let's make theseprivate
.Commenting/CoversTag: improve XML documentation
Update external reference links and minor textual improvements.
Commenting/CoversTag: bug fix - allow for
<[!]visibility>
format without class nameThis is perfectly valid when used in combination with a
@coversDefaultClass
class level tag, but would be flagged by the sniff (false positives).Fixed now. Includes tests.
Commenting/CoversTag: flag deprecated
@covers
tag formatsPHPUnit 9.0 (soft) deprecated the use of
ClassName<*>
type@covers
annotations. Support for these type of annotation has been removed completely in PHPUnit 10.0.0.This commit adds a new warning to the sniff, which will detect the use of these deprecated formats and flag them.
The choice for warning vs error is deliberate. The Yoast repos, for now, do not use PHPUnit 10.x yet, so for now, a warning is sufficient.
Once the repos would be upgraded to start using PHPUnit 10.x, this sniff should be updated and the
warning
changed to anerror
.Includes tests.
Includes a new section in the XML docs about this new warning.
Refs: