You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Argument 2 passed to ReCaptcha\ReCaptcha::__construct() must be an instance of ReCaptcha\RequestMethod, instance of ReCaptcha\RequestMethod\Curl given
#80
I encountered this interesting error with recaptcha while developing for Silex (Symfony2). The error reads:
Catchable fatal error: Argument 2 passed to ReCaptcha\ReCaptcha::__construct() must be an instance of ReCaptcha\RequestMethod, instance of ReCaptcha\RequestMethod\Curl given
The error is caused by: $recaptcha = new \ReCaptcha\ReCaptcha( CAPTCHA_SECRET_KEY, new \ReCaptcha\RequestMethod\Curl() );
The fix is to modify the class definition, google/recaptcha/src/ReCaptcha/RequestMethod/Curl.php: Original:
class Curl
{...}
Fixed:
class Curl extends Post
{...}
It appears that it must either "implements RequestMethod" or "extend" something that does.
The text was updated successfully, but these errors were encountered:
The Curl class is a wrapper for the curl_* functions, the actual request method is the CurlPost class. However, this is not particularly readable as shown by the confusion it's caused. I'll probably move these down into a lower namespace to make it clear it's a supporting class.
I encountered this interesting error with recaptcha while developing for Silex (Symfony2). The error reads:
The error is caused by:
$recaptcha = new \ReCaptcha\ReCaptcha( CAPTCHA_SECRET_KEY, new \ReCaptcha\RequestMethod\Curl() );
The fix is to modify the class definition,
google/recaptcha/src/ReCaptcha/RequestMethod/Curl.php
:Original:
Fixed:
It appears that it must either "implements RequestMethod" or "extend" something that does.
The text was updated successfully, but these errors were encountered: