public function getTopCommunities($limit = 10, $cursor = null)
    {
        if (!$this->apiVersionIsGreaterThanV3()) {
            throw new EndpointNotSupportedByApiVersionException();
        }

        if (!$this->isValidLimit($limit)) {
            throw new InvalidLimitException();
        }

        if ($cursor && !is_string($cursor)) {
            throw new InvalidTypeException('Cursor', 'string', gettype($cursor));
        }

        $params = [
            'limit' => intval($limit),
            'cursor' => $cursor,
        ];

        return $this->get('communities/top', $params);
    }
public function getTopCommunities($limit = 10, $cursor = null)
    {
        if (!$this->apiVersionIsGreaterThanV3()) {
            throw new EndpointNotSupportedByApiVersionException();
        }

        if (!$this->isValidLimit($limit)) {
            throw new InvalidLimitException();
        }

        if ($cursor && !is_string($cursor)) {
            throw new InvalidTypeException('Cursor', 'string', gettype($cursor));
        }

        $params = [
            'limit' => intval($limit),
            'cursor' => $cursor,
        ];

        return $this->get('communities/top', $params);
    }
public function getTopCommunities ( $ limit = 10 , $ cursor = null ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } if ( ! $ this -> isValidLimit ( $ limit ) ) { throw new InvalidLimitException ( ) ; } if ( $ cursor && ! is_string ( $ cursor ) ) { throw new InvalidTypeException ( 'Cursor' , 'string' , gettype ( $ cursor ) ) ; } $ params = [ 'limit' => intval ( $ limit ) , 'cursor' => $ cursor , ] ; return $ this -> get ( 'communities/top' , $ params ) ; }
Get top communities

@param int    $limit
@param string $cursor
@throws InvalidLimitException
@throws InvalidTypeException
@throws EndpointNotSupportedByApiVersionException
@return array|json
Get top communities