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 ( 085ac4...03fbf9 )
by Atymic
20:31 queued 19:10
created

TwilioProvider::boot()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 26

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 19
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 26
ccs 19
cts 19
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\Arr;
6
use Illuminate\Support\ServiceProvider;
7
use Twilio\Rest\Client as TwilioService;
8
9
class TwilioProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     */
14 2
    public function boot()
15
    {
16 2
        $this->app->when(TwilioChannel::class)
17 2
            ->needs(Twilio::class)
18 2
            ->give(function () {
19 2
                return new Twilio(
20 2
                    $this->app->make(TwilioService::class),
21 2
                    $this->app->make(TwilioConfig::class)
22
                );
23 2
            });
24
25 2
        $this->app->bind(TwilioService::class, function () {
26 2
            $config = $this->app['config']['services.twilio'];
27 2
            $account_sid = Arr::get($config, 'account_sid');
28 2
            $username = Arr::get($config, 'username');
29 2
            if (! empty($username)) {
30 1
                $password = Arr::get($config, 'password');
31
32 1
                return new TwilioService($username, $password, $account_sid);
33
            } else {
34 1
                $auth_token = Arr::get($config, 'auth_token');
35
36 1
                return new TwilioService($account_sid, $auth_token);
37
            }
38 2
        });
39 2
    }
40
41
    /**
42
     * Register the application services.
43
     */
44
    public function register()
45
    {
46
        $this->app->bind(TwilioConfig::class, function () {
47
            return new TwilioConfig($this->app['config']['services.twilio']);
48
        });
49
    }
50
}
51