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

Handler::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
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
}