Passed
Push — main ( cdba00...5be1cc )
by Dylan
01:51
created

Client::setSiteKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Lifeboat\SDK;
4
5
/**
6
 * Class Client
7
 * @package Lifeboat\SDK
8
 */
9
class Client {
10
11
    const AUTH_DOMAIN = 'https://accounts.lifeboat.app';
12
13
    private $_api_key = '';
14
    private $_api_secret = '';
15
    private $_app_id = '';
16
    private $_app_secret = '';
17
    private $_site_key = '';
18
19
    public function __construct(array $config)
20
    {
21
        if (array_key_exists('api_key', $config)) $this->_api_key = $config['api_key'];
22
        if (array_key_exists('api_secret', $config)) $this->_api_secret = $config['api_secret'];
23
        if (array_key_exists('app_id', $config)) $this->_app_id = $config['app_id'];
24
        if (array_key_exists('app_secret', $config)) $this->_app_secret = $config['app_secret'];
25
        if (array_key_exists('site_key', $config)) $this->setSiteKey($config['site_key']);
26
    }
27
28
    /**
29
     * @return string
30
     */
31
    public function getAPIKey(): string
32
    {
33
        return $this->_api_key;
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function getAPISecret(): string
40
    {
41
        return $this->_api_key;
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function getAppID(): string
48
    {
49
        return $this->_api_key;
50
    }
51
52
    /**
53
     * @return string
54
     */
55
    public function getAppSecret(): string
56
    {
57
        return $this->_api_key;
58
    }
59
60
    /**
61
     * @return string
62
     */
63
    public function getSiteKey(): string
64
    {
65
        return $this->_site_key;
66
    }
67
68
    /**
69
     * @param string $site_key
70
     * @return $this
71
     */
72
    public function setSiteKey(string $site_key): Client
73
    {
74
        $this->_site_key = $site_key;
75
        return $this;
76
    }
77
}
78