Completed
Push — master ( 1fd225...0ced52 )
by Markus
11s queued 10s
created

JsonSchemaOpisServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createValidatorFactory() 0 7 1
A register() 0 3 1
1
<?php
2
3
namespace Jellyfish\JsonSchemaOpis;
4
5
use Pimple\Container;
6
use Pimple\ServiceProviderInterface;
7
8
class JsonSchemaOpisServiceProvider implements ServiceProviderInterface
9
{
10
    /**
11
     * @param \Pimple\Container $pimple
12
     *
13
     * @return void
14
     */
15
    public function register(Container $pimple): void
16
    {
17
        $this->createValidatorFactory($pimple);
18
    }
19
20
    /**
21
     * @param \Pimple\Container $container
22
     *
23
     * @return \Pimple\ServiceProviderInterface
24
     */
25
    protected function createValidatorFactory(Container $container): ServiceProviderInterface
26
    {
27
        $container->offsetSet('json_schema_validator_factory', function () {
28
            return new ValidatorFactory();
29
        });
30
31
        return $this;
32
    }
33
}
34