Skip to content

Commit 553ed88

Browse files
committed
Tokenizer: assign a parenthesis_owner for list() parenthesis
`list()`, just like `array()` is a language construct. While the parentheses for `array()` would receive the `array` token as the `parenthesis_owner`, the parentheses for `list()` did not. This commit fixes that inconsistency. Tested by removing the `T_LIST` token from the "additional tokens indicating that parenthesis are not arbitrary" list in the `Generic.WhiteSpace.ArbitraryParenthesesSpacing` sniff.
1 parent 8c8c4ff commit 553ed88

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

src/Standards/Generic/Sniffs/WhiteSpace/ArbitraryParenthesesSpacingSniff.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public function register()
5959

6060
$this->ignoreTokens[T_ANON_CLASS] = T_ANON_CLASS;
6161
$this->ignoreTokens[T_USE] = T_USE;
62-
$this->ignoreTokens[T_LIST] = T_LIST;
6362
$this->ignoreTokens[T_DECLARE] = T_DECLARE;
6463
$this->ignoreTokens[T_THROW] = T_THROW;
6564
$this->ignoreTokens[T_YIELD] = T_YIELD;

src/Util/Tokens.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ final class Tokens
340340
*/
341341
public static $parenthesisOpeners = [
342342
T_ARRAY => T_ARRAY,
343+
T_LIST => T_LIST,
343344
T_FUNCTION => T_FUNCTION,
344345
T_CLOSURE => T_CLOSURE,
345346
T_WHILE => T_WHILE,

0 commit comments

Comments
 (0)