Skip to content

Commit 1aca784

Browse files
committed
Merge branch 'master' into 4.x
2 parents eb64bc1 + 91986ec commit 1aca784

File tree

10 files changed

+33
-33
lines changed

10 files changed

+33
-33
lines changed

src/Files/File.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,8 +2438,8 @@ public function findNext(
24382438
/**
24392439
* Returns the position of the first non-whitespace token in a statement.
24402440
*
2441-
* @param int $start The position to start searching from in the token stack.
2442-
* @param int|string|array $ignore Token types that should not be considered stop points.
2441+
* @param int $start The position to start searching from in the token stack.
2442+
* @param int|string|array|null $ignore Token types that should not be considered stop points.
24432443
*
24442444
* @return int
24452445
*/
@@ -2629,8 +2629,8 @@ public function findStartOfStatement($start, $ignore=null)
26292629
/**
26302630
* Returns the position of the last non-whitespace token in a statement.
26312631
*
2632-
* @param int $start The position to start searching from in the token stack.
2633-
* @param int|string|array $ignore Token types that should not be considered stop points.
2632+
* @param int $start The position to start searching from in the token stack.
2633+
* @param int|string|array|null $ignore Token types that should not be considered stop points.
26342634
*
26352635
* @return int
26362636
*/
@@ -2751,7 +2751,7 @@ public function findEndOfStatement($start, $ignore=null)
27512751
* token stack.
27522752
* @param bool $exclude If true, find the token that is NOT of
27532753
* the types specified in $types.
2754-
* @param string $value The value that the token must be equal to.
2754+
* @param string|null $value The value that the token must be equal to.
27552755
* If value is omitted, tokens with any value will
27562756
* be returned.
27572757
*

src/Files/FileList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ public function __construct(Config $config, Ruleset $ruleset)
112112
* If a file object has already been created, it can be passed here.
113113
* If it is left NULL, it will be created when accessed.
114114
*
115-
* @param string $path The path to the file being added.
116-
* @param \PHP_CodeSniffer\Files\File $file The file being added.
115+
* @param string $path The path to the file being added.
116+
* @param \PHP_CodeSniffer\Files\File|null $file The file being added.
117117
*
118118
* @return void
119119
*/

src/Fixer.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ public function fixFile()
226226
/**
227227
* Generates a text diff of the original file and the new content.
228228
*
229-
* @param string $filePath Optional file path to diff the file against.
230-
* If not specified, the original version of the
231-
* file will be used.
232-
* @param boolean $colors Print coloured output or not.
229+
* @param string|null $filePath Optional file path to diff the file against.
230+
* If not specified, the original version of the
231+
* file will be used.
232+
* @param boolean $colors Print coloured output or not.
233233
*
234234
* @return string
235235
*
@@ -682,10 +682,10 @@ public function revertToken($stackPtr)
682682
/**
683683
* Replace the content of a token with a part of its current content.
684684
*
685-
* @param int $stackPtr The position of the token in the token stack.
686-
* @param int $start The first character to keep.
687-
* @param int $length The number of characters to keep. If NULL, the content of
688-
* the token from $start to the end of the content is kept.
685+
* @param int $stackPtr The position of the token in the token stack.
686+
* @param int $start The first character to keep.
687+
* @param int|null $length The number of characters to keep. If NULL, the content of
688+
* the token from $start to the end of the content is kept.
689689
*
690690
* @return bool If the change was accepted.
691691
*/

src/Ruleset.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,8 +1732,8 @@ private function getRealPropertyValue($value)
17321732
* Optionally takes a listener to get ignore patterns specified
17331733
* for that sniff only.
17341734
*
1735-
* @param string $listener The listener to get patterns for. If NULL, all
1736-
* patterns are returned.
1735+
* @param string|null $listener The listener to get patterns for. If NULL, all
1736+
* patterns are returned.
17371737
*
17381738
* @return array
17391739
*/
@@ -1758,8 +1758,8 @@ public function getIgnorePatterns($listener=null)
17581758
* Optionally takes a listener to get include patterns specified
17591759
* for that sniff only.
17601760
*
1761-
* @param string $listener The listener to get patterns for. If NULL, all
1762-
* patterns are returned.
1761+
* @param string|null $listener The listener to get patterns for. If NULL, all
1762+
* patterns are returned.
17631763
*
17641764
* @return array
17651765
*/

src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function process(File $phpcsFile, $stackPtr)
7575
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
7676
* @param int $stackPtr The position of the current token
7777
* in the stack passed in $tokens.
78-
* @param int $end The token where checking should end.
78+
* @param int|null $end The token where checking should end.
7979
* If NULL, the entire file will be checked.
8080
*
8181
* @return int

src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __construct()
5353
* @param int $stackPtr The position of the forbidden function
5454
* in the token array.
5555
* @param string $functionName The name of the forbidden function.
56-
* @param string $pattern The pattern used for the match.
56+
* @param string|null $pattern The pattern used for the match.
5757
*
5858
* @return void
5959
*/

src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public function process(File $phpcsFile, $stackPtr)
206206
* @param int $stackPtr The position of the forbidden function
207207
* in the token array.
208208
* @param string $functionName The name of the forbidden function.
209-
* @param string $pattern The pattern used for the match.
209+
* @param string|null $pattern The pattern used for the match.
210210
*
211211
* @return void
212212
*/

src/Tokenizers/Tokenizer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,10 @@ private function createPositionMap()
493493
* is placed into an orig_content index and the new token length is also
494494
* set in the length index.
495495
*
496-
* @param array $token The token to replace tabs inside.
497-
* @param string $prefix The character to use to represent the start of a tab.
498-
* @param string $padding The character to use to represent the end of a tab.
499-
* @param int $tabWidth The number of spaces each tab represents.
496+
* @param array $token The token to replace tabs inside.
497+
* @param string $prefix The character to use to represent the start of a tab.
498+
* @param string $padding The character to use to represent the end of a tab.
499+
* @param int|null $tabWidth The number of spaces each tab represents.
500500
*
501501
* @return void
502502
*/

src/Util/Cache.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,8 @@ public static function save()
302302
/**
303303
* Retrieves a single entry from the cache.
304304
*
305-
* @param string $key The key of the data to get. If NULL,
306-
* everything in the cache is returned.
305+
* @param string|null $key The key of the data to get. If NULL,
306+
* everything in the cache is returned.
307307
*
308308
* @return mixed
309309
*/
@@ -325,9 +325,9 @@ public static function get($key=null)
325325
/**
326326
* Retrieves a single entry from the cache.
327327
*
328-
* @param string $key The key of the data to set. If NULL,
329-
* sets the entire cache.
330-
* @param mixed $value The value to set.
328+
* @param string|null $key The key of the data to set. If NULL,
329+
* sets the entire cache.
330+
* @param mixed $value The value to set.
331331
*
332332
* @return void
333333
*/

src/Util/Tokens.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,8 @@ public static function tokenName($token)
960960
* @param array<int|string> $tokens The token types to get the highest weighted
961961
* type for.
962962
*
963-
* @return int The highest weighted token.
964-
* On equal "weight", returns the first token of that particular weight.
963+
* @return int|string The highest weighted token.
964+
* On equal "weight", returns the first token of that particular weight.
965965
*/
966966
public static function getHighestWeightedToken(array $tokens)
967967
{

0 commit comments

Comments
 (0)