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.

NotifyServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Tylercd100\Notify\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use Tylercd100\Notify\Drivers\FleepHook;
7
use Tylercd100\Notify\Drivers\Flowdock;
8
use Tylercd100\Notify\Drivers\FromConfig;
9
use Tylercd100\Notify\Drivers\HipChat;
10
use Tylercd100\Notify\Drivers\Mail;
11
use Tylercd100\Notify\Drivers\Mailgun;
12
use Tylercd100\Notify\Drivers\Plivo;
13
use Tylercd100\Notify\Drivers\Pushover;
14
use Tylercd100\Notify\Drivers\Raven;
15
use Tylercd100\Notify\Drivers\Slack;
16
use Tylercd100\Notify\Drivers\Twilio;
17
18
class NotifyServiceProvider extends ServiceProvider
19
{
20 39
    public function register() {
21 39
        $this->mergeConfigFrom(__DIR__ . '/../../config/notify.php', 'notify');
22
23
        $registerMap = [
24 39
            'notify' => FromConfig::class,
25
            'notify-fleephook' => FleepHook::class,
26
            'notify-flowdock' => Flowdock::class,
27
            'notify-hipchat' => HipChat::class,
28
            'notify-mail' => Mail::class,
29
            'notify-mailgun' => Mailgun::class,
30
            'notify-plivo' => Plivo::class,
31
            'notify-pushover' => Pushover::class,
32
            'notify-raven' => Raven::class,
33
            'notify-slack' => Slack::class,
34
            'notify-twilio' => Twilio::class,
35
        ];
36
37 39
        $this->registerSingletonsFromMap($registerMap);
38 39
    }
39
40 39
    public function boot()
41
    {
42 39
        $this->publishes([
43 39
            __DIR__ . '/../../config/notify.php' => base_path('config/notify.php'),
44
        ]);   
45 39
    }
46
47 39
    private function registerSingletonsFromMap($map){
48 39
        foreach ($map as $key => $class) {
49 39
            $this->app->singleton($key, function() use ($class){
50 36
                return new $class;
51 39
            });
52
        }
53
    }
54
}