JsonSchemaOpisServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

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

2 Methods

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