EntityRepositoryManagerFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 15
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 12 1
1
<?php
2
3
namespace Pgs\ElasticOM\Bridge\ZF3;
4
5
use Pgs\ElasticOM\AdapterFactory;
6
use Pgs\ElasticOM\EntityRepositoryManager;
7
use Zend\ServiceManager\ServiceManager;
8
9
class EntityRepositoryManagerFactory
10
{
11 1
    public function __invoke(ServiceManager $sm)
12
    {
13 1
        $config = $sm->get('Config');
14
15 1
        $adapter = AdapterFactory::create(
16 1
            $config[Module::CONFIG_KEY]['host'] ?? 'localhost',
17 1
            $config[Module::CONFIG_KEY]['port'] ?? 9200,
18 1
            $config[Module::CONFIG_KEY]['index'] ?? 'elastic_om'
19
        );
20
21 1
        return new EntityRepositoryManager($adapter);
22
    }
23
}
24