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.

MessagebirdServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 0
cts 11
cp 0
rs 9.7998
c 0
b 0
f 0
cc 2
nc 1
nop 0
crap 6
1
<?php
2
3
namespace NotificationChannels\Messagebird;
4
5
use GuzzleHttp\Client;
6
use Illuminate\Support\ServiceProvider;
7
use NotificationChannels\Messagebird\Exceptions\InvalidConfiguration;
8
9
class MessagebirdServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     */
14
    public function boot()
15
    {
16
        $this->app->when(MessagebirdChannel::class)
17
            ->needs(MessagebirdClient::class)
18
            ->give(function () {
19
                $config = config('services.messagebird');
20
21
                if (is_null($config)) {
22
                    throw InvalidConfiguration::configurationNotSet();
23
                }
24
25
                return new MessagebirdClient(new Client(), $config['access_key']);
26
            });
27
    }
28
}
29