Completed
Push — master ( 97e8d1...15f2c9 )
by Cody
02:35
created

DiscordServiceProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 2
1
<?php
2
3
namespace NotificationChannels\Discord;
4
5
use Illuminate\Support\ServiceProvider;
6
use NotificationChannels\Discord\Commands\SetupCommand;
7
8
class DiscordServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Register the application services.
12
     */
13
    public function register()
14
    {
15
        $this->app->bind('command.discord:setup', SetupCommand::class);
16
        $this->commands('command.discord:setup');
17
    }
18
19
    /**
20
     * Bootstrap the application services.
21
     */
22
    public function boot()
23
    {
24
        $token = $this->app->make('config')->get('services.discord.token');
25
26
        $this->app->when(Discord::class)
27
            ->needs('$token')
28
            ->give($token);
29
30
        $this->app->when(SetupCommand::class)
31
            ->needs('$token')
32
            ->give($token);
33
    }
34
}
35