Completed
Pull Request — master (#2)
by Evgenii
02:16
created

InteractionServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Nasyrov\Laravel\Interactions;
4
5
use Illuminate\Support\ServiceProvider;
6
use Nasyrov\Laravel\Interactions\Console\InteractionMakeCommand;
7
use Nasyrov\Laravel\Interactions\Contracts\Interactor as InteractorContract;
8
9
class InteractionServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Indicates if loading of the provider is deferred.
13
     *
14
     * @var bool
15
     */
16
    protected $defer = true;
17
18
    /**
19
     * Register the service provider.
20
     *
21
     * @return void
22
     */
23
    public function register()
24
    {
25 6
        $this->app->singleton(Interactor::class, function ($app) {
26 3
            return new Interactor($app);
27 6
        });
28
29 6
        $this->app->alias(Interactor::class, InteractorContract::class);
30
31 6
        $this->commands([
32 6
            InteractionMakeCommand::class,
33 2
        ]);
34 6
    }
35
36
    /**
37
     * Get the services provided by the provider.
38
     *
39
     * @return array
40
     */
41 3
    public function provides()
42
    {
43
        return [
44 3
            Interactor::class,
45 1
            InteractorContract::class,
46 1
        ];
47
    }
48
}
49