Completed
Push — master ( f73df0...286c6f )
by Markus
23s queued 12s
created

createValidatorFactory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 7
rs 10
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->registerValidatorFactory($pimple);
18
    }
19
20
    /**
21
     * @param \Pimple\Container $container
22
     *
23
     * @return \Jellyfish\JsonSchemaOpis\JsonSchemaOpisServiceProvider
24
     */
25
    protected function registerValidatorFactory(Container $container): JsonSchemaOpisServiceProvider
26
    {
27
        $container->offsetSet('json_schema_validator_factory', function () {
28
            return new ValidatorFactory();
29
        });
30
31
        return $this;
32
    }
33
}
34