Code Duplication    Length = 11-12 lines in 2 locations

lib/Doctrine/ORM/Query/Parser.php 2 locations

@@ 2268-2278 (lines=11) @@
2265
2266
        $aliasResultVariable = null;
2267
2268
        if ($mustHaveAliasResultVariable || $this->lexer->isNextToken(Lexer::T_IDENTIFIER)) {
2269
            $token = $this->lexer->lookahead;
2270
            $aliasResultVariable = $this->AliasResultVariable();
2271
2272
            // Include AliasResultVariable in query components.
2273
            $this->queryComponents[$aliasResultVariable] = [
2274
                'resultVariable' => $expression,
2275
                'nestingLevel'   => $this->nestingLevel,
2276
                'token'          => $token,
2277
            ];
2278
        }
2279
2280
        // AST
2281
@@ 2361-2372 (lines=12) @@
2358
            $this->match(Lexer::T_AS);
2359
        }
2360
2361
        if ($this->lexer->isNextToken(Lexer::T_IDENTIFIER)) {
2362
            $token = $this->lexer->lookahead;
2363
            $resultVariable = $this->AliasResultVariable();
2364
            $expr->fieldIdentificationVariable = $resultVariable;
2365
2366
            // Include AliasResultVariable in query components.
2367
            $this->queryComponents[$resultVariable] = [
2368
                'resultvariable' => $expr,
2369
                'nestingLevel'   => $this->nestingLevel,
2370
                'token'          => $token,
2371
            ];
2372
        }
2373
2374
        return $expr;
2375
    }