| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | 4 | public function getToken(?string $refreshToken = null): array |
|
| 34 | { |
||
| 35 | 4 | $response = $this->client->request('POST', $this->config['token_uri'], [ |
|
| 36 | 4 | 'headers' => [ |
|
| 37 | 4 | 'Accept' => 'application/json', |
|
| 38 | 4 | 'Content-Type' => 'application/json', |
|
| 39 | 4 | 'Authorization' => 'Basic '.base64_encode($this->config['client_id'].':'.$this->config['client_secret']), |
|
| 40 | 4 | ], |
|
| 41 | 4 | 'json' => [ |
|
| 42 | 4 | 'grant_type' => 'client_credentials', |
|
| 43 | 4 | 'scope' => $this->config['scope'], |
|
| 44 | 4 | ], |
|
| 45 | 4 | ]); |
|
| 46 | |||
| 47 | 3 | return json_decode($response->getBody(), true); |
|
| 48 | } |
||
| 50 |