Completed
Push — master ( 58fdad...96445b )
by Ben
11s
created

ServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 2
Bugs 1 Features 1
Metric Value
wmc 2
c 2
b 1
f 1
lcom 1
cbo 3
dl 0
loc 25
rs 10
1
<?php
2
3
namespace RealPage\JsonApi\Lumen;
4
5
use Illuminate\Support\ServiceProvider as IlluminateServiceProvider;
6
use RealPage\JsonApi\MediaTypeGuard;
7
use RealPage\JsonApi\EncoderService;
8
9
class ServiceProvider extends IlluminateServiceProvider
10
{
11
    public function register()
12
    {
13
        $this->app->configure('json-api');
14
15
        $this->mergeConfigFrom(__DIR__ . '/../../config/json-api.php', 'json-api');
16
17
        $this->app->bind(MediaTypeGuard::class, function ($app) {
18
            return new MediaTypeGuard(config('json-api.media-type'), config('json-api.accept-header-policy');
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected ';', expecting ',' or ')'
Loading history...
19
        });
20
21
        $this->app->bind(EncoderService::class, function ($app) {
22
            return new EncoderService(config('json-api'));
23
        });
24
    }
25
26
    /**
27
     * @return array
28
     */
29
    public function provides()
30
    {
31
        return [MediaTypeGuard::class, EncoderService::class];
32
    }
33
}
34