Phalcon\Avatar\Gravatar::buildURL PHP Method

buildURL() protected method

Build the Gravatar URL based on the configuration and provided email address
protected buildURL ( string $email ) : string
$email string The email to get the gravatar for
return string
    protected function buildURL($email)
    {
        $url = static::HTTP_URL;
        if ($this->secureURL) {
            $url = static::HTTPS_URL;
        }
        $url .= $this->getEmailHash($email);
        $query = ['s' => $this->getSize(), 'r' => $this->getRating()];
        if ($this->defaultImage) {
            $query = array_merge($query, ['d' => $this->defaultImage]);
        }
        if ($this->forceDefault) {
            $query = array_merge($query, ['f' => 'y']);
        }
        $url .= '?' . http_build_query($query, '', '&');
        return $url;
    }