Lines Matching refs:_tokens

181     private $_tokens = array();  variable in PHP_CodeSniffer_File
427 return $this->_tokens;
488 foreach ($this->_tokens as $stackPtr => $token) {
639 $this->_tokens = null;
655 if ($contents === null && empty($this->_tokens) === false) {
701 …$this->_tokens = self::tokenizeString($contents, $tokenizer, $this->eolChar, $tabWidth, $encoding);
714 $this->numTokens = count($this->_tokens);
734 $numLines = $this->_tokens[($this->numTokens - 1)]['line'];
826 $line = $this->_tokens[$stackPtr]['line'];
827 $column = $this->_tokens[$stackPtr]['column'];
860 $line = $this->_tokens[$stackPtr]['line'];
861 $column = $this->_tokens[$stackPtr]['column'];
2672 $tokenCode = $this->_tokens[$stackPtr]['code'];
2687 …throw new PHP_CodeSniffer_Exception('Token type "'.$this->_tokens[$stackPtr]['type'].'" is not T_F…
2692 if ($this->_tokens[$i]['code'] === T_STRING) {
2693 $content = $this->_tokens[$i]['content'];
2715 $tokenCode = $this->_tokens[$stackPtr]['code'];
2720 if (isset($this->_tokens[$stackPtr]['parenthesis_opener']) === false) {
2727 if ($this->_tokens[$i]['code'] === T_STRING) {
2738 $open = $this->_tokens[$stackPtr]['parenthesis_opener'];
2777 if ($this->_tokens[$stackPtr]['code'] !== T_FUNCTION
2778 && $this->_tokens[$stackPtr]['code'] !== T_CLOSURE
2783 $opener = $this->_tokens[$stackPtr]['parenthesis_opener'];
2784 $closer = $this->_tokens[$stackPtr]['parenthesis_closer'];
2801 if (isset($this->_tokens[$i]['parenthesis_opener']) === true) {
2803 if ($i !== $this->_tokens[$i]['parenthesis_closer']) {
2804 $i = ($this->_tokens[$i]['parenthesis_closer'] + 1);
2808 if (isset($this->_tokens[$i]['bracket_opener']) === true) {
2810 if ($i !== $this->_tokens[$i]['bracket_closer']) {
2811 $i = ($this->_tokens[$i]['bracket_closer'] + 1);
2815 switch ($this->_tokens[$i]['code']) {
2827 $typeHint .= $this->_tokens[$i]['content'];
2834 $typeHint .= $this->_tokens[$i]['content'];
2842 if ($this->_tokens[$t]['code'] === T_COMMA) {
2851 if ($this->_tokens[$t]['code'] === T_EQUAL) {
2863 $typeHint .= $this->_tokens[$i]['content'];
2869 $typeHint .= $this->_tokens[$i]['content'];
2875 $typeHint .= $this->_tokens[$i]['content'];
2888 $vars[$paramCount]['name'] = $this->_tokens[$currVar]['content'];
2945 if ($this->_tokens[$stackPtr]['code'] !== T_FUNCTION) {
2969 if (isset($valid[$this->_tokens[$i]['code']]) === false) {
2973 switch ($this->_tokens[$i]['code']) {
3033 if ($this->_tokens[$stackPtr]['code'] !== T_VARIABLE) {
3037 $conditions = array_keys($this->_tokens[$stackPtr]['conditions']);
3039 if (isset($this->_tokens[$ptr]) === false
3040 || ($this->_tokens[$ptr]['code'] !== T_CLASS
3041 && $this->_tokens[$ptr]['code'] !== T_ANON_CLASS
3042 && $this->_tokens[$ptr]['code'] !== T_TRAIT)
3044 if (isset($this->_tokens[$ptr]) === true
3045 && $this->_tokens[$ptr]['code'] === T_INTERFACE
3051 if (isset($this->_tokens[$stackPtr]['nested_parenthesis']) === false
3052 || empty($this->_tokens[$stackPtr]['nested_parenthesis']) === true
3080 if (isset($valid[$this->_tokens[$i]['code']]) === false) {
3084 switch ($this->_tokens[$i]['code']) {
3132 if ($this->_tokens[$stackPtr]['code'] !== T_CLASS) {
3148 if (isset($valid[$this->_tokens[$i]['code']]) === false) {
3152 switch ($this->_tokens[$i]['code']) {
3183 if ($this->_tokens[$stackPtr]['code'] !== T_BITWISE_AND) {
3194 if ($this->_tokens[$tokenBefore]['code'] === T_FUNCTION) {
3199 if ($this->_tokens[$tokenBefore]['code'] === T_DOUBLE_ARROW) {
3204 if ($this->_tokens[$tokenBefore]['code'] === T_AS) {
3209 if ($this->_tokens[$tokenBefore]['code'] === T_OPEN_SHORT_ARRAY) {
3214 …if (isset(PHP_CodeSniffer_Tokens::$assignmentTokens[$this->_tokens[$tokenBefore]['code']]) === tru…
3220 if (isset($this->_tokens[$stackPtr]['nested_parenthesis']) === true) {
3221 $brackets = $this->_tokens[$stackPtr]['nested_parenthesis'];
3223 if (isset($this->_tokens[$lastBracket]['parenthesis_owner']) === true) {
3224 $owner = $this->_tokens[$this->_tokens[$lastBracket]['parenthesis_owner']];
3234 for ($t = ($this->_tokens[$lastBracket]['parenthesis_opener'] - 1); $t >= 0; $t--) {
3235 if ($this->_tokens[$t]['code'] !== T_WHITESPACE) {
3241 if ($prev !== false && $this->_tokens[$prev]['code'] === T_USE) {
3254 if ($this->_tokens[$tokenAfter]['code'] === T_VARIABLE
3255 && ($this->_tokens[$tokenBefore]['code'] === T_OPEN_PARENTHESIS
3256 || $this->_tokens[$tokenBefore]['code'] === T_COMMA)
3284 $str .= $this->_tokens[$i]['content'];
3335 if ($this->_tokens[$i]['code'] === $type) {
3344 } else if ($this->_tokens[$i]['content'] === $value) {
3350 if (isset($this->_tokens[$i]['scope_opener']) === true
3351 && $i === $this->_tokens[$i]['scope_closer']
3353 $i = $this->_tokens[$i]['scope_opener'];
3354 } else if (isset($this->_tokens[$i]['bracket_opener']) === true
3355 && $i === $this->_tokens[$i]['bracket_closer']
3357 $i = $this->_tokens[$i]['bracket_opener'];
3358 } else if (isset($this->_tokens[$i]['parenthesis_opener']) === true
3359 && $i === $this->_tokens[$i]['parenthesis_closer']
3361 $i = $this->_tokens[$i]['parenthesis_opener'];
3362 } else if ($this->_tokens[$i]['code'] === T_SEMICOLON) {
3416 if ($this->_tokens[$i]['code'] === $type) {
3425 } else if ($this->_tokens[$i]['content'] === $value) {
3430 if ($local === true && $this->_tokens[$i]['code'] === T_SEMICOLON) {
3472 if (isset($endTokens[$this->_tokens[$i]['code']]) === true) {
3477 if (isset($this->_tokens[$i]['scope_opener']) === true
3478 && $i === $this->_tokens[$i]['scope_closer']
3485 if (isset($this->_tokens[$i]['bracket_opener']) === true
3486 && $i === $this->_tokens[$i]['bracket_closer']
3488 $i = $this->_tokens[$i]['bracket_opener'];
3489 } else if (isset($this->_tokens[$i]['parenthesis_opener']) === true
3490 && $i === $this->_tokens[$i]['parenthesis_closer']
3492 $i = $this->_tokens[$i]['parenthesis_opener'];
3495 if (isset(PHP_CodeSniffer_Tokens::$emptyTokens[$this->_tokens[$i]['code']]) === false) {
3540 if ($i !== $start && isset($endTokens[$this->_tokens[$i]['code']]) === true) {
3542 if ($this->_tokens[$i]['code'] === T_CLOSE_PARENTHESIS
3543 || $this->_tokens[$i]['code'] === T_CLOSE_SQUARE_BRACKET
3544 || $this->_tokens[$i]['code'] === T_CLOSE_CURLY_BRACKET
3545 || $this->_tokens[$i]['code'] === T_CLOSE_SHORT_ARRAY
3546 || $this->_tokens[$i]['code'] === T_OPEN_TAG
3547 || $this->_tokens[$i]['code'] === T_CLOSE_TAG
3556 if (isset($this->_tokens[$i]['scope_closer']) === true
3557 && ($i === $this->_tokens[$i]['scope_opener']
3558 || $i === $this->_tokens[$i]['scope_condition'])
3560 $i = $this->_tokens[$i]['scope_closer'];
3561 } else if (isset($this->_tokens[$i]['bracket_closer']) === true
3562 && $i === $this->_tokens[$i]['bracket_opener']
3564 $i = $this->_tokens[$i]['bracket_closer'];
3565 } else if (isset($this->_tokens[$i]['parenthesis_closer']) === true
3566 && $i === $this->_tokens[$i]['parenthesis_opener']
3568 $i = $this->_tokens[$i]['parenthesis_closer'];
3571 if (isset(PHP_CodeSniffer_Tokens::$emptyTokens[$this->_tokens[$i]['code']]) === false) {
3607 if ($this->_tokens[$i]['line'] < $this->_tokens[$start]['line']) {
3614 if ($this->_tokens[$i]['code'] === $type) {
3619 if ($this->_tokens[$i]['code'] === $type) {
3629 } else if ($this->_tokens[$i]['content'] === $value) {
3651 if (isset($this->_tokens[$stackPtr]) === false) {
3656 if (isset($this->_tokens[$stackPtr]['conditions']) === false) {
3661 $conditions = $this->_tokens[$stackPtr]['conditions'];
3688 if (isset($this->_tokens[$stackPtr]) === false) {
3693 if (isset($this->_tokens[$stackPtr]['conditions']) === false) {
3697 $conditions = $this->_tokens[$stackPtr]['conditions'];
3721 if (isset($this->_tokens[$stackPtr]) === false) {
3725 if ($this->_tokens[$stackPtr]['code'] !== T_CLASS
3726 && $this->_tokens[$stackPtr]['code'] !== T_ANON_CLASS
3731 if (isset($this->_tokens[$stackPtr]['scope_closer']) === false) {
3735 $classCloserIndex = $this->_tokens[$stackPtr]['scope_closer'];
3772 if (isset($this->_tokens[$stackPtr]) === false) {
3776 if ($this->_tokens[$stackPtr]['code'] !== T_CLASS
3777 && $this->_tokens[$stackPtr]['code'] !== T_ANON_CLASS
3782 if (isset($this->_tokens[$stackPtr]['scope_closer']) === false) {
3786 $classOpenerIndex = $this->_tokens[$stackPtr]['scope_opener'];