Completed
Push — master ( 79c02f...c2c6a7 )
by Ben
10s
created

ServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 12 1
A provides() 0 4 1
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->mergeConfigFrom(__DIR__ . '/../../config/json-api.php', 'json-api');
14
15
        $this->app->bind(MediaTypeGuard::class, function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
16
            return new MediaTypeGuard(config('json-api.media-type'));
17
        });
18
19
        $this->app->bind(EncoderService::class, function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
20
            return new EncoderService(config('json-api'));
21
        });
22
    }
23
24
    /**
25
     * @return array
26
     */
27
    public function provides()
28
    {
29
        return [MediaTypeGuard::class, EncoderService::class];
30
    }
31
}
32