EloquentServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 4 1
A registerContainerBindings() 0 10 1
1
<?php
2
3
namespace Nord\Lumen\FileManager\Eloquent;
4
5
use Illuminate\Contracts\Container\Container;
6
use Illuminate\Support\ServiceProvider;
7
use Nord\Lumen\FileManager\Contracts\FileFactory as FileFactoryContract;
8
use Nord\Lumen\FileManager\Contracts\FileStorage as FileStorageContract;
9
10
class EloquentServiceProvider extends ServiceProvider
11
{
12
13
    /**
14
     * @inheritdoc
15
     */
16
    public function register()
17
    {
18
        $this->registerContainerBindings($this->app);
19
    }
20
21
22
    /**
23
     * @param Container $container
24
     */
25
    protected function registerContainerBindings(Container $container)
26
    {
27
        $container->singleton(FileFactoryContract::class, function () {
28
            return new FileFactory(File::class);
29
        });
30
        
31
        $container->singleton(FileStorageContract::class, function () {
32
            return new FileStorage();
33
        });
34
    }
35
}
36