src/Client.php
private function _clansByFilter(array $params): array
    {
        $url = self::BASE_URL . self::CLANS_URL . '?';
        $url .= http_build_query($params);
        $curlClient = curl_init($url);
        curl_setopt($curlClient, CURLOPT_HTTPHEADER, $this->_curlHeader);
        curl_setopt($curlClient, CURLOPT_RETURNTRANSFER, true);
        $results = json_decode(curl_exec($curlClient), true);
        $clans   = [];
        foreach ($results['items'] as $result) {
            $clans[] = Clan::create($result);
        }

        return $clans;
    }
private function _clansByFilter(array $params): array
    {
        $url = self::BASE_URL . self::CLANS_URL . '?';
        $url .= http_build_query($params);
        $curlClient = curl_init($url);
        curl_setopt($curlClient, CURLOPT_HTTPHEADER, $this->_curlHeader);
        curl_setopt($curlClient, CURLOPT_RETURNTRANSFER, true);
        $results = json_decode(curl_exec($curlClient), true);
        $clans   = [];
        foreach ($results['items'] as $result) {
            $clans[] = Clan::create($result);
        }

        return $clans;
    }
private function _clansByFilter ( array $ params ) : array { $ url = self :: BASE_URL . self :: CLANS_URL . '?' ; $ url .= http_build_query ( $ params ) ; $ curlClient = curl_init ( $ url ) ; curl_setopt ( $ curlClient , CURLOPT_HTTPHEADER , $ this -> _curlHeader ) ; curl_setopt ( $ curlClient , CURLOPT_RETURNTRANSFER , true ) ; $ results = json_decode ( curl_exec ( $ curlClient ) , true ) ; $ clans = [ ] ; foreach ( $ results [ 'items' ] as $ result ) { $ clans [ ] = Clan :: create ( $ result ) ; } return $ clans ; }
Retrieves a list of clans, who matches a set of filters
@param array $params an array of filters. Keys are the names of filters, like
they are defined in the coc api, values are the filter values
@return array an array of clans who match the filters
Retrieves a list of clans who matches a set of filters