HasParamsTrait::getSecretKey()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace ByTIC\GoogleRecaptcha\Config\Traits;
4
5
/**
6
 * Trait HasParamsTrait
7
 * @package ByTIC\GoogleRecaptcha\Config\Traits
8
 */
9
trait HasParamsTrait
10
{
11
    /**
12
     * @var boolean
13
     */
14
    protected $enabled = false;
15
16
    /**
17
     * @var string
18
     */
19
    protected $siteKey;
20
21
    /**
22
     * @var string
23
     */
24
    protected $secretKey;
25
26
    /**
27
     * @return bool
28
     */
29
    public function isEnabled(): bool
30
    {
31
        return $this->enabled;
32
    }
33
34
    /**
35
     * @param bool $enabled
36
     */
37
    public function setEnabled($enabled): void
38
    {
39
        $enabled = ($enabled === true || $enabled === '1' || $enabled === 'true');
40
        $this->enabled = $enabled;
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getSiteKey()
47
    {
48
        return $this->siteKey;
49
    }
50
51
    /**
52
     * @param string $siteKey
53
     */
54
    public function setSiteKey(string $siteKey)
55
    {
56
        $this->siteKey = $siteKey;
57
    }
58
59
    /**
60
     * @return string
61
     */
62
    public function getSecretKey()
63
    {
64
        return $this->secretKey;
65
    }
66
67
    /**
68
     * @param string $secretKey
69
     */
70
    public function setSecretKey(string $secretKey)
71
    {
72
        $this->secretKey = $secretKey;
73
    }
74
}
75