Skip to content

Commit

Permalink
Merge pull request #480 from PHPCSStandards/feature/various-doc-fixes
Browse files Browse the repository at this point in the history
Various minor doc fixes
  • Loading branch information
jrfnl committed May 6, 2024
2 parents 0d143c0 + c07b4cc commit a9632f5
Show file tree
Hide file tree
Showing 17 changed files with 29 additions and 29 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 @@ -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)
{
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
2 changes: 1 addition & 1 deletion src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Standards/Generic/Sniffs/Debug/ESLintSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Standards/Generic/Sniffs/Debug/JSHintSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Tokenizers/CSS.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Tokenizers/JS.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
12 changes: 6 additions & 6 deletions src/Tokenizers/PHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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
*/
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 @@ -462,7 +462,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 @@ -584,8 +584,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 @@ -619,8 +619,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
2 changes: 1 addition & 1 deletion tests/TestSuite7.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit a9632f5

Please sign in to comment.