Create   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 30
ccs 7
cts 7
cp 1
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A toArray() 0 5 1
1
<?php
2
3
namespace Matchish\ScoutElasticSearch\ElasticSearch\Params\Indices;
4
5
/**
6
 * @internal
7
 */
8
final class Create
9
{
10
    /**
11
     * @var string
12
     */
13
    private $index;
14
    /**
15
     * @var array
16
     */
17
    private $config;
18
19
    /**
20
     * Create constructor.
21
     * @param string $index
22
     * @param array $config
23
     */
24 15
    public function __construct(string $index, array $config)
25
    {
26 15
        $this->index = $index;
27 15
        $this->config = $config;
28 15
    }
29
30
    /**
31
     * @return array
32
     */
33 15
    public function toArray(): array
34
    {
35
        return [
36 15
            'index' => $this->index,
37 15
            'body' => $this->config,
38
        ];
39
    }
40
}
41