Completed
Pull Request — master (#1)
by Evgenii
07:26
created

InteractionServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 8 1
A provides() 0 7 1
1
<?php
2
3
namespace Nasyrov\Laravel\Interactions;
4
5
use Illuminate\Support\ServiceProvider;
6
use Nasyrov\Laravel\Interactions\Contracts\Interactor as InteractorContract;
7
8
class InteractionServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Indicates if loading of the provider is deferred.
12
     *
13
     * @var bool
14
     */
15
    protected $defer = true;
16
17
    /**
18
     * Register the service provider.
19
     *
20
     * @return void
21
     */
22
    public function register()
23
    {
24 3
        $this->app->singleton(Interactor::class, function ($app) {
25 3
            return new Interactor($app);
26 3
        });
27
28 3
        $this->app->alias(Interactor::class, InteractorContract::class);
29 3
    }
30
31
    /**
32
     * Get the services provided by the provider.
33
     *
34
     * @return array
35
     */
36 3
    public function provides()
37
    {
38
        return [
39 3
            Interactor::class,
40 1
            InteractorContract::class,
41 1
        ];
42
    }
43
}
44