MongoAutoSyncServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 2
Bugs 2 Features 0
Metric Value
wmc 3
eloc 11
c 2
b 2
f 0
dl 0
loc 41
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A packagePath() 0 3 1
A register() 0 5 1
A boot() 0 11 1
1
<?php
2
3
namespace OfflineAgency\MongoAutoSync;
4
5
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
6
use OfflineAgency\MongoAutoSync\Console\DropCollection;
7
use OfflineAgency\MongoAutoSync\Console\GenerateModelDocumentation;
8
9
/**
10
 * Service provider.
11
 */
12
class MongoAutoSyncServiceProvider extends BaseServiceProvider
13
{
14
    /**
15
     * Bootstrap the application services.
16
     *
17
     * @return void
18
     */
19
    public function boot()
20
    {
21
        $this->app->bind('command.model-doc:generate', GenerateModelDocumentation::class);
22
        $this->app->bind('command.drop:collection', DropCollection::class);
23
24
        $this->commands([
25
            'command.model-doc:generate',
26
        ]);
27
28
        $this->commands([
29
            'command.drop:collection',
30
        ]);
31
    }
32
33
    /**
34
     * Register the application services.
35
     *
36
     * @return void
37
     */
38
    public function register()
39
    {
40
        $this->mergeConfigFrom(
41
            $this->packagePath('config/laravel-mongo-auto-sync.php'),
42
            'laravel-mongo-auto-sync'
43
        );
44
    }
45
46
    /**
47
     * @param  $path
48
     * @return string
49
     */
50
    private function packagePath($path)
51
    {
52
        return __DIR__.'/../'.$path;
53
    }
54
}
55