Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. JS.php

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

JS

Namespace

PHP_CodeSniffer\Tokenizers

Code

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,
        ],
    ],
];

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal