ReCaptchaController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 12
rs 10
ccs 3
cts 3
cp 1
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A validateV3() 0 6 1
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
}