WhatsAppServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 10
ccs 0
cts 8
cp 0
crap 2
rs 10
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