UserCommandsServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 12 2
A register() 0 4 1
1
<?php
2
3
namespace Luilliarcec\UserCommands;
4
5
use Illuminate\Support\ServiceProvider;
6
use Luilliarcec\UserCommands\Commands\CreateNewUserCommand;
7
use Luilliarcec\UserCommands\Commands\DeleteUserCommand;
8
use Luilliarcec\UserCommands\Commands\ResetUserPasswordCommand;
9
use Luilliarcec\UserCommands\Commands\RestoreUserCommand;
10
11
class UserCommandsServiceProvider extends ServiceProvider
12
{
13
    /**
14
     * Bootstrap the application services.
15
     */
16
    public function boot()
17
    {
18
        if ($this->app->runningInConsole()) {
19
            $this->publishes([
20
                __DIR__ . '/../config/config.php' => config_path('user-commands.php'),
21
            ], 'config');
22
23
            $this->commands([
24
                CreateNewUserCommand::class,
25
                ResetUserPasswordCommand::class,
26
                DeleteUserCommand::class,
27
                RestoreUserCommand::class,
28
            ]);
29
        }
30
    }
31
32
    /**
33
     * Register the application services.
34
     */
35
    public function register()
36
    {
37
        // Automatically apply the package configuration
38
        $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'user-commands');
39
    }
40
}
41