HablameSmsServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 9
c 2
b 0
f 0
dl 0
loc 28
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 2 1
A register() 0 15 2
1
<?php
2
3
namespace Andreshg112\HablameSms;
4
5
use Illuminate\Support\Facades\Config;
6
use Illuminate\Support\ServiceProvider;
7
8
class HablameSmsServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     */
13 6
    public function boot()
14
    {
15
        // Bootstrap code here.
16 6
    }
17
18
    /**
19
     * Register the application services.
20
     */
21 6
    public function register()
22
    {
23
        // Register the main class to use with the facade
24
        $this->app->singleton('hablame-sms', function () {
25
            /** @var \Closure $callback */
26 6
            $callback = Config::get('services.hablame_sms.guzzle');
27
28
            /** @var \GuzzleHttp\Client|null $http */
29 6
            $http = isset($callback) ? $callback() : null;
30
31 6
            return new Client(
32 6
                Config::get('services.hablame_sms.account'),
33 6
                Config::get('services.hablame_sms.apikey'),
34 6
                Config::get('services.hablame_sms.token'),
35
                $http
36 6
            );
37 6
        });
38
    }
39
}
40