diff --git a/autoload.php b/autoload.php index e61c472fb1..6d92c577a2 100644 --- a/autoload.php +++ b/autoload.php @@ -190,8 +190,8 @@ public static function loadFile($path) /** * Determine which class was loaded based on the before and after lists of loaded classes. * - * @param array $classesBeforeLoad The classes/interfaces/traits before the file was included. - * @param array $classesAfterLoad The classes/interfaces/traits after the file was included. + * @param array> $classesBeforeLoad The classes/interfaces/traits before the file was included. + * @param array> $classesAfterLoad The classes/interfaces/traits after the file was included. * * @return string The fully qualified name of the class in the loaded file. */ @@ -266,7 +266,7 @@ public static function addSearchPath($path, $nsPrefix='') /** * Retrieve the namespaces and paths registered by external standards. * - * @return array + * @return array */ public static function getSearchPaths() { diff --git a/src/Files/LocalFile.php b/src/Files/LocalFile.php index babfe69c31..ec1a9c4a0f 100644 --- a/src/Files/LocalFile.php +++ b/src/Files/LocalFile.php @@ -160,8 +160,8 @@ public function process() * and then errors and warnings to be reapplied with the new rules. This is * particularly useful while caching. * - * @param array $errors The list of errors to replay. - * @param array $warnings The list of warnings to replay. + * @param array>> $errors The list of errors to replay. + * @param array>> $warnings The list of warnings to replay. * * @return void */ diff --git a/src/Fixer.php b/src/Fixer.php index bbc2506ac7..30ad002802 100644 --- a/src/Fixer.php +++ b/src/Fixer.php @@ -82,7 +82,7 @@ class Fixer * All changes in changeset must be able to be applied, or else * the entire changeset is rejected. * - * @var array + * @var array */ private $changeset = []; diff --git a/src/Reporter.php b/src/Reporter.php index 824031a485..a43900bb9e 100644 --- a/src/Reporter.php +++ b/src/Reporter.php @@ -77,7 +77,7 @@ class Reporter /** * A cache of opened temporary files. * - * @var array + * @var array */ private $tmpFiles = []; diff --git a/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php b/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php index dd0454797d..2826d40413 100644 --- a/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php +++ b/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php @@ -19,7 +19,7 @@ class DuplicateClassNameSniff implements Sniff /** * List of classes that have been found during checking. * - * @var array + * @var array> */ protected $foundClasses = []; diff --git a/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php b/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php index fecd16a754..8f910686e4 100644 --- a/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php +++ b/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php @@ -25,14 +25,14 @@ class AssignmentInConditionSniff implements Sniff * * Set in the register() method. * - * @var array + * @var array */ protected $assignmentTokens = []; /** * The tokens that indicate the start of a condition. * - * @var array + * @var array */ protected $conditionStartTokens = []; diff --git a/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php b/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php index 115677ae98..c34df305e5 100644 --- a/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php +++ b/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php @@ -110,7 +110,7 @@ public function testStdIn($content, $errorCount, $expectedErrors) /** * Data provider for testStdIn(). * - * @return array[] + * @return array> */ public function dataStdIn() { diff --git a/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php b/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php index 34b43e5d17..b8fb7aa89c 100644 --- a/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php +++ b/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php @@ -28,7 +28,7 @@ class FunctionCommentSniff implements Sniff /** * Array of methods which do not require a return type. * - * @var array + * @var array */ public $specialMethods = [ '__construct', diff --git a/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php b/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php index 765ba0e071..4b99d369de 100644 --- a/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php +++ b/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php @@ -36,7 +36,7 @@ public function register() * @param int $stackPtr The position of the current * token in the stack. * - * @return int|void + * @return int */ public function process(File $phpcsFile, $stackPtr) { diff --git a/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php b/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php index 0b671d6291..abde2b3bce 100644 --- a/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php +++ b/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php @@ -17,9 +17,9 @@ class LowercasePHPFunctionsSniff implements Sniff { /** - * String -> int hash map of all php built in function names + * Hash map of all php built in function names * - * @var array + * @var array */ private $builtInFunctions; diff --git a/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php b/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php index 2a87978a0c..b3b0a5b4a4 100644 --- a/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php +++ b/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php @@ -45,7 +45,7 @@ class OperatorSpacingSniff implements Sniff /** * A list of tokens that aren't considered as operands. * - * @var string[] + * @var array */ private $nonOperandTokens = []; diff --git a/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php b/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php index dc4738e0ad..5a6d4fb79c 100644 --- a/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php +++ b/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php @@ -25,7 +25,7 @@ final class InlineIfDeclarationUnitTest extends AbstractSniffUnitTest * * @param string $testFile The name of the file being tested. * - * @return array + * @return array */ public function getCliValues($testFile) { diff --git a/tests/Core/Config/SniffsExcludeArgsTest.php b/tests/Core/Config/SniffsExcludeArgsTest.php index 18b877c423..35e54bb367 100644 --- a/tests/Core/Config/SniffsExcludeArgsTest.php +++ b/tests/Core/Config/SniffsExcludeArgsTest.php @@ -24,7 +24,7 @@ final class SniffsExcludeArgsTest extends TestCase /** * Ensure that the expected error message is returned for invalid arguments. * - * @param string $argument 'sniffs' or 'exclude'. + * @param string $argument Either 'sniffs' or 'exclude'. * @param string $value List of sniffs to include / exclude. * @param array $errors Sniff code and associated help text. * @param string|null $suggestion Help text shown to end user with correct syntax for argument. @@ -208,7 +208,7 @@ public static function dataInvalid() /** * Ensure that the valid data does not throw an exception, and the value is stored. * - * @param string $argument 'sniffs' or 'exclude'. + * @param string $argument Either 'sniffs' or 'exclude'. * @param string $value List of sniffs to include or exclude. * @param array $result Expected sniffs to be set on the Config object. * @@ -289,7 +289,7 @@ public static function dataValid() /** * Ensure that only the first argument is processed and others are ignored. * - * @param string $argument 'sniffs' or 'exclude'. + * @param string $argument Either 'sniffs' or 'exclude'. * * @return void * @dataProvider dataOnlySetOnce diff --git a/tests/Core/Tokenizers/PHP/BackfillAsymmetricVisibilityTest.php b/tests/Core/Tokenizers/PHP/BackfillAsymmetricVisibilityTest.php index 13ac4ce410..4784558146 100644 --- a/tests/Core/Tokenizers/PHP/BackfillAsymmetricVisibilityTest.php +++ b/tests/Core/Tokenizers/PHP/BackfillAsymmetricVisibilityTest.php @@ -24,8 +24,8 @@ final class BackfillAsymmetricVisibilityTest extends AbstractTokenizerTestCase * Test that the asymmetric visibility keywords are tokenized as such. * * @param string $testMarker The comment which prefaces the target token in the test file. - * @param string $testType The expected token type - * @param string $testContent The token content to look for + * @param string $testType The expected token type. + * @param string $testContent The token content to look for. * * @dataProvider dataAsymmetricVisibility * @@ -206,8 +206,8 @@ public static function dataAsymmetricVisibility() * tokenized as such. * * @param string $testMarker The comment which prefaces the target token in the test file. - * @param string $testType The expected token type - * @param string $testContent The token content to look for + * @param string $testType The expected token type. + * @param string $testContent The token content to look for. * * @dataProvider dataNotAsymmetricVisibility * diff --git a/tests/Core/Tokenizers/PHP/ExitKeywordTest.php b/tests/Core/Tokenizers/PHP/ExitKeywordTest.php index f1dc7aad5b..fbd08c9039 100644 --- a/tests/Core/Tokenizers/PHP/ExitKeywordTest.php +++ b/tests/Core/Tokenizers/PHP/ExitKeywordTest.php @@ -2,8 +2,7 @@ /** * Tests the retokenization of the `exit`/`die` keywords to T_EXIT on PHP 8.4 and higher. * - * @author Juliette Reinders Folmer - * @copyright 2024 PHPCSStandards and contributors + * @copyright 2025 PHPCSStandards and contributors * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ diff --git a/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.php b/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.php index 9b40fe1091..4167c7da2f 100644 --- a/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.php +++ b/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.php @@ -291,7 +291,7 @@ public function testSwitchDefault($testMarker, $openerMarker, $closerMarker, $co * * @see testSwitchDefault() * - * @return array> + * @return array> */ public static function dataSwitchDefault() { diff --git a/tests/Core/Util/Tokens/GetHighestWeightedTokenTest.php b/tests/Core/Util/Tokens/GetHighestWeightedTokenTest.php index e0bd014c9b..2c7bada78e 100644 --- a/tests/Core/Util/Tokens/GetHighestWeightedTokenTest.php +++ b/tests/Core/Util/Tokens/GetHighestWeightedTokenTest.php @@ -41,7 +41,7 @@ public function testGetHighestWeightedToken($tokens, $expected) /** * Data provider. * - * @return array>> + * @return array>> */ public static function dataGetHighestWeightedToken() {