| @@ 949-953 (lines=5) @@ | ||
| 946 | $numTokens = count($this->tokens); |
|
| 947 | for ($i = ($numTokens - 1); $i >= 0; $i--) { |
|
| 948 | // Check for any unset scope conditions due to alternate IF/ENDIF syntax. |
|
| 949 | if (isset($this->tokens[$i]['scope_opener']) === true |
|
| 950 | && isset($this->tokens[$i]['scope_condition']) === false |
|
| 951 | ) { |
|
| 952 | $this->tokens[$i]['scope_condition'] = $this->tokens[$this->tokens[$i]['scope_opener']]['scope_condition']; |
|
| 953 | } |
|
| 954 | ||
| 955 | if ($this->tokens[$i]['code'] === T_FUNCTION) { |
|
| 956 | // Context sensitive keywords support. |
|
| @@ 918-927 (lines=10) @@ | ||
| 915 | } else if ($tokenType === T_OPEN_PARENTHESIS) { |
|
| 916 | if (isset($this->tokens[$i]['parenthesis_owner']) === true) { |
|
| 917 | $owner = $this->tokens[$i]['parenthesis_owner']; |
|
| 918 | if (isset(Util\Tokens::$scopeOpeners[$this->tokens[$owner]['code']]) === true |
|
| 919 | && isset($this->tokens[$i]['parenthesis_closer']) === true |
|
| 920 | ) { |
|
| 921 | // If we get into here, then we opened a parenthesis for |
|
| 922 | // a scope (eg. an if or else if) so we need to update the |
|
| 923 | // start of the line so that when we check to see |
|
| 924 | // if the closing parenthesis is more than 3 lines away from |
|
| 925 | // the statement, we check from the closing parenthesis. |
|
| 926 | $startLine = $this->tokens[$this->tokens[$i]['parenthesis_closer']]['line']; |
|
| 927 | } |
|
| 928 | } |
|
| 929 | } else if ($tokenType === T_OPEN_CURLY_BRACKET && $opener !== null) { |
|
| 930 | // We opened something that we don't have a scope opener for. |
|