diff --git a/autoload.php b/autoload.php index 6221401e6b..c295b2ea75 100644 --- a/autoload.php +++ b/autoload.php @@ -26,7 +26,8 @@ class Autoload /** * The composer autoloader. * - * @var \Composer\Autoload\ClassLoader + * @var \Composer\Autoload\ClassLoader|false|null The autoloader object or FALSE if no Composer autoloader could + * be found. NULL when this hasn't been determined yet. */ private static $composerAutoloader = null; diff --git a/src/Files/File.php b/src/Files/File.php index 6b8379d1ac..f5224948ab 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -656,13 +656,13 @@ public function cleanUp() /** * Records an error against a specific token in the file. * - * @param string $error The error message. - * @param int $stackPtr The stack position where the error occurred. - * @param string $code A violation code unique to the sniff message. - * @param array $data Replacements for the error message. - * @param int $severity The severity level for this error. A value of 0 - * will be converted into the default severity level. - * @param boolean $fixable Can the error be fixed by the sniff? + * @param string $error The error message. + * @param int|null $stackPtr The stack position where the error occurred. + * @param string $code A violation code unique to the sniff message. + * @param array $data Replacements for the error message. + * @param int $severity The severity level for this error. A value of 0 + * will be converted into the default severity level. + * @param boolean $fixable Can the error be fixed by the sniff? * * @return boolean */ @@ -690,13 +690,13 @@ public function addError( /** * Records a warning against a specific token in the file. * - * @param string $warning The error message. - * @param int $stackPtr The stack position where the error occurred. - * @param string $code A violation code unique to the sniff message. - * @param array $data Replacements for the warning message. - * @param int $severity The severity level for this warning. A value of 0 - * will be converted into the default severity level. - * @param boolean $fixable Can the warning be fixed by the sniff? + * @param string $warning The error message. + * @param int|null $stackPtr The stack position where the error occurred. + * @param string $code A violation code unique to the sniff message. + * @param array $data Replacements for the warning message. + * @param int $severity The severity level for this warning. A value of 0 + * will be converted into the default severity level. + * @param boolean $fixable Can the warning be fixed by the sniff? * * @return boolean */ diff --git a/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php b/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php index ca1ed09991..dd0454797d 100644 --- a/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php +++ b/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php @@ -43,7 +43,7 @@ public function register() * @param int $stackPtr The position of the current token * in the stack passed in $tokens. * - * @return void + * @return int */ public function process(File $phpcsFile, $stackPtr) { diff --git a/src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php b/src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php index 6cb5f92f0f..42f2f35af8 100644 --- a/src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php +++ b/src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php @@ -51,7 +51,8 @@ public function register() * @param int $stackPtr The position of the current token in * the stack passed in $tokens. * - * @return void + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. */ public function process(File $phpcsFile, $stackPtr) { diff --git a/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.php b/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.php index 78fdf44bc1..e447833d4d 100644 --- a/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.php +++ b/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.php @@ -43,7 +43,7 @@ public function setCliValues($testFile, $config) * * @param string $testFile The name of the file being tested. * - * @return array(int => int) + * @return array */ public function getErrorList($testFile='') { @@ -115,7 +115,7 @@ public function getErrorList($testFile='') * The key of the array should represent the line number and the value * should represent the number of warnings that should occur on that line. * - * @return array(int => int) + * @return array */ public function getWarningList() { diff --git a/src/Standards/Generic/Tests/Files/OneTraitPerFileUnitTest.php b/src/Standards/Generic/Tests/Files/OneTraitPerFileUnitTest.php index 38f50a47c8..ab95b5868f 100644 --- a/src/Standards/Generic/Tests/Files/OneTraitPerFileUnitTest.php +++ b/src/Standards/Generic/Tests/Files/OneTraitPerFileUnitTest.php @@ -26,7 +26,7 @@ final class OneTraitPerFileUnitTest extends AbstractSniffUnitTest * The key of the array should represent the line number and the value * should represent the number of errors that should occur on that line. * - * @return array(int => int) + * @return array */ public function getErrorList() { @@ -44,7 +44,7 @@ public function getErrorList() * The key of the array should represent the line number and the value * should represent the number of warnings that should occur on that line. * - * @return array(int => int) + * @return array */ public function getWarningList() { diff --git a/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php b/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php index a5e53ac1ba..346534ba4b 100644 --- a/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php +++ b/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php @@ -39,7 +39,8 @@ public function register() * @param int $stackPtr The position of the current token in * the stack passed in $tokens. * - * @return void + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. */ public function process(File $phpcsFile, $stackPtr) { diff --git a/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php b/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php index 7c06e42942..9ae49096f8 100644 --- a/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php +++ b/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php @@ -28,7 +28,7 @@ class LongConditionClosingCommentSniff implements Sniff /** * The openers that we are interested in. * - * @var integer[] + * @var array */ private static $openers = [ T_SWITCH, diff --git a/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php b/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php index e9b41d691c..425cedb150 100644 --- a/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php +++ b/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php @@ -44,7 +44,7 @@ class ComparisonOperatorUsageSniff implements Sniff /** * A list of invalid operators with their alternatives. * - * @var array> + * @var array> */ private static $invalidOps = [ 'PHP' => [ diff --git a/tests/Core/AbstractMethodUnitTest.php b/tests/Core/AbstractMethodUnitTest.php index 4526a9dca9..3418be498f 100644 --- a/tests/Core/AbstractMethodUnitTest.php +++ b/tests/Core/AbstractMethodUnitTest.php @@ -164,9 +164,9 @@ public static function assertTestMarkersAreUnique(File $phpcsFile) * Note: the test delimiter comment MUST start with "/* test" to allow this function to * distinguish between comments used *in* a test and test delimiters. * - * @param string $commentString The delimiter comment to look for. - * @param int|string|array $tokenType The type of token(s) to look for. - * @param string $tokenContent Optional. The token content for the target token. + * @param string $commentString The delimiter comment to look for. + * @param int|string|array $tokenType The type of token(s) to look for. + * @param string $tokenContent Optional. The token content for the target token. * * @return int */ @@ -183,10 +183,10 @@ public function getTargetToken($commentString, $tokenType, $tokenContent=null) * Note: the test delimiter comment MUST start with "/* test" to allow this function to * distinguish between comments used *in* a test and test delimiters. * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file to find the token in. - * @param string $commentString The delimiter comment to look for. - * @param int|string|array $tokenType The type of token(s) to look for. - * @param string $tokenContent Optional. The token content for the target token. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file to find the token in. + * @param string $commentString The delimiter comment to look for. + * @param int|string|array $tokenType The type of token(s) to look for. + * @param string $tokenContent Optional. The token content for the target token. * * @return int * diff --git a/tests/Core/Config/ExtensionsArgTest.php b/tests/Core/Config/ExtensionsArgTest.php index aa5fb6b810..e63b1fef9c 100644 --- a/tests/Core/Config/ExtensionsArgTest.php +++ b/tests/Core/Config/ExtensionsArgTest.php @@ -44,7 +44,7 @@ public function testValidExtensions($passedValue, $expected) * * @see self::testValidExtensions() * - * @return array> + * @return array>> */ public static function dataValidExtensions() { diff --git a/tests/Core/Config/GeneratorArgTest.php b/tests/Core/Config/GeneratorArgTest.php index f0fffd033f..5def5f68f8 100644 --- a/tests/Core/Config/GeneratorArgTest.php +++ b/tests/Core/Config/GeneratorArgTest.php @@ -44,7 +44,7 @@ public function testValidGenerators($argumentValue, $expectedPropertyValue) * * @see self::testValidGenerators() * - * @return array> + * @return array> */ public static function dataValidGeneratorNames() { @@ -131,7 +131,7 @@ public function testInvalidGenerator($generatorName) * * @see self::testInvalidGenerator() * - * @return array> + * @return array> */ public static function dataInvalidGeneratorNames() { diff --git a/tests/Core/File/FindImplementedInterfaceNamesTest.php b/tests/Core/File/FindImplementedInterfaceNamesTest.php index ffb59300a7..c0540301b0 100644 --- a/tests/Core/File/FindImplementedInterfaceNamesTest.php +++ b/tests/Core/File/FindImplementedInterfaceNamesTest.php @@ -71,7 +71,7 @@ public function testFindImplementedInterfaceNames($identifier, $expected) * * @see testFindImplementedInterfaceNames() * - * @return array>> + * @return array|false>> */ public static function dataImplementedInterface() { diff --git a/tests/Core/Filters/AbstractFilterTestCase.php b/tests/Core/Filters/AbstractFilterTestCase.php index 4277f8c6ed..3627d4aa2b 100644 --- a/tests/Core/Filters/AbstractFilterTestCase.php +++ b/tests/Core/Filters/AbstractFilterTestCase.php @@ -223,10 +223,10 @@ protected static function getFakeFileList() * These type of tests should be able to run and pass on both *nix as well as Windows * based dev systems. This method is a helper to allow for this. * - * @param array $paths A single or multi-dimensional array containing - * file paths. + * @param array> $paths A single or multi-dimensional array containing + * file paths. * - * @return array + * @return array> */ protected static function mapPathsToRuntimeOs(array $paths) { diff --git a/tests/Core/Filters/GitStagedTest.php b/tests/Core/Filters/GitStagedTest.php index 5df3e5a1b5..ce64794fb7 100644 --- a/tests/Core/Filters/GitStagedTest.php +++ b/tests/Core/Filters/GitStagedTest.php @@ -240,7 +240,7 @@ public function testExecAlwaysReturnsArray($cmd, $expected) * JRF: I've not managed to find a command which does so, let alone one, which then * doesn't have side-effects of uncatchable output while running the tests.} * - * @return array>> + * @return array>> */ public static function dataExecAlwaysReturnsArray() { diff --git a/tests/Core/Ruleset/DisplayCachedMessagesTest.php b/tests/Core/Ruleset/DisplayCachedMessagesTest.php index b8ac52af61..446bbfbcf6 100644 --- a/tests/Core/Ruleset/DisplayCachedMessagesTest.php +++ b/tests/Core/Ruleset/DisplayCachedMessagesTest.php @@ -136,7 +136,7 @@ public function testNonBlockingErrorsGenerateOutput($messages, $expected) * * @see testNonBlockingErrorsGenerateOutput() * - * @return array>> + * @return array>> */ public static function dataNonBlockingErrorsGenerateOutput() { diff --git a/tests/Core/Ruleset/ProcessRulesetTest.php b/tests/Core/Ruleset/ProcessRulesetTest.php index c18173b476..fa704bef51 100644 --- a/tests/Core/Ruleset/ProcessRulesetTest.php +++ b/tests/Core/Ruleset/ProcessRulesetTest.php @@ -243,7 +243,7 @@ public function testRuleExcludeWithoutNameIsIgnored() /** * Test Helper. * - * @return \PHP_CodeSniffer\Sniffs\Sniff + * @return \PHP_CodeSniffer\Ruleset */ private function getMiscRuleset() { diff --git a/tests/Core/Sniffs/AbstractArraySniffTest.php b/tests/Core/Sniffs/AbstractArraySniffTest.php index f074d9500f..993603a53b 100644 --- a/tests/Core/Sniffs/AbstractArraySniffTest.php +++ b/tests/Core/Sniffs/AbstractArraySniffTest.php @@ -25,7 +25,7 @@ final class AbstractArraySniffTest extends AbstractMethodUnitTest * This extends the \PHP_CodeSniffer\Sniffs\AbstractArraySniff class to make the * internal workings of the sniff observable. * - * @var \PHP_CodeSniffer\Sniffs\AbstractArraySniffTestable + * @var \PHP_CodeSniffer\Tests\Core\Sniffs\AbstractArraySniffTestable */ protected static $sniff; diff --git a/tests/Core/Tokenizers/AbstractTokenizerTestCase.php b/tests/Core/Tokenizers/AbstractTokenizerTestCase.php index aa67aaf679..f3daf2bf21 100644 --- a/tests/Core/Tokenizers/AbstractTokenizerTestCase.php +++ b/tests/Core/Tokenizers/AbstractTokenizerTestCase.php @@ -113,9 +113,9 @@ public function testTestMarkersAreUnique() * Note: the test delimiter comment MUST start with "/* test" to allow this function to * distinguish between comments used *in* a test and test delimiters. * - * @param string $commentString The delimiter comment to look for. - * @param int|string|array $tokenType The type of token(s) to look for. - * @param string $tokenContent Optional. The token content for the target token. + * @param string $commentString The delimiter comment to look for. + * @param int|string|array $tokenType The type of token(s) to look for. + * @param string $tokenContent Optional. The token content for the target token. * * @return int */ diff --git a/tests/Core/Tokenizers/PHP/BackfillMatchTokenTest.php b/tests/Core/Tokenizers/PHP/BackfillMatchTokenTest.php index ca6d27b3db..8214ea1a91 100644 --- a/tests/Core/Tokenizers/PHP/BackfillMatchTokenTest.php +++ b/tests/Core/Tokenizers/PHP/BackfillMatchTokenTest.php @@ -462,16 +462,16 @@ public static function dataSwitchCaseVersusMatch() * Helper function to verify that all scope related array indexes for a control structure * are set correctly. * - * @param string $token The control structure token to check. - * @param int $openerOffset The expected offset of the scope opener in relation to - * the control structure token. - * @param int $closerOffset The expected offset of the scope closer in relation to - * the control structure token. - * @param bool $skipScopeCloserCheck Whether to skip the scope closer check. - * This should be set to "true" when testing nested arrow functions, - * where the "inner" arrow function shares a scope closer with the - * "outer" arrow function, as the 'scope_condition' for the scope closer - * of the "inner" arrow function will point to the "outer" arrow function. + * @param int $token The control structure token to check. + * @param int $openerOffset The expected offset of the scope opener in relation to + * the control structure token. + * @param int $closerOffset The expected offset of the scope closer in relation to + * the control structure token. + * @param bool $skipScopeCloserCheck Whether to skip the scope closer check. + * This should be set to "true" when testing nested arrow functions, + * where the "inner" arrow function shares a scope closer with the + * "outer" arrow function, as the 'scope_condition' for the scope closer + * of the "inner" arrow function will point to the "outer" arrow function. * * @return void */ diff --git a/tests/Core/Tokenizers/PHP/ContextSensitiveKeywordsTest.php b/tests/Core/Tokenizers/PHP/ContextSensitiveKeywordsTest.php index 103e5ec916..a8d746ae9f 100644 --- a/tests/Core/Tokenizers/PHP/ContextSensitiveKeywordsTest.php +++ b/tests/Core/Tokenizers/PHP/ContextSensitiveKeywordsTest.php @@ -178,7 +178,7 @@ public function testKeywords($testMarker, $expectedTokenType) * * @see testKeywords() * - * @return array + * @return array> */ public static function dataKeywords() { diff --git a/tests/Core/Tokenizers/PHP/DNFTypesParseError1Test.php b/tests/Core/Tokenizers/PHP/DNFTypesParseError1Test.php index 9ceefc4a5f..3366280997 100644 --- a/tests/Core/Tokenizers/PHP/DNFTypesParseError1Test.php +++ b/tests/Core/Tokenizers/PHP/DNFTypesParseError1Test.php @@ -52,7 +52,7 @@ public function testBrokenDNFTypeCantEndOnOpenParenthesis($testMarker) * * @see testBrokenDNFTypeCantEndOnOpenParenthesis() * - * @return array> + * @return array> */ public static function dataBrokenDNFTypeCantEndOnOpenParenthesis() { diff --git a/tests/Core/Tokenizers/PHP/DNFTypesParseError2Test.php b/tests/Core/Tokenizers/PHP/DNFTypesParseError2Test.php index 163215e465..999584ac73 100644 --- a/tests/Core/Tokenizers/PHP/DNFTypesParseError2Test.php +++ b/tests/Core/Tokenizers/PHP/DNFTypesParseError2Test.php @@ -61,7 +61,7 @@ public function testBrokenDNFTypeParensShouldAlwaysBeAPairMissingCloseParens($te * * @see testBrokenDNFTypeParensShouldAlwaysBeAPairMissingCloseParens() * - * @return array> + * @return array> */ public static function dataBrokenDNFTypeParensShouldAlwaysBeAPairMissingCloseParens() { @@ -120,7 +120,7 @@ public function testBrokenDNFTypeParensShouldAlwaysBeAPairMissingOpenParens($tes * * @see testBrokenDNFTypeParensShouldAlwaysBeAPairMissingOpenParens() * - * @return array> + * @return array> */ public static function dataBrokenDNFTypeParensShouldAlwaysBeAPairMissingOpenParens() { @@ -201,7 +201,7 @@ public function testBrokenDNFTypeParensShouldAlwaysBeAPairMatchedAndUnmatched($t * * @see testBrokenDNFTypeParensShouldAlwaysBeAPairMatchedAndUnmatched() * - * @return array> + * @return array> */ public static function dataBrokenDNFTypeParensShouldAlwaysBeAPairMatchedAndUnmatched() { diff --git a/tests/Core/Tokenizers/PHP/DNFTypesTest.php b/tests/Core/Tokenizers/PHP/DNFTypesTest.php index e72dd41596..4d80c4c5a7 100644 --- a/tests/Core/Tokenizers/PHP/DNFTypesTest.php +++ b/tests/Core/Tokenizers/PHP/DNFTypesTest.php @@ -98,7 +98,7 @@ public function testNormalParentheses($testMarker, $skipCheckInside=false) * * @see testNormalParentheses() * - * @return array> + * @return array> */ public static function dataNormalParentheses() { diff --git a/tests/Core/Tokenizers/PHP/OtherContextSensitiveKeywordsTest.php b/tests/Core/Tokenizers/PHP/OtherContextSensitiveKeywordsTest.php index b1a15bcb50..35c8997148 100644 --- a/tests/Core/Tokenizers/PHP/OtherContextSensitiveKeywordsTest.php +++ b/tests/Core/Tokenizers/PHP/OtherContextSensitiveKeywordsTest.php @@ -134,7 +134,7 @@ public function testKeywords($testMarker, $expectedTokenType) * * @see testKeywords() * - * @return array + * @return array> */ public static function dataKeywords() { diff --git a/tests/Core/Tokenizers/PHP/TypedConstantsTest.php b/tests/Core/Tokenizers/PHP/TypedConstantsTest.php index 29a1fc7ad4..6968c4ef8c 100644 --- a/tests/Core/Tokenizers/PHP/TypedConstantsTest.php +++ b/tests/Core/Tokenizers/PHP/TypedConstantsTest.php @@ -271,7 +271,7 @@ public static function dataTypedConstant() * * @see testTypedConstant() * - * @return array> + * @return array>> */ public static function dataNullableTypedConstant() { @@ -386,7 +386,7 @@ public static function dataNullableTypedConstant() * * @see testTypedConstant() * - * @return array> + * @return array>> */ public static function dataUnionTypedConstant() { @@ -475,7 +475,7 @@ public static function dataUnionTypedConstant() * * @see testTypedConstant() * - * @return array> + * @return array>> */ public static function dataIntersectionTypedConstant() { @@ -520,7 +520,7 @@ public static function dataIntersectionTypedConstant() * * @see testTypedConstant() * - * @return array> + * @return array>> */ public static function dataDNFTypedConstant() { diff --git a/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapSwitchTokenScopeTest.php b/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapSwitchTokenScopeTest.php index f48b32401a..dd6634ace4 100644 --- a/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapSwitchTokenScopeTest.php +++ b/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapSwitchTokenScopeTest.php @@ -92,7 +92,7 @@ public function testSwitchScope($testMarker, $expectedTokens, $testOpenerMarker= * * @see testSwitchScope() * - * @return array>> + * @return array|null>> */ public static function dataSwitchScope() { diff --git a/tests/Core/Util/Common/GetSniffCodeTest.php b/tests/Core/Util/Common/GetSniffCodeTest.php index 79bc611e99..444ea5eb0d 100644 --- a/tests/Core/Util/Common/GetSniffCodeTest.php +++ b/tests/Core/Util/Common/GetSniffCodeTest.php @@ -24,7 +24,7 @@ final class GetSniffCodeTest extends TestCase /** * Test receiving an expected exception when the $sniffClass parameter is not passed a string value or is passed an empty string. * - * @param string $input NOT a fully qualified sniff class name. + * @param mixed $input NOT a fully qualified sniff class name. * * @dataProvider dataGetSniffCodeThrowsExceptionOnInvalidInput * @@ -54,7 +54,7 @@ public function testGetSniffCodeThrowsExceptionOnInvalidInput($input) * * @see testGetSniffCodeThrowsExceptionOnInvalidInput() * - * @return array> + * @return array> */ public static function dataGetSniffCodeThrowsExceptionOnInvalidInput() {