| Total Complexity | 4 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class Authentication implements Endpoint |
||
| 13 | { |
||
| 14 | private string $baseUrl; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var HttpClientHandler |
||
| 18 | */ |
||
| 19 | private HttpClientHandler $clientHandler; |
||
| 20 | |||
| 21 | public function __construct(ClientInterface $client, string $baseUrl, string $apiKey = null) |
||
| 22 | { |
||
| 23 | $this->baseUrl = $baseUrl; |
||
| 24 | |||
| 25 | $this->clientHandler = new HttpClientHandler($client); |
||
| 26 | if ($apiKey) { |
||
| 27 | $this->clientHandler->setApiKey($apiKey); |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Create a token to authenticate a user |
||
| 33 | * |
||
| 34 | * @param array $credentials |
||
| 35 | * @return mixed |
||
| 36 | * @throws GuzzleException |
||
| 37 | */ |
||
| 38 | public function login(array $credentials) |
||
| 42 | ); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Destroy a user token to end a session |
||
| 47 | * |
||
| 48 | * @param string $accessToken |
||
| 49 | * @return mixed |
||
| 50 | * @throws GuzzleException |
||
| 51 | */ |
||
| 52 | public function logout(string $accessToken) |
||
| 56 | ); |
||
| 57 | } |
||
| 59 |