Passed
Push — master ( 71d0aa...52238f )
by Andrés
04:41
created

HablameSmsServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 31
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 17 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 4
    public function boot()
14
    {
15
        // Bootstrap code here.
16 4
    }
17
18
    /**
19
     * Register the application services.
20
     */
21 4
    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 4
            $callback = Config::get('services.hablame_sms.guzzle');
27
28
            /** @var \GuzzleHttp\Client|null $http */
29 4
            $http = isset($callback) ? $callback() : null;
30
31 4
            return new Client(
32 4
                Config::get('services.hablame_sms.cliente'),
33 4
                Config::get('services.hablame_sms.api'),
34 4
                $http
35
            );
36 4
        });
37 4
    }
38
}
39