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

createValidatorFactory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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