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

ItemReCaptcha::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 0
loc 10
rs 10
c 1
b 0
f 0
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
}