Skip to content

Commit

Permalink
Various minor doc fixes
Browse files Browse the repository at this point in the history
... picked up along the way.
  • Loading branch information
jrfnl committed May 6, 2024
1 parent 9083ffc commit 90210e6
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function process(File $phpcsFile, $stackPtr)
* Get all used variables in the incrementer part of a for statement.
*
* @param array<int, array> $tokens Array with all code sniffer tokens.
* @param array<string, mixed> $token Current for loop token
* @param array<string, mixed> $token Current for loop token.
*
* @return string[] List of all found incrementer variables.
*/
Expand Down
12 changes: 6 additions & 6 deletions src/Tokenizers/PHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Tokenizers/Tokenizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
2 changes: 1 addition & 1 deletion tests/Core/Tokenizer/BackfillExplicitOctalNotationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
6 changes: 3 additions & 3 deletions tests/Core/Tokenizer/TypedConstantsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<int|string> $sequence The expected token sequence.
*
* @dataProvider dataTypedConstant
* @dataProvider dataNullableTypedConstant
Expand Down Expand Up @@ -151,7 +151,7 @@ public function testTypedConstant($testMarker, array $sequence)
*
* @see testTypedConstant()
*
* @return array<string, array<string, string>>
* @return array<string, array<string, string|array<int|string>>>
*/
public static function dataTypedConstant()
{
Expand Down
10 changes: 5 additions & 5 deletions tests/Core/Util/HelpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public function testReportWidthCalculations($reportWidth, $longOptions, $expecte
/**
* Data provider.
*
* @return array<string, array<string, int|string>>
* @return array<string, array<string, int|string|array<string>>>
*/
public static function dataReportWidthCalculations()
{
Expand Down Expand Up @@ -576,8 +576,8 @@ public static function dataColorizeVariableInput()
/**
* Test the various option types within a category get displayed correctly.
*
* @param array<string, array<string, string> $input The options to print.
* @param array<string, string> $expectedRegex Regexes to validate expected output.
* @param array<string, array<string, string>> $input The options to print.
* @param array<string, string> $expectedRegex Regexes to validate expected output.
*
* @dataProvider dataPrintCategoryOptions
*
Expand Down Expand Up @@ -611,8 +611,8 @@ public function testPrintCategoryOptionsNoColor($input, $expectedRegex)
/**
* Test the various option types within a category get displayed correctly.
*
* @param array<string, array<string, string> $input The options to print.
* @param array<string, string> $expectedRegex Regexes to validate expected output.
* @param array<string, array<string, string>> $input The options to print.
* @param array<string, string> $expectedRegex Regexes to validate expected output.
*
* @dataProvider dataPrintCategoryOptions
*
Expand Down
4 changes: 2 additions & 2 deletions tests/Core/Util/SuggestTypeTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Tests for the \PHP_CodeSniffer\Util\Sniffs\Comments::suggestType() method.
* Tests for the \PHP_CodeSniffer\Util\Sniffs\Common::suggestType() method.
*
* @author Juliette Reinders Folmer <phpcs_nospam@adviesenzo.nl>
* @copyright 2019 Juliette Reinders Folmer. All rights reserved.
Expand All @@ -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
*/
Expand Down

0 comments on commit 90210e6

Please sign in to comment.