LaravelParatestServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 35
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 15 2
A register() 0 10 1
1
<?php
2
3
namespace Tonysm\LaravelParatest;
4
5
use Illuminate\Support\ServiceProvider;
6
use Tonysm\LaravelParatest\Console\DbCreateCommand as DbCreateCLICommand;
7
use Tonysm\LaravelParatest\Console\DbReCreateCommand as DbReCreateCLICommand;
8
use Tonysm\LaravelParatest\Console\DbDropCommand as DbDropCLICommand;
9
10
class LaravelParatestServiceProvider extends ServiceProvider
11
{
12
    /**
13
     * Bootstrap the application services.
14
     */
15
    public function boot()
16
    {
17
        if ($this->app->runningInConsole()) {
18
            $this->publishes([
19
                __DIR__.'/../config/config.php' => config_path('paratest.php'),
20
            ], 'config');
21
22
            // Registering package commands.
23
            $this->commands([
24
                DbCreateCLICommand::class,
25
                DbReCreateCLICommand::class,
26
                DbDropCLICommand::class,
27
            ]);
28
        }
29
    }
30
31
    /**
32
     * Register the application services.
33
     */
34
    public function register()
35
    {
36
        // Automatically apply the package configuration
37
        $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'paratest');
38
39
        // Register the main class to use with the facade
40
        $this->app->singleton('laravel-paratest', function () {
41
            return new LaravelParatest;
42
        });
43
    }
44
}
45