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 b3e933355b..b429825f06 100644 --- a/src/Fixer.php +++ b/src/Fixer.php @@ -228,7 +228,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/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php b/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php index c0b584c322..637bf41ead 100644 --- a/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php +++ b/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php @@ -63,7 +63,7 @@ public function register() * the token was found. * * @return int - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jslint.js could not be run + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jslint.js could not be run. */ public function process(File $phpcsFile, $stackPtr) { diff --git a/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php b/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php index 65faed9911..1c6b0e3f31 100644 --- a/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php +++ b/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php @@ -54,7 +54,7 @@ public function register() * the token was found. * * @return int - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jshint.js could not be run + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jshint.js could not be run. */ public function process(File $phpcsFile, $stackPtr) { diff --git a/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php b/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php index f65c9a77da..ae8264ebba 100644 --- a/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php +++ b/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php @@ -48,7 +48,7 @@ public function register() * the token was found. * * @return int - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jshint.js could not be run + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jshint.js could not be run. */ public function process(File $phpcsFile, $stackPtr) { diff --git a/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php b/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php index 407d3dae2a..ff1cd830ea 100644 --- a/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php +++ b/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php @@ -182,7 +182,7 @@ protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) /** * Returns the declaration names for classes/interfaces/functions with a namespace. * - * @param array $tokens Token stack for this file + * @param array $tokens Token stack for this file. * @param int $stackPtr The position where the namespace building will start. * * @return string diff --git a/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php b/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php index 52bff6cc57..652391f112 100644 --- a/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php +++ b/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php @@ -47,7 +47,7 @@ public function register() * the token was found. * * @return int - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jslint.js could not be run + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jslint.js could not be run. */ public function process(File $phpcsFile, $stackPtr) { diff --git a/src/Tokenizers/CSS.php b/src/Tokenizers/CSS.php index d3f71b3794..36631ddc39 100644 --- a/src/Tokenizers/CSS.php +++ b/src/Tokenizers/CSS.php @@ -22,7 +22,7 @@ class CSS extends PHP * * Pre-checks the content to see if it looks minified. * - * @param string $content The content to tokenize, + * @param string $content The content to tokenize. * @param \PHP_CodeSniffer\Config $config The config data for the run. * @param string $eolChar The EOL char used in the content. * diff --git a/src/Tokenizers/JS.php b/src/Tokenizers/JS.php index cb7bd3c193..3d1162eb32 100644 --- a/src/Tokenizers/JS.php +++ b/src/Tokenizers/JS.php @@ -251,7 +251,7 @@ class JS extends Tokenizer * * Pre-checks the content to see if it looks minified. * - * @param string $content The content to tokenize, + * @param string $content The content to tokenize. * @param \PHP_CodeSniffer\Config $config The config data for the run. * @param string $eolChar The EOL char used in the content. * diff --git a/src/Tokenizers/PHP.php b/src/Tokenizers/PHP.php index 6d99bba85d..55baf41689 100644 --- a/src/Tokenizers/PHP.php +++ b/src/Tokenizers/PHP.php @@ -3712,10 +3712,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. */ @@ -3749,8 +3749,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 0857428c98..ba41f8da88 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 750f02d4c6..8b66f926d3 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 29b47e18d4..c8ef301c6f 100644 --- a/tests/Core/Util/HelpTest.php +++ b/tests/Core/Util/HelpTest.php @@ -462,7 +462,7 @@ public function testReportWidthCalculations($reportWidth, $longOptions, $expecte /** * Data provider. * - * @return array> + * @return array>> */ public static function dataReportWidthCalculations() { @@ -584,8 +584,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 * @@ -619,8 +619,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 */ diff --git a/tests/TestSuite7.php b/tests/TestSuite7.php index 1b651519dd..ad0947c58f 100644 --- a/tests/TestSuite7.php +++ b/tests/TestSuite7.php @@ -19,7 +19,7 @@ class TestSuite extends PHPUnit_TestSuite /** * Runs the tests and collects their result in a TestResult. * - * @param \PHPUnit\Framework\TestResult $result A test result. + * @param \PHPUnit\Framework\TestResult|null $result A test result. * * @return \PHPUnit\Framework\TestResult */