Skip to content

Commit 5fe5b6b

Browse files
committed
feat: use laminas-recaptcha 3.8.0's RecaptchaServiceInterface
Signed-off-by: Kent Rasmussen <hyprkookeez@gmail.com>
1 parent 71d1bc7 commit 5fe5b6b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"extra": {},
2828
"require": {
2929
"php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
30-
"laminas/laminas-recaptcha": "^3.4.0",
30+
"laminas/laminas-recaptcha": "^3.8.0",
3131
"laminas/laminas-session": "^2.12",
3232
"laminas/laminas-stdlib": "^3.10.1",
3333
"laminas/laminas-text": "^2.9.0",

src/ReCaptcha.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Laminas\Captcha;
66

7-
use Laminas\ReCaptcha\ReCaptcha as ReCaptchaService;
7+
use Laminas\ReCaptcha\RecaptchaServiceInterface;
88

99
use function array_key_exists;
1010
use function is_array;
@@ -14,7 +14,7 @@
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

Comments
 (0)