Skip to content

Commit

Permalink
Docs: remove redundant @package tags
Browse files Browse the repository at this point in the history
`@package` tags are an arcane manner to group related files as belonging to one project.

For projects using namespaces, the current recommendation is to only have `@package` tags when they have supplemental information to the namespace.

That is only in a very limited way the case in VIPCS, so I'm proposing to remove the `@package` tags from the VIPCS class docblocks, though leaving them for now in the file docblocks.

At the very least, this removed duplicate information for which there is no reason for the duplication.

Includes cleaning up (normalizing) the tag description alignments in the class docblocks.

:point_right: reviewing with whitespace changes ignored should make it easier to see that the only real change is the removal of the package tags.

Refs:
* https://docs.phpdoc.org/3.0/guide/references/phpdoc/tags/package.html#package
* https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#59-package
  • Loading branch information
jrfnl committed Aug 25, 2023
1 parent 5f34bbe commit f962816
Show file tree
Hide file tree
Showing 81 changed files with 9 additions and 171 deletions.
2 changes: 0 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
/**
* Unit test class for the WP_Query params sniff.
*
* @package VIPCS\WordPressVIPMinimum
*/
class WPQueryParamsUnitTest extends AbstractSniffUnitTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
* Restricts usage of some variables.
*
* Originally part of WordPress Coding Standards repo.
*
* @package VIPCS\WordPressVIPMinimum
*/
abstract class AbstractVariableRestrictionsSniff extends Sniff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

/**
* Class WordPressVIPMinimum_Sniffs_Classes_DeclarationCompatibilitySniff
*
* @package VIPCS\WordPressVIPMinimum
*/
class DeclarationCompatibilitySniff extends AbstractScopeSniff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
/**
* WordPressVIPMinimum_Sniffs_Classes_RestrictedExtendClassesSniff.
*
* @package VIPCS\WordPressVIPMinimum
*
* @since 0.4.0
*/
class RestrictedExtendClassesSniff extends AbstractClassRestrictionsSniff {
Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/Constants/ConstantStringSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

/**
* Sniff for properly using constant name when checking whether a constant is defined.
*
* @package VIPCS\WordPressVIPMinimum
*/
class ConstantStringSniff extends Sniff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

/**
* Restricts usage of some constants.
*
* @package VIPCS\WordPressVIPMinimum
*/
class RestrictedConstantsSniff extends Sniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/Files/IncludingFileSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* WordPressVIPMinimum_Sniffs_Files_IncludingFileSniff.
*
* Checks for custom variables, functions and constants, and external URLs used in file inclusion.
*
* @package VIPCS\WordPressVIPMinimum
*/
class IncludingFileSniff extends AbstractFunctionRestrictionsSniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/Files/IncludingNonPHPFileSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
* Ensure that non-PHP files are included via `file_get_contents()` instead of using `include/require[_once]`.
*
* This prevents potential PHP code embedded in those files from being automatically executed.
*
* @package VIPCS\WordPressVIPMinimum
*/
class IncludingNonPHPFileSniff extends Sniff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

/**
* Restricts usage of some functions in VIP context.
*
* @package VIPCS\WordPressVIPMinimum
*/
class RestrictedFunctionsSniff extends AbstractFunctionRestrictionsSniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/Functions/StripTagsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
/**
* This sniff ensures proper tag stripping.
*
* @package VIPCS\WordPressVIPMinimum
*
* @since 0.4.0
*/
class StripTagsSniff extends AbstractFunctionParameterSniff {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

/**
* This sniff validates that filters always return a value
*
* @package VIPCS\WordPressVIPMinimum
*/
class AlwaysReturnInFilterSniff extends Sniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/Hooks/PreGetPostsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
* This sniff validates a proper usage of pre_get_posts action callback.
*
* It looks for cases when the WP_Query object is being modified without checking for WP_Query::is_main_query().
*
* @package VIPCS\WordPressVIPMinimum
*/
class PreGetPostsSniff extends Sniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/Hooks/RestrictedHooksSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
/**
* This sniff restricts usage of some action and filter hooks.
*
* @package VIPCS\WordPressVIPMinimum
*
* @since 0.4.0
*/
class RestrictedHooksSniff extends AbstractFunctionParameterSniff {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* WordPressVIPMinimum_Sniffs_JS_DangerouslySetInnerHTMLSniff.
*
* Looks for instances of React's dangerouslySetInnerHMTL.
*
* @package VIPCS\WordPressVIPMinimum
*/
class DangerouslySetInnerHTMLSniff extends Sniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/JS/HTMLExecutingFunctionsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* WordPressVIPMinimum_Sniffs_JS_HTMLExecutingFunctions.
*
* Flags functions which are executing HTML passed to it.
*
* @package VIPCS\WordPressVIPMinimum
*/
class HTMLExecutingFunctionsSniff extends Sniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/JS/InnerHTMLSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* WordPressVIPMinimum_Sniffs_JS_InnerHTMLSniff.
*
* Looks for instances of .innerHMTL.
*
* @package VIPCS\WordPressVIPMinimum
*/
class InnerHTMLSniff extends Sniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/JS/StringConcatSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* WordPressVIPMinimum_Sniffs_JS_StringConcatSniff.
*
* Looks for HTML string concatenation.
*
* @package VIPCS\WordPressVIPMinimum
*/
class StringConcatSniff extends Sniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/JS/StrippingTagsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* WordPressVIPMinimum_Sniffs_JS_StrippingTagsSniff.
*
* Looks for incorrect way of stripping tags.
*
* @package VIPCS\WordPressVIPMinimum
*/
class StrippingTagsSniff extends Sniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/JS/WindowSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* WordPressVIPMinimum_Sniffs_JS_WindowSniff.
*
* Looks for instances of window properties that should be flagged.
*
* @package VIPCS\WordPressVIPMinimum
*/
class WindowSniff extends Sniff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

/**
* This sniff check whether a cached value is being overridden.
*
* @package VIPCS\WordPressVIPMinimum
*/
class CacheValueOverrideSniff extends Sniff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

/**
* Restricts usage of file_get_contents().
*
* @package VIPCS\WordPressVIPMinimum
*/
class FetchingRemoteDataSniff extends Sniff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*
* {@internal VIP uses the Memcached object cache implementation. {@link https://github.com/Automattic/wp-memcached}}
*
* @package VIPCS\WordPressVIPMinimum
*
* @since 0.4.0
*/
class LowExpiryCacheTimeSniff extends AbstractFunctionParameterSniff {
Expand Down
4 changes: 1 addition & 3 deletions WordPressVIPMinimum/Sniffs/Performance/NoPagingSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
*
* @link https://docs.wpvip.com/technical-references/code-review/#no-limit-queries
*
* @package VIPCS\WordPressVIPMinimum
*
* @since 0.5.0
* @since 0.5.0
*/
class NoPagingSniff extends AbstractArrayAssignmentRestrictionsSniff {

Expand Down
4 changes: 1 addition & 3 deletions WordPressVIPMinimum/Sniffs/Performance/OrderByRandSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
*
* @link https://docs.wpvip.com/technical-references/code-review/vip-errors/#h-order-by-rand
*
* @package VIPCS\WordPressVIPMinimum
*
* @since 0.5.0
* @since 0.5.0
*/
class OrderByRandSniff extends AbstractArrayAssignmentRestrictionsSniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/Performance/RegexpCompareSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

/**
* Flag REGEXP and NOT REGEXP in meta compare
*
* @package VIPCS\WordPressVIPMinimum
*/
class RegexpCompareSniff extends AbstractArrayAssignmentRestrictionsSniff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

/**
* Flag use of a timeout of more than 3 seconds for remote requests.
*
* @package VIPCS\WordPressVIPMinimum
*/
class RemoteRequestTimeoutSniff extends AbstractArrayAssignmentRestrictionsSniff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

/**
* Restricts the implementation of taxonomy term meta via options.
*
* @package VIPCS\WordPressVIPMinimum
*/
class TaxonomyMetaInOptionsSniff extends Sniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/Performance/WPQueryParamsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* Flag suspicious WP_Query and get_posts params.
*
* @link https://docs.wpvip.com/technical-references/caching/uncached-functions/
*
* @package VIPCS\WordPressVIPMinimum
*/
class WPQueryParamsSniff extends AbstractArrayAssignmentRestrictionsSniff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
*
* E.g. esc_html( _e( 'foo' ) );
*
* @package VIPCS\WordPressVIPMinimum
*
* @uses \WordPressCS\WordPress\Helpers\PrintingFunctionsTrait::$customPrintingFunctions
*/
class EscapingVoidReturnFunctionsSniff extends Sniff {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

/**
* Require `exit;` being called after wp_redirect and wp_safe_redirect.
*
* @package VIPCS\WordPressVIPMinimum
*/
class ExitAfterRedirectSniff extends Sniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/Security/MustacheSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

/**
* Looks for instances of unescaped output for Mustache templating engine and Handlebars.js.
*
* @package VIPCS\WordPressVIPMinimum
*/
class MustacheSniff extends Sniff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
/**
* This sniff ensures that proper sanitization is occurring when PHP's filter_* functions are used.
*
* @package VIPCS\WordPressVIPMinimum
*
* @since 0.4.0
*/
class PHPFilterFunctionsSniff extends AbstractFunctionParameterSniff {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

/**
* Checks whether proper escaping function is used.
*
* @package VIPCS\WordPressVIPMinimum
*/
class ProperEscapingFunctionSniff extends Sniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/Security/StaticStrreplaceSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

/**
* Restricts usage of str_replace with all 3 params being static.
*
* @package VIPCS\WordPressVIPMinimum
*/
class StaticStrreplaceSniff extends Sniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/Security/TwigSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

/**
* Looks for instances of unescaped output for Twig templating engine.
*
* @package VIPCS\WordPressVIPMinimum
*/
class TwigSniff extends Sniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/Security/UnderscorejsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

/**
* Looks for instances of unescaped output for Underscore.js templating engine.
*
* @package VIPCS\WordPressVIPMinimum
*/
class UnderscorejsSniff extends Sniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/Security/VuejsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

/**
* Looks for instances of unescaped output for Twig templating engine.
*
* @package VIPCS\WordPressVIPMinimum
*/
class VuejsSniff extends Sniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/Sniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
* Represents a WordPress\Sniff for sniffing VIP coding standards.
*
* Provides a bootstrap for the sniffs, to reduce code duplication.
*
* @package VIPCS\WordPressVIPMinimum
*/
abstract class Sniff extends WPCS_Sniff {
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
*
* @link https://docs.wpvip.com/technical-references/code-review/vip-warnings/#h-removing-the-admin-bar
*
* @package VIPCS\WordPressVIPMinimum
*
* @since 0.5.0
* @since 0.5.0
*/
class AdminBarRemovalSniff extends AbstractFunctionParameterSniff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
/**
* Restricts usage of some variables in VIP context.
*
* @package VIPCS\WordPressVIPMinimum
*
* @since 0.5.0
* @since 0.5.0
*/
class RestrictedVariablesSniff extends AbstractVariableRestrictionsSniff {

Expand Down
2 changes: 0 additions & 2 deletions WordPressVIPMinimum/Sniffs/Variables/ServerVariablesSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

/**
* Restricts usage of some server variables.
*
* @package VIPCS\WordPressVIPMinimum
*/
class ServerVariablesSniff extends Sniff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
/**
* Unit test class for the DeclarationCompatibility sniff.
*
* @package VIPCS\WordPressVIPMinimum
*
* @covers \WordPressVIPMinimum\Sniffs\Classes\DeclarationCompatibilitySniff
*/
class DeclarationCompatibilityUnitTest extends AbstractSniffUnitTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
/**
* Unit test class for the RestrictedExtendClasses sniff.
*
* @package VIPCS\WordPressVIPMinimum
*
* @covers \WordPressVIPMinimum\Sniffs\Classes\RestrictedExtendClassesSniff
*/
class RestrictedExtendClassesUnitTest extends AbstractSniffUnitTest {
Expand Down
Loading

0 comments on commit f962816

Please sign in to comment.