SteamApiServiceProvider::provides()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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