ServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 15
c 2
b 0
f 0
dl 0
loc 35
ccs 18
cts 18
cp 1
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 1
A boot() 0 18 2
1
<?php
2
3
namespace NovaSeoEntity;
4
5
use NovaSeoEntity\Models\SEOInfo;
6
7
class ServiceProvider extends \Illuminate\Support\ServiceProvider
8
{
9 9
    public function boot()
10
    {
11 9
        if ($this->app->runningInConsole()) {
12 9
            $this->publishes([
13 9
                __DIR__ . '/../config/nova-seo-entity.php' => config_path('nova-seo-entity.php'),
14 9
            ], 'config');
15
16 9
            $this->publishes([
17 9
                __DIR__.'/../resources/lang' => resource_path('lang/vendor/nova-seo-entity'),
18 9
            ], 'lang');
19
20
21 9
            $this->commands([
22 9
                //
23 9
            ]);
24
        }
25
26 9
        $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'nova-seo-entity');
27
    }
28
29
    /**
30
     * @inheritDoc
31
     */
32 9
    public function register()
33
    {
34 9
        $this->mergeConfigFrom(__DIR__ . '/../config/nova-seo-entity.php', 'nova-seo-entity');
35
36
        // seo_image
37 9
        $config = $this->app->make('config');
38
39 9
        $config->set('simple-image-manager.drivers', array_merge(
40 9
            [ SEOInfo::$thinkSeoImgDriver => $config->get('nova-seo-entity.seo_image', []), ],
41 9
            $config->get('simple-image-manager.drivers', [])
42 9
        ));
43
    }
44
}
45