StorageServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
dl 0
loc 13
ccs 10
cts 10
cp 1
rs 9.4285
c 2
b 1
f 0
cc 1
eloc 8
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Flaviozantut\Storage;
4
5
use Config;
6
use Flaviozantut\Storage\Posts\FilePostRepository;
7
use Illuminate\Support\ServiceProvider;
8
9
class StorageServiceProvider extends ServiceProvider
10
{
11 16
    public function register()
12
    {
13 16
        $this->app->bind(
14 16
        'Flaviozantut\Storage\Posts\PostRepositoryInterface',
15 16
        function () {
16 1
            switch (Config::get('skorry.storage')) {
17 1
                default:
18 1
                    return new FilePostRepository(Config::get('skorry.path'));
19
                    break;
20 1
            }
21
        }
22 16
    );
0 ignored issues
show
Coding Style introduced by
It seems like the identation of this line is off (expected at least 8 spaces, but found 4).
Loading history...
23 16
    }
24
}
25