EntryServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 27
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 4 1
A boot() 0 11 3
1
<?php
2
3
namespace Bavix\Entry;
4
5
use Bavix\Entry\Commands\BulkWrite;
6
use Bavix\Entry\Services\BulkService;
7
use Illuminate\Support\ServiceProvider;
8
9
class EntryServiceProvider extends ServiceProvider
10
{
11
12
    /**
13
     * @return void
14
     */
15
    public function boot(): void
16
    {
17
        if (!$this->app->runningInConsole()) {
18
            return;
19
        }
20
21
        $this->commands([BulkWrite::class]);
22
        if (function_exists('config_path')) {
23
            $this->publishes([
24
                dirname(__DIR__) . '/config/config.php' => config_path('entry.php'),
25
            ], 'laravel-entry-config');
26
        }
27
    }
28
29
    /**
30
     * Register our singleton's
31
     */
32
    public function register(): void
33
    {
34
        $this->mergeConfigFrom(\dirname(__DIR__) . '/config/config.php', 'entry');
35
        $this->app->singleton(BulkService::class);
36
    }
37
38
}
39