Code Duplication    Length = 5-10 lines in 2 locations

src/Tokenizers/PHP.php 1 location

@@ 1151-1155 (lines=5) @@
1148
        $numTokens = count($this->tokens);
1149
        for ($i = ($numTokens - 1); $i >= 0; $i--) {
1150
            // Check for any unset scope conditions due to alternate IF/ENDIF syntax.
1151
            if (isset($this->tokens[$i]['scope_opener']) === true
1152
                && isset($this->tokens[$i]['scope_condition']) === false
1153
            ) {
1154
                $this->tokens[$i]['scope_condition'] = $this->tokens[$this->tokens[$i]['scope_opener']]['scope_condition'];
1155
            }
1156
1157
            if ($this->tokens[$i]['code'] === T_FUNCTION) {
1158
                // Context sensitive keywords support.

src/Tokenizers/Tokenizer.php 1 location

@@ 947-956 (lines=10) @@
944
            } else if ($tokenType === T_OPEN_PARENTHESIS) {
945
                if (isset($this->tokens[$i]['parenthesis_owner']) === true) {
946
                    $owner = $this->tokens[$i]['parenthesis_owner'];
947
                    if (isset(Util\Tokens::$scopeOpeners[$this->tokens[$owner]['code']]) === true
948
                        && isset($this->tokens[$i]['parenthesis_closer']) === true
949
                    ) {
950
                        // If we get into here, then we opened a parenthesis for
951
                        // a scope (eg. an if or else if) so we need to update the
952
                        // start of the line so that when we check to see
953
                        // if the closing parenthesis is more than 3 lines away from
954
                        // the statement, we check from the closing parenthesis.
955
                        $startLine = $this->tokens[$this->tokens[$i]['parenthesis_closer']]['line'];
956
                    }
957
                }
958
            } else if ($tokenType === T_OPEN_CURLY_BRACKET && $opener !== null) {
959
                // We opened something that we don't have a scope opener for.