AlgoliaConfig::getApiKey()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace leinonen\Yii2Algolia;
4
5
class AlgoliaConfig
6
{
7
    /**
8
     * @var string
9
     */
10
    private $applicationId;
11
12
    /**
13
     * @var string
14
     */
15
    private $apiKey;
16
17
    /**
18
     * @var array|null
19
     */
20
    private $hostsArray;
21
22
    /**
23
     * @var array
24
     */
25
    private $options;
26
27
    /**
28
     * Initiates a new AlgoliaConfig.
29
     *
30
     * @param string $applicationId The application ID you have in your admin interface
31
     * @param string $apiKey A valid API key for the service
32
     * @param null|array $hostsArray The list of hosts that you have received for the service
33
     * @param array $options
34
     */
35 34
    public function __construct($applicationId, $apiKey, $hostsArray = null, $options = [])
36
    {
37 34
        $this->applicationId = $applicationId;
38 34
        $this->apiKey = $apiKey;
39 34
        $this->hostsArray = $hostsArray;
40 34
        $this->options = $options;
41 34
    }
42
43
    /**
44
     * @return string
45
     */
46 29
    public function getApplicationId()
47
    {
48 29
        return $this->applicationId;
49
    }
50
51
    /**
52
     * @return string
53
     */
54 29
    public function getApiKey()
55
    {
56 29
        return $this->apiKey;
57
    }
58
59
    /**
60
     * @return array|null
61
     */
62 29
    public function getHostsArray()
63
    {
64 29
        return $this->hostsArray;
65
    }
66
67
    /**
68
     * @return array
69
     */
70 29
    public function getOptions()
71
    {
72 29
        return $this->options;
73
    }
74
}
75