registerContainerBindings()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 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