BackdropHeadlessClientServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
c 2
b 0
f 0
dl 0
loc 61
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 14 2
A register() 0 11 1
1
<?php
2
3
namespace Robertgarrigos\BackdropHeadlessClient;
4
5
use Illuminate\Support\ServiceProvider;
6
use Robertgarrigos\BackdropHeadlessClient\BackdropHeadlessClient;
7
8
class BackdropHeadlessClientServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Indicates if loading of the provider is deferred.
12
     *
13
     * @var bool
14
     */
15
    // protected $defer = true;
16
17
    /**
18
     * Bootstrap the application services.
19
     */
20
    public function boot()
21
    {
22
        /*
23
         * Optional methods to load your package assets
24
         */
25
        // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'backdrop-headless-client');
26
        // $this->loadViewsFrom(__DIR__.'/../resources/views', 'backdrop-headless-client');
27
        // $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
28
        // $this->loadRoutesFrom(__DIR__.'/routes.php');
29
30
        if ($this->app->runningInConsole()) {
31
            $this->publishes([
32
                __DIR__ . '/../config/config.php' => config_path('backdrop-headless-client.php'),
33
            ], 'backdrop-config');
34
35
            // Publishing the views.
36
            /*$this->publishes([
37
                __DIR__.'/../resources/views' => resource_path('views/vendor/backdrop-headless-client'),
38
            ], 'views');*/
39
40
            // Publishing assets.
41
            /*$this->publishes([
42
                __DIR__.'/../resources/assets' => public_path('vendor/backdrop-headless-client'),
43
            ], 'assets');*/
44
45
            // Publishing the translation files.
46
            /*$this->publishes([
47
                __DIR__.'/../resources/lang' => resource_path('lang/vendor/backdrop-headless-client'),
48
            ], 'lang');*/
49
50
            // Registering package commands.
51
            // $this->commands([]);
52
        }
53
    }
54
55
    /**
56
     * Register the application services.
57
     */
58
    public function register()
59
    {
60
61
62
        // Register the main class to use with the facade
63
        $this->app->singleton('backdrop', function() {
64
            return new BackdropHeadlessClient();
65
        });
66
67
        // Automatically apply the package configuration
68
        $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'backdrop-headless-client');
69
    }
70
}
71