AbstractScoreThreshold   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getFrontendConfig() 0 3 1
A getBackendConfig() 0 3 1
A __construct() 0 8 1
A getGeneralConfig() 0 3 1
1
<?php
2
/**
3
 * Copyright (c) 2019. Volodymyr Hryvinskyi.  All rights reserved.
4
 * @author: <mailto:[email protected]>
5
 * @github: <https://github.com/hryvinskyi>
6
 */
7
8
declare(strict_types=1);
9
10
namespace Hryvinskyi\InvisibleCaptcha\Model\ScoreThreshold;
11
12
use Hryvinskyi\InvisibleCaptcha\Helper\Config\Backend;
13
use Hryvinskyi\InvisibleCaptcha\Helper\Config\Frontend;
14
use Hryvinskyi\InvisibleCaptcha\Helper\Config\General;
15
use Hryvinskyi\InvisibleCaptcha\Model\ScoreThresholdInterface;
16
17
/**
18
 * Class AbstractScoreThreshold
19
 */
20
abstract class AbstractScoreThreshold implements ScoreThresholdInterface
21
{
22
    /**
23
     * @var General
24
     */
25
    private $generalConfig;
26
27
    /**
28
     * @var Frontend
29
     */
30
    private $frontendConfig;
31
32
    /**
33
     * @var Backend
34
     */
35
    private $backendConfig;
36
37
    /**
38
     * AbstractScoreThreshold constructor.
39
     *
40
     * @param General $generalConfig
41
     * @param Frontend $frontendConfig
42
     * @param Backend $backendConfig
43
     */
44
    public function __construct(
45
        General $generalConfig,
46
        Frontend $frontendConfig,
47
        Backend $backendConfig
48
    ) {
49
        $this->generalConfig = $generalConfig;
50
        $this->frontendConfig = $frontendConfig;
51
        $this->backendConfig = $backendConfig;
52
    }
53
54
    /**
55
     * @return General
56
     */
57
    public function getGeneralConfig(): General
58
    {
59
        return $this->generalConfig;
60
    }
61
62
    /**
63
     * @return Frontend
64
     */
65
    public function getFrontendConfig(): Frontend
66
    {
67
        return $this->frontendConfig;
68
    }
69
70
    /**
71
     * @return Backend
72
     */
73
    public function getBackendConfig(): Backend
74
    {
75
        return $this->backendConfig;
76
    }
77
}