ServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 18
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 10
c 2
b 0
f 0
dl 0
loc 18
ccs 12
cts 12
cp 1
rs 9.9332
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
namespace FormEntries;
4
5
class ServiceProvider extends \Illuminate\Support\ServiceProvider
6
{
7 22
    public function boot()
8
    {
9 22
        if ($this->app->runningInConsole()) {
10 22
            $this->publishes([
11 22
                __DIR__ . '/../config/forms-entries.php' => config_path('forms-entries.php'),
12 22
            ], 'config');
13
14 22
            $this->publishes([
15 22
                __DIR__.'/../resources/lang' => lang_path('vendor/forms-entries'),
16 22
            ], 'lang');
17
18 22
            $this->commands([
19 22
            ]);
20
21 22
            $this->registerMigrations();
22
        }
23
24 22
        $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'forms-entries');
25
    }
26
27 22
    public function register()
28
    {
29 22
        $this->mergeConfigFrom(__DIR__ . '/../config/forms-entries.php', 'forms-entries');
30
    }
31
32
33
    /**
34
     * Register the package migrations.
35
     *
36
     * @return void
37
     */
38 22
    protected function registerMigrations()
39
    {
40 22
        if (FormEntryManager::$runsMigrations) {
41 22
            $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
42
        }
43
    }
44
}
45