Skip to content

Commit c93f5bb

Browse files
committed
LongTypeHintsSniff: Fixer should be case insensitive
1 parent 98fa7a3 commit c93f5bb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

SlevomatCodingStandard/Sniffs/TypeHints/LongTypeHintsSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function process(\PHP_CodeSniffer\Files\File $phpcsFile, $pointer): void
9090

9191
$docComment = TokenHelper::getContent($phpcsFile, $docCommentOpenPointer, $docCommentClosePointer);
9292

93-
$fixedDocComment = preg_replace_callback('~((?:@(?:var|param|return)\\s+)|\|)' . preg_quote($type, '~') . '(?=\\s|\||\[)~', function (array $matches) use ($suggestType): string {
93+
$fixedDocComment = preg_replace_callback('~((?:@(?:var|param|return)\\s+)|\|)' . preg_quote($type, '~') . '(?=\\s|\||\[)~i', function (array $matches) use ($suggestType): string {
9494
return $matches[1] . $suggestType;
9595
}, $docComment);
9696

tests/Sniffs/TypeHints/data/longTypeHintsErrors.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ class Foo
3232
public $array;
3333

3434
/**
35-
* @param boolean|null $a
35+
* @param Boolean|null $a
3636
* @param null|boolean
37-
* @param integer|bool $c
37+
* @param Integer|bool $c
3838
* @return integer|null
3939
*/
4040
public function doSomething($a, $b, $c)

0 commit comments

Comments
 (0)