Conditions | 2 |
Paths | 1 |
Total Lines | 26 |
Lines | 0 |
Ratio | 0 % |
Tests | 18 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
13 | 2 | public function boot() |
|
14 | { |
||
15 | 2 | $this->app->when(TwilioChannel::class) |
|
16 | 2 | ->needs(Twilio::class) |
|
17 | ->give(function () { |
||
18 | 2 | return new Twilio( |
|
19 | 2 | $this->app->make(TwilioService::class), |
|
20 | 2 | $this->app->make(TwilioConfig::class) |
|
21 | 2 | ); |
|
22 | 2 | }); |
|
23 | |||
24 | $this->app->bind(TwilioService::class, function () { |
||
25 | 2 | $config = $this->app['config']['services.twilio']; |
|
26 | 2 | $account_sid = array_get($config, 'account_sid'); |
|
|
|||
27 | 2 | $username = array_get($config, 'username'); |
|
28 | 2 | if (! empty($username)) { |
|
29 | 1 | $password = array_get($config, 'password'); |
|
30 | |||
31 | 1 | return new TwilioService($username, $password, $account_sid); |
|
32 | } else { |
||
33 | 1 | $auth_token = array_get($config, 'auth_token'); |
|
34 | |||
35 | 1 | return new TwilioService($account_sid, $auth_token); |
|
36 | } |
||
37 | 2 | }); |
|
38 | 2 | } |
|
39 | |||
50 |
This function has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.