| Conditions | 2 |
| Paths | 1 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 17 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | 2 | public function boot() |
|
| 16 | { |
||
| 17 | 2 | $this->app->when(MobilyWsChannel::class) |
|
| 18 | 2 | ->needs(MobilyWsApi::class) |
|
| 19 | ->give(function () { |
||
| 20 | 2 | $mobilyWsConfig = $this->app['config']['mobilyws']; |
|
| 21 | 2 | if (is_null($mobilyWsConfig)) { |
|
| 22 | 1 | throw CouldNotSendMobilyWsNotification::withErrorMessage('Config file was not found. Please publish the config file'); |
|
| 23 | } |
||
| 24 | |||
| 25 | 1 | return new MobilyWsApi( |
|
| 26 | 1 | new MobilyWsConfig($mobilyWsConfig), |
|
| 27 | 1 | new Client( |
|
| 28 | 1 | $mobilyWsConfig['guzzle']['client'] |
|
| 29 | 1 | ) |
|
| 30 | 1 | ); |
|
| 31 | 2 | }); |
|
| 32 | |||
| 33 | 1 | $this->publishes([ |
|
| 34 | 1 | __DIR__.'/../config/mobilyws.php' => config_path('mobilyws.php'), |
|
| 35 | 1 | ]); |
|
| 36 | 1 | } |
|
| 37 | |||
| 55 |