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

JsonSchemaServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 66.67%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 4
dl 0
loc 20
ccs 6
cts 9
cp 0.6667
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 12 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