Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Files/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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.
*
Expand Down
4 changes: 2 additions & 2 deletions src/Files/FileList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
16 changes: 8 additions & 8 deletions src/Fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Ruleset.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Tokenizers/Tokenizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
10 changes: 5 additions & 5 deletions src/Util/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Util/Tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,8 @@ public static function tokenName($token)
* @param array<int|string> $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)
{
Expand Down
Loading