diff --git a/src/Config.php b/src/Config.php index e060e41c1f..8fc78e3603 100644 --- a/src/Config.php +++ b/src/Config.php @@ -1299,7 +1299,7 @@ public function processLongArgument($arg, $pos) * @param string $argument The name of the argument which is being processed. * * @return array - * @throws DeepExitException When any of the provided codes are not valid as sniff codes. + * @throws \PHP_CodeSniffer\Exceptions\DeepExitException When any of the provided codes are not valid as sniff codes. */ private function parseSniffCodes($input, $argument) { diff --git a/src/Util/MessageCollector.php b/src/Util/MessageCollector.php index 2b6ca8f902..6db9414c18 100644 --- a/src/Util/MessageCollector.php +++ b/src/Util/MessageCollector.php @@ -179,7 +179,7 @@ public function display($order=self::ORDERBY_SEVERITY) * * @return array> */ - private function prefixAll($messages) + private function prefixAll(array $messages) { foreach ($messages as $i => $details) { $messages[$i]['message'] = $this->prefix($details['message'], $details['type']); @@ -230,7 +230,7 @@ private function prefix($message, $type) * * @return array A single dimensional array of only messages, sorted by severity. */ - private function sortBySeverity($messages) + private function sortBySeverity(array $messages) { if (count($messages) === 1) { return [$messages[0]['message']]; diff --git a/tests/Core/Standards/StandardRulesetsQATest.php b/tests/Core/Standards/StandardRulesetsQATest.php index 611acb6b0d..baba457437 100644 --- a/tests/Core/Standards/StandardRulesetsQATest.php +++ b/tests/Core/Standards/StandardRulesetsQATest.php @@ -2,8 +2,7 @@ /** * Tests that pre-defined standards do not throw errors. * - * @author Juliette Reinders Folmer - * @copyright 2025 Juliette Reinders Folmer. All rights reserved. + * @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/CreateParenthesisNestingMapDNFTypesTest.php b/tests/Core/Tokenizers/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.php index 91d10ac3fc..6a82af6697 100644 --- a/tests/Core/Tokenizers/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.php +++ b/tests/Core/Tokenizers/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.php @@ -1,6 +1,6 @@ * @copyright 2024 PHPCSStandards and contributors diff --git a/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapCaseKeywordConditionsTest.php b/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapCaseKeywordConditionsTest.php index a4f3c3f089..51382d3c5d 100644 --- a/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapCaseKeywordConditionsTest.php +++ b/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapCaseKeywordConditionsTest.php @@ -1,6 +1,6 @@ * @copyright 2021 Squiz Pty Ltd (ABN 77 084 670 600) @@ -16,7 +16,7 @@ final class RecurseScopeMapCaseKeywordConditionsTest extends AbstractTokenizerTe /** - * Test that the enum "case" is converted to T_ENUM_CASE. + * Test that enum "case" tokens does not get scope indexes. * * @param string $testMarker The comment which prefaces the target token in the test file. * @@ -64,7 +64,7 @@ public static function dataEnumCases() /** - * Test that "case" that is not enum case is still tokenized as `T_CASE`. + * Test that switch "case" tokens do get the scope indexes. * * @param string $testMarker The comment which prefaces the target token in the test file. * @param array $expectedTokens The expected token codes for the scope opener/closer. @@ -221,7 +221,7 @@ public static function dataNotEnumCases() /** - * Test that "case" that is not enum case is still tokenized as `T_CASE`. + * Test that a "case" keyword which is not a switch or enum case, does not get the scope indexes. * * @param string $testMarker The comment which prefaces the target token in the test file. * diff --git a/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.php b/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.php index 838982c51e..95807eccb4 100644 --- a/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.php +++ b/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.php @@ -1,7 +1,6 @@ * @copyright 2020-2021 Squiz Pty Ltd (ABN 77 084 670 600) @@ -17,7 +16,7 @@ final class RecurseScopeMapDefaultKeywordConditionsTest extends AbstractTokenize /** - * Test the retokenization of the `default` keyword for match structure to `T_MATCH_DEFAULT`. + * Test that match "default" tokens does not get scope indexes. * * Note: Cases and default structures within a match structure do *NOT* get case/default scope * conditions, in contrast to case and default structures in switch control structures. @@ -103,8 +102,7 @@ public static function dataMatchDefault() /** - * Verify that the retokenization of `T_DEFAULT` tokens in match constructs, doesn't negatively - * impact the tokenization of `T_DEFAULT` tokens in switch control structures. + * Test that switch "default" tokens do get the scope indexes. * * Note: Cases and default structures within a switch control structure *do* get case/default scope * conditions. @@ -220,9 +218,7 @@ public static function dataSwitchDefault() /** - * Verify that the retokenization of `T_DEFAULT` tokens in match constructs, doesn't negatively - * impact the tokenization of `T_STRING` tokens with the contents 'default' which aren't in - * actual fact the default keyword. + * Test that a "default" keyword which is not a switch or match default, does not get the scope indexes. * * @param string $testMarker The comment prefacing the target token. * @param string $testContent The token content to look for. diff --git a/tests/Core/Util/MessageCollector/MessageCollectorTest.php b/tests/Core/Util/MessageCollector/MessageCollectorTest.php index 6ca661ba34..faa98ca415 100644 --- a/tests/Core/Util/MessageCollector/MessageCollectorTest.php +++ b/tests/Core/Util/MessageCollector/MessageCollectorTest.php @@ -2,7 +2,6 @@ /** * Tests the message collecting functionality. * - * @author Juliette Reinders Folmer * @copyright 2025 PHPCSStandards and contributors * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ diff --git a/tests/Core/Util/Tokens/GetHighestWeightedTokenTest.php b/tests/Core/Util/Tokens/GetHighestWeightedTokenTest.php index f03d20a393..e0bd014c9b 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() {