MicrosoftTeamsServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 12 1
A register() 0 6 1
1
<?php
2
3
namespace NotificationChannels\MicrosoftTeams;
4
5
use GuzzleHttp\Client as HttpClient;
6
use Illuminate\Container\Container;
7
use Illuminate\Support\Facades\Notification;
8
use Illuminate\Support\ServiceProvider;
9
10
class MicrosoftTeamsServiceProvider extends ServiceProvider
11
{
12
    /**
13
     * Bootstrap the application services.
14
     */
15
    public function boot()
16
    {
17
        // Bootstrap code here.
18
19
        $this->app->when(MicrosoftTeamsChannel::class)
20
            ->needs(MicrosoftTeams::class)
21
            ->give(static function () {
22
                return new MicrosoftTeams(
23
                    new HttpClient()
24
                );
25
            });
26
    }
27
28
    /**
29
     * Register the application services.
30
     */
31
    public function register()
32
    {
33
        Notification::extend('teams', static function (Container $app) {
34
            return $app->make(MicrosoftTeamsChannel::class);
35
        });
36
    }
37
}
38