diff --git a/src/Files/File.php b/src/Files/File.php index 42e1a39f9b..83b4d15728 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -2443,8 +2443,8 @@ public function findNext( /** * Returns the position of the first non-whitespace token in a statement. * - * @param int $start The position to start searching from in the token stack. - * @param int|string|array $ignore Token types that should not be considered stop points. + * @param int $start The position to start searching from in the token stack. + * @param int|string|array|null $ignore Token types that should not be considered stop points. * * @return int */ @@ -2634,8 +2634,8 @@ public function findStartOfStatement($start, $ignore=null) /** * Returns the position of the last non-whitespace token in a statement. * - * @param int $start The position to start searching from in the token stack. - * @param int|string|array $ignore Token types that should not be considered stop points. + * @param int $start The position to start searching from in the token stack. + * @param int|string|array|null $ignore Token types that should not be considered stop points. * * @return int */ @@ -2756,7 +2756,7 @@ public function findEndOfStatement($start, $ignore=null) * token stack. * @param bool $exclude If true, find the token that is NOT of * the types specified in $types. - * @param string $value The value that the token must be equal to. + * @param string|null $value The value that the token must be equal to. * If value is omitted, tokens with any value will * be returned. * diff --git a/src/Files/FileList.php b/src/Files/FileList.php index 48c86c5861..6c8b993125 100644 --- a/src/Files/FileList.php +++ b/src/Files/FileList.php @@ -110,8 +110,8 @@ public function __construct(Config $config, Ruleset $ruleset) * If a file object has already been created, it can be passed here. * If it is left NULL, it will be created when accessed. * - * @param string $path The path to the file being added. - * @param \PHP_CodeSniffer\Files\File $file The file being added. + * @param string $path The path to the file being added. + * @param \PHP_CodeSniffer\Files\File|null $file The file being added. * * @return void */ diff --git a/src/Fixer.php b/src/Fixer.php index 3e1f482a72..bbc2506ac7 100644 --- a/src/Fixer.php +++ b/src/Fixer.php @@ -222,10 +222,10 @@ public function fixFile() /** * Generates a text diff of the original file and the new content. * - * @param string $filePath Optional file path to diff the file against. - * If not specified, the original version of the - * file will be used. - * @param boolean $colors Print coloured output or not. + * @param string|null $filePath Optional file path to diff the file against. + * If not specified, the original version of the + * file will be used. + * @param boolean $colors Print coloured output or not. * * @return string * @@ -698,10 +698,10 @@ public function revertToken($stackPtr) /** * Replace the content of a token with a part of its current content. * - * @param int $stackPtr The position of the token in the token stack. - * @param int $start The first character to keep. - * @param int $length The number of characters to keep. If NULL, the content of - * the token from $start to the end of the content is kept. + * @param int $stackPtr The position of the token in the token stack. + * @param int $start The first character to keep. + * @param int|null $length The number of characters to keep. If NULL, the content of + * the token from $start to the end of the content is kept. * * @return bool If the change was accepted. */ diff --git a/src/Ruleset.php b/src/Ruleset.php index 7614998171..6118c778c9 100644 --- a/src/Ruleset.php +++ b/src/Ruleset.php @@ -1698,8 +1698,8 @@ public function setSniffProperty($sniffClass, $name, $settings) * Optionally takes a listener to get ignore patterns specified * for that sniff only. * - * @param string $listener The listener to get patterns for. If NULL, all - * patterns are returned. + * @param string|null $listener The listener to get patterns for. If NULL, all + * patterns are returned. * * @return array */ @@ -1724,8 +1724,8 @@ public function getIgnorePatterns($listener=null) * Optionally takes a listener to get include patterns specified * for that sniff only. * - * @param string $listener The listener to get patterns for. If NULL, all - * patterns are returned. + * @param string|null $listener The listener to get patterns for. If NULL, all + * patterns are returned. * * @return array */ diff --git a/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php b/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php index 8916659a9a..2e128adc69 100644 --- a/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php +++ b/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php @@ -92,7 +92,7 @@ public function process(File $phpcsFile, $stackPtr) * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. * @param int $stackPtr The position of the current token * in the stack passed in $tokens. - * @param int $end The token where checking should end. + * @param int|null $end The token where checking should end. * If NULL, the entire file will be checked. * * @return int diff --git a/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php b/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php index 44efd53afd..fe2ceb32e0 100644 --- a/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php +++ b/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php @@ -53,7 +53,7 @@ public function __construct() * @param int $stackPtr The position of the forbidden function * in the token array. * @param string $function The name of the forbidden function. - * @param string $pattern The pattern used for the match. + * @param string|null $pattern The pattern used for the match. * * @return void */ diff --git a/src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php b/src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php index 2137e5a52d..ab6c97dfe3 100644 --- a/src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php +++ b/src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php @@ -206,7 +206,7 @@ public function process(File $phpcsFile, $stackPtr) * @param int $stackPtr The position of the forbidden function * in the token array. * @param string $function The name of the forbidden function. - * @param string $pattern The pattern used for the match. + * @param string|null $pattern The pattern used for the match. * * @return void */ diff --git a/src/Tokenizers/Tokenizer.php b/src/Tokenizers/Tokenizer.php index fe3d05e83f..af7c110e61 100644 --- a/src/Tokenizers/Tokenizer.php +++ b/src/Tokenizers/Tokenizer.php @@ -579,10 +579,10 @@ private function createPositionMap() * is placed into an orig_content index and the new token length is also * set in the length index. * - * @param array $token The token to replace tabs inside. - * @param string $prefix The character to use to represent the start of a tab. - * @param string $padding The character to use to represent the end of a tab. - * @param int $tabWidth The number of spaces each tab represents. + * @param array $token The token to replace tabs inside. + * @param string $prefix The character to use to represent the start of a tab. + * @param string $padding The character to use to represent the end of a tab. + * @param int|null $tabWidth The number of spaces each tab represents. * * @return void */ diff --git a/src/Util/Cache.php b/src/Util/Cache.php index e0ee9c8b4b..b132018fa0 100644 --- a/src/Util/Cache.php +++ b/src/Util/Cache.php @@ -300,8 +300,8 @@ public static function save() /** * Retrieves a single entry from the cache. * - * @param string $key The key of the data to get. If NULL, - * everything in the cache is returned. + * @param string|null $key The key of the data to get. If NULL, + * everything in the cache is returned. * * @return mixed */ @@ -323,9 +323,9 @@ public static function get($key=null) /** * Retrieves a single entry from the cache. * - * @param string $key The key of the data to set. If NULL, - * sets the entire cache. - * @param mixed $value The value to set. + * @param string|null $key The key of the data to set. If NULL, + * sets the entire cache. + * @param mixed $value The value to set. * * @return void */ diff --git a/src/Util/Tokens.php b/src/Util/Tokens.php index 525b5b6329..081b6ab11b 100644 --- a/src/Util/Tokens.php +++ b/src/Util/Tokens.php @@ -804,8 +804,8 @@ public static function tokenName($token) * @param array $tokens The token types to get the highest weighted * type for. * - * @return int The highest weighted token. - * On equal "weight", returns the first token of that particular weight. + * @return int|string The highest weighted token. + * On equal "weight", returns the first token of that particular weight. */ public static function getHighestWeightedToken(array $tokens) {