Completed
Branch master (fafdd5)
by Cody
01:21
created

DiscordServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 27
ccs 0
cts 15
cp 0
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 5 1
A boot() 0 12 1
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