LineServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 15 1
A register() 0 3 1
1
<?php
2
3
namespace NotificationChannels\Line;
4
5
use LINE\LINEBot;
6
use Illuminate\Support\ServiceProvider;
7
use LINE\LINEBot\HTTPClient\CurlHTTPClient;
8
9
class LineServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     */
14
    public function boot()
15
    {
16
        // Bootstrap code here.
17
18
        $this->app->when(LineChannel::class)
19
            ->needs(LINEBot::class)
20
            ->give(function () {
21
                $httpClient = new CurlHTTPClient(config('services.line.token'));
22
23
                return new LINEBot(
24
                    $httpClient,
25
                    ['channelSecret' => config('services.line.secret')]
26
                );
27
            });
28
    }
29
30
    /**
31
     * Register the application services.
32
     */
33
    public function register()
34
    {
35
    }
36
}
37