protected function validateCaptcha($token)
    {
        if (empty($token)) {
            throw new RuntimeException('Google reCAPTCHA response parameter is invalid or malformed.');
        }

        $secret = $this->recaptchaSecretKey();
        if (empty($secret)) {
            throw new RuntimeException('Google reCAPTCHA [apis.google.recaptcha.private_key] is not configured.');
        }

        $data = [
            'secret'   => $secret,
            'response' => $token,
        ];

        if (isset($_SERVER['REMOTE_ADDR'])) {
            $data['remoteip'] = $_SERVER['REMOTE_ADDR'];
        }

        $query = http_build_query($data);
        $url   = static::GOOGLE_RECAPTCHA_SERVER_URL.'?'.$query;

        $this->logger->debug(sprintf('Verifying reCAPTCHA user response: %s', $url));

        /**
         * @todo Use Guzzle
         */
        $result = file_get_contents($url);
        $result = (array)json_decode($result, true);

        $this->recaptchaLastToken  = $token;
        $this->recaptchaLastResult = $result;

        return isset($result['success']) && (bool)$result['success'];
    }