ApiResponseServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 21
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 4 1
A bindFractalSerializer() 0 7 1
1
<?php
2
3
namespace Tequilarapido\ApiResponse;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class ApiResponseServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Register the service provider.
11
     */
12 27
    public function register()
13
    {
14 27
        $this->bindFractalSerializer();
15 27
    }
16
17
    /**
18
     * Always get result with data property (even if it's one item).
19
     */
20 27
    private function bindFractalSerializer()
21
    {
22 27
        $this->app->bind(
23 27
            'League\Fractal\Serializer\SerializerAbstract',
24 27
            'League\Fractal\Serializer\DataArraySerializer'
25
        );
26 27
    }
27
}
28