| Conditions | 3 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | public function boot() |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Bootstrap the application services. |
||
| 18 | */ |
||
| 19 | $this->app->when(AfricasTalkingChannel::class) |
||
| 20 | ->needs(AfricasTalkingSDK::class) |
||
| 21 | ->give(function () { |
||
| 22 | $userName = config('services.africastalking.username'); |
||
| 23 | $key = config('services.africastalking.key'); |
||
| 24 | if (is_null($userName) || is_null($key)) { |
||
| 25 | throw InvalidConfiguration::configurationNotSet(); |
||
| 26 | } |
||
| 27 | $at = new AfricasTalkingSDK( |
||
| 28 | $userName, |
||
| 29 | $key |
||
| 30 | ); |
||
| 31 | |||
| 32 | return $at->sms(); |
||
| 33 | }); |
||
| 36 |