ServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A registerCommands() 0 13 1
A register() 0 3 1
A boot() 0 5 1
1
<?php
2
3
namespace LaravelPropertyBag;
4
5
use Illuminate\Support\ServiceProvider as BaseProvider;
6
7
class ServiceProvider extends BaseProvider
8
{
9
    /**
10
     * Register bindings in the container.
11
     *
12
     * @return void
13
     */
14
    public function register()
15
    {
16
        $this->registerCommands();
17
    }
18
19
    /**
20
     * Register any other events for your application.
21
     *
22
     * @return void
23
     */
24
    public function boot()
25
    {
26
        $this->publishes([
27
            __DIR__.'/Migrations/' => database_path('migrations'),
28
        ], 'migrations');
29
    }
30
31
    /**
32
     * Register Artisan commands.
33
     */
34
    protected function registerCommands()
35
    {
36
        $this->app->singleton('command.pbag.make', function ($app) {
37
            return $app['LaravelPropertyBag\Commands\PublishSettingsConfig'];
38
        });
39
40
        $this->app->singleton('command.pbag.rules', function ($app) {
41
            return $app['LaravelPropertyBag\Commands\PublishRulesFile'];
42
        });
43
44
        $this->commands('command.pbag.make');
45
46
        $this->commands('command.pbag.rules');
47
    }
48
}
49