44
55namespace Laminas \Captcha ;
66
7- use Laminas \ReCaptcha \ReCaptcha as ReCaptchaService ;
7+ use Laminas \ReCaptcha \RecaptchaServiceInterface ;
88
99use function array_key_exists ;
1010use function is_array ;
1414/**
1515 * ReCaptcha adapter
1616 *
17- * Allows to insert captchas driven by ReCaptcha service
17+ * Allows inserting captchas driven by ReCaptcha service
1818 *
1919 * @see http://recaptcha.net/apidocs/captcha/
2020 */
@@ -23,7 +23,7 @@ class ReCaptcha extends AbstractAdapter
2323 /**
2424 * Recaptcha service object
2525 *
26- * @var ReCaptchaService
26+ * @var RecaptchaServiceInterface
2727 */
2828 protected $ service ;
2929
@@ -161,7 +161,7 @@ public function setPubKey($key)
161161 */
162162 public function __construct ($ options = null )
163163 {
164- $ this ->setService (new ReCaptchaService ());
164+ $ this ->setService ($ options [ ' service ' ] ?? new \ Laminas \ ReCaptcha \ ReCaptcha ());
165165 $ this ->serviceParams = $ this ->getService ()->getParams ();
166166 $ this ->serviceOptions = $ this ->getService ()->getOptions ();
167167
@@ -192,7 +192,7 @@ public function __construct($options = null)
192192 *
193193 * @return ReCaptcha Provides a fluent interface
194194 */
195- public function setService (ReCaptchaService $ service )
195+ public function setService (RecaptchaServiceInterface $ service )
196196 {
197197 $ this ->service = $ service ;
198198 return $ this ;
@@ -201,7 +201,7 @@ public function setService(ReCaptchaService $service)
201201 /**
202202 * Retrieve ReCaptcha service object
203203 *
204- * @return ReCaptchaService
204+ * @return RecaptchaServiceInterface
205205 */
206206 public function getService ()
207207 {
0 commit comments