Skip to content

Commit

Permalink
fix: Formatting\ReturnTypeSniff to use new type of token for parenthe…
Browse files Browse the repository at this point in the history
  • Loading branch information
michalbundyra authored Oct 15, 2024
1 parent 341543c commit 55366d0
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 21 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"require": {
"php": "^7.3 || ^8.0",
"squizlabs/php_codesniffer": "^3.7.2"
"squizlabs/php_codesniffer": "^3.10.3"
},
"require-dev": {
"phpunit/phpunit": "^9.6.15"
Expand Down
58 changes: 43 additions & 15 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@
use const T_NULL;
use const T_NULLABLE;
use const T_OPEN_CURLY_BRACKET;
use const T_OPEN_PARENTHESIS;
use const T_PARENT;
use const T_SELF;
use const T_SEMICOLON;
use const T_STRING;
use const T_TRUE;
use const T_TYPE_CLOSE_PARENTHESIS;
use const T_TYPE_INTERSECTION;
use const T_TYPE_OPEN_PARENTHESIS;
use const T_TYPE_UNION;
use const T_USE;
use const T_WHITESPACE;
Expand Down Expand Up @@ -116,8 +117,8 @@ public function process(File $phpcsFile, $stackPtr)
T_TYPE_UNION,
T_PARENT,
T_WHITESPACE,
T_OPEN_PARENTHESIS,
T_CLOSE_PARENTHESIS,
T_TYPE_OPEN_PARENTHESIS,
T_TYPE_CLOSE_PARENTHESIS,
],
$parenthesisCloser + 1,
$eol,
Expand Down Expand Up @@ -150,8 +151,8 @@ public function process(File $phpcsFile, $stackPtr)
}

$notTypes = [
T_OPEN_PARENTHESIS,
T_CLOSE_PARENTHESIS,
T_TYPE_OPEN_PARENTHESIS,
T_TYPE_CLOSE_PARENTHESIS,
T_BITWISE_AND,
T_BITWISE_OR,
T_TYPE_INTERSECTION,
Expand Down

0 comments on commit 55366d0

Please sign in to comment.