ARCANEDEV/noCAPTCHA

Add PSR-7 ServerRequest verify method

arcanedev-maroc opened this issue · 0 comments

PSR-7 HTTP Message Interface is a common interface to represent http messages, so they can be shared between frameworks and libraries etc.

Using the ServerRequest interface can simplify handling the parameters. Example usage:

use Arcanedev\NoCaptcha\NoCaptcha;
use Psr\Http\Message\ServerRequestInterface;
// ...

public function postForm(ServerRequestInterface $request)
{
    $noCaptcha = new NoCaptcha('MY_SECRET_KEY');
    $response  = $noCaptcha->verifyRequest($request);
}

It isn't needed to actually require the interface, if people don't want to use it.