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.

OneSignalServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 18

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

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