Completed
Push — master ( 9c0195...4ed182 )
by Elf
04:17
created

SupportServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 32
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A extendResponses() 0 8 1
A register() 0 6 1
1
<?php
2
3
namespace App\Support\Providers;
4
5
use App\Support\Http\ApiResponse;
6
use Illuminate\Contracts\Routing\ResponseFactory;
7
use Illuminate\Support\ServiceProvider;
8
9
class SupportServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the service provider.
13
     */
14 1
    public function boot()
15
    {
16 1
        $this->extendResponses();
17 1
    }
18
19
    /**
20
     * Extend responses.
21
     */
22 1
    protected function extendResponses()
23
    {
24 1
        $response = $this->app->make(ResponseFactory::class);
25
26 1
        $response->macro('api', function (...$args) {
27
            return new ApiResponse(...$args);
28 1
        });
29 1
    }
30
31
    /**
32
     * Register the service provider.
33
     */
34 1
    public function register()
35
    {
36 1
        $this->app->register(CaptchaServiceProvider::class);
37 1
        $this->app->register(ClientServiceProvider::class);
38 1
        $this->app->register(OptimusServiceProvider::class);
39 1
    }
40
}
41