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.

LaravelServiceProvider::register()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 22
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
dl 0
loc 22
rs 9.2
c 2
b 0
f 0
cc 3
eloc 12
nc 4
nop 0
1
<?php namespace RuleCom\Notifier;
2
3
use GuzzleHttp\Client;
4
use Illuminate\Support\ServiceProvider;
5
use Monolog\Logger;
6
use RuleCom\Notifier\Channels\Email;
7
use RuleCom\Notifier\Channels\Slack;
8
9
class LaravelServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Register the service provider.
13
     *
14
     * @return void
15
     */
16
    public function register()
17
    {
18
        $debugEnabled = $this->app['config']['rule-notifier']['debug'];
19
20
        $emailChannel = new Email(new Client, new Logger('Notification logger'));
21
        $emailChannel->apiKey($this->app['config']['rule-notifier']['api_key']);
22
23
        if ($debugEnabled) {
24
            $emailChannel->debug($this->app['config']['rule-notifier']['log_path']);
25
        }
26
27
        $this->app->instance(Email::class, $emailChannel);
28
29
        $slackChannel = new Slack(new Client, new Logger('Notification logger'));
30
        $slackChannel->endpoint($this->app['config']['rule-notifier']['slack_endpoint']);
31
32
        if ($debugEnabled) {
33
            $slackChannel->debug($this->app['config']['rule-notifier']['log_path']);
34
        }
35
36
        $this->app->instance(Slack::class, $slackChannel);
37
    }
38
39
    /**
40
     * Perform post-registration booting of services.
41
     *
42
     * @return void
43
     */
44
    public function boot()
45
    {
46
        $this->publishes([
47
            __DIR__.'/../config/rule-notifier.php' => $this->app->basePath() . '/config/rule-notifier.php',
48
        ]);
49
    }
50
}
51