Code Duplication    Length = 5-5 lines in 2 locations

lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php 2 locations

@@ 1270-1274 (lines=5) @@
1267
            $currentPosition = $orderByPos;
1268
1269
            while ($parenCount >= 0 && $currentPosition < $qLen) {
1270
                if ($query[$currentPosition] === '(') {
1271
                    $parenCount++;
1272
                } elseif ($query[$currentPosition] === ')') {
1273
                    $parenCount--;
1274
                }
1275
1276
                $currentPosition++;
1277
            }
@@ 1310-1314 (lines=5) @@
1307
        // If $parenCount goes negative, we've exited the subquery we're examining.
1308
        // If $currentPosition goes negative, we've reached the beginning of the query.
1309
        while ($parenCount >= 0 && $currentPosition >= 0) {
1310
            if ($query[$currentPosition] === '(') {
1311
                $parenCount--;
1312
            } elseif ($query[$currentPosition] === ')') {
1313
                $parenCount++;
1314
            }
1315
1316
            // Only yank query text on the same nesting level as the ORDER BY clause.
1317
            $subQueryBuffer = ($parenCount === 0 ? $query[$currentPosition] : ' ') . $subQueryBuffer;