diff --git a/phpcs.xml.dist b/phpcs.xml.dist index b51a8c95ec025a..6a64fcf49f8107 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -172,7 +172,7 @@ - + /packages/block-library/src/.+/*\.php$ /packages/block-serialization-default-parser/.+/*\.php$ diff --git a/test/php/gutenberg-coding-standards/Gutenberg/Sniffs/Commenting/FunctionCommentSinceTagSniff.php b/test/php/gutenberg-coding-standards/Gutenberg/Sniffs/Commenting/SinceTagSniff.php similarity index 98% rename from test/php/gutenberg-coding-standards/Gutenberg/Sniffs/Commenting/FunctionCommentSinceTagSniff.php rename to test/php/gutenberg-coding-standards/Gutenberg/Sniffs/Commenting/SinceTagSniff.php index 9e0c74b49c9865..26f83475d33f71 100644 --- a/test/php/gutenberg-coding-standards/Gutenberg/Sniffs/Commenting/FunctionCommentSinceTagSniff.php +++ b/test/php/gutenberg-coding-standards/Gutenberg/Sniffs/Commenting/SinceTagSniff.php @@ -20,10 +20,11 @@ use PHPCSUtils\Utils\Variables; /** - * This sniff ensures that PHP functions have a valid `@since` tag in the docblock. - * The sniff skips checking files in __experimental block-library blocks. + * This sniff verifies the presence of valid `@since` tags in the docblocks of various PHP structures + * and WordPress hooks. Supported structures include classes, interfaces, traits, enums, functions, methods and properties. + * Files located within the __experimental block of the block-library are excluded from checks. */ -class FunctionCommentSinceTagSniff implements Sniff { +class SinceTagSniff implements Sniff { /** * Disable the check for functions with a lower visibility than the value given. diff --git a/test/php/gutenberg-coding-standards/Gutenberg/Tests/Commenting/FunctionCommentSinceTagUnitTest.inc b/test/php/gutenberg-coding-standards/Gutenberg/Tests/Commenting/SinceTagUnitTest.inc similarity index 100% rename from test/php/gutenberg-coding-standards/Gutenberg/Tests/Commenting/FunctionCommentSinceTagUnitTest.inc rename to test/php/gutenberg-coding-standards/Gutenberg/Tests/Commenting/SinceTagUnitTest.inc diff --git a/test/php/gutenberg-coding-standards/Gutenberg/Tests/Commenting/FunctionCommentSinceTagUnitTest.php b/test/php/gutenberg-coding-standards/Gutenberg/Tests/Commenting/SinceTagUnitTest.php similarity index 91% rename from test/php/gutenberg-coding-standards/Gutenberg/Tests/Commenting/FunctionCommentSinceTagUnitTest.php rename to test/php/gutenberg-coding-standards/Gutenberg/Tests/Commenting/SinceTagUnitTest.php index 97a58a4b13f83e..7e05030bd1208b 100644 --- a/test/php/gutenberg-coding-standards/Gutenberg/Tests/Commenting/FunctionCommentSinceTagUnitTest.php +++ b/test/php/gutenberg-coding-standards/Gutenberg/Tests/Commenting/SinceTagUnitTest.php @@ -9,14 +9,14 @@ namespace GutenbergCS\Gutenberg\Tests\Commenting; -use GutenbergCS\Gutenberg\Sniffs\Commenting\FunctionCommentSinceTagSniff; +use GutenbergCS\Gutenberg\Sniffs\Commenting\SinceTagSniff; use GutenbergCS\Gutenberg\Tests\AbstractSniffUnitTest; use PHP_CodeSniffer\Sniffs\Sniff; /** - * Unit test class for the FunctionCommentSinceTagSniff sniff. + * Unit test class for the SinceTagSniff sniff. */ -final class FunctionCommentSinceTagUnitTest extends AbstractSniffUnitTest { +final class SinceTagUnitTest extends AbstractSniffUnitTest { /** * Returns the lines where errors should occur. @@ -174,7 +174,7 @@ public function getWarningList() { * @return string The fully qualified class name of the sniff. */ protected function get_sniff_fqcn() { - return FunctionCommentSinceTagSniff::class; + return SinceTagSniff::class; } /** diff --git a/test/php/gutenberg-coding-standards/Gutenberg/ruleset.xml b/test/php/gutenberg-coding-standards/Gutenberg/ruleset.xml index 9930b1986ff139..fe745b830a7606 100644 --- a/test/php/gutenberg-coding-standards/Gutenberg/ruleset.xml +++ b/test/php/gutenberg-coding-standards/Gutenberg/ruleset.xml @@ -6,6 +6,6 @@ - +