JsonSchemaRequestServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 18
ccs 7
cts 7
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 4 1
A boot() 0 5 1
1
<?php
2
3
namespace Webtools\JsonSchemaRequest;
4
5
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
6
use Webtools\JsonSchemaRequest\Console\MakeJsonSchemaRequestCommand;
7
8
class JsonSchemaRequestServiceProvider extends BaseServiceProvider
9
{
10 3
    public function register()
11
    {
12 3
        $this->app->bind('command.make:json-request', MakeJsonSchemaRequestCommand::class);
13 3
        $this->commands(['command.make:json-request']);
14 3
    }
15
16
    /**
17
     * Bootstrap the application services.
18
     *
19
     * @return void
20
     */
21 3
    public function boot()
22
    {
23
        $this->app->resolving(JsonSchemaRequest::class, function ($request, $app) {
24 2
            $request = JsonSchemaRequest::createFrom($app['request'], $request);
25 2
            $request->setContainer($app);
26 3
        });
27 3
    }
28
}
29