ServiceProvider   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
eloc 10
c 3
b 0
f 1
dl 0
loc 30
ccs 13
cts 13
cp 1
rs 10
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A registerMigrations() 0 4 2
A boot() 0 11 2
A register() 0 3 1
1
<?php
2
3
namespace RecentlyViewed;
4
5
class ServiceProvider extends \Illuminate\Support\ServiceProvider
6
{
7 11
    public function boot()
8
    {
9 11
        if ($this->app->runningInConsole()) {
10 11
            $this->publishes([
11 11
                __DIR__ . '/../config/recently-viewed.php' => config_path('recently-viewed.php'),
12 11
            ], 'config');
13
14 11
            $this->commands([
15 11
            ]);
16
17 11
            $this->registerMigrations();
18
        }
19
    }
20
21 11
    public function register()
22
    {
23 11
        $this->mergeConfigFrom(__DIR__ . '/../config/recently-viewed.php', 'recently-viewed');
24
    }
25
26
    /**
27
     * Register the package migrations.
28
     *
29
     * @return void
30
     */
31 11
    protected function registerMigrations()
32
    {
33 11
        if (PersistManager::$runsMigrations) {
34 11
            $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
35
        }
36
    }
37
}
38