| Total Complexity | 12 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 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 |
||
| 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 |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @param string $site_key |
||
| 70 | * @return $this |
||
| 71 | */ |
||
| 72 | public function setSiteKey(string $site_key): Client |
||
| 76 | } |
||
| 77 | } |
||
| 78 |