diff --git a/composer.json b/composer.json index d45d23c0..bfacaed0 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "extra": {}, "require": { "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", - "laminas/laminas-recaptcha": "^3.4.0", + "laminas/laminas-recaptcha": "^3.8.0", "laminas/laminas-session": "^2.12", "laminas/laminas-stdlib": "^3.10.1", "laminas/laminas-text": "^2.9.0", diff --git a/src/ReCaptcha.php b/src/ReCaptcha.php index 34be5d3b..172ae5f6 100644 --- a/src/ReCaptcha.php +++ b/src/ReCaptcha.php @@ -4,7 +4,7 @@ namespace Laminas\Captcha; -use Laminas\ReCaptcha\ReCaptcha as ReCaptchaService; +use Laminas\ReCaptcha\ReCaptchaServiceInterface; use function array_key_exists; use function is_array; @@ -14,7 +14,7 @@ /** * ReCaptcha adapter * - * Allows to insert captchas driven by ReCaptcha service + * Allows inserting captchas driven by ReCaptcha service * * @see http://recaptcha.net/apidocs/captcha/ */ @@ -23,7 +23,7 @@ class ReCaptcha extends AbstractAdapter /** * Recaptcha service object * - * @var ReCaptchaService + * @var ReCaptchaServiceInterface */ protected $service; @@ -161,7 +161,7 @@ public function setPubKey($key) */ public function __construct($options = null) { - $this->setService(new ReCaptchaService()); + $this->setService($options['service'] ?? new \Laminas\ReCaptcha\ReCaptcha()); $this->serviceParams = $this->getService()->getParams(); $this->serviceOptions = $this->getService()->getOptions(); @@ -192,7 +192,7 @@ public function __construct($options = null) * * @return ReCaptcha Provides a fluent interface */ - public function setService(ReCaptchaService $service) + public function setService(ReCaptchaServiceInterface $service) { $this->service = $service; return $this; @@ -201,7 +201,7 @@ public function setService(ReCaptchaService $service) /** * Retrieve ReCaptcha service object * - * @return ReCaptchaService + * @return ReCaptchaServiceInterface */ public function getService() {