GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 1781dd...987681 )
by Gregorio
02:39
created

TwilioProvider::boot()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 26

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 18
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 26
ccs 18
cts 18
cp 1
rs 9.504
c 0
b 0
f 0
cc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace NotificationChannels\Twilio;
4
5
use Illuminate\Support\ServiceProvider;
6
use Twilio\Rest\Client as TwilioService;
7
8
class TwilioProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     */
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');
0 ignored issues
show
Deprecated Code introduced by
The function array_get() has been deprecated with message: Arr::get() should be used directly instead. Will be removed in Laravel 5.9.

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.

Loading history...
27 2
            $username = array_get($config, 'username');
0 ignored issues
show
Deprecated Code introduced by
The function array_get() has been deprecated with message: Arr::get() should be used directly instead. Will be removed in Laravel 5.9.

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.

Loading history...
28 2
            if (! empty($username)) {
29 1
                $password = array_get($config, 'password');
0 ignored issues
show
Deprecated Code introduced by
The function array_get() has been deprecated with message: Arr::get() should be used directly instead. Will be removed in Laravel 5.9.

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.

Loading history...
30
31 1
                return new TwilioService($username, $password, $account_sid);
32
            } else {
33 1
                $auth_token = array_get($config, 'auth_token');
0 ignored issues
show
Deprecated Code introduced by
The function array_get() has been deprecated with message: Arr::get() should be used directly instead. Will be removed in Laravel 5.9.

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.

Loading history...
34
35 1
                return new TwilioService($account_sid, $auth_token);
36
            }
37 2
        });
38 2
    }
39
40
    /**
41
     * Register the application services.
42
     */
43
    public function register()
44
    {
45
        $this->app->bind(TwilioConfig::class, function () {
46
            return new TwilioConfig($this->app['config']['services.twilio']);
47
        });
48
    }
49
}
50