ServiceProvider   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
eloc 14
c 2
b 0
f 0
dl 0
loc 37
ccs 17
cts 17
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A registerMigrations() 0 4 2
A register() 0 3 1
A boot() 0 18 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