DatabaseServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 1
A boot() 0 4 1
1
<?php
2
3
namespace Magister\Services\Database;
4
5
use Magister\Services\Database\Elegant\Model;
6
use Magister\Services\Support\ServiceProvider;
7
8
/**
9
 * Class DatabaseServiceProvider.
10
 */
11
class DatabaseServiceProvider extends ServiceProvider
12
{
13
    /**
14
     * Register bindings in the container.
15
     *
16
     * @return void
17
     */
18
    public function register()
19
    {
20
        $this->app->singleton('db', function ($app) {
21
            return new DatabaseManager($app);
22
        });
23
    }
24
25
    /**
26
     * Perform booting of services.
27
     *
28
     * @return void
29
     */
30
    public function boot()
31
    {
32
        Model::setConnectionResolver($this->app['db']);
33
    }
34
}
35