Skip to content

Commit

Permalink
Merge branch 'feature/generic-spreadoperatorspacingafter-ignore-first…
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Dec 18, 2022
2 parents e26cc50 + dc61947 commit 1e1b942
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ public function process(File $phpcsFile, $stackPtr)
return;
}

if ($tokens[$nextNonEmpty]['code'] === T_CLOSE_PARENTHESIS) {
// Ignore PHP 8.1 first class callable syntax.
return;
}

if ($this->ignoreNewlines === true
&& $tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line']
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ function bar( & ... $spread ) {
);
}

// Ignore PHP 8.1 first class callable declarations.
$map = array_map(strtolower(...), $map);

// phpcs:set Generic.WhiteSpace.SpreadOperatorSpacingAfter spacing 0

// Ignore PHP 8.1 first class callable declarations.
$map = array_map(strtolower( ... ), $map);

// Intentional parse error. This has to be the last test in the file.
function bar( ...
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ function bar( & ... $spread ) {
);
}

// Ignore PHP 8.1 first class callable declarations.
$map = array_map(strtolower(...), $map);

// phpcs:set Generic.WhiteSpace.SpreadOperatorSpacingAfter spacing 0

// Ignore PHP 8.1 first class callable declarations.
$map = array_map(strtolower( ... ), $map);

// Intentional parse error. This has to be the last test in the file.
function bar( ...

0 comments on commit 1e1b942

Please sign in to comment.