src/Reflection/ReflectionFile.php
private function endingToken(int $tokenID): int
    {
        $level = null;
        for ($localID = $tokenID; $localID < $this->countTokens; ++$localID) {
            $token = $this->tokens[$localID];
            if ($token[self::TOKEN_CODE] == '{') {
                ++$level;
                continue;
            }

            if ($token[self::TOKEN_CODE] == '}') {
                --$level;
            }

            if ($level === 0) {
                break;
            }
        }

        return $localID;
    }
private function endingToken(int $tokenID): int
    {
        $level = null;
        for ($localID = $tokenID; $localID < $this->countTokens; ++$localID) {
            $token = $this->tokens[$localID];
            if ($token[self::TOKEN_CODE] == '{') {
                ++$level;
                continue;
            }

            if ($token[self::TOKEN_CODE] == '}') {
                --$level;
            }

            if ($level === 0) {
                break;
            }
        }

        return $localID;
    }
private function endingToken ( int $ tokenID ) : int { $ level = null ; for ( $ localID = $ tokenID ; $ localID < $ this -> countTokens ; ++ $ localID ) { $ token = $ this -> tokens [ $ localID ] ; if ( $ token [ self :: TOKEN_CODE ] == '{' ) { ++ $ level ; continue ; } if ( $ token [ self :: TOKEN_CODE ] == '}' ) { -- $ level ; } if ( $ level === 0 ) { break ; } } return $ localID ; }
Find token ID of ending brace.

@param int $tokenID

@return int
Find token ID of ending brace .