Issues (16)

src/Controllers/ReCaptchaController.php (1 issue)

1
<?php
2
/**
3
 * Copyright (c) 2017 - present
4
 * LaravelGoogleRecaptcha - ReCaptchaController.php
5
 * author: Roberto Belotti - [email protected]
6
 * web : robertobelotti.com, github.com/biscolab
7
 * Initial version created on: 4/2/2019
8
 * MIT license: https://github.com/biscolab/laravel-recaptcha/blob/master/LICENSE
9
 */
10
11
namespace Biscolab\ReCaptcha\Controllers;
12
13
use Illuminate\Routing\Controller;
14
15
/**
16
 * Class ReCaptchaController
17
 * @package Biscolab\ReCaptcha\Controllers
18
 */
19
class ReCaptchaController extends Controller
20
{
21
22
	/**
23
	 * @return array
24
	 */
25 1
	public function validateV3(): array
26
	{
27
28 1
		$token = request()->input(config('recaptcha.default_token_parameter_name', 'token'), '');
29
30 1
		return recaptcha()->validate($token);
0 ignored issues
show
Bug Best Practice introduced by
The expression return recaptcha()->validate($token) could return the type boolean which is incompatible with the type-hinted return array. Consider adding an additional type-check to rule them out.
Loading history...
31
	}
32
}