Completed
Pull Request — master (#42)
by Mahmoud
03:25
created

UserServiceProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace App\Containers\User\Settings\Providers;
4
5
use App\Containers\User\Settings\Contracts\UserRepositoryInterface;
6
use App\Containers\User\Settings\Repositories\UserRepository;
7
use App\Port\Provider\Abstracts\ServiceProviderAbstract;
8
9
/**
10
 * Class UserServiceProvider.
11
 *
12
 * The Main Service Provider of this Module.
13
 * Will be automatically registered in the framework after
14
 * adding the Module name to containers config file.
15
 *
16
 * @author  Mahmoud Zalt <[email protected]>
17
 */
18
class UserServiceProvider extends ServiceProviderAbstract
19
{
20
21
    /**
22
     * Indicates if loading of the provider is deferred.
23
     *
24
     * @var bool
25
     */
26
    protected $defer = false;
27
28
    /**
29
     * Container internal Service Provides.
30
     *
31
     * @var array
32
     */
33
    private $containerServiceProviders = [
34
        PoliciesServiceProvider::class,
35
        EventsServiceProvider::class,
36
    ];
37
38
    /**
39
     * Perform post-registration booting of services.
40
     */
41
    public function boot()
42
    {
43
        $this->registerServiceProviders($this->containerServiceProviders);
44
    }
45
46
    /**
47
     * Register bindings in the container.
48
     */
49
    public function register()
50
    {
51
        $this->app->bind(UserRepositoryInterface::class, UserRepository::class);
52
    }
53
}
54