Passed
Push — master ( 26f295...e4804f )
by Roberto
02:49
created

ReCaptchaBuilderV2::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Copyright (c) 2017 - present
4
 * LaravelGoogleRecaptcha - ReCaptchaBuilderV2.php
5
 * author: Roberto Belotti - [email protected]
6
 * web : robertobelotti.com, github.com/biscolab
7
 * Initial version created on: 12/9/2018
8
 * MIT license: https://github.com/biscolab/laravel-recaptcha/blob/master/LICENSE
9
 */
10
11
namespace Biscolab\ReCaptcha;
12
13
/**
14
 * Class ReCaptchaBuilderV2
15
 * @package Biscolab\ReCaptcha
16
 */
17
class ReCaptchaBuilderV2 extends ReCaptchaBuilder {
18
19
    /**
20
     * ReCaptchaBuilderV2 constructor.
21
     *
22
     * @param string $api_site_key
23
     * @param string $api_secret_key
24
     */
25
    public function __construct(string $api_site_key, string $api_secret_key) {
26
        parent::__construct($api_site_key, $api_secret_key, 'v2');
27
    }
28
29
    /**
30
     * Write ReCAPTCHA HTML tag in your FORM
31
     * Insert before </form> tag
32
     * @return string
33
     */
34
    public function htmlFormSnippet(): string {
35
36
        return ($this->version == 'v2') ? '<div class="g-recaptcha" data-sitekey="' . $this->api_site_key . '"></div>' : '';
37
    }
38
39
}