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 WPCS, so I'm proposing to remove the `@package` tags from the WPCS 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 11, 2023
1 parent 306542c commit 38c950e
Show file tree
Hide file tree
Showing 138 changed files with 426 additions and 681 deletions.
12 changes: 5 additions & 7 deletions WordPress/AbstractArrayAssignmentRestrictionsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@
/**
* Restricts array assignment of certain keys.
*
* @package WPCS\WordPressCodingStandards
*
* @since 0.3.0
* @since 0.10.0 Class became a proper abstract class. This was already the behaviour.
* Moved the file and renamed the class from
* `\WordPressCS\WordPress\Sniffs\Arrays\ArrayAssignmentRestrictionsSniff` to
* `\WordPressCS\WordPress\AbstractArrayAssignmentRestrictionsSniff`.
* @since 0.3.0
* @since 0.10.0 Class became a proper abstract class. This was already the behaviour.
* Moved the file and renamed the class from
* `\WordPressCS\WordPress\Sniffs\Arrays\ArrayAssignmentRestrictionsSniff` to
* `\WordPressCS\WordPress\AbstractArrayAssignmentRestrictionsSniff`.
*/
abstract class AbstractArrayAssignmentRestrictionsSniff extends Sniff {

Expand Down
4 changes: 1 addition & 3 deletions WordPress/AbstractClassRestrictionsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
/**
* Restricts usage of some classes.
*
* @package WPCS\WordPressCodingStandards
*
* @since 0.10.0
* @since 0.10.0
*/
abstract class AbstractClassRestrictionsSniff extends AbstractFunctionRestrictionsSniff {

Expand Down
4 changes: 1 addition & 3 deletions WordPress/AbstractFunctionParameterSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
/**
* Advises about parameters used in function calls.
*
* @package WPCS\WordPressCodingStandards
*
* @since 0.11.0
* @since 0.11.0
*/
abstract class AbstractFunctionParameterSniff extends AbstractFunctionRestrictionsSniff {

Expand Down
14 changes: 6 additions & 8 deletions WordPress/AbstractFunctionRestrictionsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@
/**
* Restricts usage of some functions.
*
* @package WPCS\WordPressCodingStandards
*
* @since 0.3.0
* @since 0.10.0 Class became a proper abstract class. This was already the behaviour.
* Moved the file and renamed the class from
* `\WordPressCS\WordPress\Sniffs\Functions\FunctionRestrictionsSniff` to
* `\WordPressCS\WordPress\AbstractFunctionRestrictionsSniff`.
* @since 0.11.0 Extends the WordPressCS native `Sniff` class.
* @since 0.3.0
* @since 0.10.0 Class became a proper abstract class. This was already the behaviour.
* Moved the file and renamed the class from
* `\WordPressCS\WordPress\Sniffs\Functions\FunctionRestrictionsSniff` to
* `\WordPressCS\WordPress\AbstractFunctionRestrictionsSniff`.
* @since 0.11.0 Extends the WordPressCS native `Sniff` class.
*/
abstract class AbstractFunctionRestrictionsSniff extends Sniff {

Expand Down
5 changes: 2 additions & 3 deletions WordPress/Helpers/ArrayWalkingFunctionsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
/**
* Helper functions and function lists for checking whether a function applies a callback to an array.
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The property in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
* @since 3.0.0 The property in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
*/
final class ArrayWalkingFunctionsHelper {

Expand Down
5 changes: 2 additions & 3 deletions WordPress/Helpers/ConstantsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
*
* @internal
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The method in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
* @since 3.0.0 The method in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
*/
final class ConstantsHelper {

Expand Down
5 changes: 2 additions & 3 deletions WordPress/Helpers/ContextHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
*
* @internal
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The methods in this class were previously contained in the
* `WordPressCS\WordPress\Sniff` class and have been moved here.
* @since 3.0.0 The methods in this class were previously contained in the
* `WordPressCS\WordPress\Sniff` class and have been moved here.
*/
final class ContextHelper {

Expand Down
5 changes: 2 additions & 3 deletions WordPress/Helpers/DeprecationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
*
* @internal
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The method in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
* @since 3.0.0 The method in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
*/
final class DeprecationHelper {

Expand Down
7 changes: 3 additions & 4 deletions WordPress/Helpers/EscapingFunctionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
* - `customEscapingFunctions`.
* - `customAutoEscapedFunctions`
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The properties in this trait were previously contained partially in the
* `WordPressCS\WordPress\Sniff` class and partially in the `EscapeOutputSniff`
* class and have been moved here.
* @since 3.0.0 The properties in this trait were previously contained partially in the
* `WordPressCS\WordPress\Sniff` class and partially in the `EscapeOutputSniff`
* class and have been moved here.
*/
trait EscapingFunctionsTrait {

Expand Down
5 changes: 2 additions & 3 deletions WordPress/Helpers/FormattingFunctionsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
/**
* Helper functions and function lists for checking whether a function is a formatting function.
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The property in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
* @since 3.0.0 The property in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
*/
final class FormattingFunctionsHelper {

Expand Down
5 changes: 2 additions & 3 deletions WordPress/Helpers/IsUnitTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
* - The sniff can call the `is_test_class()` method in this trait to verify if a class is
* a test class. The `is_test_class()` method will take the custom property into account.
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The properties and method in this trait were previously contained in the
* `WordPressCS\WordPress\Sniff` class and have been moved here.
* @since 3.0.0 The properties and method in this trait were previously contained in the
* `WordPressCS\WordPress\Sniff` class and have been moved here.
*/
trait IsUnitTestTrait {

Expand Down
5 changes: 2 additions & 3 deletions WordPress/Helpers/ListHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
*
* @internal
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The method in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
* @since 3.0.0 The method in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
*/
final class ListHelper {

Expand Down
5 changes: 2 additions & 3 deletions WordPress/Helpers/MinimumWPVersionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
* - After that, the `MinimumWPVersionTrait::$minimum_wp_version` property can be freely used
* in the sniff.
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The property and method in this trait were previously contained in the
* `WordPressCS\WordPress\Sniff` class and have been moved here.
* @since 3.0.0 The property and method in this trait were previously contained in the
* `WordPressCS\WordPress\Sniff` class and have been moved here.
*/
trait MinimumWPVersionTrait {

Expand Down
7 changes: 3 additions & 4 deletions WordPress/Helpers/PrintingFunctionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
* following `public` property which can be changed from within a custom ruleset:
* - `customPrintingFunctions`.
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The properties in this trait were previously contained partially in the
* `WordPressCS\WordPress\Sniff` class and partially in the `EscapeOutputSniff`
* class and have been moved here.
* @since 3.0.0 The properties in this trait were previously contained partially in the
* `WordPressCS\WordPress\Sniff` class and partially in the `EscapeOutputSniff`
* class and have been moved here.
*/
trait PrintingFunctionsTrait {

Expand Down
5 changes: 2 additions & 3 deletions WordPress/Helpers/RulesetPropertyHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
*
* @internal
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The method in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
* @since 3.0.0 The method in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
*/
final class RulesetPropertyHelper {

Expand Down
7 changes: 3 additions & 4 deletions WordPress/Helpers/SanitizingFunctionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
* - `customSanitizingFunctions`.
* - `customUnslashingSanitizingFunctions`
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The properties in this trait were previously contained partially in the
* `WordPressCS\WordPress\Sniff` class and partially in the `NonceVerificationSniff`
* and the `ValidatedSanitizedInputSniff` classes and have been moved here.
* @since 3.0.0 The properties in this trait were previously contained partially in the
* `WordPressCS\WordPress\Sniff` class and partially in the `NonceVerificationSniff`
* and the `ValidatedSanitizedInputSniff` classes and have been moved here.
*/
trait SanitizingFunctionsTrait {

Expand Down
5 changes: 2 additions & 3 deletions WordPress/Helpers/SnakeCaseHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
*
* @internal
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The method in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
* @since 3.0.0 The method in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
*/
final class SnakeCaseHelper {

Expand Down
5 changes: 2 additions & 3 deletions WordPress/Helpers/UnslashingFunctionsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
/**
* Helper functions and function lists for checking whether a function is an unslashing function.
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The property in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
* @since 3.0.0 The property in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
*/
final class UnslashingFunctionsHelper {

Expand Down
5 changes: 2 additions & 3 deletions WordPress/Helpers/ValidationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
/**
* Helper function for checking whether a token is validated.
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The method in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
* @since 3.0.0 The method in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
*/
final class ValidationHelper {

Expand Down
5 changes: 2 additions & 3 deletions WordPress/Helpers/VariableHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
*
* @internal
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The methods in this class were previously contained in the
* `WordPressCS\WordPress\Sniff` class and have been moved here.
* @since 3.0.0 The methods in this class were previously contained in the
* `WordPressCS\WordPress\Sniff` class and have been moved here.
*/
final class VariableHelper {

Expand Down
6 changes: 2 additions & 4 deletions WordPress/Helpers/WPDBTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
/**
* Helper utilities for sniffs which examine WPDB method calls.
*
* @package WPCS\WordPressCodingStandards
*
* @since 3.0.0 The method in this trait was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
* @since 3.0.0 The method in this trait was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
*/
trait WPDBTrait {

Expand Down
5 changes: 2 additions & 3 deletions WordPress/Helpers/WPGlobalVariablesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
/**
* Helper utilities for recognizing WP global variables.
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The property in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
* @since 3.0.0 The property in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
*/
final class WPGlobalVariablesHelper {

Expand Down
5 changes: 2 additions & 3 deletions WordPress/Helpers/WPHookHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
/**
* Helper utilities for recognizing functions related to the WP Hook mechanism.
*
* @package WPCS\WordPressCodingStandards
* @since 3.0.0 The property in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
* @since 3.0.0 The property in this class was previously contained in the
* `WordPressCS\WordPress\Sniff` class and has been moved here.
*/
final class WPHookHelper {

Expand Down
3 changes: 1 addition & 2 deletions WordPress/Sniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
*
* Provides a bootstrap for the sniffs, to reduce code duplication.
*
* @package WPCS\WordPressCodingStandards
* @since 0.4.0
* @since 0.4.0
*/
abstract class Sniff implements PHPCS_Sniff {

Expand Down
32 changes: 15 additions & 17 deletions WordPress/Sniffs/Arrays/ArrayDeclarationSpacingSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,22 @@
* - Checks that associative arrays are multi-line.
* - Checks that each array item in a multi-line array starts on a new line.
*
* @link https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#indentation
* @link https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#indentation
*
* @package WPCS\WordPressCodingStandards
*
* @since 0.11.0 - The WordPress specific additional checks have now been split off
* from the `WordPress.Arrays.ArrayDeclaration` sniff into this sniff.
* - Added sniffing & fixing for associative arrays.
* @since 0.12.0 Decoupled this sniff from the upstream sniff completely.
* This sniff now extends the WordPressCS native `Sniff` class instead.
* @since 0.13.0 Added the last remaining checks from the `WordPress.Arrays.ArrayDeclaration`
* sniff which were not covered elsewhere.
* The `WordPress.Arrays.ArrayDeclaration` sniff has now been deprecated.
* @since 0.13.0 Class name changed: this class is now namespaced.
* @since 0.14.0 Single item associative arrays are now by default exempt from the
* "must be multi-line" rule. This behaviour can be changed using the
* `allow_single_item_single_line_associative_arrays` property.
* @since 3.0.0 Removed various whitespace related checks and fixers in favour of the PHPCSExtra
* `NormalizedArrays.Arrays.ArrayBraceSpacing` sniff.
* @since 0.11.0 - The WordPress specific additional checks have now been split off
* from the `WordPress.Arrays.ArrayDeclaration` sniff into this sniff.
* - Added sniffing & fixing for associative arrays.
* @since 0.12.0 Decoupled this sniff from the upstream sniff completely.
* This sniff now extends the WordPressCS native `Sniff` class instead.
* @since 0.13.0 Added the last remaining checks from the `WordPress.Arrays.ArrayDeclaration`
* sniff which were not covered elsewhere.
* The `WordPress.Arrays.ArrayDeclaration` sniff has now been deprecated.
* @since 0.13.0 Class name changed: this class is now namespaced.
* @since 0.14.0 Single item associative arrays are now by default exempt from the
* "must be multi-line" rule. This behaviour can be changed using the
* `allow_single_item_single_line_associative_arrays` property.
* @since 3.0.0 Removed various whitespace related checks and fixers in favour of the PHPCSExtra
* `NormalizedArrays.Arrays.ArrayBraceSpacing` sniff.
*/
final class ArrayDeclarationSpacingSniff extends Sniff {

Expand Down
8 changes: 3 additions & 5 deletions WordPress/Sniffs/Arrays/ArrayIndentationSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
/**
* Enforces WordPress array indentation for multi-line arrays.
*
* @link https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#indentation
* @link https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#indentation
*
* @package WPCS\WordPressCodingStandards
*
* @since 0.12.0
* @since 0.13.0 Class name changed: this class is now namespaced.
* @since 0.12.0
* @since 0.13.0 Class name changed: this class is now namespaced.
*
* {@internal This sniff should eventually be pulled upstream as part of a solution
* for https://github.com/squizlabs/PHP_CodeSniffer/issues/582 }}
Expand Down
14 changes: 6 additions & 8 deletions WordPress/Sniffs/Arrays/ArrayKeySpacingRestrictionsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@
/**
* Check for proper spacing in array key references.
*
* @link https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#space-usage
* @link https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#space-usage
*
* @package WPCS\WordPressCodingStandards
*
* @since 0.3.0
* @since 0.7.0 This sniff now has the ability to fix a number of the issues it flags.
* @since 0.12.0 This class now extends the WordPressCS native `Sniff` class.
* @since 0.13.0 Class name changed: this class is now namespaced.
* @since 2.2.0 The sniff now also checks the size of the spacing, if applicable.
* @since 0.3.0
* @since 0.7.0 This sniff now has the ability to fix a number of the issues it flags.
* @since 0.12.0 This class now extends the WordPressCS native `Sniff` class.
* @since 0.13.0 Class name changed: this class is now namespaced.
* @since 2.2.0 The sniff now also checks the size of the spacing, if applicable.
*/
final class ArrayKeySpacingRestrictionsSniff extends Sniff {

Expand Down
6 changes: 2 additions & 4 deletions WordPress/Sniffs/Arrays/MultipleStatementAlignmentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@
* - Allows for new line(s) before a double arrow (configurable).
* - Allows for handling multi-line array items differently if so desired (configurable).
*
* @link https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#indentation
* @link https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#indentation
*
* @package WPCS\WordPressCodingStandards
*
* @since 0.14.0
* @since 0.14.0
*
* {@internal This sniff should eventually be pulled upstream as part of a solution
* for https://github.com/squizlabs/PHP_CodeSniffer/issues/582 }}
Expand Down
Loading

0 comments on commit 38c950e

Please sign in to comment.