Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions src/ReCaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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/
*/
Expand All @@ -23,7 +23,7 @@ class ReCaptcha extends AbstractAdapter
/**
* Recaptcha service object
*
* @var ReCaptchaService
* @var ReCaptchaServiceInterface
*/
protected $service;

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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;
Expand All @@ -201,7 +201,7 @@ public function setService(ReCaptchaService $service)
/**
* Retrieve ReCaptcha service object
*
* @return ReCaptchaService
* @return ReCaptchaServiceInterface
*/
public function getService()
{
Expand Down