TeamworkServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

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