Create::__construct()   A
last analyzed

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