Passed
Push — master ( da797a...38c1ce )
by Gombos
03:26
created

ModelSettingsServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 19
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 11 2
A register() 0 3 1
1
<?php
2
3
namespace Glorand\Model\Settings;
4
5
use Glorand\Model\Settings\Console\CreateSettingsFieldForModel;
6
use Glorand\Model\Settings\Console\CreateSettingsTable;
7
use Illuminate\Support\ServiceProvider;
8
9
class ModelSettingsServiceProvider extends ServiceProvider
10
{
11 19
    public function boot()
12
    {
13 19
        if ($this->app->runningInConsole()) {
14 19
            $this->commands([
15 19
                CreateSettingsFieldForModel::class,
16
                CreateSettingsTable::class,
17
            ]);
18
        }
19
20 19
        $this->publishes([
21 19
            __DIR__ . '/../config/model_settings.php' => config_path('model_settings.php'),
22
        ]);
23 19
    }
24
25 19
    public function register()
26
    {
27 19
        $this->mergeConfigFrom(__DIR__ . '/../config/model_settings.php', 'model_settings');
28 19
    }
29
}
30