| Conditions | 1 |
| Paths | 1 |
| Total Lines | 28 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function boot() |
||
| 16 | { |
||
| 17 | $this->app->afterResolving(ChannelManager::class, function (ChannelManager $channels) { |
||
| 18 | $channels->extend('sipgate', function ($app) { |
||
| 19 | /* @var Application $app */ |
||
| 20 | return $app->make(SipgateChannel::class); |
||
| 21 | }); |
||
| 22 | }); |
||
| 23 | |||
| 24 | $this->app->when(SipgateChannel::class) |
||
| 25 | ->needs('$smsId') |
||
| 26 | ->give($this->app['config']['services.sipgate.smsId']); |
||
| 27 | |||
| 28 | $this->app->when(SipgateChannel::class) |
||
| 29 | ->needs('$channelEnabled') |
||
| 30 | ->give($this->app['config']['services.sipgate.enabled']); |
||
| 31 | |||
| 32 | $this->app->bind(SipgateClient::class, function () { |
||
| 33 | return new SipgateClient( |
||
| 34 | new Client([ |
||
| 35 | 'base_uri' => 'https://api.sipgate.com/v2/', |
||
| 36 | 'auth' => [ |
||
| 37 | $this->app['config']['services.sipgate.username'], |
||
| 38 | $this->app['config']['services.sipgate.password'], |
||
| 39 | ], |
||
| 40 | 'headers' => [ |
||
| 41 | 'Accept' => 'application/json', |
||
| 42 | 'Content-Type' => 'application/json', |
||
| 43 | ], |
||
| 49 |