GeoLocationServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
dl 0
loc 57
c 2
b 0
f 0
wmc 3
lcom 1
cbo 2
ccs 14
cts 14
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 12 1
A boot() 0 6 1
A provides() 0 6 1
1
<?php namespace Arcanedev\GeoLocation;
2
3
use Arcanedev\Support\PackageServiceProvider;
4
5
/**
6
 * Class     GeoLocationServiceProvider
7
 *
8
 * @package  Arcanedev\GeoLocation
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class GeoLocationServiceProvider extends PackageServiceProvider
12
{
13
    /* -----------------------------------------------------------------
14
     |  Properties
15
     | -----------------------------------------------------------------
16
     */
17
18
    /**
19
     * Package name.
20
     *
21
     * @var string
22
     */
23
    protected $package = 'geo-location';
24
25
    /* -----------------------------------------------------------------
26
     |  Main Methods
27
     | -----------------------------------------------------------------
28
     */
29
30
    /**
31
     * Register the service provider.
32
     */
33 255
    public function register()
34
    {
35 255
        parent::register();
36
37 255
        $this->registerConfig();
38
39 255
        $this->bind(\GuzzleHttp\ClientInterface::class, \GuzzleHttp\Client::class);
40
41 255
        $this->singleton(Contracts\GoogleManager::class, function ($app) {
42 57
            return new Google\GoogleManager($app);
43 255
        });
44 255
    }
45
46
    /**
47
     * Boot the service provider.
48
     */
49 255
    public function boot()
50
    {
51 255
        parent::boot();
52
53 255
        $this->publishConfig();
54 255
    }
55
56
    /**
57
     * Get the services provided by the provider.
58
     *
59
     * @return array
60
     */
61 3
    public function provides()
62
    {
63
        return [
64 3
            Contracts\GoogleManager::class,
65
        ];
66
    }
67
}
68