| Total Complexity | 5 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | final class LnBitsBackendConfig implements BackendConfigInterface |
||
| 8 | { |
||
| 9 | private string $apiEndpoint = 'http://localhost:5000'; |
||
| 10 | private string $apiKey = ''; |
||
| 11 | |||
| 12 | 2 | private function __construct() |
|
| 14 | 2 | } |
|
| 15 | |||
| 16 | 2 | public static function withEndpointAndKey(string $endpoint, string $key): self |
|
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @return array{ |
||
|
|
|||
| 25 | * api_endpoint: string, |
||
| 26 | * api_key: string |
||
| 27 | * } |
||
| 28 | */ |
||
| 29 | 2 | public function jsonSerialize(): array |
|
| 34 | 2 | ]; |
|
| 35 | } |
||
| 36 | |||
| 37 | 2 | private function setApiEndpoint(string $apiEndpoint): self |
|
| 38 | { |
||
| 39 | 2 | $this->apiEndpoint = rtrim($apiEndpoint, '/'); |
|
| 40 | 2 | return $this; |
|
| 41 | } |
||
| 42 | |||
| 43 | 2 | private function setApiKey(string $apiKey): self |
|
| 47 | } |
||
| 48 | } |
||
| 49 |