Completed
Push — master ( e2aeec...2e17a9 )
by GBProd
02:10
created

Handler   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 3
c 2
b 0
f 1
lcom 1
cbo 2
dl 0
loc 27
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 8 2
1
<?php
2
3
namespace GBProd\ElasticsearchDataProviderBundle\DataProvider;
4
5
use Elasticsearch\Client;
6
7
/**
8
 * Handle data providing
9
 * 
10
 * @author gbprod <[email protected]>
11
 */
12
class Handler
13
{
14
    /**
15
     * @var Registry
16
     */
17
    private $registry;
18
    
19
    /**
20
     * @param Registry $registry
21
     */
22 2
    public function __construct(Registry $registry)
23
    {
24 2
        $this->registry = $registry;
25 2
    }
26
    
27
    /**
28
     * Handle provide command
29
     */
30 1
    public function handle(Client $client, $index, $type)
31
    {
32 1
        $providers = $this->registry->getProviders($index, $type);
33
        
34 1
        foreach($providers as $provider) {
35 1
            $provider->run($client, $index, $type);
36 1
        }
37
    }
38
}