From 90210e6f4ba8651c95bf8dd7dd885ef9674ad20d Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 11 Apr 2024 01:49:35 +0200 Subject: [PATCH] Various minor doc fixes ... picked up along the way. --- autoload.php | 2 +- src/Fixer.php | 2 +- .../Sniffs/CodeAnalysis/JumbledIncrementerSniff.php | 2 +- src/Tokenizers/PHP.php | 12 ++++++------ src/Tokenizers/Tokenizer.php | 2 +- .../Tokenizer/BackfillExplicitOctalNotationTest.php | 2 +- tests/Core/Tokenizer/TypedConstantsTest.php | 6 +++--- tests/Core/Util/HelpTest.php | 10 +++++----- tests/Core/Util/SuggestTypeTest.php | 4 ++-- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/autoload.php b/autoload.php index 3d54ee409d..5dd1387325 100644 --- a/autoload.php +++ b/autoload.php @@ -298,7 +298,7 @@ public static function getLoadedClassName($path) * * @param string $class The name of the class. * - * @throws \Exception If the class name has not been loaded + * @throws \Exception If the class name has not been loaded. * @return string */ public static function getLoadedFileName($class) diff --git a/src/Fixer.php b/src/Fixer.php index 1552e13991..c143a4d888 100644 --- a/src/Fixer.php +++ b/src/Fixer.php @@ -225,7 +225,7 @@ public function fixFile() * * @return string * - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException when the diff command fails. + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException When the diff command fails. */ public function generateDiff($filePath=null, $colors=true) { diff --git a/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php b/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php index 392dc74c78..8174d66532 100644 --- a/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php +++ b/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php @@ -101,7 +101,7 @@ public function process(File $phpcsFile, $stackPtr) * Get all used variables in the incrementer part of a for statement. * * @param array $tokens Array with all code sniffer tokens. - * @param array $token Current for loop token + * @param array $token Current for loop token. * * @return string[] List of all found incrementer variables. */ diff --git a/src/Tokenizers/PHP.php b/src/Tokenizers/PHP.php index d19aa9c46c..6a95b72a9e 100644 --- a/src/Tokenizers/PHP.php +++ b/src/Tokenizers/PHP.php @@ -3538,10 +3538,10 @@ public static function resolveSimpleToken($token) * Finds a "closer" token (closing parenthesis or square bracket for example) * Handle parenthesis balancing while searching for closing token * - * @param array $tokens The list of tokens to iterate searching the closing token (as returned by token_get_all) - * @param int $start The starting position - * @param string|string[] $openerTokens The opening character - * @param string $closerChar The closing character + * @param array $tokens The list of tokens to iterate searching the closing token (as returned by token_get_all). + * @param int $start The starting position. + * @param string|string[] $openerTokens The opening character. + * @param string $closerChar The closing character. * * @return int|null The position of the closing token, if found. NULL otherwise. */ @@ -3575,8 +3575,8 @@ private function findCloser(array &$tokens, $start, $openerTokens, $closerChar) * PHP 8 attributes parser for PHP < 8 * Handles single-line and multiline attributes. * - * @param array $tokens The original array of tokens (as returned by token_get_all) - * @param int $stackPtr The current position in token array + * @param array $tokens The original array of tokens (as returned by token_get_all). + * @param int $stackPtr The current position in token array. * * @return array|null The array of parsed attribute tokens */ diff --git a/src/Tokenizers/Tokenizer.php b/src/Tokenizers/Tokenizer.php index d008e88763..96a01d940e 100644 --- a/src/Tokenizers/Tokenizer.php +++ b/src/Tokenizers/Tokenizer.php @@ -76,7 +76,7 @@ abstract class Tokenizer /** * Initialise and run the tokenizer. * - * @param string $content The content to tokenize, + * @param string $content The content to tokenize. * @param \PHP_CodeSniffer\Config | null $config The config data for the run. * @param string $eolChar The EOL char used in the content. * diff --git a/tests/Core/Tokenizer/BackfillExplicitOctalNotationTest.php b/tests/Core/Tokenizer/BackfillExplicitOctalNotationTest.php index 609a54c00f..ffa03cc884 100644 --- a/tests/Core/Tokenizer/BackfillExplicitOctalNotationTest.php +++ b/tests/Core/Tokenizer/BackfillExplicitOctalNotationTest.php @@ -17,7 +17,7 @@ final class BackfillExplicitOctalNotationTest extends AbstractTokenizerTestCase * Test that explicitly-defined octal values are tokenized as a single number and not as a number and a string. * * @param string $marker The comment which prefaces the target token in the test file. - * @param string $value The expected content of the token + * @param string $value The expected content of the token. * @param int|string $nextToken The expected next token. * @param string $nextContent The expected content of the next token. * diff --git a/tests/Core/Tokenizer/TypedConstantsTest.php b/tests/Core/Tokenizer/TypedConstantsTest.php index c94fbc1925..6937a6259f 100644 --- a/tests/Core/Tokenizer/TypedConstantsTest.php +++ b/tests/Core/Tokenizer/TypedConstantsTest.php @@ -109,8 +109,8 @@ public static function dataUntypedConstant() /** * Test the tokens in the type of a typed constant as well as the constant name are tokenized correctly. * - * @param string $testMarker The comment prefacing the target token. - * @param string $sequence The expected token sequence. + * @param string $testMarker The comment prefacing the target token. + * @param array $sequence The expected token sequence. * * @dataProvider dataTypedConstant * @dataProvider dataNullableTypedConstant @@ -151,7 +151,7 @@ public function testTypedConstant($testMarker, array $sequence) * * @see testTypedConstant() * - * @return array> + * @return array>> */ public static function dataTypedConstant() { diff --git a/tests/Core/Util/HelpTest.php b/tests/Core/Util/HelpTest.php index 638ffde2d0..9062bd4eca 100644 --- a/tests/Core/Util/HelpTest.php +++ b/tests/Core/Util/HelpTest.php @@ -454,7 +454,7 @@ public function testReportWidthCalculations($reportWidth, $longOptions, $expecte /** * Data provider. * - * @return array> + * @return array>> */ public static function dataReportWidthCalculations() { @@ -576,8 +576,8 @@ public static function dataColorizeVariableInput() /** * Test the various option types within a category get displayed correctly. * - * @param array $input The options to print. - * @param array $expectedRegex Regexes to validate expected output. + * @param array> $input The options to print. + * @param array $expectedRegex Regexes to validate expected output. * * @dataProvider dataPrintCategoryOptions * @@ -611,8 +611,8 @@ public function testPrintCategoryOptionsNoColor($input, $expectedRegex) /** * Test the various option types within a category get displayed correctly. * - * @param array $input The options to print. - * @param array $expectedRegex Regexes to validate expected output. + * @param array> $input The options to print. + * @param array $expectedRegex Regexes to validate expected output. * * @dataProvider dataPrintCategoryOptions * diff --git a/tests/Core/Util/SuggestTypeTest.php b/tests/Core/Util/SuggestTypeTest.php index 48790a888c..88da1cd5d1 100644 --- a/tests/Core/Util/SuggestTypeTest.php +++ b/tests/Core/Util/SuggestTypeTest.php @@ -1,6 +1,6 @@ * @copyright 2019 Juliette Reinders Folmer. All rights reserved. @@ -13,7 +13,7 @@ use PHPUnit\Framework\TestCase; /** - * Tests for the \PHP_CodeSniffer\Util\Sniffs\Comments::suggestType() method. + * Tests for the \PHP_CodeSniffer\Util\Sniffs\Common::suggestType() method. * * @covers \PHP_CodeSniffer\Util\Common::suggestType */