Completed
Push — master ( 0b50c9...d835d4 )
by Ben
02:46
created

ServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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');
0 ignored issues
show
Bug introduced by
The method configure() does not exist on Illuminate\Contracts\Foundation\Application. Did you maybe mean registerConfiguredProviders()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
14
15
        $this->mergeConfigFrom(__DIR__ . '/../../config/json-api.php', 'json-api');
16
17
        $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...
18
            return new MediaTypeGuard(config('json-api.media-type'), config('json-api.accept-header-policy'));
19
        });
20
21
        $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...
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