Completed
Push — master ( 7d4a72...efe314 )
by Jason
04:42
created

JsonSchemaServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace JDesrosiers\Silex\Provider;
4
5
use Pimple\Container;
6
use Pimple\ServiceProviderInterface;
7
use SchemaStore;
8
use Silex\Application;
9
use Silex\Api\BootableProviderInterface;
10
11
class JsonSchemaServiceProvider implements ServiceProviderInterface, BootableProviderInterface
12
{
13 5
    public function boot(Application $app)
14
    {
15 5
        $app->after(new DescribedBy());
16 5
    }
17
18 5
    public function register(Container $app)
19
    {
20 5
        $app["json-schema.correlationMechanism"] = "profile";
21
22
        $app["json-schema.schema-store"] = function () {
23
            return new SchemaStore();
24
        };
25
26
        $app["json-schema.validator"] = function () {
27
            return new Jsv4Validator();
28
        };
29 5
    }
30
}
31