HipChatServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 13
ccs 0
cts 12
cp 0
crap 2
rs 9.8333
c 0
b 0
f 0
1
<?php
2
3
namespace NotificationChannels\HipChat;
4
5
use GuzzleHttp\Client as HttpClient;
6
use Illuminate\Support\ServiceProvider;
7
8
class HipChatServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     */
13
    public function boot()
14
    {
15
        $this->app->when(HipChatChannel::class)
16
            ->needs(HipChat::class)
17
            ->give(function () {
18
                return new HipChat(
19
                    new HttpClient,
20
                    config('services.hipchat.url'),
21
                    config('services.hipchat.token'),
22
                    config('services.hipchat.room')
23
                );
24
            });
25
    }
26
}
27