RocketChatServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 6
dl 0
loc 22
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 14 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace NotificationChannels\RocketChat;
6
7
use GuzzleHttp\Client as HttpClient;
8
use Illuminate\Support\Facades\Config;
9
use Illuminate\Support\ServiceProvider;
10
11
final class RocketChatServiceProvider extends ServiceProvider
12
{
13
    /**
14
     * Bootstrap the application services.
15
     *
16
     * @return void
17
     */
18
    public function boot(): void
19
    {
20
        $this->app
21
            ->when(RocketChatWebhookChannel::class)
22
            ->needs(RocketChat::class)
23
            ->give(function () {
24
                return new RocketChat(
25
                    new HttpClient(),
26
                    Config::get('services.rocketchat.url'),
27
                    Config::get('services.rocketchat.token'),
28
                    Config::get('services.rocketchat.channel')
29
                );
30
            });
31
    }
32
}
33