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 ( 1ecb69...1e2954 )
by Freek
02:33
created

OneSignalServiceProvider::boot()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 18
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 18
rs 9.4285
cc 2
eloc 11
nc 1
nop 0
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