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