Completed
Push — master ( 1b3dfc...3e655f )
by Elf
05:19 queued 02:52
created

ApiServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
1
<?php
2
3
namespace App\Providers;
4
5
use Illuminate\Contracts\Routing\ResponseFactory;
6
use Illuminate\Support\ServiceProvider;
7
use App\Http\ApiResponse;
8
9
class ApiServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the service provider.
13
     *
14
     * @param  \Illuminate\Contracts\Routing\ResponseFactory  $response
15
     * @return void
16
     */
17
    public function boot(ResponseFactory $response)
18
    {
19 1
        $response->macro('api', function ($data = null, $code = null, $headers = [], $options = 0) {
20
            return new ApiResponse($data, $code, $headers, $options);
21 1
        });
22 1
    }
23
}
24