RivetServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 9 1
A register() 0 14 1
1
<?php
2
3
namespace Luminark\Rivet;
4
5
use Illuminate\Support\ServiceProvider;
6
use Luminark\Rivet\Interfaces\FileProcessorInterface;
7
use Luminark\Rivet\Interfaces\AttachingListenerInterface;
8
use Luminark\Rivet\Services\FileProcessor;
9
use Luminark\Rivet\Listeners\AttachingListener;
10
11
class RivetServiceProvider extends ServiceProvider
12
{
13
    public function boot()
14
    {
15
        $this->publishes([
16
            __DIR__ . '/../database/migrations/' => database_path('migrations')
17
        ], 'migrations');
18
        $this->publishes([
19
            __DIR__ . '/../config/luminark/rivet.php' => config_path('luminark/courier.php'),
20
        ], 'config');
21
    }
22
23
    public function register()
24
    {
25
        $this->mergeConfigFrom(
26
            __DIR__ . '/../config/luminark/rivet.php', 'luminark.rivet'
27
        );
28
29
        $this->app->bind(FileProcessorInterface::class, function ($app) {
30
            return $app->make(FileProcessor::class);
31
        });
32
        $this->app->bind(AttachingListenerInterface::class, function ($app) {
33
            return $app->make(AttachingListener::class);
34
        });
35
        $this->app->register(RivetEventServiceProvider::class);
36
    }
37
}
38