ServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 2
eloc 6
c 2
b 0
f 1
nc 2
nop 0
dl 0
loc 11
ccs 8
cts 8
cp 1
crap 2
rs 10
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