EventRevertServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 9 1
A register() 0 7 1
A publishFiles() 0 14 1
1
<?php
2
3
namespace Djunehor\EventRevert;
4
5
use Illuminate\Support\ServiceProvider as MyServiceProvider;
6
7
class EventRevertServiceProvider extends MyServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     *
12
     * @return void
13
     */
14 14
    public function boot()
15
    {
16 14
        $this->loadRoutesFrom(__DIR__.'/routes/web.php');
17 14
        $this->loadMigrationsFrom(__DIR__.'/database/migrations');
18 14
        $this->loadViewsFrom(__DIR__.'/resources/views', 'ModelEventLogger');
19 14
        $this->loadTranslationsFrom(__DIR__.'/resources/lang', 'ModelEventLogger');
20
21 14
        $this->publishFiles();
22 14
    }
23
24
    /**
25
     * Register the application services.
26
     *
27
     * @return void
28
     */
29 14
    public function register()
30
    {
31 14
        $this->app['router']->aliasMiddleware('model-event-logger-middleware', ModelEventLogMiddleware::class);
32 14
        $this->commands([
33 14
            RevertModelEvent::class,
34
        ]);
35 14
    }
36
37 14
    private function publishFiles()
38
    {
39 14
        $publishTag = 'ModelEventLogger';
40
41 14
        $this->publishes([
42 14
            __DIR__.'/resources/views' => base_path('resources/views/vendor/'.$publishTag),
43 14
        ], $publishTag);
44 14
        $this->publishes([
45 14
            __DIR__.'/resources/lang' => base_path('resources/lang/vendor/'.$publishTag),
46 14
        ], $publishTag);
47 14
        $this->publishes([
48 14
            __DIR__.'/config/model-event-logger.php' => config_path('model-event-logger.php'),
49 14
        ], $publishTag);
50 14
    }
51
}
52