| Conditions | 4 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4.0218 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | 1 | public function httpClient(): PendingRequest |
|
| 33 | { |
||
| 34 | 1 | $token = $this->auth->getToken(); |
|
| 35 | 1 | if (!$token || !($token instanceof AccessToken) || !$token->valid()) { |
|
| 36 | throw new WorkcastException('Token not valid'); |
||
| 37 | } |
||
| 38 | |||
| 39 | 1 | return Http::withToken($token->getToken()) |
|
| 40 | 1 | ->withOptions(array_merge( |
|
| 41 | 1 | config('workcast.http_registration_config', []), |
|
| 42 | 1 | [ |
|
| 43 | 1 | 'base_uri' => config('workcast.registration_url'), |
|
| 44 | 1 | ] |
|
| 48 |