src/Client.php
public function community(string $communityIdOrName, string $type = '', string $titleId = '') : Community
    {
        if (!empty($type) && !empty($titleId)) {
            // Create the Community.
            $response = $this->httpClient()->post(Community::COMMUNITY_ENDPOINT . 'communities?action=create', [
                'name' => $communityIdOrName,
                'type' => $type,
                'titleId' => $titleId
            ], HttpClient::JSON);

            $communityIdOrName = $response->id;
        }

        return new Community($this, $communityIdOrName);
    }
public function community(string $communityIdOrName, string $type = '', string $titleId = '') : Community
    {
        if (!empty($type) && !empty($titleId)) {
            // Create the Community.
            $response = $this->httpClient()->post(Community::COMMUNITY_ENDPOINT . 'communities?action=create', [
                'name' => $communityIdOrName,
                'type' => $type,
                'titleId' => $titleId
            ], HttpClient::JSON);

            $communityIdOrName = $response->id;
        }

        return new Community($this, $communityIdOrName);
    }
public function community ( string $ communityIdOrName , string $ type = '' , string $ titleId = '' ) : Community { if ( ! empty ( $ type ) && ! empty ( $ titleId ) ) { // Create the Community. $ response = $ this -> httpClient ( ) -> post ( Community :: COMMUNITY_ENDPOINT . 'communities?action=create' , [ 'name' => $ communityIdOrName , 'type' => $ type , 'titleId' => $ titleId ] , HttpClient :: JSON ) ; $ communityIdOrName = $ response -> id ; } return new Community ( $ this , $ communityIdOrName ) ; }
Get or create a Community.

@param string $communityIdOrName Community ID or the name of the new community.
@param string $type
@param string $titleId Game to associate your Community with.
@return Community
Get or create a Community .