| Total Complexity | 9 |
| Total Lines | 70 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 5 | final class Environment |
||
| 6 | { |
||
| 7 | private $apiUrl; |
||
| 8 | private $apiKey; |
||
| 9 | private $apiSecret; |
||
| 10 | private $clientUsername; |
||
| 11 | private $channel; |
||
| 12 | private $appName; |
||
| 13 | |||
| 14 | public function __construct( |
||
| 15 | string $apiUrl, |
||
| 16 | string $apiKey, |
||
| 17 | string $apiSecret, |
||
| 18 | ?string $clientUsername = null, |
||
| 19 | ?string $appName = null, |
||
| 20 | ?string $channel = 'WEB' |
||
| 21 | ) { |
||
| 22 | $this->apiUrl = $apiUrl; |
||
| 23 | $this->apiKey = $apiKey; |
||
| 24 | $this->apiSecret = $apiSecret; |
||
| 25 | $this->clientUsername = $clientUsername; |
||
| 26 | $this->channel = $channel; |
||
| 27 | $this->appName = $appName; |
||
| 28 | } |
||
| 29 | |||
| 30 | public static function createWithUserName ( |
||
| 31 | string $apiUrl, |
||
| 32 | string $apiKey, |
||
| 33 | string $apiSecret, |
||
| 34 | ?string $clientUsername = null, |
||
| 35 | ?string $channel = null |
||
| 36 | ) :self { |
||
| 37 | return new self($apiUrl, $apiKey, $apiSecret, $clientUsername, null, $channel); |
||
| 38 | } |
||
| 39 | public static function createWithAppName ( |
||
| 47 | } |
||
| 48 | public function getApiUrl() :string |
||
| 49 | { |
||
| 50 | return $this->apiUrl; |
||
| 51 | } |
||
| 52 | |||
| 53 | public function getApiKey() :string |
||
| 56 | } |
||
| 57 | |||
| 58 | public function getApiSecret() : string |
||
| 61 | } |
||
| 62 | |||
| 63 | public function getClientUsername() : string |
||
| 64 | { |
||
| 65 | return $this->clientUsername; |
||
|
|
|||
| 66 | } |
||
| 67 | |||
| 68 | public function getChannel() : string |
||
| 71 | } |
||
| 72 | public function getAppName() : string |
||
| 75 | } |
||
| 76 | } |
||
| 77 |