Skip to content

Instantly share code, notes, and snippets.

@gsherwood
Created November 21, 2016 22:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gsherwood/f17cfc90f14a9b29eeb6b2e99e6e7f66 to your computer and use it in GitHub Desktop.
Save gsherwood/f17cfc90f14a9b29eeb6b2e99e6e7f66 to your computer and use it in GitHub Desktop.
Using PHP_CodeSniffer to tokenize a JS file
<?php
namespace MyCustomProject;
use PHP_CodeSniffer\Runner;
use PHP_CodeSniffer\Config;
use PHP_CodeSniffer\Files\DummyFile;
// Include the PHPCS autoloader, however you need to.
require_once __DIR__.'/autoload.php';
// Init the PHPCS runner; no settings are required.
$runner = new Runner();
$runner->config = new Config();
$runner->init();
// Create a new JS file, but only tokenize it - don't process it.
$fileContent = file_get_contents(__DIR__.'/temp.js');
$file = new DummyFile($fileContent, $runner->ruleset, $runner->config);
$file->tokenizerType = 'JS';
$file->parse();
// Get the tokens of the file. Note that the first token is a T_OPEN_TAG
// token and the last is a T_CLOSE_TAG token, so these can be removed
// to make the token array cleaner because they are only needed
// by PHP_CodeSniffer sniffs.
$tokens = $file->getTokens();
array_pop($tokens);
array_shift($tokens);
print_r($tokens);
if (window.jQuery)(function($) {
$.fn.reset = function() {
return this.each(function() {
try {
this.reset();
} catch (e) {}
});
};
})(jQuery);
@gsherwood
Copy link
Author

The output from running the above JSTokenizer.php script is:

Array
(
    [0] => Array
        (
            [code] => 302
            [type] => T_IF
            [content] => if
            [line] => 1
            [column] => 1
            [length] => 2
            [parenthesis_opener] => 3
            [parenthesis_closer] => 7
            [parenthesis_owner] => 1
            [level] => 0
            [conditions] => Array
                (
                )

        )

    [1] => Array
        (
            [code] => 377
            [type] => T_WHITESPACE
            [content] =>  
            [line] => 1
            [column] => 3
            [length] => 1
            [level] => 0
            [conditions] => Array
                (
                )

        )

    [2] => Array
        (
            [code] => PHPCS_T_OPEN_PARENTHESIS
            [type] => T_OPEN_PARENTHESIS
            [content] => (
            [line] => 1
            [column] => 4
            [length] => 1
            [parenthesis_opener] => 3
            [parenthesis_owner] => 1
            [parenthesis_closer] => 7
            [level] => 0
            [conditions] => Array
                (
                )

        )

    [3] => Array
        (
            [code] => 308
            [type] => T_STRING
            [content] => window
            [line] => 1
            [column] => 5
            [length] => 6
            [nested_parenthesis] => Array
                (
                    [3] => 7
                )

            [level] => 0
            [conditions] => Array
                (
                )

        )

    [4] => Array
        (
            [code] => 361
            [type] => T_OBJECT_OPERATOR
            [content] => .
            [line] => 1
            [column] => 11
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [3] => 7
                )

            [level] => 0
            [conditions] => Array
                (
                )

        )

    [5] => Array
        (
            [code] => 308
            [type] => T_STRING
            [content] => jQuery
            [line] => 1
            [column] => 12
            [length] => 6
            [nested_parenthesis] => Array
                (
                    [3] => 7
                )

            [level] => 0
            [conditions] => Array
                (
                )

        )

    [6] => Array
        (
            [code] => PHPCS_T_CLOSE_PARENTHESIS
            [type] => T_CLOSE_PARENTHESIS
            [content] => )
            [line] => 1
            [column] => 18
            [length] => 1
            [parenthesis_owner] => 1
            [parenthesis_opener] => 3
            [parenthesis_closer] => 7
            [level] => 0
            [conditions] => Array
                (
                )

        )

    [7] => Array
        (
            [code] => PHPCS_T_OPEN_PARENTHESIS
            [type] => T_OPEN_PARENTHESIS
            [content] => (
            [line] => 1
            [column] => 19
            [length] => 1
            [parenthesis_opener] => 8
            [parenthesis_closer] => 79
            [level] => 0
            [conditions] => Array
                (
                )

        )

    [8] => Array
        (
            [code] => PHPCS_T_CLOSURE
            [type] => T_CLOSURE
            [content] => function
            [line] => 1
            [column] => 20
            [length] => 8
            [parenthesis_opener] => 10
            [parenthesis_closer] => 12
            [parenthesis_owner] => 9
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [scope_condition] => 9
            [scope_opener] => 14
            [scope_closer] => 78
            [level] => 0
            [conditions] => Array
                (
                )

        )

    [9] => Array
        (
            [code] => PHPCS_T_OPEN_PARENTHESIS
            [type] => T_OPEN_PARENTHESIS
            [content] => (
            [line] => 1
            [column] => 28
            [length] => 1
            [parenthesis_opener] => 10
            [parenthesis_owner] => 9
            [parenthesis_closer] => 12
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 0
            [conditions] => Array
                (
                )

        )

    [10] => Array
        (
            [code] => 308
            [type] => T_STRING
            [content] => $
            [line] => 1
            [column] => 29
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [10] => 12
                )

            [level] => 0
            [conditions] => Array
                (
                )

        )

    [11] => Array
        (
            [code] => PHPCS_T_CLOSE_PARENTHESIS
            [type] => T_CLOSE_PARENTHESIS
            [content] => )
            [line] => 1
            [column] => 30
            [length] => 1
            [parenthesis_owner] => 9
            [parenthesis_opener] => 10
            [parenthesis_closer] => 12
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 0
            [conditions] => Array
                (
                )

        )

    [12] => Array
        (
            [code] => 377
            [type] => T_WHITESPACE
            [content] =>  
            [line] => 1
            [column] => 31
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 0
            [conditions] => Array
                (
                )

        )

    [13] => Array
        (
            [code] => PHPCS_T_OPEN_CURLY_BRACKET
            [type] => T_OPEN_CURLY_BRACKET
            [content] => {
            [line] => 1
            [column] => 32
            [length] => 1
            [bracket_opener] => 14
            [bracket_closer] => 78
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [scope_condition] => 9
            [scope_opener] => 14
            [scope_closer] => 78
            [level] => 0
            [conditions] => Array
                (
                )

        )

    [14] => Array
        (
            [content] => 

            [type] => T_WHITESPACE
            [code] => 377
            [line] => 1
            [column] => 33
            [length] => 0
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [15] => Array
        (
            [content] =>     
            [type] => T_WHITESPACE
            [code] => 377
            [line] => 2
            [column] => 1
            [length] => 4
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [16] => Array
        (
            [code] => 308
            [type] => T_STRING
            [content] => $
            [line] => 2
            [column] => 5
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [17] => Array
        (
            [code] => 361
            [type] => T_OBJECT_OPERATOR
            [content] => .
            [line] => 2
            [column] => 6
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [18] => Array
        (
            [code] => 308
            [type] => T_STRING
            [content] => fn
            [line] => 2
            [column] => 7
            [length] => 2
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [19] => Array
        (
            [code] => 361
            [type] => T_OBJECT_OPERATOR
            [content] => .
            [line] => 2
            [column] => 9
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [20] => Array
        (
            [code] => 308
            [type] => T_STRING
            [content] => reset
            [line] => 2
            [column] => 10
            [length] => 5
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [21] => Array
        (
            [code] => 377
            [type] => T_WHITESPACE
            [content] =>  
            [line] => 2
            [column] => 15
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [22] => Array
        (
            [code] => PHPCS_T_EQUAL
            [type] => T_EQUAL
            [content] => =
            [line] => 2
            [column] => 16
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [23] => Array
        (
            [code] => 377
            [type] => T_WHITESPACE
            [content] =>  
            [line] => 2
            [column] => 17
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [24] => Array
        (
            [code] => PHPCS_T_CLOSURE
            [type] => T_CLOSURE
            [content] => function
            [line] => 2
            [column] => 18
            [length] => 8
            [parenthesis_opener] => 26
            [parenthesis_closer] => 27
            [parenthesis_owner] => 25
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [scope_condition] => 25
            [scope_opener] => 29
            [scope_closer] => 75
            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [25] => Array
        (
            [code] => PHPCS_T_OPEN_PARENTHESIS
            [type] => T_OPEN_PARENTHESIS
            [content] => (
            [line] => 2
            [column] => 26
            [length] => 1
            [parenthesis_opener] => 26
            [parenthesis_owner] => 25
            [parenthesis_closer] => 27
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [26] => Array
        (
            [code] => PHPCS_T_CLOSE_PARENTHESIS
            [type] => T_CLOSE_PARENTHESIS
            [content] => )
            [line] => 2
            [column] => 27
            [length] => 1
            [parenthesis_owner] => 25
            [parenthesis_opener] => 26
            [parenthesis_closer] => 27
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [27] => Array
        (
            [code] => 377
            [type] => T_WHITESPACE
            [content] =>  
            [line] => 2
            [column] => 28
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [28] => Array
        (
            [code] => PHPCS_T_OPEN_CURLY_BRACKET
            [type] => T_OPEN_CURLY_BRACKET
            [content] => {
            [line] => 2
            [column] => 29
            [length] => 1
            [bracket_opener] => 29
            [bracket_closer] => 75
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [scope_condition] => 25
            [scope_opener] => 29
            [scope_closer] => 75
            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [29] => Array
        (
            [content] => 

            [type] => T_WHITESPACE
            [code] => 377
            [line] => 2
            [column] => 30
            [length] => 0
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [30] => Array
        (
            [content] =>         
            [type] => T_WHITESPACE
            [code] => 377
            [line] => 3
            [column] => 1
            [length] => 8
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [31] => Array
        (
            [code] => 337
            [type] => T_RETURN
            [content] => return
            [line] => 3
            [column] => 9
            [length] => 6
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [32] => Array
        (
            [code] => 377
            [type] => T_WHITESPACE
            [content] =>  
            [line] => 3
            [column] => 15
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [33] => Array
        (
            [code] => PHPCS_T_THIS
            [type] => T_THIS
            [content] => this
            [line] => 3
            [column] => 16
            [length] => 4
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [34] => Array
        (
            [code] => 361
            [type] => T_OBJECT_OPERATOR
            [content] => .
            [line] => 3
            [column] => 20
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [35] => Array
        (
            [code] => 308
            [type] => T_STRING
            [content] => each
            [line] => 3
            [column] => 21
            [length] => 4
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [36] => Array
        (
            [code] => PHPCS_T_OPEN_PARENTHESIS
            [type] => T_OPEN_PARENTHESIS
            [content] => (
            [line] => 3
            [column] => 25
            [length] => 1
            [parenthesis_opener] => 37
            [parenthesis_closer] => 71
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [37] => Array
        (
            [code] => PHPCS_T_CLOSURE
            [type] => T_CLOSURE
            [content] => function
            [line] => 3
            [column] => 26
            [length] => 8
            [parenthesis_opener] => 39
            [parenthesis_closer] => 40
            [parenthesis_owner] => 38
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [scope_condition] => 38
            [scope_opener] => 42
            [scope_closer] => 70
            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [38] => Array
        (
            [code] => PHPCS_T_OPEN_PARENTHESIS
            [type] => T_OPEN_PARENTHESIS
            [content] => (
            [line] => 3
            [column] => 34
            [length] => 1
            [parenthesis_opener] => 39
            [parenthesis_owner] => 38
            [parenthesis_closer] => 40
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [39] => Array
        (
            [code] => PHPCS_T_CLOSE_PARENTHESIS
            [type] => T_CLOSE_PARENTHESIS
            [content] => )
            [line] => 3
            [column] => 35
            [length] => 1
            [parenthesis_owner] => 38
            [parenthesis_opener] => 39
            [parenthesis_closer] => 40
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [40] => Array
        (
            [code] => 377
            [type] => T_WHITESPACE
            [content] =>  
            [line] => 3
            [column] => 36
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [41] => Array
        (
            [code] => PHPCS_T_OPEN_CURLY_BRACKET
            [type] => T_OPEN_CURLY_BRACKET
            [content] => {
            [line] => 3
            [column] => 37
            [length] => 1
            [bracket_opener] => 42
            [bracket_closer] => 70
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [scope_condition] => 38
            [scope_opener] => 42
            [scope_closer] => 70
            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [42] => Array
        (
            [content] => 

            [type] => T_WHITESPACE
            [code] => 377
            [line] => 3
            [column] => 38
            [length] => 0
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [43] => Array
        (
            [content] =>             
            [type] => T_WHITESPACE
            [code] => 377
            [line] => 4
            [column] => 1
            [length] => 12
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [44] => Array
        (
            [code] => 338
            [type] => T_TRY
            [content] => try
            [line] => 4
            [column] => 13
            [length] => 3
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [scope_condition] => 45
            [scope_opener] => 47
            [scope_closer] => 58
            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [45] => Array
        (
            [code] => 377
            [type] => T_WHITESPACE
            [content] =>  
            [line] => 4
            [column] => 16
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [46] => Array
        (
            [code] => PHPCS_T_OPEN_CURLY_BRACKET
            [type] => T_OPEN_CURLY_BRACKET
            [content] => {
            [line] => 4
            [column] => 17
            [length] => 1
            [bracket_opener] => 47
            [bracket_closer] => 58
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [scope_condition] => 45
            [scope_opener] => 47
            [scope_closer] => 58
            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [47] => Array
        (
            [content] => 

            [type] => T_WHITESPACE
            [code] => 377
            [line] => 4
            [column] => 18
            [length] => 0
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 4
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                    [45] => 338
                )

        )

    [48] => Array
        (
            [content] =>                 
            [type] => T_WHITESPACE
            [code] => 377
            [line] => 5
            [column] => 1
            [length] => 16
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 4
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                    [45] => 338
                )

        )

    [49] => Array
        (
            [code] => PHPCS_T_THIS
            [type] => T_THIS
            [content] => this
            [line] => 5
            [column] => 17
            [length] => 4
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 4
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                    [45] => 338
                )

        )

    [50] => Array
        (
            [code] => 361
            [type] => T_OBJECT_OPERATOR
            [content] => .
            [line] => 5
            [column] => 21
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 4
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                    [45] => 338
                )

        )

    [51] => Array
        (
            [code] => 308
            [type] => T_STRING
            [content] => reset
            [line] => 5
            [column] => 22
            [length] => 5
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 4
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                    [45] => 338
                )

        )

    [52] => Array
        (
            [code] => PHPCS_T_OPEN_PARENTHESIS
            [type] => T_OPEN_PARENTHESIS
            [content] => (
            [line] => 5
            [column] => 27
            [length] => 1
            [parenthesis_opener] => 53
            [parenthesis_closer] => 54
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 4
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                    [45] => 338
                )

        )

    [53] => Array
        (
            [code] => PHPCS_T_CLOSE_PARENTHESIS
            [type] => T_CLOSE_PARENTHESIS
            [content] => )
            [line] => 5
            [column] => 28
            [length] => 1
            [parenthesis_opener] => 53
            [parenthesis_closer] => 54
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 4
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                    [45] => 338
                )

        )

    [54] => Array
        (
            [code] => PHPCS_T_SEMICOLON
            [type] => T_SEMICOLON
            [content] => ;
            [line] => 5
            [column] => 29
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 4
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                    [45] => 338
                )

        )

    [55] => Array
        (
            [content] => 

            [type] => T_WHITESPACE
            [code] => 377
            [line] => 5
            [column] => 30
            [length] => 0
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 4
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                    [45] => 338
                )

        )

    [56] => Array
        (
            [content] =>             
            [type] => T_WHITESPACE
            [code] => 377
            [line] => 6
            [column] => 1
            [length] => 12
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 4
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                    [45] => 338
                )

        )

    [57] => Array
        (
            [code] => PHPCS_T_CLOSE_CURLY_BRACKET
            [type] => T_CLOSE_CURLY_BRACKET
            [content] => }
            [line] => 6
            [column] => 13
            [length] => 1
            [bracket_opener] => 47
            [bracket_closer] => 58
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [scope_condition] => 45
            [scope_opener] => 47
            [scope_closer] => 58
            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [58] => Array
        (
            [code] => 377
            [type] => T_WHITESPACE
            [content] =>  
            [line] => 6
            [column] => 14
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [59] => Array
        (
            [code] => 339
            [type] => T_CATCH
            [content] => catch
            [line] => 6
            [column] => 15
            [length] => 5
            [parenthesis_opener] => 62
            [parenthesis_closer] => 64
            [parenthesis_owner] => 60
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [scope_condition] => 60
            [scope_opener] => 66
            [scope_closer] => 67
            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [60] => Array
        (
            [code] => 377
            [type] => T_WHITESPACE
            [content] =>  
            [line] => 6
            [column] => 20
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [61] => Array
        (
            [code] => PHPCS_T_OPEN_PARENTHESIS
            [type] => T_OPEN_PARENTHESIS
            [content] => (
            [line] => 6
            [column] => 21
            [length] => 1
            [parenthesis_opener] => 62
            [parenthesis_owner] => 60
            [parenthesis_closer] => 64
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [62] => Array
        (
            [code] => 308
            [type] => T_STRING
            [content] => e
            [line] => 6
            [column] => 22
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                    [62] => 64
                )

            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [63] => Array
        (
            [code] => PHPCS_T_CLOSE_PARENTHESIS
            [type] => T_CLOSE_PARENTHESIS
            [content] => )
            [line] => 6
            [column] => 23
            [length] => 1
            [parenthesis_owner] => 60
            [parenthesis_opener] => 62
            [parenthesis_closer] => 64
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [64] => Array
        (
            [code] => 377
            [type] => T_WHITESPACE
            [content] =>  
            [line] => 6
            [column] => 24
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [65] => Array
        (
            [code] => PHPCS_T_OPEN_CURLY_BRACKET
            [type] => T_OPEN_CURLY_BRACKET
            [content] => {
            [line] => 6
            [column] => 25
            [length] => 1
            [bracket_opener] => 66
            [bracket_closer] => 67
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [scope_condition] => 60
            [scope_opener] => 66
            [scope_closer] => 67
            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [66] => Array
        (
            [code] => PHPCS_T_CLOSE_CURLY_BRACKET
            [type] => T_CLOSE_CURLY_BRACKET
            [content] => }
            [line] => 6
            [column] => 26
            [length] => 1
            [bracket_opener] => 66
            [bracket_closer] => 67
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [scope_condition] => 60
            [scope_opener] => 66
            [scope_closer] => 67
            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [67] => Array
        (
            [content] => 

            [type] => T_WHITESPACE
            [code] => 377
            [line] => 6
            [column] => 27
            [length] => 0
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [68] => Array
        (
            [content] =>         
            [type] => T_WHITESPACE
            [code] => 377
            [line] => 7
            [column] => 1
            [length] => 8
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [level] => 3
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                    [38] => PHPCS_T_CLOSURE
                )

        )

    [69] => Array
        (
            [code] => PHPCS_T_CLOSE_CURLY_BRACKET
            [type] => T_CLOSE_CURLY_BRACKET
            [content] => }
            [line] => 7
            [column] => 9
            [length] => 1
            [bracket_opener] => 42
            [bracket_closer] => 70
            [nested_parenthesis] => Array
                (
                    [8] => 79
                    [37] => 71
                )

            [scope_condition] => 38
            [scope_opener] => 42
            [scope_closer] => 70
            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [70] => Array
        (
            [code] => PHPCS_T_CLOSE_PARENTHESIS
            [type] => T_CLOSE_PARENTHESIS
            [content] => )
            [line] => 7
            [column] => 10
            [length] => 1
            [parenthesis_opener] => 37
            [parenthesis_closer] => 71
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [71] => Array
        (
            [code] => PHPCS_T_SEMICOLON
            [type] => T_SEMICOLON
            [content] => ;
            [line] => 7
            [column] => 11
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [72] => Array
        (
            [content] => 

            [type] => T_WHITESPACE
            [code] => 377
            [line] => 7
            [column] => 12
            [length] => 0
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [73] => Array
        (
            [content] =>     
            [type] => T_WHITESPACE
            [code] => 377
            [line] => 8
            [column] => 1
            [length] => 4
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 2
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                    [25] => PHPCS_T_CLOSURE
                )

        )

    [74] => Array
        (
            [code] => PHPCS_T_CLOSE_CURLY_BRACKET
            [type] => T_CLOSE_CURLY_BRACKET
            [content] => }
            [line] => 8
            [column] => 5
            [length] => 1
            [bracket_opener] => 29
            [bracket_closer] => 75
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [scope_condition] => 25
            [scope_opener] => 29
            [scope_closer] => 75
            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [75] => Array
        (
            [code] => PHPCS_T_SEMICOLON
            [type] => T_SEMICOLON
            [content] => ;
            [line] => 8
            [column] => 6
            [length] => 1
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [76] => Array
        (
            [content] => 

            [type] => T_WHITESPACE
            [code] => 377
            [line] => 8
            [column] => 7
            [length] => 0
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [level] => 1
            [conditions] => Array
                (
                    [9] => PHPCS_T_CLOSURE
                )

        )

    [77] => Array
        (
            [code] => PHPCS_T_CLOSE_CURLY_BRACKET
            [type] => T_CLOSE_CURLY_BRACKET
            [content] => }
            [line] => 9
            [column] => 1
            [length] => 1
            [bracket_opener] => 14
            [bracket_closer] => 78
            [nested_parenthesis] => Array
                (
                    [8] => 79
                )

            [scope_condition] => 9
            [scope_opener] => 14
            [scope_closer] => 78
            [level] => 0
            [conditions] => Array
                (
                )

        )

    [78] => Array
        (
            [code] => PHPCS_T_CLOSE_PARENTHESIS
            [type] => T_CLOSE_PARENTHESIS
            [content] => )
            [line] => 9
            [column] => 2
            [length] => 1
            [parenthesis_opener] => 8
            [parenthesis_closer] => 79
            [level] => 0
            [conditions] => Array
                (
                )

        )

    [79] => Array
        (
            [code] => PHPCS_T_OPEN_PARENTHESIS
            [type] => T_OPEN_PARENTHESIS
            [content] => (
            [line] => 9
            [column] => 3
            [length] => 1
            [parenthesis_opener] => 80
            [parenthesis_closer] => 82
            [level] => 0
            [conditions] => Array
                (
                )

        )

    [80] => Array
        (
            [code] => 308
            [type] => T_STRING
            [content] => jQuery
            [line] => 9
            [column] => 4
            [length] => 6
            [nested_parenthesis] => Array
                (
                    [80] => 82
                )

            [level] => 0
            [conditions] => Array
                (
                )

        )

    [81] => Array
        (
            [code] => PHPCS_T_CLOSE_PARENTHESIS
            [type] => T_CLOSE_PARENTHESIS
            [content] => )
            [line] => 9
            [column] => 10
            [length] => 1
            [parenthesis_opener] => 80
            [parenthesis_closer] => 82
            [level] => 0
            [conditions] => Array
                (
                )

        )

    [82] => Array
        (
            [code] => PHPCS_T_SEMICOLON
            [type] => T_SEMICOLON
            [content] => ;
            [line] => 9
            [column] => 11
            [length] => 1
            [level] => 0
            [conditions] => Array
                (
                )

        )

    [83] => Array
        (
            [content] => 

            [type] => T_WHITESPACE
            [code] => 377
            [line] => 9
            [column] => 12
            [length] => 0
            [level] => 0
            [conditions] => Array
                (
                )

        )

)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment