Passed
Push — 2.x ( a2237c...c5863b )
by Terry
02:56
created

ItemReCaptcha   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 19
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 10 1
1
<?php
2
/*
3
 * This file is part of the Shieldon package.
4
 *
5
 * (c) Terry L. <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace Shieldon\Firewall\Firewall\Captcha;
14
15
use Shieldon\Firewall\Captcha\CaptchaInterface;
16
use Shieldon\Firewall\Captcha\ReCaptcha;
17
18
/**
19
 * Get File driver.
20
 */
21
class ItemReCaptcha
22
{
23
    /**
24
     * Initialize and get the instance.
25
     *
26
     * @param array $setting The configuration of that driver.
27
     *
28
     * @return CaptchaInterface
29
     */
30
    public static function get(array $setting): CaptchaInterface
31
    {
32
        $recaptchaSetting = [
33
            'key'     => $setting['config']['site_key'],
34
            'secret'  => $setting['config']['secret_key'],
35
            'version' => $setting['config']['version'],
36
            'lang'    => $setting['config']['lang'],
37
        ];
38
39
        return new ReCaptcha($recaptchaSetting);
40
    }
41
}