Passed
Push — master ( c5bd37...640ffc )
by
unknown
05:22
created

AbstractRestApiServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 11
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 5 2
1
<?php
2
3
4
namespace W2w\Laravel\Apie\Providers;
5
6
use Illuminate\Support\ServiceProvider;
7
8
/**
9
 * Service provider that allows you to add a REST api from a service provider.
10
 */
11
abstract class AbstractRestApiServiceProvider extends ServiceProvider
12
{
13
    abstract protected function getApiName(): string;
14
15
    abstract protected function getApiConfig(): array;
16
17
    public function register()
18
    {
19
        $apiConfig = $this->getApiConfig();
20
        $this->app->get('config')->set('apie.contexts.' . $this->getApiName(), $apiConfig);
21
        if ($apiConfig['bind-api-resource-facade-response'] ?? true) {
22
23
        }
24
    }
25
}
26