Doctrine\ORM\Query\Parser::_peekBeyondClosingParenthesis PHP Method

_peekBeyondClosingParenthesis() private method

Peek beyond the matched closing parenthesis and return the first token after that one.
    private function _peekBeyondClosingParenthesis()
    {
        $token = $this->_lexer->peek();
        $numUnmatched = 1;

        while ($numUnmatched > 0 && $token !== null) {
            if ($token['value'] == ')') {
                --$numUnmatched;
            } else if ($token['value'] == '(') {
                ++$numUnmatched;
            }

            $token = $this->_lexer->peek();
        }
        
        $this->_lexer->resetPeek();

        return $token;
    }
Parser