ComposerServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 34
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 8 1
A boot() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Rinvex\Composer\Providers;
6
7
use Illuminate\Support\ServiceProvider;
8
use Rinvex\Support\Traits\ConsoleTools;
9
use Rinvex\Composer\Console\Commands\PublishCommand;
10
11
class ComposerServiceProvider extends ServiceProvider
12
{
13
    use ConsoleTools;
14
15
    /**
16
     * The commands to be registered.
17
     *
18
     * @var array
19
     */
20
    protected $commands = [
21
        PublishCommand::class => 'command.rinvex.composer.publish',
22
    ];
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function register()
28
    {
29
        // Merge config
30
        $this->mergeConfigFrom(realpath(__DIR__.'/../../config/config.php'), 'rinvex.composer');
31
32
        // Register console commands
33
        $this->registerCommands($this->commands);
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function boot()
40
    {
41
        // Publish Resources
42
        $this->publishesConfig('rinvex/laravel-composer');
43
    }
44
}
45