bindFractalSerializer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 1
rs 10
c 0
b 0
f 0
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