| Conditions | 2 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function register() |
||
| 15 | { |
||
| 16 | $this->app->when(ZendeskChannel::class) |
||
| 17 | ->needs(HttpClient::class) |
||
| 18 | ->give(function () { |
||
| 19 | $config = config('services.zendesk'); |
||
| 20 | if (! isset($config['subdomin'], $config['username'], $config['token'])) { |
||
| 21 | throw InvalidConfiguration::configurationNotSet(); |
||
| 22 | } |
||
| 23 | |||
| 24 | $client = new HttpClient($config['subdomin']); |
||
| 25 | $client->setAuth('basic', ['username' => $config['username'], 'token' => $config['token']]); |
||
| 26 | |||
| 27 | return $client; |
||
| 28 | }); |
||
| 29 | } |
||
| 30 | } |
||
| 31 |