WhatsAppServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 7
c 2
b 0
f 0
dl 0
loc 15
ccs 0
cts 8
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 1
1
<?php
2
3
namespace NotificationChannels\WhatsApp;
4
5
use Illuminate\Support\ServiceProvider;
6
use Netflie\WhatsAppCloudApi\WhatsAppCloudApi;
7
8
class WhatsAppServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Register the application services.
12
     */
13
    public function register()
14
    {
15
        $config = [
16
            'from_phone_number_id' => $this->app->make('config')->get('services.whatsapp.from-phone-number-id'),
17
            'access_token' => $this->app->make('config')->get('services.whatsapp.token'),
18
            'graph_version' => $this->app->make('config')->get('services.whatsapp.graph_version', WhatsAppCloudApi::DEFAULT_GRAPH_VERSION),
19
            'timeout' => $this->app->make('config')->get('services.whatsapp.timeout'),
20
        ];
21
22
        $this->app->bind(WhatsAppCloudApi::class, static fn () => new WhatsAppCloudApi($config));
23
    }
24
}
25