Skip to content

Commit 1014d43

Browse files
committed
Docs: various minor fixes
... picked up along the way.
1 parent 44a555f commit 1014d43

28 files changed

+72
-69
lines changed

autoload.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class Autoload
2626
/**
2727
* The composer autoloader.
2828
*
29-
* @var \Composer\Autoload\ClassLoader
29+
* @var \Composer\Autoload\ClassLoader|false|null The autoloader object or FALSE if no Composer autoloader could
30+
* be found. NULL when this hasn't been determined yet.
3031
*/
3132
private static $composerAutoloader = null;
3233

src/Files/File.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -603,13 +603,13 @@ public function cleanUp()
603603
/**
604604
* Records an error against a specific token in the file.
605605
*
606-
* @param string $error The error message.
607-
* @param int $stackPtr The stack position where the error occurred.
608-
* @param string $code A violation code unique to the sniff message.
609-
* @param array $data Replacements for the error message.
610-
* @param int $severity The severity level for this error. A value of 0
611-
* will be converted into the default severity level.
612-
* @param boolean $fixable Can the error be fixed by the sniff?
606+
* @param string $error The error message.
607+
* @param int|null $stackPtr The stack position where the error occurred.
608+
* @param string $code A violation code unique to the sniff message.
609+
* @param array $data Replacements for the error message.
610+
* @param int $severity The severity level for this error. A value of 0
611+
* will be converted into the default severity level.
612+
* @param boolean $fixable Can the error be fixed by the sniff?
613613
*
614614
* @return boolean
615615
*/
@@ -637,13 +637,13 @@ public function addError(
637637
/**
638638
* Records a warning against a specific token in the file.
639639
*
640-
* @param string $warning The error message.
641-
* @param int $stackPtr The stack position where the error occurred.
642-
* @param string $code A violation code unique to the sniff message.
643-
* @param array $data Replacements for the warning message.
644-
* @param int $severity The severity level for this warning. A value of 0
645-
* will be converted into the default severity level.
646-
* @param boolean $fixable Can the warning be fixed by the sniff?
640+
* @param string $warning The error message.
641+
* @param int|null $stackPtr The stack position where the error occurred.
642+
* @param string $code A violation code unique to the sniff message.
643+
* @param array $data Replacements for the warning message.
644+
* @param int $severity The severity level for this warning. A value of 0
645+
* will be converted into the default severity level.
646+
* @param boolean $fixable Can the warning be fixed by the sniff?
647647
*
648648
* @return boolean
649649
*/

src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function register()
4343
* @param int $stackPtr The position of the current token
4444
* in the stack passed in $tokens.
4545
*
46-
* @return void
46+
* @return int
4747
*/
4848
public function process(File $phpcsFile, $stackPtr)
4949
{

src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public function register()
5151
* @param int $stackPtr The position of the current token in
5252
* the stack passed in $tokens.
5353
*
54-
* @return void
54+
* @return int|void Integer stack pointer to skip forward or void to continue
55+
* normal file processing.
5556
*/
5657
public function process(File $phpcsFile, $stackPtr)
5758
{

src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function setCliValues($testFile, $config)
4343
*
4444
* @param string $testFile The name of the file being tested.
4545
*
46-
* @return array(int => int)
46+
* @return array<int, int>
4747
*/
4848
public function getErrorList($testFile='')
4949
{
@@ -114,7 +114,7 @@ public function getErrorList($testFile='')
114114
* The key of the array should represent the line number and the value
115115
* should represent the number of warnings that should occur on that line.
116116
*
117-
* @return array(int => int)
117+
* @return array<int, int>
118118
*/
119119
public function getWarningList()
120120
{

src/Standards/Generic/Tests/Files/OneTraitPerFileUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class OneTraitPerFileUnitTest extends AbstractSniffUnitTest
2626
* The key of the array should represent the line number and the value
2727
* should represent the number of errors that should occur on that line.
2828
*
29-
* @return array(int => int)
29+
* @return array<int, int>
3030
*/
3131
public function getErrorList()
3232
{
@@ -44,7 +44,7 @@ public function getErrorList()
4444
* The key of the array should represent the line number and the value
4545
* should represent the number of warnings that should occur on that line.
4646
*
47-
* @return array(int => int)
47+
* @return array<int, int>
4848
*/
4949
public function getWarningList()
5050
{

src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ public function register()
3939
* @param int $stackPtr The position of the current token in
4040
* the stack passed in $tokens.
4141
*
42-
* @return void
42+
* @return int|void Integer stack pointer to skip forward or void to continue
43+
* normal file processing.
4344
*/
4445
public function process(File $phpcsFile, $stackPtr)
4546
{

src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class LongConditionClosingCommentSniff implements Sniff
1818
/**
1919
* The openers that we are interested in.
2020
*
21-
* @var integer[]
21+
* @var array<int|string>
2222
*/
2323
private static $openers = [
2424
T_SWITCH,

src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ComparisonOperatorUsageSniff implements Sniff
3434
/**
3535
* A list of invalid operators with their alternatives.
3636
*
37-
* @var array<string, array<int, string>>
37+
* @var array<string, array<int|string, string>>
3838
*/
3939
private static $invalidOps = [
4040
T_IS_EQUAL => '===',

tests/Core/AbstractMethodUnitTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ public static function assertTestMarkersAreUnique(File $phpcsFile)
161161
* Note: the test delimiter comment MUST start with "/* test" to allow this function to
162162
* distinguish between comments used *in* a test and test delimiters.
163163
*
164-
* @param string $commentString The delimiter comment to look for.
165-
* @param int|string|array $tokenType The type of token(s) to look for.
166-
* @param string $tokenContent Optional. The token content for the target token.
164+
* @param string $commentString The delimiter comment to look for.
165+
* @param int|string|array<int|string> $tokenType The type of token(s) to look for.
166+
* @param string $tokenContent Optional. The token content for the target token.
167167
*
168168
* @return int
169169
*/
@@ -180,10 +180,10 @@ public function getTargetToken($commentString, $tokenType, $tokenContent=null)
180180
* Note: the test delimiter comment MUST start with "/* test" to allow this function to
181181
* distinguish between comments used *in* a test and test delimiters.
182182
*
183-
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file to find the token in.
184-
* @param string $commentString The delimiter comment to look for.
185-
* @param int|string|array $tokenType The type of token(s) to look for.
186-
* @param string $tokenContent Optional. The token content for the target token.
183+
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file to find the token in.
184+
* @param string $commentString The delimiter comment to look for.
185+
* @param int|string|array<int|string> $tokenType The type of token(s) to look for.
186+
* @param string $tokenContent Optional. The token content for the target token.
187187
*
188188
* @return int
189189
*

0 commit comments

Comments
 (0)