LaravelVersioningHelperServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 45
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 30 2
A register() 0 5 1
1
<?php
2
3
namespace Swatty007\LaravelVersioningHelper;
4
5
use Illuminate\Support\ServiceProvider;
6
use Swatty007\LaravelVersioningHelper\Console\Command\VersioningHelper;
7
use Swatty007\LaravelVersioningHelper\Views\Components\ApplicationName;
8
use Swatty007\LaravelVersioningHelper\Views\Components\BuildString;
9
use Swatty007\LaravelVersioningHelper\Views\Components\Copyright;
10
use Swatty007\LaravelVersioningHelper\Views\Components\Version;
11
12
class LaravelVersioningHelperServiceProvider extends ServiceProvider
13
{
14
    /**
15
     * Bootstrap the application services.
16
     */
17
    public function boot()
18
    {
19
        /*
20
         * Optional methods to load your package assets
21
         */
22
        $this->loadViewsFrom(__DIR__.'/../resources/views', 'laravel-versioning-helper');
23
24
        if ($this->app->runningInConsole()) {
25
            $this->publishes([
26
                __DIR__.'/../config/config.php' => config_path('laravel-versioning-helper.php'),
27
            ], 'config');
28
29
            // Publishing the views.
30
            $this->publishes([
31
                __DIR__.'/../resources/views' => resource_path('views/vendor/laravel-versioning-helper'),
32
            ], 'views');
33
34
            // Registering package commands.
35
            $this->commands([
36
                VersioningHelper::class
37
            ]);
38
        }
39
40
        $this->loadViewComponentsAs('versioning-helper', [
41
           ApplicationName::class,
42
           BuildString::class,
43
           Copyright::class,
44
           Version::class
45
       ]);
46
    }
47
48
    /**
49
     * Register the application services.
50
     */
51
    public function register()
52
    {
53
        // Automatically apply the package configuration
54
        $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'laravel-versioning-helper');
55
    }
56
}
57