Passed
Push — master ( 1c3fc1...f51d93 )
by Mike
02:44
created

ElasticsearchFacade   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 28
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createDocuments() 0 6 1
A createIndizes() 0 6 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Xervice\Elasticsearch\Business;
5
6
7
use DataProvider\DocumentListDataProvider;
8
use Xervice\Core\Business\Model\Facade\AbstractFacade;
9
use Xervice\Elasticsearch\Dependency\Plugin\DocumentBuilderPlugin;
10
11
/**
12
 * @method \Xervice\Elasticsearch\Business\ElasticsearchBusinessFactory getFactory()
13
 * @method \Xervice\Elasticsearch\ElasticsearchConfig getConfig()
14
 */
15
class ElasticsearchFacade extends AbstractFacade
16
{
17
    /**
18
     * Generate all indizes in elasticsearch
19
     *
20
     * @api
21
     */
22 1
    public function createIndizes(): void
23
    {
24
        $this
25 1
            ->getFactory()
26 1
            ->createIndexer()
27 1
            ->createIndizes();
28 1
    }
29
30
    /**
31
     * Create a list of documents in elasticsearch
32
     *
33
     * @api
34
     *
35
     * @param \DataProvider\DocumentListDataProvider $listDataProvider
36
     */
37 1
    public function createDocuments(DocumentListDataProvider $listDataProvider): void
38
    {
39
        $this
40 1
            ->getFactory()
41 1
            ->createDocumentBuilder()
42 1
            ->createDocuments($listDataProvider);
43
    }
44
}