MongoAutoSyncServiceProvider::packagePath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 1
c 1
b 1
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 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