HermesServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Jenky\Hermes;
4
5
use Illuminate\Support\ServiceProvider;
6
use Jenky\Hermes\Contracts\Hermes;
7
8
class HermesServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap any package services.
12
     *
13
     * @return void
14
     */
15
    public function boot()
16
    {
17
        $this->registerPublishing();
18
    }
19
20
    /**
21
     * Register any package services.
22
     *
23
     * @return void
24
     */
25
    public function register()
26
    {
27
        $this->mergeConfigFrom(
28
            __DIR__.'/../config/hermes.php', 'hermes'
29
        );
30
31
        $this->app->singleton(Hermes::class, function ($app) {
32
            return new GuzzleManager($app);
33
        });
34
35
        $this->app->alias(Hermes::class, 'hermes');
36
    }
37
38
    /**
39
     * Register the package's publishable resources.
40
     *
41
     * @return void
42
     */
43
    protected function registerPublishing()
44
    {
45
        if ($this->app->runningInConsole()) {
46
            $this->publishes([
47
                __DIR__.'/../config/hermes.php' => config_path('hermes.php'),
48
            ], 'hermes-config');
49
        }
50
    }
51
}
52