SteamApiServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 4
dl 0
loc 56
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 8 1
A registerAlias() 0 7 1
A provides() 0 4 1
1
<?php
2
3
namespace Syntax\SteamApi;
4
5
use Illuminate\Foundation\AliasLoader;
6
use Illuminate\Support\ServiceProvider;
7
8
class SteamApiServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Indicates if loading of the provider is deferred.
12
     *
13
     * @var bool
14
     */
15
    protected $defer = false;
16
17
    /**
18
     * Bootstrap the application events.
19
     *
20
     * @return void
21
     */
22
    public function boot()
23
    {
24
        $this->publishes([__DIR__ . '/../../config/config.php' => config_path('steam-api.php')]);
25
    }
26
27
    /**
28
     * Register the service provider.
29
     *
30
     * @return void
31
     */
32
    public function register()
33
    {
34
        $this->registerAlias();
35
36
        $this->app->singleton('steam-api', function () {
37
            return new Client;
38
        });
39
    }
40
41
    /**
42
     * Register the alias for package.
43
     *
44
     * @return void
45
     */
46
    protected function registerAlias()
47
    {
48
        $this->app->booting(function () {
49
            $loader = AliasLoader::getInstance();
50
            $loader->alias('Steam', 'Syntax\SteamApi\Facades\SteamApi');
51
        });
52
    }
53
54
    /**
55
     * Get the services provided by the provider.
56
     *
57
     * @return string[]
58
     */
59
    public function provides()
60
    {
61
        return ['steam-api'];
62
    }
63
}
64