Passed
Push — master ( ac7ac5...67fb51 )
by Roberto
03:29
created

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
	 * @return array
23
	 */
24
	public function validateV3(): array {
25
26
		$token = request()->input(config('recaptcha.default_token_parameter_name', 'token'), '');
27
		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...
28
	}
29
}