JS::$scopeOpeners
A list of tokens that are allowed to open a scope.
This array also contains information about what kind of token the scope opener uses to open and close the scope, if the token strictly requires an opener, if the token can share a scope closer, and who it can be shared with. An example of a token that shares a scope closer is a CASE scope.
Type: array
Overrides Tokenizer::$scopeOpeners
File
-
vendor/
squizlabs/ php_codesniffer/ src/ Tokenizers/ JS.php, line 29
Class
Namespace
PHP_CodeSniffer\TokenizersCode
public $scopeOpeners = [
T_IF => [
'start' => [
T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
],
'end' => [
T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
],
'strict' => false,
'shared' => false,
'with' => [],
],
T_TRY => [
'start' => [
T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
],
'end' => [
T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
],
'strict' => true,
'shared' => false,
'with' => [],
],
T_CATCH => [
'start' => [
T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
],
'end' => [
T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
],
'strict' => true,
'shared' => false,
'with' => [],
],
T_ELSE => [
'start' => [
T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
],
'end' => [
T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
],
'strict' => false,
'shared' => false,
'with' => [],
],
T_FOR => [
'start' => [
T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
],
'end' => [
T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
],
'strict' => false,
'shared' => false,
'with' => [],
],
T_CLASS => [
'start' => [
T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
],
'end' => [
T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
],
'strict' => true,
'shared' => false,
'with' => [],
],
T_FUNCTION => [
'start' => [
T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
],
'end' => [
T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
],
'strict' => false,
'shared' => false,
'with' => [],
],
T_WHILE => [
'start' => [
T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
],
'end' => [
T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
],
'strict' => false,
'shared' => false,
'with' => [],
],
T_DO => [
'start' => [
T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
],
'end' => [
T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
],
'strict' => true,
'shared' => false,
'with' => [],
],
T_SWITCH => [
'start' => [
T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
],
'end' => [
T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
],
'strict' => true,
'shared' => false,
'with' => [],
],
T_CASE => [
'start' => [
T_COLON => T_COLON,
],
'end' => [
T_BREAK => T_BREAK,
T_RETURN => T_RETURN,
T_CONTINUE => T_CONTINUE,
T_THROW => T_THROW,
],
'strict' => true,
'shared' => true,
'with' => [
T_DEFAULT => T_DEFAULT,
T_CASE => T_CASE,
T_SWITCH => T_SWITCH,
],
],
T_DEFAULT => [
'start' => [
T_COLON => T_COLON,
],
'end' => [
T_BREAK => T_BREAK,
T_RETURN => T_RETURN,
T_CONTINUE => T_CONTINUE,
T_THROW => T_THROW,
],
'strict' => true,
'shared' => true,
'with' => [
T_CASE => T_CASE,
T_SWITCH => T_SWITCH,
],
],
];