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 ( 676889...623b3f )
by Tyler
04:34
created

NotifyServiceProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 14
CRAP Score 1

Importance

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