Code Duplication    Length = 11-12 lines in 2 locations

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

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